Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

The `source` option for `has_many => through` should accept String

values.

With the changes introduced by 16b70fd
it was expecting the value to be a Symbol, while it could be also a
String value.
  • Loading branch information...
commit a91e5ff2cbf2f8971ad0d2a80b2e22e63b1900f6 1 parent 7b75b67
@laurocaetano laurocaetano authored
View
2  activerecord/lib/active_record/reflection.rb
@@ -621,7 +621,7 @@ def source_reflection_names
end
def source_reflection_name # :nodoc:
- return @source_reflection_name if @source_reflection_name
+ return @source_reflection_name.to_sym if @source_reflection_name
names = [name.to_s.singularize, name].collect { |n| n.to_sym }.uniq
names = names.find_all { |n|
View
4 activerecord/test/models/tag.rb
@@ -3,5 +3,5 @@ class Tag < ActiveRecord::Base
has_many :taggables, :through => :taggings
has_one :tagging
- has_many :tagged_posts, :through => :taggings, :source => :taggable, :source_type => 'Post'
-end
+ has_many :tagged_posts, :through => :taggings, :source => 'taggable', :source_type => 'Post'
+end
Please sign in to comment.
Something went wrong with that request. Please try again.