Module: Forcast::Controller::RuleEngine::WebhookEngine

Extended by:
ActiveSupport::Concern
Included in:
Api::WebhooksController
Defined in:
lib/forcast/controllers/controller/rule_engine/webhook_engine.rb

Instance Method Summary collapse

Instance Method Details

#createObject



12
13
14
15
16
17
18
19
# File 'lib/forcast/controllers/controller/rule_engine/webhook_engine.rb', line 12

def create
    params[:webhook_model] = @webhook_model
    params[:execute?] = true
    params[:send?] = true
    params[:duration_time] ||= 10
    params[:send_time] ||= 10
    model_id = super
end

#object_duplicate_paramsObject



28
29
30
31
32
# File 'lib/forcast/controllers/controller/rule_engine/webhook_engine.rb', line 28

def object_duplicate_params
    comp = Hash.new
    comp["rule_id"] = @rule_id
    return comp
end

#set_model_rule_and_model_id_ruleObject



21
22
23
24
25
26
# File 'lib/forcast/controllers/controller/rule_engine/webhook_engine.rb', line 21

def set_model_rule_and_model_id_rule
    puts "set_modelo_and_modelo_id"
    rule = Rule.find(@rule_id)
    raise Forcast::Application::Error::General.new(t("webhook_exist")) if Webhook.duplicate_object?(object_duplicate_params)
    rule.update_columns(:last_value_attr_comparable => nil)
end