openstax_accounts 3.1.1 → 4.0.0

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.
Files changed (43) hide show
  1. checksums.yaml +8 -8
  2. data/app/assets/stylesheets/openstax/accounts/dev.css.scss +4 -0
  3. data/app/controllers/openstax/accounts/dev/accounts_controller.rb +2 -2
  4. data/app/handlers/openstax/accounts/accounts_search.rb +66 -0
  5. data/app/handlers/openstax/accounts/dev/accounts_search.rb +10 -21
  6. data/app/models/openstax/accounts/group.rb +12 -8
  7. data/app/representers/openstax/accounts/api/v1/account_representer.rb +5 -0
  8. data/app/representers/openstax/accounts/api/v1/account_search_representer.rb +12 -17
  9. data/app/representers/openstax/accounts/api/v1/application_account_search_representer.rb +3 -1
  10. data/app/routines/openstax/accounts/dev/create_account.rb +1 -1
  11. data/app/routines/openstax/accounts/search_accounts.rb +16 -171
  12. data/app/routines/openstax/accounts/search_local_accounts.rb +101 -0
  13. data/app/views/openstax/accounts/dev/accounts/_search_results.html.erb +19 -45
  14. data/app/views/openstax/accounts/dev/accounts/index.html.erb +11 -8
  15. data/app/views/openstax/accounts/shared/accounts/_search.html.erb +9 -6
  16. data/db/migrate/{20140811182433_create_openstax_accounts_groups.rb → 1_create_openstax_accounts_groups.rb} +0 -0
  17. data/db/migrate/{20140811182505_create_openstax_accounts_group_members.rb → 2_create_openstax_accounts_group_members.rb} +0 -0
  18. data/db/migrate/{20140811182527_create_openstax_accounts_group_owners.rb → 3_create_openstax_accounts_group_owners.rb} +0 -0
  19. data/db/migrate/{20140811182553_create_openstax_accounts_group_nestings.rb → 4_create_openstax_accounts_group_nestings.rb} +0 -0
  20. data/lib/openstax/accounts/engine.rb +1 -0
  21. data/lib/openstax/accounts/has_many_through_groups.rb +4 -2
  22. data/lib/openstax/accounts/version.rb +1 -1
  23. data/lib/openstax_accounts.rb +11 -5
  24. data/spec/controllers/openstax/accounts/dev/accounts_controller_spec.rb +1 -1
  25. data/spec/controllers/openstax/accounts/sessions_controller_spec.rb +1 -1
  26. data/spec/dummy/app/access_policies/account_access_policy.rb +11 -0
  27. data/spec/dummy/app/controllers/oauth_controller.rb +2 -0
  28. data/spec/dummy/config/environments/production.rb +1 -1
  29. data/spec/dummy/config/environments/test.rb +1 -1
  30. data/spec/dummy/config/initializers/access_policies.rb +1 -0
  31. data/spec/dummy/config/initializers/doorkeeper.rb +75 -0
  32. data/spec/dummy/config/initializers/openstax_accounts.rb +2 -1
  33. data/spec/dummy/db/migrate/{1_create_users.rb → 5_create_users.rb} +0 -0
  34. data/spec/dummy/db/migrate/{2_create_ownerships.rb → 6_create_ownerships.rb} +0 -0
  35. data/spec/dummy/db/schema.rb +1 -1
  36. data/spec/factories/openstax_accounts_account.rb +1 -1
  37. data/spec/factories/openstax_accounts_group.rb +1 -1
  38. data/spec/handlers/openstax/accounts/accounts_search_spec.rb +63 -0
  39. data/spec/handlers/openstax/accounts/dev/accounts_search_spec.rb +55 -0
  40. data/spec/lib/openstax_accounts_spec.rb +66 -66
  41. data/spec/routines/openstax/accounts/search_accounts_spec.rb +23 -23
  42. metadata +60 -15
  43. data/app/routines/openstax/accounts/dev/search_accounts.rb +0 -27
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstax_accounts
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JP Slavinsky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-14 00:00:00.000000000 Z
11
+ date: 2015-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -87,6 +87,9 @@ dependencies:
87
87
  - - ! '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0.8'
90
+ - - <
91
+ - !ruby/object:Gem::Version
92
+ version: '1.0'
90
93
  type: :runtime
91
94
  prerelease: false
92
95
  version_requirements: !ruby/object:Gem::Requirement
@@ -94,6 +97,9 @@ dependencies:
94
97
  - - ! '>='
95
98
  - !ruby/object:Gem::Version
96
99
  version: '0.8'
100
+ - - <
101
+ - !ruby/object:Gem::Version
102
+ version: '1.0'
97
103
  - !ruby/object:Gem::Dependency
98
104
  name: lev
99
105
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +134,28 @@ dependencies:
128
134
  requirements:
129
135
  - - ! '>='
130
136
  - !ruby/object:Gem::Version
131
- version: 2.2.3
137
+ version: 4.1.0
138
+ type: :runtime
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ! '>='
143
+ - !ruby/object:Gem::Version
144
+ version: 4.1.0
145
+ - !ruby/object:Gem::Dependency
146
+ name: openstax_api
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ! '>='
150
+ - !ruby/object:Gem::Version
151
+ version: 3.1.0
132
152
  type: :runtime
133
153
  prerelease: false
134
154
  version_requirements: !ruby/object:Gem::Requirement
135
155
  requirements:
136
156
  - - ! '>='
137
157
  - !ruby/object:Gem::Version
138
- version: 2.2.3
158
+ version: 3.1.0
139
159
  - !ruby/object:Gem::Dependency
140
160
  name: action_interceptor
141
161
  requirement: !ruby/object:Gem::Requirement
@@ -170,14 +190,14 @@ dependencies:
170
190
  requirements:
171
191
  - - ! '>='
172
192
  - !ruby/object:Gem::Version
173
- version: 3.0.0
193
+ version: '0'
174
194
  type: :development
175
195
  prerelease: false
176
196
  version_requirements: !ruby/object:Gem::Requirement
177
197
  requirements:
178
198
  - - ! '>='
179
199
  - !ruby/object:Gem::Version
180
- version: 3.0.0
200
+ version: '0'
181
201
  - !ruby/object:Gem::Dependency
182
202
  name: capybara
183
203
  requirement: !ruby/object:Gem::Requirement
@@ -234,6 +254,20 @@ dependencies:
234
254
  - - ! '>='
235
255
  - !ruby/object:Gem::Version
236
256
  version: '0'
257
+ - !ruby/object:Gem::Dependency
258
+ name: responders
259
+ requirement: !ruby/object:Gem::Requirement
260
+ requirements:
261
+ - - ! '>='
262
+ - !ruby/object:Gem::Version
263
+ version: '0'
264
+ type: :development
265
+ prerelease: false
266
+ version_requirements: !ruby/object:Gem::Requirement
267
+ requirements:
268
+ - - ! '>='
269
+ - !ruby/object:Gem::Version
270
+ version: '0'
237
271
  description: Rails common code and bindings and for the 'accounts' API
238
272
  email:
239
273
  - jps@kindlinglabs.com
@@ -251,6 +285,7 @@ files:
251
285
  - app/controllers/openstax/accounts/dev/accounts_controller.rb
252
286
  - app/controllers/openstax/accounts/dev/base_controller.rb
253
287
  - app/controllers/openstax/accounts/sessions_controller.rb
288
+ - app/handlers/openstax/accounts/accounts_search.rb
254
289
  - app/handlers/openstax/accounts/dev/accounts_create.rb
255
290
  - app/handlers/openstax/accounts/dev/accounts_search.rb
256
291
  - app/handlers/openstax/accounts/sessions_callback.rb
@@ -274,8 +309,8 @@ files:
274
309
  - app/representers/openstax/accounts/api/v1/group_representer.rb
275
310
  - app/representers/openstax/accounts/api/v1/group_user_representer.rb
276
311
  - app/routines/openstax/accounts/dev/create_account.rb
277
- - app/routines/openstax/accounts/dev/search_accounts.rb
278
312
  - app/routines/openstax/accounts/search_accounts.rb
313
+ - app/routines/openstax/accounts/search_local_accounts.rb
279
314
  - app/routines/openstax/accounts/sync_accounts.rb
280
315
  - app/routines/openstax/accounts/sync_groups.rb
281
316
  - app/routines/openstax/accounts/update_group_caches.rb
@@ -288,10 +323,10 @@ files:
288
323
  - config/initializers/action_interceptor.rb
289
324
  - config/routes.rb
290
325
  - db/migrate/0_create_openstax_accounts_accounts.rb
291
- - db/migrate/20140811182433_create_openstax_accounts_groups.rb
292
- - db/migrate/20140811182505_create_openstax_accounts_group_members.rb
293
- - db/migrate/20140811182527_create_openstax_accounts_group_owners.rb
294
- - db/migrate/20140811182553_create_openstax_accounts_group_nestings.rb
326
+ - db/migrate/1_create_openstax_accounts_groups.rb
327
+ - db/migrate/2_create_openstax_accounts_group_members.rb
328
+ - db/migrate/3_create_openstax_accounts_group_owners.rb
329
+ - db/migrate/4_create_openstax_accounts_group_nestings.rb
295
330
  - lib/generators/openstax/accounts/schedule/USAGE
296
331
  - lib/generators/openstax/accounts/schedule/schedule_generator.rb
297
332
  - lib/generators/openstax/accounts/schedule/templates/schedule.rb
@@ -307,6 +342,7 @@ files:
307
342
  - spec/controllers/openstax/accounts/sessions_controller_spec.rb
308
343
  - spec/dummy/README.md
309
344
  - spec/dummy/Rakefile
345
+ - spec/dummy/app/access_policies/account_access_policy.rb
310
346
  - spec/dummy/app/assets/javascripts/application.js
311
347
  - spec/dummy/app/assets/stylesheets/application.css
312
348
  - spec/dummy/app/controllers/api/application_groups_controller.rb
@@ -331,9 +367,11 @@ files:
331
367
  - spec/dummy/config/environments/development.rb
332
368
  - spec/dummy/config/environments/production.rb
333
369
  - spec/dummy/config/environments/test.rb
370
+ - spec/dummy/config/initializers/access_policies.rb
334
371
  - spec/dummy/config/initializers/assets.rb
335
372
  - spec/dummy/config/initializers/backtrace_silencers.rb
336
373
  - spec/dummy/config/initializers/cookies_serializer.rb
374
+ - spec/dummy/config/initializers/doorkeeper.rb
337
375
  - spec/dummy/config/initializers/filter_parameter_logging.rb
338
376
  - spec/dummy/config/initializers/inflections.rb
339
377
  - spec/dummy/config/initializers/mime_types.rb
@@ -343,8 +381,8 @@ files:
343
381
  - spec/dummy/config/locales/en.yml
344
382
  - spec/dummy/config/routes.rb
345
383
  - spec/dummy/config/secrets.yml
346
- - spec/dummy/db/migrate/1_create_users.rb
347
- - spec/dummy/db/migrate/2_create_ownerships.rb
384
+ - spec/dummy/db/migrate/5_create_users.rb
385
+ - spec/dummy/db/migrate/6_create_ownerships.rb
348
386
  - spec/dummy/db/schema.rb
349
387
  - spec/dummy/db/test.sqlite3
350
388
  - spec/dummy/log/development.log
@@ -359,6 +397,8 @@ files:
359
397
  - spec/factories/openstax_accounts_group_member.rb
360
398
  - spec/factories/openstax_accounts_group_nesting.rb
361
399
  - spec/factories/openstax_accounts_group_owner.rb
400
+ - spec/handlers/openstax/accounts/accounts_search_spec.rb
401
+ - spec/handlers/openstax/accounts/dev/accounts_search_spec.rb
362
402
  - spec/lib/openstax/accounts/current_user_manager_spec.rb
363
403
  - spec/lib/openstax/accounts/has_many_through_groups_spec.rb
364
404
  - spec/lib/openstax_accounts_spec.rb
@@ -395,6 +435,7 @@ summary: Rails common code and bindings and for the 'accounts' API
395
435
  test_files:
396
436
  - spec/controllers/openstax/accounts/dev/accounts_controller_spec.rb
397
437
  - spec/controllers/openstax/accounts/sessions_controller_spec.rb
438
+ - spec/dummy/app/access_policies/account_access_policy.rb
398
439
  - spec/dummy/app/assets/javascripts/application.js
399
440
  - spec/dummy/app/assets/stylesheets/application.css
400
441
  - spec/dummy/app/controllers/api/application_groups_controller.rb
@@ -418,9 +459,11 @@ test_files:
418
459
  - spec/dummy/config/environments/development.rb
419
460
  - spec/dummy/config/environments/production.rb
420
461
  - spec/dummy/config/environments/test.rb
462
+ - spec/dummy/config/initializers/access_policies.rb
421
463
  - spec/dummy/config/initializers/assets.rb
422
464
  - spec/dummy/config/initializers/backtrace_silencers.rb
423
465
  - spec/dummy/config/initializers/cookies_serializer.rb
466
+ - spec/dummy/config/initializers/doorkeeper.rb
424
467
  - spec/dummy/config/initializers/filter_parameter_logging.rb
425
468
  - spec/dummy/config/initializers/inflections.rb
426
469
  - spec/dummy/config/initializers/mime_types.rb
@@ -431,8 +474,8 @@ test_files:
431
474
  - spec/dummy/config/routes.rb
432
475
  - spec/dummy/config/secrets.yml
433
476
  - spec/dummy/config.ru
434
- - spec/dummy/db/migrate/1_create_users.rb
435
- - spec/dummy/db/migrate/2_create_ownerships.rb
477
+ - spec/dummy/db/migrate/5_create_users.rb
478
+ - spec/dummy/db/migrate/6_create_ownerships.rb
436
479
  - spec/dummy/db/schema.rb
437
480
  - spec/dummy/db/test.sqlite3
438
481
  - spec/dummy/log/development.log
@@ -449,6 +492,8 @@ test_files:
449
492
  - spec/factories/openstax_accounts_group_member.rb
450
493
  - spec/factories/openstax_accounts_group_nesting.rb
451
494
  - spec/factories/openstax_accounts_group_owner.rb
495
+ - spec/handlers/openstax/accounts/accounts_search_spec.rb
496
+ - spec/handlers/openstax/accounts/dev/accounts_search_spec.rb
452
497
  - spec/lib/openstax/accounts/current_user_manager_spec.rb
453
498
  - spec/lib/openstax/accounts/has_many_through_groups_spec.rb
454
499
  - spec/lib/openstax_accounts_spec.rb
@@ -1,27 +0,0 @@
1
- # Routine for searching for accounts
2
- #
3
- # Caller provides a query and some options. The query follows the rules of
4
- # https://github.com/bruce/keyword_search, e.g.:
5
- #
6
- # "username:jps,richb" --> returns the "jps" and "richb" accounts
7
- # "name:John" --> returns accounts with first, last, or full name starting with "John"
8
- #
9
- # Query terms can be combined, e.g. "username:jp first_name:john"
10
- #
11
- # There are currently two options to control query pagination:
12
- #
13
- # :per_page -- the max number of results to return (default: 20)
14
- # :page -- the zero-indexed page to return (default: 0)
15
-
16
- module OpenStax
17
- module Accounts
18
- module Dev
19
- class SearchAccounts < OpenStax::Accounts::SearchAccounts
20
- def exec(query, options={})
21
- options = options.merge!(:max_matching_accounts => Float::INFINITY)
22
- super
23
- end
24
- end
25
- end
26
- end
27
- end