cancancan 1.16.0 → 1.17.0

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
2
  SHA1:
3
- metadata.gz: 993f2327cf688ab257cf339cabfd621ee1757d86
4
- data.tar.gz: 8e04df79a1f6619758cfa6faffa8a9d8a91bf647
3
+ metadata.gz: 418d49100740136f143204714c01555ca5787a1e
4
+ data.tar.gz: 2631fb854865b69ab8720023eb2e50289f680603
5
5
  SHA512:
6
- metadata.gz: f761b9d2b370a9105184d09cb05ea11729ca16fae21dd74e979cb07c5885021181cd4f4aa75d8562b49c55663cf70a4d84f8de8ec0b1ece6da3a5ee1b117aa9a
7
- data.tar.gz: 372c69b7c60be72ccb473137fcd1ae2be1815a8b6996a520d53c13079d425cd0ab879c9867bedfb39827db85c04efb0d499cf72fd1dbfbcc7848db3934cb5e0a
6
+ metadata.gz: 2ac85e5511555021a0841efbdb82eb0eccf5d3145d8e53de3df189484f5a7eb34796224912556c553ead44d75aa0d496838fe73c8db25a10ede4d889c0ab115f
7
+ data.tar.gz: 34dc9609930ec647cf36f7ce5fe3caa8663720ba4f8d871df3333ad41e42177aac79f383a932f6189ea05c02b2060f6a44724cd1cd27c5ecd574886742d6b303
data/.rubocop.yml CHANGED
@@ -34,5 +34,6 @@ AllCops:
34
34
  TargetRubyVersion: 2.0
35
35
  Exclude:
36
36
  - 'gemfiles/vendor/bundle/**/*'
37
+ - 'Appraisals'
37
38
 
38
39
  inherit_from: .rubocop_todo.yml
data/.rubocop_todo.yml CHANGED
@@ -46,3 +46,9 @@ Style/PredicateName:
46
46
  Exclude:
47
47
  - 'spec/**/*'
48
48
  - 'lib/cancan/ability.rb'
49
+
50
+ Style/SymbolArray:
51
+ Enabled: false
52
+
53
+ Style/InverseMethods:
54
+ Enabled: false
data/CHANGELOG.rdoc CHANGED
@@ -2,6 +2,10 @@ Develop
2
2
 
3
3
  Unreleased
4
4
 
5
+ 1.17.0 (March 26th, 2017)
6
+
7
+ * Improve performance for the Mongoid Adapter
8
+
5
9
  1.16.0 (February 2nd, 2017)
6
10
 
7
11
  * Introduce rubocop and fixes most of the issues
data/README.md CHANGED
@@ -19,7 +19,7 @@ All permissions are defined in a single location (the `Ability` class) and not d
19
19
 
20
20
  Add this to your Gemfile:
21
21
 
22
- gem 'cancancan'
22
+ gem 'cancancan', '~> 1.10'
23
23
 
24
24
  and run the `bundle install` command.
25
25
 
@@ -104,7 +104,7 @@ def update_params
104
104
  end
105
105
  ```
106
106
 
107
- For the `:create` action, CanCan will try to initialize a new instance with sanitized input by seeing if your
107
+ For the `:create` action, CanCanCan will try to initialize a new instance with sanitized input by seeing if your
108
108
  controller will respond to the following methods (in order):
109
109
 
110
110
  1. `create_params`
data/cancancan.gemspec CHANGED
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'cancan/version'
@@ -4,6 +4,7 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "activerecord", "~> 3.2.0", :require => "active_record"
6
6
  gem "actionpack", "~> 3.2.0", :require => "action_pack"
7
+ gem "rubocop", "0.48.0"
7
8
 
8
9
  platforms :jruby do
9
10
  gem "activerecord-jdbcsqlite3-adapter"
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  gem "activerecord", "~> 4.0.5", :require => "active_record"
6
6
  gem "activesupport", "~> 4.0.5", :require => "active_support/all"
7
7
  gem "actionpack", "~> 4.0.5", :require => "action_pack"
8
+ gem "rubocop", "0.48.0"
8
9
 
9
10
  platforms :jruby do
10
11
  gem "activerecord-jdbcsqlite3-adapter"
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  gem "activerecord", "~> 4.1.1", :require => "active_record"
6
6
  gem "activesupport", "~> 4.1.1", :require => "active_support/all"
7
7
  gem "actionpack", "~> 4.1.1", :require => "action_pack"
8
+ gem "rubocop", "0.48.0"
8
9
 
9
10
  platforms :jruby do
10
11
  gem "activerecord-jdbcsqlite3-adapter"
@@ -6,6 +6,7 @@ gem "activerecord", "~> 4.2.0", :require => "active_record"
6
6
  gem "activesupport", "~> 4.2.0", :require => "active_support/all"
7
7
  gem "actionpack", "~> 4.2.0", :require => "action_pack"
8
8
  gem "nokogiri", "~> 1.6.8", :require => "nokogiri"
9
+ gem "rubocop", "0.48.0"
9
10
 
10
11
  platforms :jruby do
11
12
  gem "activerecord-jdbcsqlite3-adapter"
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  gem "activerecord", "~> 5.0.0.rc1", :require => "active_record"
6
6
  gem "activesupport", "~> 5.0.0.rc1", :require => "active_support/all"
7
7
  gem "actionpack", "~> 5.0.0.rc1", :require => "action_pack"
8
+ gem "rubocop", "0.48.0"
8
9
 
9
10
  platforms :jruby do
10
11
  gem "activerecord-jdbcsqlite3-adapter"
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  gem "activesupport", "~> 3.0", :require => "active_support/all"
6
6
  gem "actionpack", "~> 3.0", :require => "action_pack"
7
7
  gem "mongoid", "~> 2.0.0"
8
+ gem "rubocop", "0.48.0"
8
9
 
9
10
  platforms :ruby, :mswin, :mingw do
10
11
  gem "bson_ext", "~> 1.1"
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  gem "sequel", "~> 3.48.0"
6
6
  gem "activesupport", "~> 3.0", :require => "active_support/all"
7
7
  gem "actionpack", "~> 3.0", :require => "action_pack"
8
+ gem "rubocop", "0.48.0"
8
9
 
9
10
  platforms :jruby do
10
11
  gem "jdbc-sqlite3"
@@ -62,7 +62,7 @@ module CanCan
62
62
  if (relation = model_relations[k])
63
63
  relation_class_name = relation[:class_name].blank? ? k.to_s.classify : relation[:class_name]
64
64
  v = simplify_relations(relation_class_name.constantize, v)
65
- relation_ids = relation_class_name.constantize.where(v).only(:id).map(&:id)
65
+ relation_ids = relation_class_name.constantize.where(v).distinct(:_id)
66
66
  k = "#{k}_id"
67
67
  v = { '$in' => relation_ids }
68
68
  end
@@ -1,3 +1,3 @@
1
1
  module CanCan
2
- VERSION = '1.16.0'.freeze
2
+ VERSION = '1.17.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cancancan
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.0
4
+ version: 1.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Rodi (Renuo AG)
@@ -11,76 +11,76 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-02-10 00:00:00.000000000 Z
14
+ date: 2017-05-18 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
18
18
  requirement: !ruby/object:Gem::Requirement
19
19
  requirements:
20
- - - ~>
20
+ - - "~>"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '1.3'
23
23
  type: :development
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ~>
27
+ - - "~>"
28
28
  - !ruby/object:Gem::Version
29
29
  version: '1.3'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rubocop
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - ~>
34
+ - - "~>"
35
35
  - !ruby/object:Gem::Version
36
36
  version: '0.46'
37
37
  type: :development
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - ~>
41
+ - - "~>"
42
42
  - !ruby/object:Gem::Version
43
43
  version: '0.46'
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: rake
46
46
  requirement: !ruby/object:Gem::Requirement
47
47
  requirements:
48
- - - ~>
48
+ - - "~>"
49
49
  - !ruby/object:Gem::Version
50
50
  version: 10.1.1
51
51
  type: :development
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - ~>
55
+ - - "~>"
56
56
  - !ruby/object:Gem::Version
57
57
  version: 10.1.1
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rspec
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - ~>
62
+ - - "~>"
63
63
  - !ruby/object:Gem::Version
64
64
  version: 3.2.0
65
65
  type: :development
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - ~>
69
+ - - "~>"
70
70
  - !ruby/object:Gem::Version
71
71
  version: 3.2.0
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: appraisal
74
74
  requirement: !ruby/object:Gem::Requirement
75
75
  requirements:
76
- - - '>='
76
+ - - ">="
77
77
  - !ruby/object:Gem::Version
78
78
  version: 2.0.0
79
79
  type: :development
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - '>='
83
+ - - ">="
84
84
  - !ruby/object:Gem::Version
85
85
  version: 2.0.0
86
86
  description: Simple authorization solution for Rails. All permissions are stored in
@@ -90,11 +90,11 @@ executables: []
90
90
  extensions: []
91
91
  extra_rdoc_files: []
92
92
  files:
93
- - .gitignore
94
- - .rspec
95
- - .rubocop.yml
96
- - .rubocop_todo.yml
97
- - .travis.yml
93
+ - ".gitignore"
94
+ - ".rspec"
95
+ - ".rubocop.yml"
96
+ - ".rubocop_todo.yml"
97
+ - ".travis.yml"
98
98
  - Appraisals
99
99
  - CHANGELOG.rdoc
100
100
  - CONTRIBUTING.md
@@ -159,17 +159,17 @@ require_paths:
159
159
  - lib
160
160
  required_ruby_version: !ruby/object:Gem::Requirement
161
161
  requirements:
162
- - - '>='
162
+ - - ">="
163
163
  - !ruby/object:Gem::Version
164
164
  version: 2.0.0
165
165
  required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  requirements:
167
- - - '>='
167
+ - - ">="
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
170
  requirements: []
171
171
  rubyforge_project:
172
- rubygems_version: 2.0.14
172
+ rubygems_version: 2.5.2
173
173
  signing_key:
174
174
  specification_version: 4
175
175
  summary: Simple authorization solution for Rails.