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: a1ce2e992ce1a5fd8274e579b0ba721e3a2d2e0a2c832e3d4e64e22118818aca
4
- data.tar.gz: fe4439d634d44737883aca3e08d16537cffced5445a71b18462dba9356f3f827
3
+ metadata.gz: eed51b344d38bb111854f4e32d985856ea3504b76fbf901fee56735183eae415
4
+ data.tar.gz: d430ca30613c117aed36db0493885b4399d4015d53d12f34470fd8bf60fe7d71
5
5
  SHA512:
6
- metadata.gz: 052bda57f4c9c1e2d63e576c4714dfb2d243efb645c7b1271b823525b0114323f593f88bfe8c967ec5b1fed77e9534d60395f379620a9a946a84851c2c2ce49b
7
- data.tar.gz: 2ec5e631e6492390fb5b3f19d33873f50dbc1ab2c6804646082d48d89653b293aa12e12b60d0102439f765937101144cc3692316a24f59aae4f2299631af9101
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
- params[:model].constantize
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
 
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Api
3
- VERSION = '1.4.3'
3
+ VERSION = '1.4.4'
4
4
  end
5
5
  end
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.3
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 00:00:00.000000000 Z
11
+ date: 2019-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: knock