Class: ActiveRecord::ConnectionAdapters::JdbcColumn
- Inherits:
-
Column
- Object
- Column
- ActiveRecord::ConnectionAdapters::JdbcColumn
- Defined in:
- lib/arjdbc/jdbc/column.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#limit ⇒ Object
writeonly
Sets the attribute limit.
-
#precision ⇒ Object
writeonly
Sets the attribute precision.
Class Method Summary collapse
Instance Method Summary collapse
- #default_value(val) ⇒ Object
- #init_column(*args) ⇒ Object
-
#initialize(config, name, default, *args) ⇒ JdbcColumn
constructor
A new instance of JdbcColumn.
Constructor Details
#initialize(config, name, default, *args) ⇒ JdbcColumn
Returns a new instance of JdbcColumn.
6 7 8 9 10 |
# File 'lib/arjdbc/jdbc/column.rb', line 6 def initialize(config, name, default, *args) call_discovered_column_callbacks(config) super(name,default_value(default),*args) init_column(name, default, *args) end |
Instance Attribute Details
#limit=(value) ⇒ Object (writeonly)
Sets the attribute limit
4 5 6 |
# File 'lib/arjdbc/jdbc/column.rb', line 4 def limit=(value) @limit = value end |
#precision=(value) ⇒ Object (writeonly)
Sets the attribute precision
4 5 6 |
# File 'lib/arjdbc/jdbc/column.rb', line 4 def precision=(value) @precision = value end |
Class Method Details
.column_types ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/arjdbc/jdbc/column.rb', line 19 def self.column_types # GH #25: reset the column types if the # of constants changed # since last call if ::ArJdbc.constants.size != driver_constants.size @driver_constants = nil @column_types = nil end @column_types ||= driver_constants.select {|c| c.respond_to? :column_selector }.map {|c| c.column_selector }.inject({}) {|h,val| h[val[0]] = val[1]; h } end |
Instance Method Details
#default_value(val) ⇒ Object
15 16 17 |
# File 'lib/arjdbc/jdbc/column.rb', line 15 def default_value(val) val end |
#init_column(*args) ⇒ Object
12 13 |
# File 'lib/arjdbc/jdbc/column.rb', line 12 def init_column(*args) end |