aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-01-24 05:36:13 +0900
committerGitHub <noreply@github.com>2019-01-24 05:36:13 +0900
commit060fe164471213209de9637c19ee5c25492d0c1c (patch)
treec212a0bc05ca58db31e0a45966f773dae2c4394d /activerecord/lib/active_record
parentd1456e3ad52cdab6d2fa07ef3f239631a20a9a1f (diff)
parent5b58cc4f443b61ab157bf9ff3cb478314fdd31bd (diff)
downloadrails-060fe164471213209de9637c19ee5c25492d0c1c.tar.gz
rails-060fe164471213209de9637c19ee5c25492d0c1c.tar.bz2
rails-060fe164471213209de9637c19ee5c25492d0c1c.zip
Merge pull request #35029 from dylanahsmith/fix-strictly-cast-attribute-types
activerecord: Fix statement cache for strictly cast attributes
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/relation/query_attribute.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/query_attribute.rb b/activerecord/lib/active_record/relation/query_attribute.rb
index 5e0b4ac160..1dd6462d8d 100644
--- a/activerecord/lib/active_record/relation/query_attribute.rb
+++ b/activerecord/lib/active_record/relation/query_attribute.rb
@@ -32,7 +32,7 @@ module ActiveRecord
if defined?(@_unboundable)
@_unboundable
else
- value_for_database
+ value_for_database unless value_before_type_cast.is_a?(StatementCache::Substitute)
@_unboundable = nil
end
rescue ::RangeError