aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/reflection.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-08-13 22:31:03 +0900
committerRyuta Kamizono <kamipo@gmail.com>2017-08-13 22:31:03 +0900
commitbdae5b5d61af0b7b38c4748f0bae748a34e0612e (patch)
tree3e24953b53e5313f368ea1bae88438e3f0b2b2cf /activerecord/lib/active_record/reflection.rb
parent788f46d4863a0f38ecec042864da291f2342ec74 (diff)
downloadrails-bdae5b5d61af0b7b38c4748f0bae748a34e0612e.tar.gz
rails-bdae5b5d61af0b7b38c4748f0bae748a34e0612e.tar.bz2
rails-bdae5b5d61af0b7b38c4748f0bae748a34e0612e.zip
Remove unused `source_type_info` in `RuntimeReflection`
`source_type_info` is only used for `constraints` in `PolymorphicReflection`.
Diffstat (limited to 'activerecord/lib/active_record/reflection.rb')
-rw-r--r--activerecord/lib/active_record/reflection.rb17
1 files changed, 7 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index d2b85e168b..30439d7b04 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -1085,15 +1085,16 @@ module ActiveRecord
@reflection.constraints + [source_type_info]
end
- def source_type_info
- type = @previous_reflection.foreign_type
- source_type = @previous_reflection.options[:source_type]
- lambda { |object| where(type => source_type) }
- end
-
def get_join_keys(association_klass)
@reflection.get_join_keys(association_klass)
end
+
+ private
+ def source_type_info
+ type = @previous_reflection.foreign_type
+ source_type = @previous_reflection.options[:source_type]
+ lambda { |object| where(type => source_type) }
+ end
end
class RuntimeReflection < PolymorphicReflection # :nodoc:
@@ -1112,10 +1113,6 @@ module ActiveRecord
@reflection.constraints
end
- def source_type_info
- @reflection.source_type_info
- end
-
def alias_candidate(name)
"#{plural_name}_#{name}_join"
end