Class: ActiveRecord::ConnectionAdapters::OracleColumn

Inherits:
Column
  • Object
show all
Defined in:
lib/connection_adapters/oracle_adapter.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, default, sql_type = nil, null = true) ⇒ OracleColumn

The default initialize method must be overridden here in order to retrieve the original default value. The standard Rails adapter nils out the default value if it is not of a recognized type, so it then appears as if no default value was specified. DrySQL grabs the default value before it gets nil’d out



11
12
13
14
# File 'lib/connection_adapters/oracle_adapter.rb', line 11

def initialize(name, default, sql_type = nil, null = true)
  if !(default.nil? || default.blank?) then @default_specified = true end
  super(name, default, sql_type, null)
end

Instance Method Details

#is_nullable?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/connection_adapters/oracle_adapter.rb', line 16

def is_nullable?
		@null || @default_specified
end