aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/type
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-05-24 08:23:32 -0700
committerSean Griffin <sean@thoughtbot.com>2014-05-26 06:19:44 -0700
commitb5c4ef2c785ef634a81d7bb554e9b20f164be95b (patch)
tree19336e52e362bfeb4a09ea41de94a04e194ce6b7 /activerecord/lib/active_record/connection_adapters/type
parentec88d6861a81e5d7402660fb141f75f0aab86a4a (diff)
downloadrails-b5c4ef2c785ef634a81d7bb554e9b20f164be95b.tar.gz
rails-b5c4ef2c785ef634a81d7bb554e9b20f164be95b.tar.bz2
rails-b5c4ef2c785ef634a81d7bb554e9b20f164be95b.zip
Add an interface for type objects to control Ruby => SQL
Adds the ability to save custom types, which type cast to non-primitive ruby objects.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/type')
-rw-r--r--activerecord/lib/active_record/connection_adapters/type/value.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/type/value.rb b/activerecord/lib/active_record/connection_adapters/type/value.rb
index 54a3e9dd7a..9bbc249c2b 100644
--- a/activerecord/lib/active_record/connection_adapters/type/value.rb
+++ b/activerecord/lib/active_record/connection_adapters/type/value.rb
@@ -21,6 +21,10 @@ module ActiveRecord
value
end
+ def type_cast_for_database(value)
+ type_cast_for_write(value)
+ end
+
def text?
false
end