Open deemytch opened 5 years ago
Hi @deemytch, can you propose a pull request?
You can check out what changed at workflow-activerecord
Excuse me, not this and next week. You can also take into this: https://github.com/geekq/workflow/issues/217 I think this path will not be trivial for me.
I made a spike in my project for now, hope this will help you (or me in the future) to to discover the bug.
module WorkflowSequel
def load_workflow_state
send( self.class.workflow_column )
end
def persist_workflow_state(new_value)
send( "#{self.class.workflow_column}=", new_value )
save( changed: true, validate: false)
end
def dataset_update( attrs )
self.class.instance_dataset.where( id: id ).update( attrs.delete_if{|k,v| [:id, 'id'].include?(k) } )
end
def before_validation
send( "#{self.class.workflow_column}=", current_state.to_s ) unless send( self.class.workflow_column )
super
end
end