aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/reflection.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-02-20 20:42:35 +0000
committerAaron Patterson <aaron.patterson@gmail.com>2011-02-21 10:16:14 -0800
commit32eef69dc1abbf9b67de780a882754e1717c2a3b (patch)
treeec88ff3d6a212e900ff63dbcf49172d501782ea8 /activerecord/lib/active_record/reflection.rb
parent73ff0076b37316af685bc411bd11a7908d7794f6 (diff)
downloadrails-32eef69dc1abbf9b67de780a882754e1717c2a3b.tar.gz
rails-32eef69dc1abbf9b67de780a882754e1717c2a3b.tar.bz2
rails-32eef69dc1abbf9b67de780a882754e1717c2a3b.zip
Delegate Association#options to the reflection, and replace 'reflection.options' with 'options'. Also add through_options and source_options methods for through associations.
Diffstat (limited to 'activerecord/lib/active_record/reflection.rb')
-rw-r--r--activerecord/lib/active_record/reflection.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index 4093a1a209..49659b3aa5 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -394,6 +394,14 @@ module ActiveRecord
@source_reflection_names ||= (options[:source] ? [options[:source]] : [name.to_s.singularize, name]).collect { |n| n.to_sym }
end
+ def source_options
+ source_reflection.options
+ end
+
+ def through_options
+ through_reflection.options
+ end
+
def association_primary_key
source_reflection.association_primary_key
end