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
In our Rails 4.2 app. model payment_request has a workflow which is defined within the model. The workflow is defined as:
module PaymentRequestx
require 'workflow'
class PaymentRequest < ActiveRecord::Base
include Workflow
workflow do
#workflow definition
end
end
The above code worked fine. In order to pass a session variable into model, a method add_wf is defined around the workflow in model payment_request:
module PaymentRequestx
require 'workflow'
class PaymentRequest < ActiveRecord::Base
include Workflow
def self.add_wf(session_token)
workflow do
#workflow definition
end
end
end
The method add_wf is called in before_action in application_controller.
PaymentRequest.add_wf(session_token)
The problem is workflow is not defined after execution. I also tried the active record base:
def self.add_wf(session_token)
def self.included(base)
base.workflow do
#workflow definition
end
end
end
The workflow is still not defined. I guess problem is that the workflow do loop is not executed within the context of model payment request. How to force the execution of workflow do loop within the context of model PaymentRequest?
The text was updated successfully, but these errors were encountered:
In our Rails 4.2 app. model payment_request has a workflow which is defined within the model. The workflow is defined as:
module PaymentRequestx
require 'workflow'
class PaymentRequest < ActiveRecord::Base
include Workflow
workflow do
#workflow definition
end
end
The above code worked fine. In order to pass a session variable into model, a method add_wf is defined around the workflow in model payment_request:
module PaymentRequestx
require 'workflow'
class PaymentRequest < ActiveRecord::Base
include Workflow
end
The method add_wf is called in before_action in application_controller.
PaymentRequest.add_wf(session_token)
The problem is workflow is not defined after execution. I also tried the active record base:
The workflow is still not defined. I guess problem is that the workflow do loop is not executed within the context of model payment request. How to force the execution of workflow do loop within the context of model PaymentRequest?
The text was updated successfully, but these errors were encountered: