Class: ActiveRecord::ConnectionAdapters::OracleEnhanced::TableDefinition

Inherits:
TableDefinition
  • Object
show all
Includes:
ColumnMethods
Defined in:
lib/active_record/connection_adapters/oracle_enhanced/schema_definitions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ColumnMethods

#primary_key

Constructor Details

#initialize(conn, name, temporary: false, options: nil, as: nil, tablespace: nil, organization: nil, comment: nil) ⇒ TableDefinition

Returns a new instance of TableDefinition.



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/active_record/connection_adapters/oracle_enhanced/schema_definitions.rb', line 56

def initialize(
  conn,
  name,
  temporary: false,
  options: nil,
  as: nil,
  tablespace: nil,
  organization: nil,
  comment: nil,
  **
)
  @tablespace = tablespace
  @organization = organization
  super(conn, name, temporary: temporary, options: options, as: as, comment: comment)
end

Instance Attribute Details

#organizationObject

Returns the value of attribute organization.



55
56
57
# File 'lib/active_record/connection_adapters/oracle_enhanced/schema_definitions.rb', line 55

def organization
  @organization
end

#tablespaceObject

Returns the value of attribute tablespace.



55
56
57
# File 'lib/active_record/connection_adapters/oracle_enhanced/schema_definitions.rb', line 55

def tablespace
  @tablespace
end

Instance Method Details

#new_column_definition(name, type, **options) ⇒ Object

:nodoc:



72
73
74
75
76
77
78
# File 'lib/active_record/connection_adapters/oracle_enhanced/schema_definitions.rb', line 72

def new_column_definition(name, type, **options) # :nodoc:
  if type == :virtual
    raise "No virtual column definition found." unless options[:as]
    type = options[:type]
  end
  super
end

#references(*args, **options) ⇒ Object Also known as: belongs_to



80
81
82
# File 'lib/active_record/connection_adapters/oracle_enhanced/schema_definitions.rb', line 80

def references(*args, **options)
  super(*args, type: :integer, **options)
end