aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-06-09 16:49:26 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-06-09 16:49:26 -0300
commit9664661f7b8e916ab2cf3fee1b2d2d2f0b26ceeb (patch)
treecf3a8925d1776444195a85229e1479e51f9eb849 /activerecord/lib/active_record/associations
parent254efb712ac10fd8e165fb34bb459f4abd59b213 (diff)
parentd24e6407a7f5d662cb52ed57efc4d8ee11758170 (diff)
downloadrails-9664661f7b8e916ab2cf3fee1b2d2d2f0b26ceeb.tar.gz
rails-9664661f7b8e916ab2cf3fee1b2d2d2f0b26ceeb.tar.bz2
rails-9664661f7b8e916ab2cf3fee1b2d2d2f0b26ceeb.zip
Merge pull request #15592 from sgrif/sg-type-cast-from-database
Rename `type_cast` to `type_cast_from_database`
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r--activerecord/lib/active_record/associations/collection_association.rb2
-rw-r--r--activerecord/lib/active_record/associations/join_dependency.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb
index c5f7bcae7d..306588ac66 100644
--- a/activerecord/lib/active_record/associations/collection_association.rb
+++ b/activerecord/lib/active_record/associations/collection_association.rb
@@ -57,7 +57,7 @@ module ActiveRecord
def ids_writer(ids)
pk_column = reflection.primary_key_column
ids = Array(ids).reject { |id| id.blank? }
- ids.map! { |i| pk_column.type_cast(i) }
+ ids.map! { |i| pk_column.type_cast_from_user(i) }
replace(klass.find(ids).index_by { |r| r.id }.values_at(*ids))
end
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)
}