Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

status helpers provided by ministry of state are not working on non persisted objects #8

Closed
iffyuva opened this issue Nov 26, 2014 · 0 comments · Fixed by #12
Closed
Assignees
Labels

Comments

@iffyuva
Copy link
Member

iffyuva commented Nov 26, 2014

consider this example

class User < AR::Base
  include MinistryOfState
  ministry_of_state('status') do
    add_initial_state :active
    add_state :suspended
  end
end

# calling active? doesnot work if user is not persisted
u = User.new
u.active?    #=> false
u.save!
u.reload
u.active?    #=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant