cannot find before_create Permanently deleted user Created March 14, 2013 22:16 I am getting the warning "cannot find before_create" in my model. I am using RM 5.0.2Any idea what may be causing it?thanks,Murat
I guess it is difficult for RM to find (or reach) callback functions as they are dynamically defined. Here is how/where before_create is defined:
.../activemodel-3.2.9/lib/active_model/callbacks.rb @ line 109:
Owner: #<Class:ActiveRecord::Base>
Visibility: public
Number of lines: 3
def self.before_#{callback}(*args, &block)
set_callback(:#{callback}, :before, *args, &block)
end
Nonetheless, it would have been nice for RM to somehow recognize these callbacks as they are pretty well-known
-Murat