Sha256: 3eaa7fabc468a242fd06d6bbef3cffa21c4ee594a2220bc7b237ae23e07f7f3b

Contents?: true

Size: 446 Bytes

Versions: 37

Compression:

Stored size: 446 Bytes

Contents

class Create<%= class_name.pluralize.delete('::') %> < ActiveRecord::Migration
def self.up
create_table :<%= table_name || plural_name.split('/').last %> do |t|
<%- for attribute in model_attributes -%>
      t.<%= attribute.type %> :<%= attribute.name %>
<%- end -%>
    <%- unless options[:skip_timestamps] -%>
t.timestamps
<%- end -%>
    end
  end

  def self.down
    drop_table :<%= table_name || plural_name.split('/').last %>
  end
end


Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
thesilverspoon-0.0.18 lib/templates/migration.rb
thesilverspoon-0.0.17 lib/templates/migration.rb
thesilverspoon-0.0.16 lib/templates/migration.rb
thesilverspoon-0.0.15 lib/templates/migration.rb
thesilverspoon-0.0.14 lib/templates/migration.rb
thesilverspoon-0.0.13 lib/templates/migration.rb
thesilverspoon-0.0.12 lib/templates/migration.rb
thesilverspoon-0.0.11 lib/templates/migration.rb
thesilverspoon-0.0.10 lib/templates/migration.rb
thesilverspoon-0.0.9 lib/templates/migration.rb
thesilverspoon-0.0.8 lib/templates/migration.rb
thesilverspoon-0.0.7 lib/templates/migration.rb
thesilverspoon-0.0.6 lib/templates/migration.rb
thesilverspoon-0.0.5 lib/templates/migration.rb
thesilverspoon-0.0.4 lib/templates/migration.rb
thesilverspoon-0.0.3 lib/templates/migration.rb
integratedscaffold-1.0.4 lib/templates/migration.rb