Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/state_machine/integrations/sequel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down