native_enum icon indicating copy to clipboard operation
native_enum copied to clipboard

Rails 5.1 validation problems

Open peterwake opened this issue 7 years ago • 0 comments

@mcls @iangreenleaf just FYI I tried this gem with Rails 5.1, (and also with your new Rails 5.1 branch), and was getting ActiveRecord Validation failed errors on my models (which I don't get using the original). This is occuring where I had e.g.

belongs_to :communication

Which I could solve by adding

belongs_to :communication, optional: true

However for models where I have

class Communication < ApplicationRecord

  has_many :communications_stores

  has_many :stores, -> { distinct },
    through: :communications_stores

And I do

Communication.create(stores: stores)

It blew up. I couldn't work out how to stop it throwing the error in this case.

peterwake avatar Oct 14 '18 13:10 peterwake