Class: ActiveRecord::ConnectionAdapters::FirebirdColumn

Inherits:
Column
  • Object
show all
Defined in:
lib/active_record/connection_adapters/rubyfb_adapter.rb

Overview

:nodoc:

Constant Summary collapse

VARCHAR_MAX_LENGTH =
32_765

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection, name, domain, type, sub_type, length, precision, scale, default_source, null_flag) ⇒ FirebirdColumn

Returns a new instance of FirebirdColumn.



102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/active_record/connection_adapters/rubyfb_adapter.rb', line 102

def initialize(connection, name, domain, type, sub_type, length, precision, scale, default_source, null_flag)
  @firebird_type = Rubyfb::SQLType.to_base_type(type, sub_type).to_s
  @domain, @sub_type = domain, sub_type

  super(name.downcase, nil, @firebird_type, !null_flag)

  @precision, @scale = precision, (scale.nil? ? 0 : scale.abs)
  @limit = decide_limit(length)
  @type = simplified_type(@firebird_type)
  @default = parse_default(default_source) if default_source
  @default = type_cast(decide_default(connection)) if @default
end

Class Method Details

.value_to_boolean(value) ⇒ Object



115
116
117
# File 'lib/active_record/connection_adapters/rubyfb_adapter.rb', line 115

def self.value_to_boolean(value)
  (TRUE_VALUES + [RubyfbAdapter.boolean_domain[:true]]).include?(value) || super
end