snorlax 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/README.md +1 -1
- data/app/controllers/snorlax/base.rb +9 -3
- data/lib/snorlax/version.rb +1 -1
- data/snorlax.gemspec +0 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2275e30723ffb0f1d7e9892ec4398cd0715e90f0
|
4
|
+
data.tar.gz: 05b2977a32bb2c0102fb6bad962c66692523607a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60299279a6e0e7e7d48e0307d4c5b3571bda085df43f3569ae28e94565e415b697313022e175e2ac34b690f82f071e9dbc6ef5456ad65ff5bed149ca3854ae06
|
7
|
+
data.tar.gz: 95366fa304596bbdb4e3d99d06dc2bb6685dd0ae5e5703eacadadde54a7078b06a876d2b5e1150cda58dc9418ce8e32c4422da53f50edbd16af5b01b2ba97360
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -146,7 +146,7 @@ If you want to disallow timeframing and/or pagination for a particular action, s
|
|
146
146
|
```
|
147
147
|
class SquirtlesController < Snorlax::Base
|
148
148
|
def all_squirtles
|
149
|
-
instantiate_collection
|
149
|
+
instantiate_collection page_collection: false, timeframe_collection: false
|
150
150
|
respond_with_collection
|
151
151
|
end
|
152
152
|
end
|
@@ -3,7 +3,13 @@ module Snorlax
|
|
3
3
|
|
4
4
|
def self.snorlax_used_rest!(controller)
|
5
5
|
controller.class_eval do
|
6
|
-
|
6
|
+
if defined? CanCan::AccessDenied
|
7
|
+
rescue_from(CanCan::AccessDenied) { |e| respond_with_standard_error e, 403 }
|
8
|
+
end
|
9
|
+
if defined? Pundit::NotAuthorizedError
|
10
|
+
rescue_from(Pundit::NotAuthorizedError) { |e| respond_with_standard_error e, 403 }
|
11
|
+
end
|
12
|
+
|
7
13
|
rescue_from(ActionController::UnpermittedParameters) { |e| respond_with_standard_error e, 400 }
|
8
14
|
rescue_from(ActionController::ParameterMissing) { |e| respond_with_standard_error e, 400 }
|
9
15
|
rescue_from(ActiveRecord::RecordNotFound) { |e| respond_with_standard_error e, 404 }
|
@@ -18,7 +24,7 @@ module Snorlax
|
|
18
24
|
end
|
19
25
|
|
20
26
|
def create
|
21
|
-
|
27
|
+
instantiate_resource
|
22
28
|
create_action
|
23
29
|
respond_with_resource
|
24
30
|
end
|
@@ -65,7 +71,7 @@ module Snorlax
|
|
65
71
|
instance_variable_set :"@#{resource_name.pluralize}", value
|
66
72
|
end
|
67
73
|
|
68
|
-
def
|
74
|
+
def instantiate_resource
|
69
75
|
self.resource = resource_class.new(resource_params)
|
70
76
|
end
|
71
77
|
|
data/lib/snorlax/version.rb
CHANGED
data/snorlax.gemspec
CHANGED
@@ -19,7 +19,6 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_runtime_dependency "rails", "> 4.1"
|
22
|
-
spec.add_runtime_dependency "cancancan", "~> 1.10.1"
|
23
22
|
|
24
23
|
spec.add_development_dependency "bundler", "~> 1.10"
|
25
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snorlax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Kiesel (gdpelican)
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ">"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4.1'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: cancancan
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.10.1
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 1.10.1
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: bundler
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|