method
klass
rails latest stable - Class:
ActiveRecord::ConnectionAdapters::Column
Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v3.0.9) is shown here.
klass()public
Returns the Ruby class that corresponds to the abstract data type.
# File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 54
def klass
case type
when :integer then Fixnum
when :float then Float
when :decimal then BigDecimal
when :datetime then Time
when :date then Date
when :timestamp then Time
when :time then Time
when :text, :string then String
when :binary then String
when :boolean then Object
end
end Related methods
- Instance methods
- extract_default
- has_default?
- human_name
- klass
- number?
- text?
- type_cast
- type_cast_code
- Class methods
- binary_to_string
- new
- string_to_binary
- string_to_date
- string_to_dummy_time
- string_to_time
- value_to_boolean
- value_to_decimal
- Protected methods
-
fallback_string_to_date -
fallback_string_to_time -
fast_string_to_date -
fast_string_to_time -
microseconds -
new_date -
new_time - Private methods
-
extract_limit -
extract_precision -
extract_scale -
simplified_type