diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-06-09 13:27:15 -0600 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-06-09 13:39:51 -0600 |
commit | d24e6407a7f5d662cb52ed57efc4d8ee11758170 (patch) | |
tree | cf3a8925d1776444195a85229e1479e51f9eb849 /activerecord/lib/active_record/associations/join_dependency.rb | |
parent | 254efb712ac10fd8e165fb34bb459f4abd59b213 (diff) | |
download | rails-d24e6407a7f5d662cb52ed57efc4d8ee11758170.tar.gz rails-d24e6407a7f5d662cb52ed57efc4d8ee11758170.tar.bz2 rails-d24e6407a7f5d662cb52ed57efc4d8ee11758170.zip |
Rename `type_cast` to `type_cast_from_database`
In some cases there is a difference between the two, we should always
be doing one or the other. For convenience, `type_cast` is still a
private method on type, so new types that do not need different behavior
don't need to implement two methods, but it has been moved to private so
it cannot be used accidentally.
Diffstat (limited to 'activerecord/lib/active_record/associations/join_dependency.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index 35659766d3..fbb4551b22 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -144,7 +144,7 @@ module ActiveRecord column_aliases = aliases.column_aliases join_root result_set.each { |row_hash| - primary_id = type_caster.type_cast row_hash[primary_key] + primary_id = type_caster.type_cast_from_database row_hash[primary_key] parent = parents[primary_id] ||= join_root.instantiate(row_hash, column_aliases) construct(parent, join_root, row_hash, result_set, seen, model_cache, aliases) } |