-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
Add:
def create_model
table_name = name.parameterize('_').tableize
migration_template 'migration.rb', "db/migrate/create_#{table_name.pluralize}.rb"
template 'model.rb', "app/models/#{name.singularize}.rb"
endthe template:
https://github.com/HitFox/foxinator-generator/blob/master/lib/generators/foxinator/scaffold/templates/migration.rb
should be replaced with:
class Create<%= class_name.gsub('::','').pluralize %> < ActiveRecord::Migration
def change
create_table :<%= table_name.pluralize %> do |t|
<%- model_attrs.each do |attr| -%>
t.<%= attr.type %> :<%= attr.name %>
<%- end -%>
t.timestamps
end
end
endReactions are currently unavailable