Class: ActiveRecord::ConnectionAdapters::SunstoneColumn
- Inherits:
-
Column
- Object
- Column
- ActiveRecord::ConnectionAdapters::SunstoneColumn
- Defined in:
- lib/active_record/connection_adapters/sunstone/column.rb
Overview
Sunstone-specific extensions to column definitions in a table.
Constant Summary collapse
- NONE =
:nodoc:
Object.new
Instance Attribute Summary collapse
-
#array ⇒ Object
readonly
Returns the value of attribute array.
Instance Method Summary collapse
- #auto_populated? ⇒ Boolean
-
#initialize(name, sql_type_metadata, options = {}) ⇒ SunstoneColumn
constructor
A new instance of SunstoneColumn.
- #primary_key? ⇒ Boolean
Constructor Details
#initialize(name, sql_type_metadata, options = {}) ⇒ SunstoneColumn
Returns a new instance of SunstoneColumn.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/active_record/connection_adapters/sunstone/column.rb', line 9 def initialize(name, , ={}) @name = name.freeze @sql_type_metadata = @null = ['null'] @default = ['default'] ? JSON.generate(['default']) : ['default'] @default_function = nil @collation = nil @table_name = nil @primary_key = (['primary_key'] == true) @array = ['array'] @auto_populated = .has_key?('auto_populated') ? ['auto_populated'] : NONE end |
Instance Attribute Details
#array ⇒ Object (readonly)
Returns the value of attribute array.
7 8 9 |
# File 'lib/active_record/connection_adapters/sunstone/column.rb', line 7 def array @array end |
Instance Method Details
#auto_populated? ⇒ Boolean
26 27 28 29 30 31 |
# File 'lib/active_record/connection_adapters/sunstone/column.rb', line 26 def auto_populated? # TODO: when retuning is working we can do the following to only # return autopulated fields from StandardAPI # @auto_populated == NONE ? @primary_key : @auto_populated true end |
#primary_key? ⇒ Boolean
22 23 24 |
# File 'lib/active_record/connection_adapters/sunstone/column.rb', line 22 def primary_key? @primary_key end |