activeadmin-searchable_select 1.0.1 → 1.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e5f2ce9146eca37e95d909b912c1ef5afe9fc511ac736b3d118e81c05c937a4
4
- data.tar.gz: 206673047e75f7a79c369c2a5a4a4532b5f336cc4035b817d313775095f227e9
3
+ metadata.gz: adbee989dd2ce2851dce0565e4eb04e02b7d63dd164fb3bfb491f7b3840eddf9
4
+ data.tar.gz: 01f9cf36616ed6ccdb22e956f6f43dfd1a3d44cf52a18f9957433b384bfe893d
5
5
  SHA512:
6
- metadata.gz: 80c69cf8baa62dac91cbf3f0ff073d5b967f87b5966d547cddc984790e63d99754e5e78acb999512f92bee49e996e3b7edb4272dd32356ea101b1ada17b6fc72
7
- data.tar.gz: 931f1f0653de38ef169d0664ebf69396dc4819ee2c3eafd4f33a63ca476b658aaa60c9888903919d1f2ed5c43c5c153b7473e7cef2aaa4533dbbc42852268d9f
6
+ metadata.gz: 00ca17e82f7a964c1b50425e2d62a16a49bdb06c041879d05ad6a98e5f520b9f8a324d888b6e26299c6b994199c8e44a402c44a2e303ac1ce6c743c9a5336675
7
+ data.tar.gz: da3c49a990ca32f3ae6fcbe126eaeb80d144a772a8340ed45d7e40aac5de94440e57035196223af055f69d3eb8cee1377f1fa7cc794d543ede2e4efc964ed414
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # CHANGELOG
2
2
 
3
+ ### Version 1.0.2
4
+
5
+ 2018-02-08
6
+
7
+ [Compare changes](https://github.com/codevise/activeadmin-searchable_select/compare/v1.0.1...v1.0.2)
8
+
9
+ - Use the namespace for the active admin resource.
10
+ ([#4](https://github.com/codevise/activeadmin-searchable_select/pull/4))
11
+ - Make end to end specs less brittle
12
+ ([#5](https://github.com/codevise/activeadmin-searchable_select/pull/5))
13
+
3
14
  ### Version 1.0.1
4
15
 
5
16
  2018-01-19
data/README.md CHANGED
@@ -138,7 +138,7 @@ based on the input attribute name, you can pass an object with a
138
138
  end
139
139
  ```
140
140
 
141
- #### Mutlple Options Endpoints per Resource
141
+ #### Multiple Options Endpoints per Resource
142
142
 
143
143
  A single ActiveAdmin resource can define multiple options endpoints:
144
144
 
@@ -167,6 +167,23 @@ To specify which collection to use, pass an object with a
167
167
  end
168
168
  ```
169
169
 
170
+ #### Querying Multiple Attributes
171
+
172
+ ActiveAdmin Searchable Select querying is performed by Ransack. As such, you can
173
+ build your query in a way that it can query multiple attributes at once.
174
+
175
+ ```ruby
176
+ ActiveAdmin.register User do
177
+ searchable_select_options(scope: User.all,
178
+ text_attribute: :username,
179
+ filter: lambda do |term, scope|
180
+ scope.ransack(email_or_username_cont: term).result
181
+ end)
182
+ end
183
+ ```
184
+
185
+ In this example, the `all` scope will query `email OR username`.
186
+
170
187
  #### Passing Parameters
171
188
 
172
189
  You can pass additional parameters to the options endpoint:
@@ -45,7 +45,7 @@ module ActiveAdmin
45
45
 
46
46
  def ajax_url
47
47
  return unless options[:ajax]
48
- template.polymorphic_path([:admin, ajax_resource_class],
48
+ template.polymorphic_path([template.active_admin_namespace.name, ajax_resource_class],
49
49
  action: option_collection.collection_action_name,
50
50
  **ajax_params)
51
51
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveAdmin
2
2
  module SearchableSelect
3
- VERSION = '1.0.1'.freeze
3
+ VERSION = '1.0.2'.freeze
4
4
  end
5
5
  end
@@ -80,6 +80,7 @@ RSpec.describe 'end to end', type: :feature, js: true do
80
80
 
81
81
  def wait_for_ajax
82
82
  Timeout.timeout(Capybara.default_max_wait_time) do
83
+ sleep 0.1
83
84
  loop until finished_all_ajax_requests?
84
85
  end
85
86
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin-searchable_select
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Codevise Solutions Ltd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-19 00:00:00.000000000 Z
11
+ date: 2018-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -304,7 +304,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
304
304
  version: '0'
305
305
  requirements: []
306
306
  rubyforge_project:
307
- rubygems_version: 2.7.0
307
+ rubygems_version: 2.7.5
308
308
  signing_key:
309
309
  specification_version: 4
310
310
  summary: Use searchable selects based on Select2 in Active Admin forms and filters.