activeadmin-searchable_select 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.rspec +1 -0
  4. data/.rubocop.yml +10 -0
  5. data/.travis.yml +16 -0
  6. data/.yardopts +2 -0
  7. data/Appraisals +15 -0
  8. data/CHANGELOG.md +7 -0
  9. data/Gemfile +3 -0
  10. data/LICENSE.txt +25 -0
  11. data/README.md +247 -0
  12. data/Rakefile +6 -0
  13. data/activeadmin-searchable_select.gemspec +37 -0
  14. data/app/assets/javascripts/active_admin/searchable_select.js.coffee +3 -0
  15. data/app/assets/javascripts/active_admin/searchable_select/init.js.coffee +29 -0
  16. data/app/assets/stylesheets/active_admin/searchable_select.scss +5 -0
  17. data/bin/rspec +17 -0
  18. data/gemfiles/rails_4.2_active_admin_1.0.0.pre4.gemfile +9 -0
  19. data/gemfiles/rails_5.1_active_admin_1.0.gemfile +8 -0
  20. data/gemfiles/rails_5.1_active_admin_1.1.gemfile +8 -0
  21. data/lib/activeadmin-searchable_select.rb +6 -0
  22. data/lib/activeadmin/inputs/filters/searchable_select_input.rb +13 -0
  23. data/lib/activeadmin/inputs/searchable_select_input.rb +11 -0
  24. data/lib/activeadmin/searchable_select.rb +20 -0
  25. data/lib/activeadmin/searchable_select/engine.rb +11 -0
  26. data/lib/activeadmin/searchable_select/option_collection.rb +103 -0
  27. data/lib/activeadmin/searchable_select/resource_dsl_extension.rb +39 -0
  28. data/lib/activeadmin/searchable_select/resource_extension.rb +10 -0
  29. data/lib/activeadmin/searchable_select/select_input_extension.rb +130 -0
  30. data/lib/activeadmin/searchable_select/version.rb +5 -0
  31. data/spec/features/ajax_params_spec.rb +53 -0
  32. data/spec/features/end_to_end_spec.rb +83 -0
  33. data/spec/features/filter_input_spec.rb +191 -0
  34. data/spec/features/form_input_spec.rb +178 -0
  35. data/spec/features/inline_ajax_setting_spec.rb +41 -0
  36. data/spec/features/input_errors_spec.rb +55 -0
  37. data/spec/features/options_dsl_spec.rb +248 -0
  38. data/spec/internal/app/assets/javascripts/active_admin.js +2 -0
  39. data/spec/internal/app/assets/stylesheets/active_admin.scss +2 -0
  40. data/spec/internal/app/controllers/application_controller.rb +5 -0
  41. data/spec/internal/config/database.yml +3 -0
  42. data/spec/internal/config/initializers/assets.rb +3 -0
  43. data/spec/internal/config/routes.rb +3 -0
  44. data/spec/internal/db/schema.rb +26 -0
  45. data/spec/internal/log/.gitignore +1 -0
  46. data/spec/internal/public/favicon.ico +0 -0
  47. data/spec/rails_helper.rb +13 -0
  48. data/spec/spec_helper.rb +96 -0
  49. data/spec/support/active_admin_helpers.rb +9 -0
  50. data/spec/support/capybara.rb +8 -0
  51. data/spec/support/models.rb +21 -0
  52. data/spec/support/pluck_polyfill.rb +12 -0
  53. data/spec/support/reset_settings.rb +5 -0
  54. metadata +311 -0
@@ -0,0 +1,9 @@
1
+ module ActiveAdminHelpers
2
+ module_function
3
+
4
+ def setup
5
+ ActiveAdmin.application = nil
6
+ yield
7
+ Rails.application.reload_routes!
8
+ end
9
+ end
@@ -0,0 +1,8 @@
1
+ require 'capybara/rspec'
2
+ require 'capybara/poltergeist'
3
+
4
+ Capybara.javascript_driver = :poltergeist
5
+
6
+ RSpec.configure do |config|
7
+ config.include Capybara::RSpecMatchers, type: :request
8
+ end
@@ -0,0 +1,21 @@
1
+ require 'database_cleaner'
2
+
3
+ class User < ActiveRecord::Base; end
4
+
5
+ class Category < ActiveRecord::Base
6
+ belongs_to :created_by, class_name: 'User'
7
+ end
8
+
9
+ class Post < ActiveRecord::Base
10
+ belongs_to :category
11
+ belongs_to :user
12
+
13
+ scope(:published, -> { where(published: true) })
14
+ end
15
+
16
+ RSpec.configure do |config|
17
+ config.after do
18
+ DatabaseCleaner.strategy = :truncation
19
+ DatabaseCleaner.clean
20
+ end
21
+ end
@@ -0,0 +1,12 @@
1
+ # Required for ActiveSupport < 5
2
+ unless [].respond_to?(:pluck)
3
+ module Enumerable
4
+ def pluck(*keys)
5
+ if keys.many?
6
+ map { |element| keys.map { |key| element[key] } }
7
+ else
8
+ map { |element| element[keys.first] }
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,5 @@
1
+ RSpec.configure do |config|
2
+ config.before(:each) do
3
+ ActiveAdmin::SearchableSelect.inline_ajax_options = false
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,311 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activeadmin-searchable_select
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Codevise Solutions Ltd
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-10-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: appraisal
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.2'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.2'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.6'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.6'
69
+ - !ruby/object:Gem::Dependency
70
+ name: combustion
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.7.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.7.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: database_cleaner
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.6'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.6'
97
+ - !ruby/object:Gem::Dependency
98
+ name: sqlite3
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.3'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.3'
111
+ - !ruby/object:Gem::Dependency
112
+ name: capybara
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '2.15'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '2.15'
125
+ - !ruby/object:Gem::Dependency
126
+ name: poltergeist
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.15'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1.15'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 0.42.0
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 0.42.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: semmy
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '1.0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '1.0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rails
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: activeadmin
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: 1.x
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: 1.x
195
+ - !ruby/object:Gem::Dependency
196
+ name: jquery-rails
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '3.0'
202
+ - - "<"
203
+ - !ruby/object:Gem::Version
204
+ version: '5'
205
+ type: :runtime
206
+ prerelease: false
207
+ version_requirements: !ruby/object:Gem::Requirement
208
+ requirements:
209
+ - - ">="
210
+ - !ruby/object:Gem::Version
211
+ version: '3.0'
212
+ - - "<"
213
+ - !ruby/object:Gem::Version
214
+ version: '5'
215
+ - !ruby/object:Gem::Dependency
216
+ name: select2-rails
217
+ requirement: !ruby/object:Gem::Requirement
218
+ requirements:
219
+ - - "~>"
220
+ - !ruby/object:Gem::Version
221
+ version: '4.0'
222
+ type: :runtime
223
+ prerelease: false
224
+ version_requirements: !ruby/object:Gem::Requirement
225
+ requirements:
226
+ - - "~>"
227
+ - !ruby/object:Gem::Version
228
+ version: '4.0'
229
+ description:
230
+ email: info@codevise.de
231
+ executables: []
232
+ extensions: []
233
+ extra_rdoc_files: []
234
+ files:
235
+ - ".gitignore"
236
+ - ".rspec"
237
+ - ".rubocop.yml"
238
+ - ".travis.yml"
239
+ - ".yardopts"
240
+ - Appraisals
241
+ - CHANGELOG.md
242
+ - Gemfile
243
+ - LICENSE.txt
244
+ - README.md
245
+ - Rakefile
246
+ - activeadmin-searchable_select.gemspec
247
+ - app/assets/javascripts/active_admin/searchable_select.js.coffee
248
+ - app/assets/javascripts/active_admin/searchable_select/init.js.coffee
249
+ - app/assets/stylesheets/active_admin/searchable_select.scss
250
+ - bin/rspec
251
+ - gemfiles/rails_4.2_active_admin_1.0.0.pre4.gemfile
252
+ - gemfiles/rails_5.1_active_admin_1.0.gemfile
253
+ - gemfiles/rails_5.1_active_admin_1.1.gemfile
254
+ - lib/activeadmin-searchable_select.rb
255
+ - lib/activeadmin/inputs/filters/searchable_select_input.rb
256
+ - lib/activeadmin/inputs/searchable_select_input.rb
257
+ - lib/activeadmin/searchable_select.rb
258
+ - lib/activeadmin/searchable_select/engine.rb
259
+ - lib/activeadmin/searchable_select/option_collection.rb
260
+ - lib/activeadmin/searchable_select/resource_dsl_extension.rb
261
+ - lib/activeadmin/searchable_select/resource_extension.rb
262
+ - lib/activeadmin/searchable_select/select_input_extension.rb
263
+ - lib/activeadmin/searchable_select/version.rb
264
+ - spec/features/ajax_params_spec.rb
265
+ - spec/features/end_to_end_spec.rb
266
+ - spec/features/filter_input_spec.rb
267
+ - spec/features/form_input_spec.rb
268
+ - spec/features/inline_ajax_setting_spec.rb
269
+ - spec/features/input_errors_spec.rb
270
+ - spec/features/options_dsl_spec.rb
271
+ - spec/internal/app/assets/javascripts/active_admin.js
272
+ - spec/internal/app/assets/stylesheets/active_admin.scss
273
+ - spec/internal/app/controllers/application_controller.rb
274
+ - spec/internal/config/database.yml
275
+ - spec/internal/config/initializers/assets.rb
276
+ - spec/internal/config/routes.rb
277
+ - spec/internal/db/schema.rb
278
+ - spec/internal/log/.gitignore
279
+ - spec/internal/public/favicon.ico
280
+ - spec/rails_helper.rb
281
+ - spec/spec_helper.rb
282
+ - spec/support/active_admin_helpers.rb
283
+ - spec/support/capybara.rb
284
+ - spec/support/models.rb
285
+ - spec/support/pluck_polyfill.rb
286
+ - spec/support/reset_settings.rb
287
+ homepage: https://github.com/codevise/activeadmin-searchable_select
288
+ licenses:
289
+ - MIT
290
+ metadata: {}
291
+ post_install_message:
292
+ rdoc_options: []
293
+ require_paths:
294
+ - lib
295
+ required_ruby_version: !ruby/object:Gem::Requirement
296
+ requirements:
297
+ - - "~>"
298
+ - !ruby/object:Gem::Version
299
+ version: '2.1'
300
+ required_rubygems_version: !ruby/object:Gem::Requirement
301
+ requirements:
302
+ - - ">="
303
+ - !ruby/object:Gem::Version
304
+ version: '0'
305
+ requirements: []
306
+ rubyforge_project:
307
+ rubygems_version: 2.6.8
308
+ signing_key:
309
+ specification_version: 4
310
+ summary: Use searchable selects based on Select2 in Active Admin forms and filters.
311
+ test_files: []