tramway-api 1.4.3 → 1.4.4
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: eed51b344d38bb111854f4e32d985856ea3504b76fbf901fee56735183eae415
|
4
|
+
data.tar.gz: d430ca30613c117aed36db0493885b4399d4015d53d12f34470fd8bf60fe7d71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f84dd206d408c41f1d3c230079418445ff4b7fffbb4808637297695c3f033dec031e3e7f3f29f699a58d865e950d1afac1d1f8a3f6116c1ea40469fabc06bf0d
|
7
|
+
data.tar.gz: c746cad5ecbce016799e6337ea9f23a38287bd2cbee543a9460a5750e301238e10459bd0f4da0cb0e9bb3f3fd885665daa998b4e59982f2cb014034a48297ed1
|
@@ -6,6 +6,7 @@ module Tramway::Api::V1
|
|
6
6
|
|
7
7
|
def index
|
8
8
|
records = model_class.active.order(id: :desc).send params[:scope] || :all
|
9
|
+
records = records.full_text_search params[:search] if params[:search]
|
9
10
|
render json: records,
|
10
11
|
each_serializer: serializer_class,
|
11
12
|
include: '*',
|
@@ -73,7 +74,11 @@ module Tramway::Api::V1
|
|
73
74
|
|
74
75
|
def model_class
|
75
76
|
if params[:model].to_s.in? ::Tramway::Api.available_models.keys.map(&:to_s)
|
76
|
-
|
77
|
+
begin
|
78
|
+
params[:model].constantize
|
79
|
+
rescue ActiveSupport::Concern::MultipleIncludedBlocks => e
|
80
|
+
raise "#{e}. Maybe #{params[:model]} model doesn't exists or there is naming conflicts with it"
|
81
|
+
end
|
77
82
|
end
|
78
83
|
end
|
79
84
|
|
data/lib/tramway/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: knock
|