SchemaPlus / schema_associations

ActiveRecord extension that automatically (DRY) creates associations based on the schema
Other
46 stars 8 forks source link

Minitest / Shoulda Gem errors #23

Open eliaszica opened 7 years ago

eliaszica commented 7 years ago

I'm having a issue similar to #15 in my Rails 5 application models tests with Minitest and Shoulda gem. So I inserted this code block (as issue #15's author suggests) in my "schema_associations.rb", and the tests now run smoothly:

if Rails.env.test?
   [Class1, Class2, Class3].each do |c|
      c.reflect_on_all_associations
   end
end

For now I'm happy with this solution, and maybe this scenario can help you to find some improvement to schema_associations gem (I hope so).

Thank you, this gem is awesome!

Elias