monarchy 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github_changelog_generator +1 -1
- data/CHANGELOG.md +10 -2
- data/Gemfile.lock +20 -19
- data/dummy/app/models/project.rb +1 -1
- data/dummy/db/migrate/20160502212213_parent_as_setup.rb +1 -1
- data/dummy/db/schema.rb +3 -3
- data/lib/monarchy/acts_as_resource.rb +7 -1
- data/lib/monarchy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 815ca965ee47bec334658cc90ce50557a8d0154e
|
4
|
+
data.tar.gz: 8353cc02f268a429bf61b117c421b5481942a2c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a11658a76ea5dc9cf75567c7c2485c0501fb95cc8003ed64b650bfdc13c6ae64db63037ee30b8c79d7c9b2c48a55e585faec53a99e26483f5d260568b55d143
|
7
|
+
data.tar.gz: aa8c93f91f7a4bcf48154e1207bd7bdfd81f58f5391a8488eade7a16da410a9507286f3425442ab928ff91b1f087b1f4a5646ad9de65d9c6f52fef81796c1a82
|
data/.github_changelog_generator
CHANGED
@@ -1 +1 @@
|
|
1
|
-
future-release=2.2.
|
1
|
+
future-release=2.2.2
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [2.2.
|
4
|
-
[Full Changelog](https://github.com/Exelord/Monarchy/compare/v2.2.
|
3
|
+
## [2.2.2](https://github.com/Exelord/Monarchy/tree/2.2.2) (2017-06-14)
|
4
|
+
[Full Changelog](https://github.com/Exelord/Monarchy/compare/v2.2.1...2.2.2)
|
5
|
+
|
6
|
+
**Fixed bugs:**
|
7
|
+
|
8
|
+
- Fix parent as [\#78](https://github.com/Exelord/Monarchy/issues/78)
|
9
|
+
- Fix parent\_as [\#75](https://github.com/Exelord/Monarchy/pull/75) ([Exelord](https://github.com/Exelord))
|
10
|
+
|
11
|
+
## [v2.2.1](https://github.com/Exelord/Monarchy/tree/v2.2.1) (2017-05-29)
|
12
|
+
[Full Changelog](https://github.com/Exelord/Monarchy/compare/v2.2.0...v2.2.1)
|
5
13
|
|
6
14
|
**Merged pull requests:**
|
7
15
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
monarchy (2.2.
|
4
|
+
monarchy (2.2.2)
|
5
5
|
active_record_union (= 1.2.0)
|
6
6
|
activerecord (>= 4.2.7.1)
|
7
7
|
closure_tree (= 6.5.0)
|
@@ -71,23 +71,23 @@ GEM
|
|
71
71
|
factory_girl (~> 4.8.0)
|
72
72
|
railties (>= 3.0.0)
|
73
73
|
ffaker (2.5.0)
|
74
|
-
globalid (0.
|
75
|
-
activesupport (>= 4.
|
76
|
-
i18n (0.8.
|
77
|
-
json (2.0
|
74
|
+
globalid (0.4.0)
|
75
|
+
activesupport (>= 4.2.0)
|
76
|
+
i18n (0.8.4)
|
77
|
+
json (2.1.0)
|
78
78
|
loofah (2.0.3)
|
79
79
|
nokogiri (>= 1.5.9)
|
80
|
-
mail (2.6.
|
80
|
+
mail (2.6.6)
|
81
81
|
mime-types (>= 1.16, < 4)
|
82
82
|
method_source (0.8.2)
|
83
83
|
mime-types (3.1)
|
84
84
|
mime-types-data (~> 3.2015)
|
85
85
|
mime-types-data (3.2016.0521)
|
86
|
-
mini_portile2 (2.
|
87
|
-
minitest (5.10.
|
88
|
-
nio4r (2.
|
89
|
-
nokogiri (1.
|
90
|
-
mini_portile2 (~> 2.
|
86
|
+
mini_portile2 (2.2.0)
|
87
|
+
minitest (5.10.2)
|
88
|
+
nio4r (2.1.0)
|
89
|
+
nokogiri (1.8.0)
|
90
|
+
mini_portile2 (~> 2.2.0)
|
91
91
|
parser (2.4.0.0)
|
92
92
|
ast (~> 2.2)
|
93
93
|
powerpack (0.1.1)
|
@@ -97,7 +97,7 @@ GEM
|
|
97
97
|
slop (~> 3.4)
|
98
98
|
pry-rails (0.3.6)
|
99
99
|
pry (>= 0.10.4)
|
100
|
-
rack (2.0.
|
100
|
+
rack (2.0.3)
|
101
101
|
rack-test (0.6.3)
|
102
102
|
rack (>= 1.0)
|
103
103
|
rails (5.0.2)
|
@@ -112,9 +112,9 @@ GEM
|
|
112
112
|
bundler (>= 1.3.0, < 2.0)
|
113
113
|
railties (= 5.0.2)
|
114
114
|
sprockets-rails (>= 2.0.0)
|
115
|
-
rails-dom-testing (2.0.
|
116
|
-
activesupport (>= 4.2.0
|
117
|
-
nokogiri (
|
115
|
+
rails-dom-testing (2.0.3)
|
116
|
+
activesupport (>= 4.2.0)
|
117
|
+
nokogiri (>= 1.6)
|
118
118
|
rails-html-sanitizer (1.0.3)
|
119
119
|
loofah (~> 2.0)
|
120
120
|
railties (5.0.2)
|
@@ -123,7 +123,8 @@ GEM
|
|
123
123
|
method_source
|
124
124
|
rake (>= 0.8.7)
|
125
125
|
thor (>= 0.18.1, < 2.0)
|
126
|
-
rainbow (2.2.
|
126
|
+
rainbow (2.2.2)
|
127
|
+
rake
|
127
128
|
rake (12.0.0)
|
128
129
|
rspec (3.5.0)
|
129
130
|
rspec-core (~> 3.5.0)
|
@@ -159,7 +160,7 @@ GEM
|
|
159
160
|
docile (~> 1.1.0)
|
160
161
|
json (>= 1.8, < 3)
|
161
162
|
simplecov-html (~> 0.10.0)
|
162
|
-
simplecov-html (0.10.
|
163
|
+
simplecov-html (0.10.1)
|
163
164
|
slop (3.6.0)
|
164
165
|
sprockets (3.7.1)
|
165
166
|
concurrent-ruby (~> 1.0)
|
@@ -174,7 +175,7 @@ GEM
|
|
174
175
|
tqdm (0.3.0)
|
175
176
|
tzinfo (1.2.3)
|
176
177
|
thread_safe (~> 0.1)
|
177
|
-
unicode-display_width (1.1
|
178
|
+
unicode-display_width (1.2.1)
|
178
179
|
websocket-driver (0.6.5)
|
179
180
|
websocket-extensions (>= 0.1.0)
|
180
181
|
websocket-extensions (0.1.2)
|
@@ -206,4 +207,4 @@ RUBY VERSION
|
|
206
207
|
ruby 2.4.0p0
|
207
208
|
|
208
209
|
BUNDLED WITH
|
209
|
-
1.
|
210
|
+
1.15.1
|
data/dummy/app/models/project.rb
CHANGED
data/dummy/db/schema.rb
CHANGED
@@ -71,9 +71,9 @@ ActiveRecord::Schema.define(version: 20160818205534) do
|
|
71
71
|
|
72
72
|
create_table "projects", force: :cascade do |t|
|
73
73
|
t.string "name"
|
74
|
-
t.datetime "created_at",
|
75
|
-
t.datetime "updated_at",
|
76
|
-
t.integer "
|
74
|
+
t.datetime "created_at", null: false
|
75
|
+
t.datetime "updated_at", null: false
|
76
|
+
t.integer "parent_id"
|
77
77
|
end
|
78
78
|
|
79
79
|
create_table "resources", force: :cascade do |t|
|
@@ -105,11 +105,17 @@ module Monarchy
|
|
105
105
|
parentize = self.class.parentize_name
|
106
106
|
return unless parentize
|
107
107
|
|
108
|
-
|
108
|
+
keys = relation_keys(parentize)
|
109
|
+
was_changed = changes[keys[:foreign_key]] || changes[keys[:foreign_type]]
|
109
110
|
Monarchy::Validators.resource(send(parentize), true, false)
|
110
111
|
self.parent = send(parentize) if was_changed || force
|
111
112
|
end
|
112
113
|
|
114
|
+
def relation_keys(relation_name)
|
115
|
+
reflection = self.class.reflections[relation_name.to_s]
|
116
|
+
{ foreign_key: reflection.foreign_key, foreign_type: reflection.foreign_type }
|
117
|
+
end
|
118
|
+
|
113
119
|
def children_resources
|
114
120
|
c = hierarchy.try(:children)
|
115
121
|
return nil if c.nil?
|
data/lib/monarchy/version.rb
CHANGED
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.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Exelord
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|