diff options
author | Matthew Draper <matthew@trebex.net> | 2017-07-01 22:12:54 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-01 22:12:54 +0930 |
commit | 3acc3767c103e1a2a5de4d262d166f447f537e0f (patch) | |
tree | 48efb0c665bd556e69463dd4ab6150a3b9ee2b6e /activerecord/lib | |
parent | 4fd4d369f7351b880d9165af571b49ed23e3c5c8 (diff) | |
parent | c2120582e4d27d2a64131820a46392af60f1e8b6 (diff) | |
download | rails-3acc3767c103e1a2a5de4d262d166f447f537e0f.tar.gz rails-3acc3767c103e1a2a5de4d262d166f447f537e0f.tar.bz2 rails-3acc3767c103e1a2a5de4d262d166f447f537e0f.zip |
Merge pull request #28808 from fschwahn/fix-polymorphic-automic-inverse
Fix automatic inverse for polymorphic interfaces
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/reflection.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index 73761ed7ed..8ff2f50fdb 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -592,7 +592,7 @@ module ActiveRecord end VALID_AUTOMATIC_INVERSE_MACROS = [:has_many, :has_one, :belongs_to] - INVALID_AUTOMATIC_INVERSE_OPTIONS = [:conditions, :through, :polymorphic, :foreign_key] + INVALID_AUTOMATIC_INVERSE_OPTIONS = [:conditions, :through, :foreign_key] def add_as_source(seed) seed @@ -663,9 +663,8 @@ module ActiveRecord # us from being able to guess the inverse automatically. First, the # <tt>inverse_of</tt> option cannot be set to false. Second, we must # have <tt>has_many</tt>, <tt>has_one</tt>, <tt>belongs_to</tt> associations. - # Third, we must not have options such as <tt>:polymorphic</tt> or - # <tt>:foreign_key</tt> which prevent us from correctly guessing the - # inverse association. + # Third, we must not have options such as <tt>:foreign_key</tt> + # which prevent us from correctly guessing the inverse association. # # Anything with a scope can additionally ruin our attempt at finding an # inverse, so we exclude reflections with scopes. |