Sha256: b230858ec419ea9334584d771342c08298f6d5a526afbf08667512bdd78d63e7

Contents?: true

Size: 375 Bytes

Versions: 9

Compression:

Stored size: 375 Bytes

Contents

class <%= migration_class_name %> < <%= migration_parent %>
  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

9 entries across 9 versions & 1 rubygems

Version Path
audited-4.10.0 lib/generators/audited/templates/rename_parent_to_association.rb
audited-4.9.0 lib/generators/audited/templates/rename_parent_to_association.rb
audited-4.8.0 lib/generators/audited/templates/rename_parent_to_association.rb
audited-4.7.1 lib/generators/audited/templates/rename_parent_to_association.rb
audited-4.7.0 lib/generators/audited/templates/rename_parent_to_association.rb
audited-4.6.0 lib/generators/audited/templates/rename_parent_to_association.rb
audited-4.5.0 lib/generators/audited/templates/rename_parent_to_association.rb
audited-4.4.1 lib/generators/audited/templates/rename_parent_to_association.rb
audited-4.4.0 lib/generators/audited/templates/rename_parent_to_association.rb