class Object
Public Class Methods
down()
click to toggle source
# File lib/generators/audited/templates/add_association_to_audits.rb, line 7 def self.down remove_column :audits, :association_type remove_column :audits, :association_id end
up()
click to toggle source
# File lib/generators/audited/templates/add_association_to_audits.rb, line 2 def self.up add_column :audits, :association_id, :integer add_column :audits, :association_type, :string end
Public Instance Methods
fix_index_order_for(columns, index_name)
click to toggle source
# File lib/generators/audited/templates/revert_polymorphic_indexes_order.rb, line 14 def fix_index_order_for(columns, index_name) if index_exists? :audits, columns, name: index_name remove_index :audits, name: index_name add_index :audits, columns.reverse, name: index_name end end