Class: ActiveRecord::ConnectionAdapters::JdbcColumn
- Inherits:
-
Column
- Object
- Column
- ActiveRecord::ConnectionAdapters::JdbcColumn
- Defined in:
- lib/arjdbc/jdbc/column.rb
Overview
The base class for all of JdbcAdapter's returned columns.
Instances of JdbcColumn will get extended with "column-spec" modules
(similar to how JdbcAdapter gets spec modules in) if the adapter spec
module provided a column_selector
(matcher) method for it's database
specific type.
Direct Known Subclasses
Class Method Summary collapse
-
.column_types ⇒ Hash
Returns the available column types.
Instance Method Summary collapse
-
#default_value(value) ⇒ Object
Similar to
ActiveRecord
'sextract_value_from_default(default)
.
Class Method Details
.column_types ⇒ Hash
Returns the available column types
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/arjdbc/jdbc/column.rb', line 22 def self.column_types types = {} for mod in ::ArJdbc.modules if mod.respond_to?(:column_selector) sel = mod.column_selector # [ matcher, block ] types[ sel[0] ] = sel[1] end end types end |
Instance Method Details
#default_value(value) ⇒ Object
Similar to ActiveRecord
's extract_value_from_default(default)
.
18 |
# File 'lib/arjdbc/jdbc/column.rb', line 18 def default_value(value); value; end |