diff --git a/lib/state_machine/integrations/sequel.rb b/lib/state_machine/integrations/sequel.rb index 11381711..6eabf2ee 100644 --- a/lib/state_machine/integrations/sequel.rb +++ b/lib/state_machine/integrations/sequel.rb @@ -416,13 +416,13 @@ def around_validation(*) # Gets the db default for the machine's attribute def owner_class_attribute_default if owner_class.db.table_exists?(owner_class.table_name) && column = owner_class.db_schema[attribute.to_sym] - column[:default] + column[:ruby_default] end end # Uses the DB literal to match the default against the specified state def owner_class_attribute_default_matches?(state) - owner_class.db.literal(state.value) == owner_class_attribute_default + state.value == owner_class_attribute_default end # Creates a scope for finding records *with* a particular state or