[bug?] Bypassing validations on update #5735
-
Let's say I have an application with a One can reproduce it by running the following code: class Company
include Mongoid::Document
field :name, type: String
end
class Client
include Mongoid::Document
field :name, type: String
has_and_belongs_to_many :companies, class_name: 'Company'
validates :companies, presence: true
end
c = Client.first
c.update!(companies: []) # raises error but updates document |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @zbrunoneves, and thanks for reporting this! I've filed MONGOID-5694 to have the team review this and identify next steps. |
Beta Was this translation helpful? Give feedback.
-
@alexbevi Sorry if this isn't according to protocol, I wanted to report, as I've done some testing while trying to upgrade Mongoid, this issue affects 7.3.5, 7.4.x, and 7.5.x |
Beta Was this translation helpful? Give feedback.
Hi @zbrunoneves, and thanks for reporting this! I've filed MONGOID-5694 to have the team review this and identify next steps.