search for: association_type

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

2006 Mar 13
1
adding custom cache field
...work for polymorphic associations also. Any comments are welcome. module ActiveRecord module Associations # :nodoc: def self.append_features(base) super base.extend(ClassMethods) end module ClassMethods def belongs_to_extra(association_id, options = { }) association_type = association_id.to_s + "_type" if association_id association_primary_key = association_id.to_s + "_id" if options[:total_cache] module_eval( "after_create ''#{association_type}.constantize.modify_value(\"#{self.t...