You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Event < ActiveRecord::Base
has_many :event_approval_requests
belongs_to :user
include Workflow
workflow do
state :pre_registered do
event :submit, :transitions_to => :awaiting_approval
end
state :awaiting_approval do
event :approve, :transitions_to => :approved
event :reject, :transitions_to => :rejected
end
state :approved do
event :submit, :transitions_to => :awaiting_approval
end
state :rejected do
event :submit, :transitions_to => :awaiting_approval
end
end
...
end
class EventApprovalRequest < ActiveRecord::Base
belongs_to :user
belongs_to :department
belongs_to :event
include Workflow
workflow do
state :pending do
event :approve, :transitions_to => :approved
event :reject, :transitions_to => :rejected
end
state :approved
state :rejected
end
...
end
Note that the two classes have workflow definitions and one have a relationship with the other. In a view, when I try to access the event from the event_approval_request like below:
<%=h event_approval_request.event.title %>
I got the following error: NoMethodError in Event_approval_requests#index undefined method `find' for Workflow::Event:Class
this error doesn't occur if I access a non-workflow class, like below:
<%=h event_approval_request.user.first_name %>
Could anyone help me? Is it really an issue?
Thanks in advance,
Gustavo
The text was updated successfully, but these errors were encountered:
Hi,
I have the following classes on my system:
Note that the two classes have workflow definitions and one have a relationship with the other. In a view, when I try to access the event from the event_approval_request like below:
I got the following error: NoMethodError in Event_approval_requests#index undefined method `find' for Workflow::Event:Class
this error doesn't occur if I access a non-workflow class, like below:
Could anyone help me? Is it really an issue?
Thanks in advance,
Gustavo
The text was updated successfully, but these errors were encountered: