Class: ActiveRecord::ConnectionAdapters::JdbcColumn

Inherits:
Column
  • Object
show all
Defined in:
lib/arjdbc/jdbc/column.rb

Direct Known Subclasses

MysqlColumn, SQLite3Column

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

  • value

    the value to set the attribute limit to.



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

Parameters:

  • value

    the value to set the attribute precision to.



4
5
6
# File 'lib/arjdbc/jdbc/column.rb', line 4

def precision=(value)
  @precision = value
end

Class Method Details

.column_typesObject



19
20
21
22
23
24
25
# File 'lib/arjdbc/jdbc/column.rb', line 19

def self.column_types
  @column_types ||= ::ArJdbc.constants.map{|c|
    ::ArJdbc.const_get c }.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