mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge branch 'master' into adequaterecord
* master: add services: memcache to travis The `source` option for `has_many => through` should accept String values.
This commit is contained in:
commit
c954a74ee2
3 changed files with 4 additions and 3 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
services: memcache
|
||||||
script: 'ci/travis.rb'
|
script: 'ci/travis.rb'
|
||||||
before_install:
|
before_install:
|
||||||
- travis_retry gem install bundler
|
- travis_retry gem install bundler
|
||||||
|
|
|
@ -621,7 +621,7 @@ module ActiveRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def source_reflection_name # :nodoc:
|
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 = [name.to_s.singularize, name].collect { |n| n.to_sym }.uniq
|
||||||
names = names.find_all { |n|
|
names = names.find_all { |n|
|
||||||
|
|
|
@ -3,5 +3,5 @@ class Tag < ActiveRecord::Base
|
||||||
has_many :taggables, :through => :taggings
|
has_many :taggables, :through => :taggings
|
||||||
has_one :tagging
|
has_one :tagging
|
||||||
|
|
||||||
has_many :tagged_posts, :through => :taggings, :source => :taggable, :source_type => 'Post'
|
has_many :tagged_posts, :through => :taggings, :source => 'taggable', :source_type => 'Post'
|
||||||
end
|
end
|
Loading…
Reference in a new issue