Ticket #8884: doc_ar_reflection.diff
| File doc_ar_reflection.diff, 0.9 kB (added by pelargir, 1 year ago) |
|---|
-
activerecord/lib/active_record/reflection.rb
old new 100 100 @klass ||= class_name.constantize 101 101 end 102 102 103 # Returns the class name for the macro, so "composed_of :balance, :class_name => 'Money'" returns "Money" and 104 # "has_many :clients" returns "Client." 103 105 def class_name 104 106 @class_name ||= options[:class_name] || derive_class_name 105 107 end 106 108 109 # Returns true if other_aggregation has the same name and active_record attributes 110 # and has an options hash assigned to it. 107 111 def ==(other_aggregation) 108 112 name == other_aggregation.name && other_aggregation.options && active_record == other_aggregation.active_record 109 113 end