Permalink
Browse files

No need to call `to_sym` on reflection name, since the cache now works

with strings with string keys.

Related #14668.
  • Loading branch information...
1 parent 1f31488 commit 4c6ba7432dc5288708817d5b03e7ed13458ca58d @laurocaetano laurocaetano committed Apr 10, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/reflection.rb
@@ -617,11 +617,11 @@ def association_primary_key(klass = nil)
# # => [:tag, :tags]
#
def source_reflection_names
- (options[:source] ? [options[:source]] : [name.to_s.singularize, name]).collect { |n| n.to_sym }.uniq
+ (options[:source] ? [options[:source]] : [name.to_s.singularize, name]).collect { |n| n }.uniq
end
def source_reflection_name # :nodoc:
- return @source_reflection_name.to_sym if @source_reflection_name
+ return @source_reflection_name if @source_reflection_name
names = [name.to_s.singularize, name].collect { |n| n.to_sym }.uniq
names = names.find_all { |n|

0 comments on commit 4c6ba74

Please sign in to comment.