Hi
I have the following classes and relations
ServiceDeskTicket
has_many :service_desk_status_histories
has_one :service_desk_resolution
ServiceDeskResolution
belongs_to :service_desk_ticket
def
self.add_resolution_on_convert_to_incident(sd_id,status_id,created_by_id,modified_by_id)
puts 'in resolution status is '+status_id.to_s
end
ServiceDeskStatusHistory
belongs_to :service_desk_ticket
self.add_status_histories_on_convert(sd_id,status_id,created_by_id,modified_by_id)
puts 'called add_status_histories_on_convert
end
Now from ServiceDeskTicket in a def I tried
sd_ticket=self.find(ticket_id)
sd_ticket.service_desk_resolution.add_resolution_on_convert(sd_ticket.id,sd_ticket.service_desk_status_id,created_by,modified_by)
Then I get error
error is undefined method `add_resolution_on_convert' for
#<ServiceDeskResolution:0xb73e2120>
But when I call
sd_ticket.add_status_histories_on_convert(sd_id,status_id,created_by_id,modified_by_id)
It works properly Please tell me why this happens
Thanks in advance
Sijo
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---