diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-29 11:18:43 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-29 11:18:43 -0700 |
commit | 5793d5e0023257962ed9a8ef980062cddd30ce19 (patch) | |
tree | f5b48497144a7876448a45e624fa78e6bdc3c6aa /activerecord/lib/active_record/connection_adapters/abstract | |
parent | c57f5d58ea5ba60b0997017ab322481377c81c2c (diff) | |
download | rails-5793d5e0023257962ed9a8ef980062cddd30ce19.tar.gz rails-5793d5e0023257962ed9a8ef980062cddd30ce19.tar.bz2 rails-5793d5e0023257962ed9a8ef980062cddd30ce19.zip |
eliminating method_missing on TableDefinition
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb index 84fc4c03f9..6480aeb171 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb @@ -318,21 +318,13 @@ module ActiveRecord @base = base end - #Handles non supported datatypes - e.g. XML - def method_missing(symbol, *args) - if symbol.to_s == 'xml' - xml_column_fallback(args) - else - super - end - end + def xml(*args) + raise NotImplementedError unless %w{ + sqlite mysql mysql2 + }.include? @base.adapter_name.downcase - def xml_column_fallback(*args) - case @base.adapter_name.downcase - when 'sqlite', 'mysql' - options = args.extract_options! - column(args[0], :text, options) - end + options = args.extract_options! + column(args[0], :text, options) end # Appends a primary key definition to the table definition. |