Closed thejonanshow closed 4 years ago
I was unable to reproduce this in an app running Ruby 2.6.5, Rails 6.0.1, and fabrication 2.21.0. I see you're on the latest fabrication but what versions of Ruby and Rails do you have?
Versions:
ruby 2.6.5p114
Rails 6.0.2.1
.railsrc
--skip-action-cable
--skip-spring
--skip-coffee
--skip-turbolinks
--skip-test-unit
--template=~/.rails_template.rb
rails_template.rb
gem_group :development, :test do
gem "dotenv-rails"
gem "pry-byebug"
gem "faker"
gem "fabrication"
gem "rspec-rails"
end
run "bundle install"
generate :controller, "home index"
route "root to: 'home#index'"
generate "rspec:install"
If you can't reproduce it I think it's reasonable to assume that it's not something in fabrication, in which case please feel free to close. Just thought I'd let you know in case it was something you'd missed.
In your initial report you said you ran:
rails g fakemodel
rails d fakemodel
You can't run those commands without specifying what you're generating though. Unless I'm missing something? I've tried doing it as a model
and as a scaffold
on a new app but both worked just fine.
I'm going to assume this is PEBKAC and tidy up your issues. Thanks for a great project, hope you're well 😁
It's not immediately obvious to me what's going on here as I don't know the Rails destroy mechanism very well, but destroying a model right after creating it in a brand new app throws a file not found error:
Repro:
I wouldn't guess that it's relevant but I'm installing fabrication automatically in all new Rails apps using
.railsrc
and a template file. If you think it matters I can include them here.https://github.com/paulelliott/fabrication/blob/2fe931c083067c6b499da44445a5dc92a08e2875/lib/rails/generators/fabrication/model/model_generator.rb#L11
Thanks for taking a look!