module Mv::Core::Db::Helpers::TableValidators

Attributes

table_name[RW]

Public Instance Methods

delete_table_validators() click to toggle source
# File lib/mv/core/db/helpers/table_validators.rb, line 14
def delete_table_validators
  delete_validators(table_validators)
end
table_validators() click to toggle source
# File lib/mv/core/db/helpers/table_validators.rb, line 10
def table_validators
  Mv::Core::Db::MigrationValidator.where(table_name: table_name)
end
update_table_validators(new_table_name) click to toggle source
# File lib/mv/core/db/helpers/table_validators.rb, line 18
def update_table_validators new_table_name
  table_validators.update_all(table_name: new_table_name)
end

Private Instance Methods

delete_validators(validators) click to toggle source
# File lib/mv/core/db/helpers/table_validators.rb, line 28
def delete_validators validators
  validators.each do |validator|
    validator.destroy
  end
  validators.length
end
say(message) click to toggle source
# File lib/mv/core/db/helpers/table_validators.rb, line 24
def say(message)
  ::ActiveRecord::Migration.say(message, true)
end