model_driven_api 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b2e60735be9ed9050c42d522a30c5e441bd649cf8447f0313b717e04c0186ce
|
4
|
+
data.tar.gz: 29607e7fc184665bcab771c1889745e21f87973aff976c8865bbe0f714f249c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84e9365bf07f643ef2bf78055902f538f77d06301c7ba1e888cfd6773bfa381791d861d13ffa46f3448f58426f954522e9187f1d70aec48f3622d801f93c6615
|
7
|
+
data.tar.gz: 1db187f6b765a5cb0bd0c1b2f0ee0f33883c9f4c3a5dabad32eaeda8488d57d386ddd71094b3a632c2b1222d04e421e95ba25d3be4eba3c5d13a25746e7b2ff0
|
@@ -137,9 +137,9 @@ class Api::V2::ApplicationController < ActionController::API
|
|
137
137
|
# The endpoint can be expressed in two wayy:
|
138
138
|
# 1. As a method in the model, with suffix custom_action_<custom_action>
|
139
139
|
# 2. As a module instance method in the model, like Track::Endpoints.inventory
|
140
|
-
if
|
140
|
+
if defined?("Endpoints::#{@model}.#{custom_action}")
|
141
141
|
# Custom endpoint exists and can be called in the sub-modules form
|
142
|
-
body, status = @model
|
142
|
+
body, status = "Endpoints::#{@model}".constantize.send(custom_action, params)
|
143
143
|
elsif @model.respond_to?("custom_action_#{custom_action}")
|
144
144
|
body, status = @model.send("custom_action_#{custom_action}", params)
|
145
145
|
else
|