Can you access a lifecycle's create :params in the :if or :unless precondition option?
I can't seem to... I'm trying to do something like this: class PersonProject < ActiveRecord::Base belongs_to :person belongs_to :project lifecycle do state :active create :activate, :params => [:person, :project], :become => :active, :if => "PersonProject.person_is(person).project_is (project).active.empty?" do end end end The idea is to only allow the create when there isn't already an "active" PersonProject for person/project specified as the :params for the create action. But the code above doesn't work... an exception is triggered when it tires to evaluate the :if statement. Is there a way to get at the parameters in the:if or :unless block? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/hobousers?hl=en -~----------~----~----~----~------~----~------~--~---
