diff options
author | Matthew Draper <matthew@trebex.net> | 2017-05-26 09:02:48 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-26 09:02:48 +0930 |
commit | 289cd3755a3483f5f6de3b6d9b509e513cb14c5a (patch) | |
tree | 321b0963991b5663b98dda3d558c539f5c948f73 /activerecord/lib/active_record/inheritance.rb | |
parent | e8391bab928bda5ec4555e2ddb61e9092c2203c0 (diff) | |
parent | fb6ccce80663dad034d86c472024076a8348a12f (diff) | |
download | rails-289cd3755a3483f5f6de3b6d9b509e513cb14c5a.tar.gz rails-289cd3755a3483f5f6de3b6d9b509e513cb14c5a.tar.bz2 rails-289cd3755a3483f5f6de3b6d9b509e513cb14c5a.zip |
Merge pull request #29215 from voxmedia/ar_optimizations
ActiveRecord initialization optimizations
Diffstat (limited to 'activerecord/lib/active_record/inheritance.rb')
-rw-r--r-- | activerecord/lib/active_record/inheritance.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/inheritance.rb b/activerecord/lib/active_record/inheritance.rb index fbdaeaae51..236a65eba7 100644 --- a/activerecord/lib/active_record/inheritance.rb +++ b/activerecord/lib/active_record/inheritance.rb @@ -217,7 +217,7 @@ module ActiveRecord def subclass_from_attributes(attrs) attrs = attrs.to_h if attrs.respond_to?(:permitted?) if attrs.is_a?(Hash) - subclass_name = attrs.with_indifferent_access[inheritance_column] + subclass_name = attrs[inheritance_column] || attrs[inheritance_column.to_sym] if subclass_name.present? find_sti_class(subclass_name) |