Class: Thredded::BaseMigration

Inherits:
Object
  • Object
show all
Defined in:
lib/thredded/base_migration.rb

Instance Method Summary collapse

Instance Method Details

#column_type(table, column_name) ⇒ Object



9
10
11
12
# File 'lib/thredded/base_migration.rb', line 9

def column_type(table, column_name)
  column_name = column_name.to_s
  columns(table).find { |c| c.name == column_name }.sql_type
end

#user_id_typeObject



5
6
7
# File 'lib/thredded/base_migration.rb', line 5

def user_id_type
  Thredded.user_class.columns.find { |c| c.name == Thredded.user_class.primary_key }.sql_type
end