mongoid_ability 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 721df8ecdb6424b68a3bc809f25cdaba1c8ff688
4
- data.tar.gz: 6d80989eadf2723af7eef09b9069b63ca2b84e26
2
+ SHA256:
3
+ metadata.gz: cccd3fd24f60f4b34354c4ded9ad957fc4fb70137fc42d38ec38e74b84fa8904
4
+ data.tar.gz: 55950648a4435d08485617178431cc60326e38b2f83c094d20909c11d9f0a1ed
5
5
  SHA512:
6
- metadata.gz: b2a8e5866633b0cb5451edf17ade4b4b4fc5977f6bac78054df986b13b674e4647b6d0d3d704b5fed4bacb13b2225496153379f749f3fe1f827e09459998e28b
7
- data.tar.gz: 8cd962801bd4b8960432707c6a4a8a0b6f8bd2fced346a9dee183f2724a830a67076b244563134a81fd79b1c620e8b0c452f963c3aaf88eeb77799be714f9f1c
6
+ metadata.gz: a99121ecb016a80bb5cbc94ca5ae325dcc7303ece2f419f92bdb83380cd4bf970baefde9a1c99aa433c737c7ad76ad5399df14d2bdd3190190856a4b82d5f2d1
7
+ data.tar.gz: 3a5297b943f849c774bf8162b7a3bbf796df4ce676d49c5f30f83e46d9ac9fb989e97553a547b86aa8b239a534b817c2db96f8d5899185c56d9474f4aa891d6b
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.0.2
4
+
5
+ * upgrade to `CanCanCan` 2.2
6
+ * performance optimisation in `MongoidAdapter`
7
+
3
8
  ## 2.0.1
4
9
 
5
10
  * make sure all `subject_id` values are converted to BSON
data/Gemfile CHANGED
@@ -6,5 +6,3 @@ git_source(:github) do |repo_name|
6
6
  end
7
7
 
8
8
  gemspec
9
-
10
- # gem 'cancancan-mongoid', github: 'tomasc/cancancan-mongoid', branch: 'master'
@@ -1,3 +1,5 @@
1
+ require 'set'
2
+
1
3
  module CanCan
2
4
  module ModelAdapters
3
5
  class MongoidAdapter < AbstractAdapter
@@ -51,12 +53,12 @@ module CanCan
51
53
 
52
54
  def open_subject_types
53
55
  @open_subject_types ||= begin
54
- subject_types.inject([]) do |res, cls|
56
+ subject_types.inject(Set[]) do |res, cls|
55
57
  subject_type_rules_for(cls).each do |rule|
56
58
  cls_list = [cls, *cls.descendants].compact
57
59
  rule.base_behavior ? res += cls_list : res -= cls_list
58
60
  end
59
- res.uniq
61
+ res.to_a
60
62
  end
61
63
  end
62
64
  end
@@ -1,3 +1,3 @@
1
1
  module MongoidAbility
2
- VERSION = '2.0.1'.freeze
2
+ VERSION = '2.0.2'.freeze
3
3
  end
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency 'cancancan', '>= 1.9'
22
- spec.add_dependency 'mongoid', '>= 5'
21
+ spec.add_dependency 'cancancan', '~> 2.2'
22
+ spec.add_dependency 'mongoid', '>= 5', '< 7'
23
23
 
24
24
  spec.add_development_dependency 'bundler'
25
25
  spec.add_development_dependency 'coveralls'
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid_ability
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-28 00:00:00.000000000 Z
11
+ date: 2018-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cancancan
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.9'
19
+ version: '2.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.9'
26
+ version: '2.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mongoid
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -31,6 +31,9 @@ dependencies:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '5'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '7'
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -38,6 +41,9 @@ dependencies:
38
41
  - - ">="
39
42
  - !ruby/object:Gem::Version
40
43
  version: '5'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '7'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: bundler
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -202,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
208
  version: '0'
203
209
  requirements: []
204
210
  rubyforge_project:
205
- rubygems_version: 2.5.2
211
+ rubygems_version: 2.7.6
206
212
  signing_key:
207
213
  specification_version: 4
208
214
  summary: Custom Ability class that allows CanCanCan authorization library store permissions