Sha256: 016846ea1d03d09b2c659f42d35bb476f2bfcb5319678ffd95be137b6fac3416

Contents?: true

Size: 375 Bytes

Versions: 45

Compression:

Stored size: 375 Bytes

Contents

class <%= migration_class_name %> < ActiveRecord::Migration
  def self.up
    rename_column :audits, :auditable_parent_id, :association_id
    rename_column :audits, :auditable_parent_type, :association_type
  end

  def self.down
    rename_column :audits, :association_type, :auditable_parent_type
    rename_column :audits, :association_id, :auditable_parent_id
  end
end

Version data entries

45 entries across 41 versions & 7 rubygems

Version Path
acts_as_audited-2.1.0 lib/generators/acts_as_audited/templates/rename_parent_to_association.rb
acts_as_audited-2.0.0 lib/generators/acts_as_audited/templates/rename_parent_to_association.rb
acts_as_audited-2.0.0.rc7 lib/generators/acts_as_audited/templates/rename_parent_to_association.rb
acts_as_audited-2.0.0.rc6 lib/generators/acts_as_audited/templates/rename_parent_to_association.rb
acts_as_audited-2.0.0.rc5 lib/generators/acts_as_audited/templates/rename_parent_to_association.rb