Hi TF
that's the lifecycle for my ticket model

..
has_many :ticket_atributos, :dependent => :destroy

lifecycle do

    state :aberto, :default => true
    state :fechado

    create :acao, :available_to => "User",
           :params => [ :date, :description ],
           :become => :aberto, :new_key => true do
           TicketMailer.deliver_normal(self, lifecycle.key)unless
description.blank?
    end

    transition :accept, { :aberto => :fechado },  :new_key => true do
      TicketMailer.deliver_closed(self, lifecycle.key)
    end

    transition :accept, { :aberto => :fechado }, :available_to
=> :key_holder,
               :params => [ :date, :description ]

  end

Ive tried so many names for the creators and transitions, but still no
email delivery.
In the controler (ticket) i've defined the creators and transitions
but nothing happens..in that moment i have nothing defined on the
controller, but after testing it still no errors

my problem is to find what i'm doing wrong.

Thanks in advance TF,

Best regards,

Edson

On 11 fev, 18:35, Tiago Franco <[email protected]> wrote:
> Hi Edson,
>
> Can you post the lifecycle?
>
> Thanks,
>    TF
>
> On 02/11/2011 06:40 PM, Edson wrote:
>
>
>
>
>
>
>
> > Hello everyone,
>
> > I need some help on this, if is somebody that can give me tips or
> > suggestions about some similar topics already opened on the discussion
> > i'll appreciate:
>
> > I have a model:
>
> > class Ticket<  ActiveRecord::Base
>
> >    hobo_model # Don't put anything above this
>
> >    fields do
> >      date        :datetime
> >      description :string
> >      timestamps
> >    end
>
> > belongs_to :system, :creator =>  true
> > belongs_to :user, :class_name =>  "User", :creator =>  true
> > belongs_to :status, :class_name =>  "TicketStatus"
> > has_many :ticket_atributos, :dependent =>  :destroy
>
> > And i want to create a lifecycle for anytime that the user creates a
> > new ticket the app can automatically sends a email notification to all
> > the users off the app with a link to access the new ticket created,
> > directly. And to to the same process when the ticket get updated.
>
> > I've seen the friendship tutorial but i can't make my lifecycle
> > working because i don't use the hobo_user_model..i need to implement
> > it in the ticket model. I don't know if its possible or if i can do it
> > through the hobo_user_model.
>
> > I've tried to create in the C of the ticket all the creators and
> > transitions (declared in the ticketController) i've tested and got no
> > errors but the email never been sent.
>
> > My environment config is set all right because i can send email for
> > forgotten password and activate account through  te hobo_user_model of
> > my app.
>
> > Please can somebody give me a tip? I've been trying almost 3 weeks on
> > this and nuthin.
>
> > Thank you in advance!
>
> > Edson Salom�o

-- 
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.

Reply via email to