Aside: The ! is a ruby convention for a method that modifies it's source 
object.

Your 3rd attempt should work as far as I can tell... as long as the 
unsent_message object is in the :not_sent state.

On Tuesday, September 11, 2012 12:48:23 PM UTC-6, brettnem wrote:
>
> Hello All,
> I have my lifecycle working great with transition buttons, but I'd like a 
> script to be able to call the transition.
>
> So far, I've tried the following:
> unsent_message.lifecycle.deliver  (undefined method `deliver`)
>
> unsent_message.lifecycle.deliver!  (wrong number of arguments 0 for 1)
>
> unsent_message.lifecycle.deliver!(user) 
> (Hobo::Model::Lifecycles::LifecycleError: No transition deliver available)
>
> I'm pretty sure it's seeing the lifecycle, just not sure why it's not 
> running. Not sure why the "!" makes a difference as I see it referenced in 
> the docs but couldn't find it's explanation. 
>
> My transition looks like this:
>
>> transition :deliver, {:not_sent => :sent}, :available_to => :all do
>> ..code..
>> end
>
>
> However, I would like it to be available to "A valid user OR the script 
> called externally" (not sure how to define that)
>
> Thanks!
> -Brett
>
>

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/hobousers/-/snwFMQdzPykJ.
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.

Reply via email to