collate 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/collate/active_record_extension.rb +1 -1
- data/lib/collate/filter.rb +1 -0
- data/lib/collate/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94cfb77ae2c2ee79dd927782c5450491c658fe02
|
4
|
+
data.tar.gz: 58c968df9aad21f0e194e6f5b3108bd2ecbea4ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0e101db11da883bfdb65d40ad3db4c8459bf4481e602a064d7f585eb85eed0653aa22a8913adde699db8862d8e480afb055a34b39acfbc8051f61e97376b565
|
7
|
+
data.tar.gz: 7e5df6f52f0629bde97dbc90457bd36f7e42f42f77ce0229c57c24da8a67beb6c1468449cf81e79c70ca11b92eed6eb0eb39df2395c1b0b90c797942cee4e692
|
@@ -195,7 +195,7 @@ module Collate
|
|
195
195
|
if filter.component[:load_records]
|
196
196
|
results = filter.component[:load_record_model].constantize.where("#{filter.component[:load_record_field]} IN (?)", filter_value)
|
197
197
|
|
198
|
-
filter.component[:values] = results.map{ |r| {id: r.id, text: r.
|
198
|
+
filter.component[:values] = results.map{ |r| {id: r.id, text: r.public_send(filter.component[:load_record_text_method])} }
|
199
199
|
end
|
200
200
|
|
201
201
|
if filter.component[:tags]
|
data/lib/collate/filter.rb
CHANGED
@@ -58,6 +58,7 @@ module Collate
|
|
58
58
|
self.component[:load_record_model] ||= model_name.titleize
|
59
59
|
self.component[:load_record_field] ||= "id"
|
60
60
|
self.component[:load_record_route] ||= "/#{model_name.pluralize}.json"
|
61
|
+
self.component[:load_record_text_method] ||= "name"
|
61
62
|
end
|
62
63
|
|
63
64
|
self.joins ||= if table_name != base_model_table_name
|
data/lib/collate/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: collate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Page
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-04-
|
12
|
+
date: 2017-04-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|