Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

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  
    100100        @klass ||= class_name.constantize 
    101101      end 
    102102 
     103      # Returns the class name for the macro, so "composed_of :balance, :class_name => 'Money'" returns "Money" and 
     104      # "has_many :clients" returns "Client." 
    103105      def class_name 
    104106        @class_name ||= options[:class_name] || derive_class_name 
    105107      end 
    106108 
     109      # Returns true if other_aggregation has the same name and active_record attributes 
     110      # and has an options hash assigned to it. 
    107111      def ==(other_aggregation) 
    108112        name == other_aggregation.name && other_aggregation.options && active_record == other_aggregation.active_record 
    109113      end