destroyed_at 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/destroyed_at/mapper.rb +3 -1
- data/lib/destroyed_at/version.rb +1 -1
- data/test/mapper_test.rb +15 -0
- 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: dcb907905ded6d91d8608d0946fd0e47dc6e40a5
|
4
|
+
data.tar.gz: 2ee4044301299b5e5b503b1419b28646713a7f37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7febe07d4630e309263f8cb3575d898e9c4d22239a36d6befe37d02065d8bf8f7fd32b748fe1f536dd65c8f5fdc3821efb22836113a0f33ca5571604f6688f44
|
7
|
+
data.tar.gz: 4ff52345686b2a891b04556d22f8b77ff1a0e556f098c22b48de85cd00260b25e7dfd9d2f339a5ed20a82848dbb86ef3bb82fcd5500b97e279bededd3ee59aed
|
data/CHANGELOG.md
CHANGED
data/lib/destroyed_at/mapper.rb
CHANGED
@@ -14,7 +14,9 @@ ActionDispatch::Routing::Mapper.send(:prepend, DestroyedAt::Routes)
|
|
14
14
|
module DestroyedAt::Resource
|
15
15
|
def default_actions
|
16
16
|
actions = super
|
17
|
-
|
17
|
+
class_name = self.name.camelcase.singularize
|
18
|
+
|
19
|
+
if Module.const_defined?(class_name) && class_name.constantize.included_modules.include?(DestroyedAt)
|
18
20
|
actions << :restore
|
19
21
|
end
|
20
22
|
|
data/lib/destroyed_at/version.rb
CHANGED
data/test/mapper_test.rb
CHANGED
@@ -3,6 +3,8 @@ require 'action_dispatch'
|
|
3
3
|
require 'action_dispatch/routing/route_set'
|
4
4
|
require 'action_controller'
|
5
5
|
|
6
|
+
class CarsController < ActionController::Base; end
|
7
|
+
class AuthorsController < ActionController::Base; end
|
6
8
|
class CommentsController < ActionController::Base; end
|
7
9
|
|
8
10
|
class MapperTest < ActiveSupport::TestCase
|
@@ -56,6 +58,19 @@ class MapperTest < ActiveSupport::TestCase
|
|
56
58
|
end
|
57
59
|
end
|
58
60
|
|
61
|
+
test 'does not raise if contstant does not exist for resource' do
|
62
|
+
draw do
|
63
|
+
resources :cars
|
64
|
+
end
|
65
|
+
|
66
|
+
begin
|
67
|
+
@set.recognize_path('/cars', method: 'get')
|
68
|
+
assert true, 'path recognized'
|
69
|
+
rescue ActionController::RoutingError
|
70
|
+
assert false, 'this should not be reached'
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
59
74
|
private
|
60
75
|
|
61
76
|
def draw(&block)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: destroyed_at
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Dupuis Jr.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|