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-1.0.2 lib/templates/migration.rb
thesilverspoon-1.0.1 lib/templates/migration.rb
thesilverspoon-1.0.0 lib/templates/migration.rb
thesilverspoon-0.0.35 lib/templates/migration.rb
thesilverspoon-0.0.34 lib/templates/migration.rb
thesilverspoon-0.0.33 lib/templates/migration.rb
thesilverspoon-0.0.32 lib/templates/migration.rb
thesilverspoon-0.0.31 lib/templates/migration.rb
thesilverspoon-0.0.30 lib/templates/migration.rb
thesilverspoon-0.0.29 lib/templates/migration.rb
thesilverspoon-0.0.28 lib/templates/migration.rb
thesilverspoon-0.0.27 lib/templates/migration.rb
thesilverspoon-0.0.26 lib/templates/migration.rb
thesilverspoon-0.0.25 lib/templates/migration.rb
thesilverspoon-0.0.24 lib/templates/migration.rb
thesilverspoon-0.0.23 lib/templates/migration.rb
thesilverspoon-0.0.22 lib/templates/migration.rb
thesilverspoon-0.0.21 lib/templates/migration.rb
thesilverspoon-0.0.20 lib/templates/migration.rb
thesilverspoon-0.0.19 lib/templates/migration.rb