Skip to content

Commit 62a1134

Browse files
fix: exclude default before validations
1 parent 01c2309 commit 62a1134

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/services/forest_liana/schema_adapter.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,11 @@ def add_default_value(column_schema, column)
446446
def add_validations(column_schema, column)
447447
# NOTICE: Do not consider validations if a before_validation Active Records
448448
# Callback is detected.
449-
if @model._validation_callbacks.map(&:kind).include? :before
449+
default_callback_excluded = [:normalize_changed_in_place_attributes]
450+
if @model._validation_callbacks
451+
.reject { |callback| default_callback_excluded.include?(callback.filter) }
452+
.map(&:kind).include?(:before)
453+
450454
return column_schema
451455
end
452456

0 commit comments

Comments
 (0)