diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-13 18:19:18 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-13 18:19:18 -0300 |
commit | 4c0a1021e51bfb8f3623480f577f7f52d83a0fc7 (patch) | |
tree | 2aaff660948a48ff70a4351446f9f1a1a8908ea5 /activerecord/lib/active_record | |
parent | c28e436aae4a13225d86e00094a5fa72d82fc297 (diff) | |
parent | 9feadc11a71b655dd7748c0f3a92bc411c9e63c2 (diff) | |
download | rails-4c0a1021e51bfb8f3623480f577f7f52d83a0fc7.tar.gz rails-4c0a1021e51bfb8f3623480f577f7f52d83a0fc7.tar.bz2 rails-4c0a1021e51bfb8f3623480f577f7f52d83a0fc7.zip |
Merge pull request #15343 from dontfidget/fix_polymorphic_automatic_inverse_of
prevent bad automatic inverse_of association
Diffstat (limited to 'activerecord/lib/active_record')
-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 95a3c70c93..51c96373ee 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -487,7 +487,7 @@ Joining, Preloading and eager loading of these associations is deprecated and wi # returns either nil or the inverse association name that it finds. def automatic_inverse_of if can_find_inverse_of_automatically?(self) - inverse_name = ActiveSupport::Inflector.underscore(active_record.name).to_sym + inverse_name = ActiveSupport::Inflector.underscore(options[:as] || active_record.name).to_sym begin reflection = klass._reflect_on_association(inverse_name) |