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: 4cce6c28c96890bc490cc6e378fb55915671b29fd66e7b7be9acdbf48b1076cc
4
- data.tar.gz: 8faf390787d24f102c2dc79c27be9823114e73344522f24b11021dc3ed0d3e06
3
+ metadata.gz: 5b2e60735be9ed9050c42d522a30c5e441bd649cf8447f0313b717e04c0186ce
4
+ data.tar.gz: 29607e7fc184665bcab771c1889745e21f87973aff976c8865bbe0f714f249c2
5
5
  SHA512:
6
- metadata.gz: 5688761f9a2707f5518317cfc061ef9e7e9902e241ac4495ef52f9d583e7524bd4948797e788e80f5e070ab9a0d05a2021267e67a7e9df871e18ad220c74ba7a
7
- data.tar.gz: a3b87deaab6fc9c4b45f8bc0f7f2b304d3adb61d296a58b48791b75f022a24565c3af6856275afe08cf15afeb0ed4974be3a3e368eb46c9d036dd17a16238015
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 @model.const_defined?(:Endpoints) && defined?("#{@model}::Endpoints.#{custom_action}")
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::Endpoints.send(custom_action, params)
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
@@ -1,3 +1,3 @@
1
1
  module ModelDrivenApi
2
- VERSION = "3.1.0".freeze
2
+ VERSION = "3.1.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_driven_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni