diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-06-12 18:56:23 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-06-12 18:56:23 -0700 |
commit | b3bc3aa5cbe7540de21ae4eb566886e3b8efe6e3 (patch) | |
tree | 86c2908b9ad39b288aae4df406a94aa5c3a30bbf /activerecord | |
parent | 9e7040d8a01819391c77a34fd185595d845f3aae (diff) | |
download | rails-b3bc3aa5cbe7540de21ae4eb566886e3b8efe6e3.tar.gz rails-b3bc3aa5cbe7540de21ae4eb566886e3b8efe6e3.tar.bz2 rails-b3bc3aa5cbe7540de21ae4eb566886e3b8efe6e3.zip |
sometimes singularize does not work, so we get a list of two strings. just uniq them
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/reflection.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index f5ea0edb72..2aec73bd5b 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -635,7 +635,7 @@ module ActiveRecord # # => [:tag, :tags] # def source_reflection_names - @source_reflection_names ||= (options[:source] ? [options[:source]] : [name.to_s.singularize, name]).collect { |n| n.to_sym } + @source_reflection_names ||= (options[:source] ? [options[:source]] : [name.to_s.singularize, name]).collect { |n| n.to_sym }.uniq end def source_options |