Sha256: 77e1dbcbfef3115d0d4cc0218edeb03728a7158f571e1bd2ce09197c74b98a57
Contents?: true
Size: 1.11 KB
Versions: 7
Compression:
Stored size: 1.11 KB
Contents
class Create<%= namespacing %><%= class_name.pluralize %> < ActiveRecord::Migration def up create_table :refinery_<%= "#{namespacing.underscore}_" if table_name != namespacing.underscore.pluralize -%><%= table_name %> do |t| <% attributes.each do |attribute| -%> t.<%= attribute.type %> :<%= attribute.column_name %> <% end -%> t.integer :position t.timestamps end <% if localized? %> Refinery::<%= namespacing %>::<%= class_name %>.create_translation_table! <%= attributes_for_translation_table %> <% end %> end def down if defined?(::Refinery::UserPlugin) ::Refinery::UserPlugin.destroy_all({:name => "refinerycms-<%= namespacing.underscore %>"}) end <% unless skip_frontend? %> if defined?(::Refinery::Page) ::Refinery::Page.delete_all({:link_url => "/<%= namespacing.underscore %>/<%= plural_name %>"}) end <% end %> drop_table :refinery_<%= "#{namespacing.underscore}_" if table_name != namespacing.underscore.pluralize -%><%= table_name %> <% if localized? %> Refinery::<%= namespacing %>::<%= class_name %>.drop_translation_table! <% end %> end end
Version data entries
7 entries across 7 versions & 1 rubygems