Giter VIP home page Giter VIP logo

state_machine-mongoid's Introduction

state_machine-mongoid

The mongoid integration for pluginaweek’s state_machine

TODO

  • tests!

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2010 Marcin Ciunelis. See LICENSE for details.

state_machine-mongoid's People

Contributors

martinciu avatar lostboy avatar sutto avatar yalab avatar

Stargazers

Angus H. avatar hidekuni KAJITA avatar Ben-Alexander Cassell avatar Paul Meserve avatar Michael Schiller avatar Vladimir Zhukov avatar Douglas Puchalski avatar Sam Winterton avatar Tony Daly avatar  avatar  avatar  avatar Paul Cowles avatar Scott Burton avatar Brent Hargrave avatar Russell Jones avatar  avatar Thibaud Guillaume-Gentil avatar

Watchers

 avatar James Cloos avatar

state_machine-mongoid's Issues

Unable to run state_machine

Hello i am having issues with your plugin. I have installed both state_machine and state_machine-mongoid gems. Both show up in the gem -list. I added them to my GemFile
and added the required in my config/application.rb.

when i do a rake routes i receive this error

rake aborted!
undefined method `state_machine' for main:Object

Here is a snipped of my code



  state_machine :initial => :pending
  state :pending
  state :converting
  state :converted, :enter => :set_new_filename
  state :error

  event :convert do
    transitions :from => :pending, :to => :converting
  end

  event :converted do
    transitions :from => :converting, :to => :converted
  end

  event :failed do
    transitions :from => :converting, :to => :error
  end

Any ideas on what may be the issue? I am running Rails 3.0.3

Empty errors if transition fails

I have such state_machine in MyModel:

state_machine :state, :initial => :new do
    state :new
    state :accepted

    event :accept do
      transition :new => :accepted
    end
end

And I try to accept accepted object

irb(main):020:0> a = MyModel.make! :state => "new"
=> #<MyModel _id: 4cf60b5e5e6f991951000007, created_at: 2010-12-01 08:46:22 UTC, updated_at: 2010-12-01 08:46:22 UTC, request_type: nil, state: "new", value: nil, account_ids: [BSON::ObjectId('4cf60b5e5e6f991951000008')], user_id: nil>
irb(main):021:0> a.accept
=> true
irb(main):022:0> a.accept
=> false
irb(main):023:0> a.errors
=> {}

And I don't see the errors but I should...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.