You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tested on the different versions of Rails on branches on the sample app and it works fine with rails 5.1.
It doesn't work with rails '>= 5.0.0, ~> 5.0.0'.
Simple solutions are
Upgrading Rails to 5.1
Add required: true option
class User < ApplicationRecord
belongs_to :company, required: false
The text was updated successfully, but these errors were encountered:
From memory this was to do with ActiveRecord being initialised way before the Rails Default initialiser file is run (due to a particular gem touching it early on). The solution is to configure it earlier in the boot process, or as you say, just keep on upgrading through to Rails 5.1.
Tested on the sample app.
https://github.com/kyamaguchi/required_validation_from_belongs_to
Rails 5 requires relation with
belongs_to
by default.rails/rails#18233
But it doesn't work after adding 'audited'.
$ rails console
Before adding 'audited' gem,
I tested on the different versions of Rails on branches on the sample app and it works fine with rails 5.1.
It doesn't work with rails '>= 5.0.0, ~> 5.0.0'.
Simple solutions are
Upgrading Rails to 5.1
Add
required: true
optionThe text was updated successfully, but these errors were encountered: