Displaying 1 result from an estimated 1 matches for "active_record_patch".
2012 Jul 25
0
Rails3-default_scope throws exception: undefined method abstract_class? for Object:Class
...all ActiveRecord''s queries while fetching the records.
With reference Rails extending ActiveRecord::Base<http://stackoverflow.com/questions/2328984/rails-extending-activerecordbase>,
I decided to use monkey patch to do above. Created monkey patch file in
config/initializer/active_record_patch.rb:
class ActiveRecord::Base
def inactive
update_attribute(:available, false)
end
default_scope :available => true
end
Getting following error when add the default_scope
*/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/base.rb:1212:in
class_of_active_record_de...