Administrate doesn't read context on Model when load form for mandatory field
Created by: helmiItsavirus
- What were you trying to do?
When I define validation inside of the context on my Model, Administrate doesn't read the context. So, Mandatory appears on the form that should not appear because of the mandatory inside of the context.
- What did you end up with (logs, or, even better, example apps are great!)?
class User < ApplicationRecord
with_options on: [:update_birth_date] do
before_validation :age_is_old_enough
validates_presence_of :birth_date
end
end
- What versions are you running?
- ruby "2.6.6"
- gem "rails", "~> 6.0.3", ">= 6.0.3.2"
- gem "administrate", "~> 0.14.0"