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
notifiably_audited-activerecord-2.1.0 lib/generators/audited/templates/rename_parent_to_association.rb
notifiably_audited-activerecord-2.0.0 lib/generators/audited/templates/rename_parent_to_association.rb
audited-hp-4.3.1 lib/generators/audited/templates/rename_parent_to_association.rb
audited-hp-4.3.0 lib/generators/audited/templates/rename_parent_to_association.rb
audited-4.3.0 lib/generators/audited/templates/rename_parent_to_association.rb
audited-activerecord-4.2.2 lib/generators/audited/templates/rename_parent_to_association.rb
audited-activerecord-4.2.1 lib/generators/audited/templates/rename_parent_to_association.rb
audited-activerecord-4.2.0 lib/generators/audited/templates/rename_parent_to_association.rb
audited-activerecord-4.0.0 lib/generators/audited/templates/rename_parent_to_association.rb
audited-activerecord-4.0.0.rc1 lib/generators/audited/templates/rename_parent_to_association.rb
notifiably_audited-activerecord-1.0.10 lib/generators/notifiably_audited/templates/rename_parent_to_association.rb
notifiably_audited-activerecord-1.0.9 lib/generators/notifiably_audited/templates/rename_parent_to_association.rb
notifiably_audited-activerecord-1.0.8 lib/generators/notifiably_audited/templates/rename_parent_to_association.rb
notifiably_audited-activerecord-1.0.7 lib/generators/notifiably_audited/templates/rename_parent_to_association.rb
notifiably_audited-activerecord-1.0.6 lib/generators/notifiably_audited/templates/rename_parent_to_association.rb
notifiably_audited-activerecord-1.0.5 lib/generators/notifiably_audited/templates/rename_parent_to_association.rb
notifiably_audited-activerecord-1.0.4 lib/generators/notifiably_audited/templates/rename_parent_to_association.rb
notifiably_audited-activerecord-1.0.3 lib/generators/notifiably_audited/templates/rename_parent_to_association.rb
notifiably_audited-activerecord-1.0.2 lib/generators/notifiably_audited/templates/rename_parent_to_association.rb
notifiably_audited-activerecord-1.0.1 lib/generators/notifiably_audited/templates/rename_parent_to_association.rb