Sha256: 5ddff56c0bb1fdda7b9c62570c4e2fa8207bc4ec901a4bc096b85212e8426858
Contents?: true
Size: 1.18 KB
Versions: 4
Compression:
Stored size: 1.18 KB
Contents
class Create<%= namespacing %><%= class_name.pluralize %> < ActiveRecord::Migration[<%= "#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}" %>] 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
4 entries across 4 versions & 1 rubygems