Class: ActiveRecord::ConnectionAdapters::IBM_DB2Column
- Defined in:
- lib/connection_adapters/ibm_db2_adapter.rb
Instance Attribute Summary collapse
-
#default_specified ⇒ Object
Returns the value of attribute default_specified.
-
#generated ⇒ Object
Returns the value of attribute generated.
Instance Method Summary collapse
- #default_specified? ⇒ Boolean
- #generated? ⇒ Boolean
-
#initialize(name, default, generated, sql_type = nil, null = true) ⇒ IBM_DB2Column
constructor
A new instance of IBM_DB2Column.
Constructor Details
#initialize(name, default, generated, sql_type = nil, null = true) ⇒ IBM_DB2Column
Returns a new instance of IBM_DB2Column.
111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/connection_adapters/ibm_db2_adapter.rb', line 111 def initialize(name, default, generated, sql_type = nil, null = true) @name, @type, @null = name, simplified_type(sql_type), null @text = [:string, :text, :binary].include? @type @sql_type = sql_type # have to do this one separately because type_cast depends on #type if !(default.nil? || default.blank?) then @default_specified = true end @default = type_cast(default) # Extracts the limit if it's a :string or :text type @limit = extract_limit(sql_type) if !sql_type.nil? && @text @primary = nil @number = [:float, :integer].include? @type @generated = generated end |
Instance Attribute Details
#default_specified ⇒ Object
Returns the value of attribute default_specified.
109 110 111 |
# File 'lib/connection_adapters/ibm_db2_adapter.rb', line 109 def default_specified @default_specified end |
#generated ⇒ Object
Returns the value of attribute generated.
109 110 111 |
# File 'lib/connection_adapters/ibm_db2_adapter.rb', line 109 def generated @generated end |
Instance Method Details
#default_specified? ⇒ Boolean
125 126 127 |
# File 'lib/connection_adapters/ibm_db2_adapter.rb', line 125 def default_specified? @default_specified end |
#generated? ⇒ Boolean
129 130 131 |
# File 'lib/connection_adapters/ibm_db2_adapter.rb', line 129 def generated? !(generated.nil? || generated.blank?) end |