para 0.8.3.2 → 0.8.3.3

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: 263a0c4e059b700b6557076837f0e9dc6c0e577538ae4b864a1699a9bb06ce2e
4
- data.tar.gz: ef5ad53a24de69abce3a43c7b55c6fbf6f12f32e0e52bb4ae152a2f63ba553f4
3
+ metadata.gz: 34cf9dd56413ef5e25dc49969075a9cfe6344c04b49bcc2411dac16b58b6f2da
4
+ data.tar.gz: 7e6ce611948b6d096f2479a91f451e9ff98708ddca65de0aa3d7cf44aa0b8912
5
5
  SHA512:
6
- metadata.gz: 0f2a8ec0abb35f9c78e6cd6b555e8c0403e43e669f1e48326c80f015129327b6da064a5a7efcac0f2127db08b28b72fec0210258038be33e104bfc26cb32a650
7
- data.tar.gz: 4d066ed1cf92b3cfa029d66ce73f047ff1670925e45ab66b0543db741330cfea546fe739d9adec0aa08f85a12c473b825df2c11631729951f13c05acde063cc6
6
+ metadata.gz: a956b05c65552b0c407891a52237e268d2c04d67cce364d7faf1163776d672ff8cc1a6259d2b6f8af024ffe588d6d55f2bd1dcc541c7085f2b7550c8a4f781c9
7
+ data.tar.gz: 54fd0283d7cb5e928bf3a5b866feba4a8e2aa1a5978fc0756c6af5e4ff4228f292cc87beb142b0040060cfd1af4f8095a1ea2ce28326bd80524f9d29565d5eb2
@@ -1,6 +1,8 @@
1
1
  module Para
2
2
  module Admin
3
3
  class SearchController < ApplicationController
4
+ include Para::Helpers::ResourceName
5
+
4
6
  def index
5
7
  # Parse ids that are provided as string into array
6
8
  if params[:q] && params[:q][:id_in].is_a?(String)
@@ -9,8 +11,16 @@ module Para
9
11
 
10
12
  model = params[:model_name].constantize
11
13
  @results = model.ransack(params[:q]).result
14
+ @results = @results.limit(params[:limit]) if params[:limit]
12
15
 
13
- render layout: false
16
+ case params[:mode]
17
+ when "selectize"
18
+ render json: @results.map { |res|
19
+ { text: resource_name(res), value: res.id }
20
+ }
21
+ else
22
+ render layout: false
23
+ end
14
24
  end
15
25
  end
16
26
  end
data/lib/para/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Para
2
- VERSION = '0.8.3.2'
2
+ VERSION = '0.8.3.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: para
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3.2
4
+ version: 0.8.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valentin Ballestrino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-28 00:00:00.000000000 Z
11
+ date: 2019-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails