aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/query_attribute.rb
diff options
context:
space:
mode:
authorDylan Thacker-Smith <Dylan.Smith@shopify.com>2019-01-23 10:15:06 -0500
committerDylan Thacker-Smith <Dylan.Smith@shopify.com>2019-01-23 14:49:42 -0500
commit5b58cc4f443b61ab157bf9ff3cb478314fdd31bd (patch)
treec212a0bc05ca58db31e0a45966f773dae2c4394d /activerecord/lib/active_record/relation/query_attribute.rb
parentd1456e3ad52cdab6d2fa07ef3f239631a20a9a1f (diff)
downloadrails-5b58cc4f443b61ab157bf9ff3cb478314fdd31bd.tar.gz
rails-5b58cc4f443b61ab157bf9ff3cb478314fdd31bd.tar.bz2
rails-5b58cc4f443b61ab157bf9ff3cb478314fdd31bd.zip
activerecord: Fix statement cache for strictly cast attributes
Diffstat (limited to 'activerecord/lib/active_record/relation/query_attribute.rb')
-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