diff options
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/column.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/column.rb | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/column.rb b/activerecord/lib/active_record/connection_adapters/column.rb index f46f9af239..0f0aa9110e 100644 --- a/activerecord/lib/active_record/connection_adapters/column.rb +++ b/activerecord/lib/active_record/connection_adapters/column.rb @@ -18,7 +18,7 @@ module ActiveRecord alias :encoded? :coder - delegate :type, to: :cast_type + delegate :type, :text?, :number?, :binary?, to: :cast_type # Instantiates a new column in the table. # @@ -43,16 +43,6 @@ module ActiveRecord @coder = nil end - # Returns +true+ if the column is either of type string or text. - def text? - type == :string || type == :text - end - - # Returns +true+ if the column is either of type integer, float or decimal. - def number? - type == :integer || type == :float || type == :decimal - end - def has_default? !default.nil? end @@ -70,10 +60,6 @@ module ActiveRecord end end - def binary? - type == :binary - end - # Casts a Ruby value to something appropriate for writing to the database. # Numeric columns will typecast boolean and string to appropriate numeric # values. |