rivsc / Beautiful-Scaffold

Rails generator for a complete and beautiful scaffold.
http://beautiful-scaffold.rivsc.ovh/
MIT License
74 stars 22 forks source link

Rails 6 and beautiful_migration with foreign_key #23

Closed rivsc closed 4 years ago

rivsc commented 4 years ago

rails g beautiful_migration AddFamilyToPlants family:references

Produce :

4: from /Users/scl/.rvm/gems/ruby-2.7.0/gems/beautiful_scaffold-2.0.0.pre/lib/generators/beautiful_migration_generator.rb:42:in 'add_to_model' 3: from /Users/scl/.rvm/gems/ruby-2.7.0/gems/beautiful_scaffold-2.0.0.pre/lib/generators/beautiful_scaffold_common_methods.rb:217:in 'add_relation' 2: from /Users/scl/.rvm/gems/ruby-2.7.0/gems/beautiful_scaffold-2.0.0.pre/lib/generators/beautiful_scaffold_common_methods.rb:217:in 'each' 1: from /Users/scl/.rvm/gems/ruby-2.7.0/gems/beautiful_scaffold-2.0.0.pre/lib/generators/beautiful_scaffold_common_methods.rb:226:in 'block in add_relation' /Users/scl/.rvm/gems/ruby-2.7.0/gems/beautiful_scaffold-2.0.0.pre/lib/generators/beautiful_migration_generator.rb:63:in 'model': undefined method 'underscore' for nil:NilClass (NoMethodError)

Need to add that in tests !