para 0.8.3.2 → 0.8.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/para/admin/search_controller.rb +11 -1
- data/lib/para/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34cf9dd56413ef5e25dc49969075a9cfe6344c04b49bcc2411dac16b58b6f2da
|
4
|
+
data.tar.gz: 7e6ce611948b6d096f2479a91f451e9ff98708ddca65de0aa3d7cf44aa0b8912
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
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.
|
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-
|
11
|
+
date: 2019-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|