search for: model_with_notes

Displaying 1 result from an estimated 1 matches for "model_with_notes".

2008 Jan 08
1
add comments to ALL models (ie automatically add has_many)
I have the acts_as_commentable and a bunch of others added to pretty much every model, is there a way to automaically add these to EVERY model ? I tried the following but it fails with an error... ActiveRecord::Base.class_eval do has_many :notes, :as => :model_with_notes, :dependent => true end fails with.... /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/ base.rb:1369:in `class_of_active_record_descendant'':NoMethodError: undefined method `abstract_class?'' for Object:Class --~--~---------~--~----~------------~-------~--~----...