-
I use avram with kemal. Following is a example. class UpdateUser < User::SaveOperation
permit_columns licenses_allowed_creation_times, password
before_save do
if licenses_allowed_creation_times.value.blank? || !licenses_allowed_creation_times.changed?
# Need skip save on licenses_allowed_creation_times column here
end
# others password update logic here.
end
end I guess, if no add before_save hook, the value from so, how can i skip updated this column instead? thank you. |
Beta Was this translation helpful? Give feedback.
Answered by
jwoertink
Jun 26, 2022
Replies: 1 comment 9 replies
-
If you remove the class UpdateUser < User::SaveOperation
permit_columns password
before_save do
# others password update logic here.
end
end If you need it in some cases, you could have a separate operation for that. class UpdateUserPassword < User::SaveOperation
include DefaultUserValidations
permit_columns password
end
class UpdateUserLicenses < User::SaveOperation
include DefaultUserValidations
permit_columns licenses_allowed_creation_times
end You could try something like that. |
Beta Was this translation helpful? Give feedback.
9 replies
Answer selected by
zw963
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you remove the
licenses_allowed_creation_times
from thepermit_columns
, then it won't set the value from params.If you need it in some cases, you could have a separate operation for that.
You could try something like that.