Closed paulslaby closed 2 years ago
Not sure, if it is problem of this gem, but people might be trying to find solution here.
This is my code:
class Recipe < ActiveRecord::Base default_scope {where(:state => :approved)}
include Workflow workflow_column :state workflow do state :new do event :approve, transitions_to: :approved end state :approved end end
when I run rails c: Recipe.new.state => :approved
when commenting out defaul_scope, it is ok.
I use this workaround:
def initialize(attrs={}, *args) super({:state => :new}.merge!(attrs), args) end
Not sure, if it is problem of this gem, but people might be trying to find solution here.
This is my code:
class Recipe < ActiveRecord::Base default_scope {where(:state => :approved)}
include Workflow workflow_column :state workflow do state :new do event :approve, transitions_to: :approved end state :approved end end
when I run rails c: Recipe.new.state => :approved
when commenting out defaul_scope, it is ok.