Module: DBNazi::Table

Defined in:
lib/db_nazi/table.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/db_nazi/table.rb', line 3

def self.included(base)
  base.class_eval do
    alias_method_chain :column, :db_nazi
    alias_method_chain :index, :db_nazi
    alias_method_chain :change, :db_nazi
  end
end

Instance Method Details

#change_with_db_nazi(column_name, type, options = {}) ⇒ Object



21
22
23
24
# File 'lib/db_nazi/table.rb', line 21

def change_with_db_nazi(column_name, type, options = {})
  DBNazi.check_column(type, options)
  change_without_db_nazi(column_name, type, options)
end

#column_with_db_nazi(column_name, type, options = {}) ⇒ Object



11
12
13
14
# File 'lib/db_nazi/table.rb', line 11

def column_with_db_nazi(column_name, type, options = {})
  DBNazi.check_column(type, options)
  column_without_db_nazi(column_name, type, options)
end

#index_with_db_nazi(column_name, options = {}) ⇒ Object



16
17
18
19
# File 'lib/db_nazi/table.rb', line 16

def index_with_db_nazi(column_name, options = {})
  DBNazi.check_index(options)
  index_without_db_nazi(column_name, options)
end