aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2015-02-06 11:05:38 -0700
committerSean Griffin <sean@thoughtbot.com>2015-02-06 11:51:13 -0700
commit101c19f55f5f1d86d35574b805278f11e9a1a48e (patch)
treecf5821f06acafe416a0cea205967f243f08ec9ef /activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
parentd7318599160dbc6d362793673e8c6db926eeb7b8 (diff)
downloadrails-101c19f55f5f1d86d35574b805278f11e9a1a48e.tar.gz
rails-101c19f55f5f1d86d35574b805278f11e9a1a48e.tar.bz2
rails-101c19f55f5f1d86d35574b805278f11e9a1a48e.zip
Allow a symbol to be passed to `attribute`, in place of a type object
The same is not true of `define_attribute`, which is meant to be the low level no-magic API that sits underneath. The differences between the two APIs are: - `attribute` - Lazy (the attribute will be defined after the schema has loaded) - Allows either a type object or a symbol - `define_attribute` - Runs immediately (might get trampled by schema loading) - Requires a type object This was the last blocker in terms of public interface requirements originally discussed for this feature back in May. All the implementation blockers have been cleared, so this feature is probably ready for release (pending one more look-over by me).
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
index 5c8c4b883a..61bac6741f 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
@@ -947,6 +947,10 @@ module ActiveRecord
end
end
end
+
+ def type_classes_with_standard_constructor
+ super.merge(string: MysqlString, date_time: MysqlDateTime)
+ end
end
end
end