monarchy 2.3.0 → 2.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37446023d193a35f3d1989848c858d173810af90
4
- data.tar.gz: 4db1f53bf50bb8f75995d10d6e4da232f042b1d9
3
+ metadata.gz: 1aaafd9f05eba8c4c1ebbb90c951241b72f3781e
4
+ data.tar.gz: 5baaa9d33d93e9f9a057836ed8c846042ea6175e
5
5
  SHA512:
6
- metadata.gz: 7f1f23cb2bde8c85ef10b201e8ae337b70abacdf927cedf9586b8c46a839ca41118d106c925c7ebe163e7ad3ead9e4b0f8e389d6e536d3e34935d3442cacc95f
7
- data.tar.gz: 7dcbd125eda5e4bc2c6c1afbd94d8382c70f89b54ee176fefad54e893fc84a1e0d6706f9fd802af11ac098ca2b3cd1d25d584ae09319cde4ca08093ce8207b2c
6
+ metadata.gz: fa759e884b9a68cd202fa60f05454e90f0c2d6783ab06cc2d42091b2362183f162055e6989172e0c2b938ef1329530a6b19acb5683290cee9d2658fe1f0d0353
7
+ data.tar.gz: 76efe92b8149c6dd0b3c1cbcfcfc139e3e8f87a2475a09b4dca8f86ee1c47648d6261a1f0be57e8157924dc3b0b1506120513d10d37b15d2da6d4b24f18a9b55
@@ -1 +1 @@
1
- future-release=2.3.0
1
+ future-release=2.4.0
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.3
2
+ TargetRubyVersion: 2.4
3
3
  Exclude:
4
4
  - 'dummy/db/seeds.rb'
5
5
  - 'dummy/db/migrate/**'
@@ -13,7 +13,7 @@ Metrics/ModuleLength:
13
13
  Max: 150
14
14
  Metrics/BlockLength:
15
15
  ExcludedMethods: ['describe', 'context']
16
- Style/CaseIndentation:
16
+ Layout/CaseIndentation:
17
17
  Enabled: false
18
18
  Style/StructInheritance:
19
19
  Enabled: false
data/.travis.yml CHANGED
@@ -3,7 +3,7 @@ addons:
3
3
  repo_token: 60b8a9fc7e8d659c7dd22ed8912651c35b3ca5eebf1c23d5470308e6a802abbd
4
4
  language: ruby
5
5
  rvm:
6
- - 2.4.0
6
+ - 2.4.2
7
7
  before_install: gem update --system
8
8
  after_success:
9
9
  - bundle exec codeclimate-test-reporter
data/CHANGELOG.md CHANGED
@@ -1,7 +1,14 @@
1
1
  # Change Log
2
2
 
3
- ## [2.3.0](https://github.com/Exelord/Monarchy/tree/2.3.0) (2017-06-14)
4
- [Full Changelog](https://github.com/Exelord/Monarchy/compare/v2.2.2...2.3.0)
3
+ ## [2.4.0](https://github.com/Exelord/Monarchy/tree/2.4.0) (2017-10-03)
4
+ [Full Changelog](https://github.com/Exelord/Monarchy/compare/v2.3.0...2.4.0)
5
+
6
+ **Merged pull requests:**
7
+
8
+ - Support for Rails 5.1 [\#77](https://github.com/Exelord/Monarchy/pull/77) ([Exelord](https://github.com/Exelord))
9
+
10
+ ## [v2.3.0](https://github.com/Exelord/Monarchy/tree/v2.3.0) (2017-06-14)
11
+ [Full Changelog](https://github.com/Exelord/Monarchy/compare/v2.2.2...v2.3.0)
5
12
 
6
13
  **Closed issues:**
7
14
 
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  source 'https://rubygems.org'
4
- ruby '2.4.0'
4
+ ruby '2.4.2'
5
5
 
6
6
  # Declare your gem's dependencies in monarchy.gemspec.
7
7
  # Bundler will treat runtime dependencies like base dependencies, and
@@ -17,15 +17,15 @@ gemspec
17
17
  # gem 'byebug', group: [:development, :test]
18
18
 
19
19
  group :development, :test do
20
- gem 'database_cleaner', '1.5.3'
21
- gem 'db-query-matchers', '0.8.0'
20
+ gem 'database_cleaner', '1.6.1'
21
+ gem 'db-query-matchers', '0.9.0'
22
22
  gem 'factory_girl_rails', '4.8.0'
23
- gem 'ffaker', '2.5.0'
23
+ gem 'ffaker', '2.7.0'
24
24
  gem 'pry-rails', '0.3.6'
25
- gem 'rails', '5.0.2'
26
- gem 'rspec-rails', '3.5.2'
27
- gem 'rubocop', '0.48.0'
28
- gem 'shoulda-matchers', '3.1.1'
25
+ gem 'rails', '5.1.4'
26
+ gem 'rspec-rails', '3.6.1'
27
+ gem 'rubocop', '0.50.0'
28
+ gem 'shoulda-matchers', '3.1.2'
29
29
  gem 'sqlite3', '1.3.13'
30
30
  end
31
31
 
data/Gemfile.lock CHANGED
@@ -1,186 +1,190 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- monarchy (2.3.0)
4
+ monarchy (2.4.0)
5
5
  active_record_union (= 1.2.0)
6
6
  activerecord (>= 4.2.7.1)
7
- closure_tree (= 6.5.0)
7
+ closure_tree (= 6.6.0)
8
8
  configurations (= 2.2.2)
9
9
  tqdm (= 0.3.0)
10
10
 
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- actioncable (5.0.2)
15
- actionpack (= 5.0.2)
16
- nio4r (>= 1.2, < 3.0)
14
+ actioncable (5.1.4)
15
+ actionpack (= 5.1.4)
16
+ nio4r (~> 2.0)
17
17
  websocket-driver (~> 0.6.1)
18
- actionmailer (5.0.2)
19
- actionpack (= 5.0.2)
20
- actionview (= 5.0.2)
21
- activejob (= 5.0.2)
18
+ actionmailer (5.1.4)
19
+ actionpack (= 5.1.4)
20
+ actionview (= 5.1.4)
21
+ activejob (= 5.1.4)
22
22
  mail (~> 2.5, >= 2.5.4)
23
23
  rails-dom-testing (~> 2.0)
24
- actionpack (5.0.2)
25
- actionview (= 5.0.2)
26
- activesupport (= 5.0.2)
24
+ actionpack (5.1.4)
25
+ actionview (= 5.1.4)
26
+ activesupport (= 5.1.4)
27
27
  rack (~> 2.0)
28
- rack-test (~> 0.6.3)
28
+ rack-test (>= 0.6.3)
29
29
  rails-dom-testing (~> 2.0)
30
30
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
31
- actionview (5.0.2)
32
- activesupport (= 5.0.2)
31
+ actionview (5.1.4)
32
+ activesupport (= 5.1.4)
33
33
  builder (~> 3.1)
34
- erubis (~> 2.7.0)
34
+ erubi (~> 1.4)
35
35
  rails-dom-testing (~> 2.0)
36
36
  rails-html-sanitizer (~> 1.0, >= 1.0.3)
37
37
  active_record_union (1.2.0)
38
38
  activerecord (>= 4.0)
39
- activejob (5.0.2)
40
- activesupport (= 5.0.2)
39
+ activejob (5.1.4)
40
+ activesupport (= 5.1.4)
41
41
  globalid (>= 0.3.6)
42
- activemodel (5.0.2)
43
- activesupport (= 5.0.2)
44
- activerecord (5.0.2)
45
- activemodel (= 5.0.2)
46
- activesupport (= 5.0.2)
47
- arel (~> 7.0)
48
- activesupport (5.0.2)
42
+ activemodel (5.1.4)
43
+ activesupport (= 5.1.4)
44
+ activerecord (5.1.4)
45
+ activemodel (= 5.1.4)
46
+ activesupport (= 5.1.4)
47
+ arel (~> 8.0)
48
+ activesupport (5.1.4)
49
49
  concurrent-ruby (~> 1.0, >= 1.0.2)
50
50
  i18n (~> 0.7)
51
51
  minitest (~> 5.1)
52
52
  tzinfo (~> 1.1)
53
- arel (7.1.4)
53
+ arel (8.0.0)
54
54
  ast (2.3.0)
55
55
  builder (3.2.3)
56
- closure_tree (6.5.0)
56
+ closure_tree (6.6.0)
57
57
  activerecord (>= 4.1.0)
58
58
  with_advisory_lock (>= 3.0.0)
59
59
  codeclimate-test-reporter (1.0.8)
60
60
  simplecov (<= 0.13)
61
- coderay (1.1.1)
61
+ coderay (1.1.2)
62
62
  concurrent-ruby (1.0.5)
63
63
  configurations (2.2.2)
64
- database_cleaner (1.5.3)
65
- db-query-matchers (0.8.0)
64
+ crass (1.0.2)
65
+ database_cleaner (1.6.1)
66
+ db-query-matchers (0.9.0)
67
+ activesupport (>= 4.0, <= 6.0)
68
+ rspec (~> 3.0)
66
69
  diff-lcs (1.3)
67
70
  docile (1.1.5)
68
- erubis (2.7.0)
69
- factory_girl (4.8.0)
71
+ erubi (1.6.1)
72
+ factory_girl (4.8.1)
70
73
  activesupport (>= 3.0.0)
71
74
  factory_girl_rails (4.8.0)
72
75
  factory_girl (~> 4.8.0)
73
76
  railties (>= 3.0.0)
74
- ffaker (2.5.0)
77
+ ffaker (2.7.0)
75
78
  globalid (0.4.0)
76
79
  activesupport (>= 4.2.0)
77
- i18n (0.8.4)
80
+ i18n (0.8.6)
78
81
  json (2.1.0)
79
- loofah (2.0.3)
82
+ loofah (2.1.1)
83
+ crass (~> 1.0.2)
80
84
  nokogiri (>= 1.5.9)
81
85
  mail (2.6.6)
82
86
  mime-types (>= 1.16, < 4)
83
- method_source (0.8.2)
87
+ method_source (0.9.0)
84
88
  mime-types (3.1)
85
89
  mime-types-data (~> 3.2015)
86
90
  mime-types-data (3.2016.0521)
87
- mini_portile2 (2.2.0)
88
- minitest (5.10.2)
91
+ mini_portile2 (2.3.0)
92
+ minitest (5.10.3)
89
93
  nio4r (2.1.0)
90
- nokogiri (1.8.0)
91
- mini_portile2 (~> 2.2.0)
94
+ nokogiri (1.8.1)
95
+ mini_portile2 (~> 2.3.0)
96
+ parallel (1.12.0)
92
97
  parser (2.4.0.0)
93
98
  ast (~> 2.2)
94
99
  powerpack (0.1.1)
95
- pry (0.10.4)
100
+ pry (0.11.1)
96
101
  coderay (~> 1.1.0)
97
- method_source (~> 0.8.1)
98
- slop (~> 3.4)
102
+ method_source (~> 0.9.0)
99
103
  pry-rails (0.3.6)
100
104
  pry (>= 0.10.4)
101
105
  rack (2.0.3)
102
- rack-test (0.6.3)
103
- rack (>= 1.0)
104
- rails (5.0.2)
105
- actioncable (= 5.0.2)
106
- actionmailer (= 5.0.2)
107
- actionpack (= 5.0.2)
108
- actionview (= 5.0.2)
109
- activejob (= 5.0.2)
110
- activemodel (= 5.0.2)
111
- activerecord (= 5.0.2)
112
- activesupport (= 5.0.2)
113
- bundler (>= 1.3.0, < 2.0)
114
- railties (= 5.0.2)
106
+ rack-test (0.7.0)
107
+ rack (>= 1.0, < 3)
108
+ rails (5.1.4)
109
+ actioncable (= 5.1.4)
110
+ actionmailer (= 5.1.4)
111
+ actionpack (= 5.1.4)
112
+ actionview (= 5.1.4)
113
+ activejob (= 5.1.4)
114
+ activemodel (= 5.1.4)
115
+ activerecord (= 5.1.4)
116
+ activesupport (= 5.1.4)
117
+ bundler (>= 1.3.0)
118
+ railties (= 5.1.4)
115
119
  sprockets-rails (>= 2.0.0)
116
120
  rails-dom-testing (2.0.3)
117
121
  activesupport (>= 4.2.0)
118
122
  nokogiri (>= 1.6)
119
123
  rails-html-sanitizer (1.0.3)
120
124
  loofah (~> 2.0)
121
- railties (5.0.2)
122
- actionpack (= 5.0.2)
123
- activesupport (= 5.0.2)
125
+ railties (5.1.4)
126
+ actionpack (= 5.1.4)
127
+ activesupport (= 5.1.4)
124
128
  method_source
125
129
  rake (>= 0.8.7)
126
130
  thor (>= 0.18.1, < 2.0)
127
131
  rainbow (2.2.2)
128
132
  rake
129
- rake (12.0.0)
130
- rspec (3.5.0)
131
- rspec-core (~> 3.5.0)
132
- rspec-expectations (~> 3.5.0)
133
- rspec-mocks (~> 3.5.0)
134
- rspec-core (3.5.4)
135
- rspec-support (~> 3.5.0)
136
- rspec-expectations (3.5.0)
133
+ rake (12.1.0)
134
+ rspec (3.6.0)
135
+ rspec-core (~> 3.6.0)
136
+ rspec-expectations (~> 3.6.0)
137
+ rspec-mocks (~> 3.6.0)
138
+ rspec-core (3.6.0)
139
+ rspec-support (~> 3.6.0)
140
+ rspec-expectations (3.6.0)
137
141
  diff-lcs (>= 1.2.0, < 2.0)
138
- rspec-support (~> 3.5.0)
139
- rspec-mocks (3.5.0)
142
+ rspec-support (~> 3.6.0)
143
+ rspec-mocks (3.6.0)
140
144
  diff-lcs (>= 1.2.0, < 2.0)
141
- rspec-support (~> 3.5.0)
142
- rspec-rails (3.5.2)
145
+ rspec-support (~> 3.6.0)
146
+ rspec-rails (3.6.1)
143
147
  actionpack (>= 3.0)
144
148
  activesupport (>= 3.0)
145
149
  railties (>= 3.0)
146
- rspec-core (~> 3.5.0)
147
- rspec-expectations (~> 3.5.0)
148
- rspec-mocks (~> 3.5.0)
149
- rspec-support (~> 3.5.0)
150
- rspec-support (3.5.0)
151
- rubocop (0.48.0)
150
+ rspec-core (~> 3.6.0)
151
+ rspec-expectations (~> 3.6.0)
152
+ rspec-mocks (~> 3.6.0)
153
+ rspec-support (~> 3.6.0)
154
+ rspec-support (3.6.0)
155
+ rubocop (0.50.0)
156
+ parallel (~> 1.10)
152
157
  parser (>= 2.3.3.1, < 3.0)
153
158
  powerpack (~> 0.1)
154
- rainbow (>= 1.99.1, < 3.0)
159
+ rainbow (>= 2.2.2, < 3.0)
155
160
  ruby-progressbar (~> 1.7)
156
161
  unicode-display_width (~> 1.0, >= 1.0.1)
157
- ruby-progressbar (1.8.1)
158
- shoulda-matchers (3.1.1)
162
+ ruby-progressbar (1.9.0)
163
+ shoulda-matchers (3.1.2)
159
164
  activesupport (>= 4.0.0)
160
165
  simplecov (0.13.0)
161
166
  docile (~> 1.1.0)
162
167
  json (>= 1.8, < 3)
163
168
  simplecov-html (~> 0.10.0)
164
- simplecov-html (0.10.1)
165
- slop (3.6.0)
169
+ simplecov-html (0.10.2)
166
170
  sprockets (3.7.1)
167
171
  concurrent-ruby (~> 1.0)
168
172
  rack (> 1, < 3)
169
- sprockets-rails (3.2.0)
173
+ sprockets-rails (3.2.1)
170
174
  actionpack (>= 4.0)
171
175
  activesupport (>= 4.0)
172
176
  sprockets (>= 3.0.0)
173
177
  sqlite3 (1.3.13)
174
- thor (0.19.4)
178
+ thor (0.20.0)
175
179
  thread_safe (0.3.6)
176
180
  tqdm (0.3.0)
177
181
  tzinfo (1.2.3)
178
182
  thread_safe (~> 0.1)
179
- unicode-display_width (1.2.1)
183
+ unicode-display_width (1.3.0)
180
184
  websocket-driver (0.6.5)
181
185
  websocket-extensions (>= 0.1.0)
182
186
  websocket-extensions (0.1.2)
183
- with_advisory_lock (3.1.0)
187
+ with_advisory_lock (3.1.1)
184
188
  activerecord (>= 3.2)
185
189
  thread_safe
186
190
 
@@ -190,23 +194,23 @@ PLATFORMS
190
194
  DEPENDENCIES
191
195
  bundler (~> 1.12)
192
196
  codeclimate-test-reporter (~> 1.0.8)
193
- database_cleaner (= 1.5.3)
194
- db-query-matchers (= 0.8.0)
197
+ database_cleaner (= 1.6.1)
198
+ db-query-matchers (= 0.9.0)
195
199
  factory_girl_rails (= 4.8.0)
196
- ffaker (= 2.5.0)
200
+ ffaker (= 2.7.0)
197
201
  monarchy!
198
202
  pry-rails (= 0.3.6)
199
- rails (= 5.0.2)
203
+ rails (= 5.1.4)
200
204
  rake (~> 12.0)
201
- rspec (= 3.5.0)
202
- rspec-rails (= 3.5.2)
203
- rubocop (= 0.48.0)
204
- shoulda-matchers (= 3.1.1)
205
+ rspec (= 3.6.0)
206
+ rspec-rails (= 3.6.1)
207
+ rubocop (= 0.50.0)
208
+ shoulda-matchers (= 3.1.2)
205
209
  simplecov (= 0.13.0)
206
210
  sqlite3 (= 1.3.13)
207
211
 
208
212
  RUBY VERSION
209
- ruby 2.4.0p0
213
+ ruby 2.4.2p198
210
214
 
211
215
  BUNDLED WITH
212
- 1.15.1
216
+ 1.15.4
@@ -63,9 +63,9 @@ module Monarchy
63
63
  # rubocop:enable all
64
64
 
65
65
  def include_relationships
66
+ has_one :hierarchy, as: :resource, dependent: :destroy, class_name: "::#{Monarchy.hierarchy_class}"
66
67
  has_many :members, through: :hierarchy, class_name: "::#{Monarchy.member_class}"
67
68
  has_many :users, through: :members, class_name: "::#{Monarchy.user_class}"
68
- has_one :hierarchy, as: :resource, dependent: :destroy, class_name: "::#{Monarchy.hierarchy_class}"
69
69
  end
70
70
  end
71
71
 
@@ -111,7 +111,7 @@ module Monarchy
111
111
  return unless parentize
112
112
 
113
113
  keys = relation_keys(parentize)
114
- was_changed = changes[keys[:foreign_key]] || changes[keys[:foreign_type]]
114
+ was_changed = saved_changes[keys[:foreign_key]] || saved_changes[keys[:foreign_type]]
115
115
  Monarchy::Validators.resource(send(parentize), true, false)
116
116
  self.parent = send(parentize) if was_changed || force
117
117
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Monarchy
4
- VERSION = '2.3.0'
4
+ VERSION = '2.4.0'
5
5
  end
data/monarchy.gemspec CHANGED
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  lib = File.expand_path('../lib', __FILE__)
@@ -28,12 +27,12 @@ Gem::Specification.new do |s|
28
27
  s.required_ruby_version = '>= 2.3'
29
28
 
30
29
  s.add_dependency 'activerecord', '>=4.2.7.1'
31
- s.add_dependency 'closure_tree', '6.5.0'
30
+ s.add_dependency 'closure_tree', '6.6.0'
32
31
  s.add_dependency 'configurations', '2.2.2'
33
32
  s.add_dependency 'active_record_union', '1.2.0'
34
33
  s.add_dependency 'tqdm', '0.3.0'
35
34
 
36
35
  s.add_development_dependency 'bundler', '~> 1.12'
37
36
  s.add_development_dependency 'rake', '~> 12.0'
38
- s.add_development_dependency 'rspec', '3.5.0'
37
+ s.add_development_dependency 'rspec', '3.6.0'
39
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monarchy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Exelord
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-14 00:00:00.000000000 Z
11
+ date: 2017-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 6.5.0
33
+ version: 6.6.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 6.5.0
40
+ version: 6.6.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: configurations
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 3.5.0
117
+ version: 3.6.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 3.5.0
124
+ version: 3.6.0
125
125
  description: Hierarchical access management system with roles inheritance.
126
126
  email:
127
127
  - exelord@macsour.com
@@ -259,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
259
  version: '0'
260
260
  requirements: []
261
261
  rubyforge_project:
262
- rubygems_version: 2.6.10
262
+ rubygems_version: 2.6.13
263
263
  signing_key:
264
264
  specification_version: 4
265
265
  summary: Hierarchical access management system with roles inheritance.