Class: Liquigen::ModifyDataType

Inherits:
Change
  • Object
show all
Defined in:
lib/liquigen/modify_data_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table, from, to) ⇒ ModifyDataType

Returns a new instance of ModifyDataType.



9
10
11
12
13
# File 'lib/liquigen/modify_data_type.rb', line 9

def initialize(table, from, to)
  self.table_name = table&.underscore&.pluralize
  self.column_name = from
  self.new_date_type = TypeMap.new(to).db_type || to
end

Instance Attribute Details

#column_nameObject

Returns the value of attribute column_name.



6
7
8
# File 'lib/liquigen/modify_data_type.rb', line 6

def column_name
  @column_name
end

#new_date_typeObject

Returns the value of attribute new_date_type.



7
8
9
# File 'lib/liquigen/modify_data_type.rb', line 7

def new_date_type
  @new_date_type
end

#table_nameObject

Returns the value of attribute table_name.



5
6
7
# File 'lib/liquigen/modify_data_type.rb', line 5

def table_name
  @table_name
end