diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-05-20 09:15:22 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-05-20 09:15:22 -0700 |
commit | e781aa31fc52a7c696115302ef4d4e02bfd1533b (patch) | |
tree | cd23f0a417dfee59208965bb3921a6173b40dbd7 /activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | |
parent | 89ca6806a72006ef493e5e6ceb50f8ed02dc2da3 (diff) | |
download | rails-e781aa31fc52a7c696115302ef4d4e02bfd1533b.tar.gz rails-e781aa31fc52a7c696115302ef4d4e02bfd1533b.tar.bz2 rails-e781aa31fc52a7c696115302ef4d4e02bfd1533b.zip |
Replace `type_cast` case statement with delegation
All subclasses of column were now delegating `type_cast` to their
injected type object. We can remove the overriding methods, and
generalize it on the `Column` class itself. This also enabled us to
remove several column classes completely, as they no longer had any
meaningful behavior of their own.
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.rb | 3 |
1 files changed, 1 insertions, 2 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 852b7105d3..86eb2a38d8 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -249,10 +249,9 @@ module ActiveRecord raise NotImplementedError end - # Overridden by the adapters to instantiate their specific Column type. def new_column(field, default, sql_type, null, collation, extra = "") # :nodoc: cast_type = lookup_cast_type(sql_type) - Column.new(field, default, cast_type, sql_type, null, collation, extra) + Column.new(field, default, cast_type, sql_type, null, collation, strict_mode?, extra) end # Must return the Mysql error number from the exception, if the exception has an |