aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/reflection.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-07-23 13:12:25 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-07-23 13:12:25 -0700
commiteb8d48eb3ea27b7a7470eb9668748abd4914386b (patch)
tree65fc8f3e5ee4045e808bf135dad7e1e1a298f4f1 /activerecord/lib/active_record/reflection.rb
parent5f169b2aed2476aabd9edc95577af774b469ef87 (diff)
downloadrails-eb8d48eb3ea27b7a7470eb9668748abd4914386b.tar.gz
rails-eb8d48eb3ea27b7a7470eb9668748abd4914386b.tar.bz2
rails-eb8d48eb3ea27b7a7470eb9668748abd4914386b.zip
factory methods should not have side effects.
Move model mutation to the methods that are called on the model.
Diffstat (limited to 'activerecord/lib/active_record/reflection.rb')
-rw-r--r--activerecord/lib/active_record/reflection.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index de2204da29..55c58319b2 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -20,9 +20,7 @@ module ActiveRecord
klass = AggregateReflection
end
- reflection = klass.new(macro, name, scope, options, ar)
- add_reflection ar, name, reflection
- reflection
+ klass.new(macro, name, scope, options, ar)
end
def self.add_reflection(ar, name, reflection)