aasm Questions
6
I successfully integrated the most recent AASM gem into an application, using it for the creation of a wizard. In my case I have a model order
class Order < ActiveRecord::Base
belongs_to :use...
Pastiche asked 7/6, 2010 at 11:7
4
I'm using the aasm (formerly acts_as_state_machine) gem in my rails 4 application. I have something like this on my Post model
...
aasm column: :state do
state :pending_approval, initial: true
...
Pelican asked 28/1, 2014 at 20:24
2
I've an ActiveRecord model. I'd like to set an initial state depending on its attributes at the initialization. Here is my condition:
self.expected_delivery_date.blank? ? :in_preparation : :waitin...
Deery asked 28/10, 2017 at 9:52
3
Solved
Some Sidekiq jobs in my app are scheduled to change the state of a resource to cancelled unless a user responds within a certain timeframe. There is a lot of information about how to best accomplis...
Vega asked 10/12, 2018 at 20:4
3
Solved
I have a model that represents a registration process, which needs to track the progression of several processes (background checks, interviews, information collection...). Each one can be represen...
Eucharis asked 24/2, 2010 at 0:57
1
Solved
Is there a way to define a guard (eg has_legs?) that is checked before entering a state (eg running) in any event?
In the list of all possible callbacks there are guards for events and transitions...
Adscititious asked 1/8, 2016 at 2:8
2
I'm using Rails 3.2.2, with aasm gem, I have Document model this way:
class Document < ActiveRecord::Base
include AASM
aasm do
state :unread, :initial => true
state :read
state :clos...
Armelda asked 16/6, 2012 at 20:7
1
Solved
I am using AASM. Is it possible 2 different states depending on conditions For example:
aasm_event :completes do
transitions :to => condition? ? :complete : :terminate,
:from => [:active]...
Ahwaz asked 10/10, 2014 at 0:13
1
Solved
suppose I have this class (taken directly from the aasm documentation):
class Job < ActiveRecord::Base
include AASM
aasm do
state :sleeping, :initial => true
state :running
state :clea...
4
i would like to know how you guys use the workflow or the AASM gem in the controller if you want to update all attributes, but also need the workflow/AASM callbacks to fire properly.
currently, i ...
Tingey asked 5/7, 2011 at 10:59
2
Solved
I am using AASM. Is it possible to transition from any state? For example:
aasm_event :publish do
transitions :to => :publish, :from => ANY_STATE
end
I know that it is possible to pass an...
Liddell asked 6/2, 2011 at 9:57
1
Solved
I need a state machine for a message private system and order status system.
you can see these two gems:
https://github.com/pluginaweek/state_machine
https://github.com/rubyist/aasm
Edited..
I...
Tropism asked 28/9, 2012 at 11:56
2
I'm using the rubyist-aasm state machine for handling the different states in my Event object (event initialized, event discussed, event published, etc.). I added guards to prevent state changes wh...
Jocose asked 7/1, 2010 at 8:27
4
Solved
What is the best way to persist the object's state to the database on a transition using aasm? I had thought that this would happen automatically but this doesn't seem to be the case.
(Edit: when ...
Traps asked 25/3, 2009 at 18:42
1
Solved
I'm using AASM by Rubyist to build a 4-step wizard for an AR object. According to the state of the object, there are different validations that need to be done. What is the smartest way to validate...
Lipolysis asked 6/4, 2009 at 11:56
1
© 2022 - 2024 — McMap. All rights reserved.