File tree Expand file tree Collapse file tree
lib/generators/foxinator/scaffold Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11PATH
22 remote: .
33 specs:
4- foxinator-generator (0.0.18 )
4+ foxinator-generator (0.0.19 )
55 bootstrap-kaminari-views (~> 0.0.5 )
66 devise (~> 3.4.1 )
77 inherited_resources (~> 1.6.0 )
@@ -162,3 +162,6 @@ DEPENDENCIES
162162 rdoc (~> 3.12 )
163163 shoulda
164164 simplecov
165+
166+ BUNDLED WITH
167+ 1.10.2
Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ def self.next_migration_number(dirname)
2727 end
2828
2929 def create_model
30- migration_template 'migration.rb' , "db/migrate/create_#{ file_name . pluralize } .rb"
30+ table_name = class_name . tableize . parameterize ( '_' )
31+ migration_template 'migration.rb' , "db/migrate/create_#{ table_name } .rb"
3132 template 'model.rb' , "app/models/#{ file_name . singularize } .rb"
3233 end
3334 end
Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ def self.next_migration_number(dirname)
2626 end
2727
2828 def create_model
29- migration_template 'migration.rb' , "db/migrate/create_#{ file_name . pluralize } .rb"
29+ table_name = class_name . tableize . parameterize ( '_' )
30+ migration_template 'migration.rb' , "db/migrate/create_#{ table_name } .rb"
3031 template 'model.rb' , "app/models/#{ file_name . singularize } .rb"
3132 end
3233
Original file line number Diff line number Diff line change 1- class Create < %= class_name . pluralize %> < ActiveRecord::Migration
1+ class Create < %= class_name . gsub ( '::' , '' ) . pluralize %> < ActiveRecord::Migration
22
33 def change
4- create_table :<%= file_name.pluralize %> do |t |
4+ create_table :<%= table_name %> do |t |
55 <%- model_attrs.each do |attr| - %>
66 t.<%= attr.type %> :< %= attr . name %>
77 <%- end -%>
You can’t perform that action at this time.
0 commit comments