effective_resources 1.2.16 → 1.3.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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 62a13e49dcaa1728b9d2e692effb9317025f50ee43c94c4bdfba755a41b6f934
|
4
|
+
data.tar.gz: 12ae76b6b3036eeb8b4d96eb537db5de68549ca79d45430a98cde565454d58ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e34e82481d6186e20c200a24eb76db93b5c08e5f9bd2bc9a2c5910b22f30f543bdc1a742c009767e2adbe894dd5cc73b037500faa57408be0bf898e6890dd348
|
7
|
+
data.tar.gz: ee8fc48132ea61fa5d0b4a5851c35e35578dd1b35bdb739ed48d8c1a3a191737a116ec1a49157d3c5e59e34f80553ea59eaf16be7a8105f15a00cd7bf72c51dc
|
@@ -9,7 +9,7 @@ module Effective
|
|
9
9
|
matches = [[namespace, plural_name].compact.join('/'.freeze), [namespace, name].compact.join('/'.freeze)]
|
10
10
|
|
11
11
|
routes_engine.routes.routes.select do |route|
|
12
|
-
matches.any? { |match| match == route.defaults[:controller] }
|
12
|
+
matches.any? { |match| match == route.defaults[:controller] } && !route.name.to_s.end_with?('root')
|
13
13
|
end.inject({}) do |h, route|
|
14
14
|
h[route.defaults[:action].to_sym] = route; h
|
15
15
|
end
|
@@ -9,19 +9,6 @@ module EffectiveResources
|
|
9
9
|
eval File.read("#{config.root}/config/effective_resources.rb")
|
10
10
|
end
|
11
11
|
|
12
|
-
# Register the acts_as_archived routes concern
|
13
|
-
# resources :things, concerns: :acts_as_archived
|
14
|
-
initializer 'effective_resources.routes_concern' do |app|
|
15
|
-
ActionDispatch::Routing::Mapper.include(ActsAsArchived::RoutesConcern)
|
16
|
-
end
|
17
|
-
|
18
|
-
# Register the flash_messages concern so that it can be called in ActionController
|
19
|
-
initializer 'effective_resources.action_controller' do |app|
|
20
|
-
ActiveSupport.on_load :action_controller do
|
21
|
-
include(Effective::FlashMessages)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
12
|
# Include acts_as_addressable concern and allow any ActiveRecord object to call it
|
26
13
|
initializer 'effective_resources.active_record' do |app|
|
27
14
|
ActiveSupport.on_load :active_record do
|
@@ -34,17 +21,36 @@ module EffectiveResources
|
|
34
21
|
end
|
35
22
|
|
36
23
|
initializer 'effective_resources.cancancan' do |app|
|
37
|
-
|
38
|
-
CanCan::Ability
|
39
|
-
|
24
|
+
ActiveSupport.on_load :active_record do
|
25
|
+
if defined?(CanCan::Ability)
|
26
|
+
CanCan::Ability.module_eval do
|
27
|
+
CRUD_ACTIONS = [:index, :new, :create, :edit, :update, :show, :destroy]
|
40
28
|
|
41
|
-
|
42
|
-
|
29
|
+
def crud
|
30
|
+
CRUD_ACTIONS
|
31
|
+
end
|
43
32
|
end
|
33
|
+
|
34
|
+
CanCan::Ability.include(ActsAsArchived::CanCan)
|
35
|
+
CanCan::Ability.include(ActsAsStatused::CanCan)
|
44
36
|
end
|
37
|
+
end
|
38
|
+
end
|
45
39
|
|
46
|
-
|
47
|
-
|
40
|
+
# Register the acts_as_archived routes concern
|
41
|
+
# resources :things, concerns: :acts_as_archived
|
42
|
+
initializer 'effective_resources.routes_concern' do |app|
|
43
|
+
ActionDispatch::Routing::Mapper.include(ActsAsArchived::RoutesConcern)
|
44
|
+
|
45
|
+
# ActiveSupport.on_load :active_record do
|
46
|
+
# ActionDispatch::Routing::Mapper.include(ActsAsArchived::RoutesConcern)
|
47
|
+
# end
|
48
|
+
end
|
49
|
+
|
50
|
+
# Register the flash_messages concern so that it can be called in ActionController
|
51
|
+
initializer 'effective_resources.action_controller' do |app|
|
52
|
+
ActiveSupport.on_load :action_controller do
|
53
|
+
include(Effective::FlashMessages)
|
48
54
|
end
|
49
55
|
end
|
50
56
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -110,8 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
112
|
requirements: []
|
113
|
-
|
114
|
-
rubygems_version: 2.4.5.1
|
113
|
+
rubygems_version: 3.0.3
|
115
114
|
signing_key:
|
116
115
|
specification_version: 4
|
117
116
|
summary: Make any controller an effective resource controller.
|