rhino_project_core 0.21.0.beta.45 → 0.21.0.beta.47
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
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06a96de885bbf31a18ef367c6139c3cb78a25f37102a6d980b65fd170c9bc8a2
|
4
|
+
data.tar.gz: ec3d9a80aba2a6fdc53692299640d07968c1d157b3ad4b15ea54ccab00431032
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63b1fa716e6bf30d664d18376b73885cdaf1505752f7b9cc68854a2d1e4a08b997b1e3c5e3b2684aac108c957e566a8e82e70be46dbf2e49c6219023044785c5
|
7
|
+
data.tar.gz: 9bdbb9d79a108d6920a2c3e5a0ac53fedb11bb7d006b910ca4a26893d6d7cdc713ec2d26f55c5e3c6410d4a07f00c7264b1923aa7f757ab3d653c62b994133eb
|
@@ -23,14 +23,16 @@ module Rhino
|
|
23
23
|
|
24
24
|
rescue_from ActiveRecord::RecordNotFound, with: :not_found
|
25
25
|
|
26
|
-
def handle_uncaught_error(
|
26
|
+
def handle_uncaught_error(e)
|
27
|
+
raise e if Rails.env.test?
|
28
|
+
|
27
29
|
# Send to rollbar if available
|
28
|
-
Rollbar.error(
|
30
|
+
Rollbar.error(e) if defined? Rollbar
|
29
31
|
|
30
|
-
logger.error
|
32
|
+
logger.error "There was an exception - #{e.class}(#{e.message})"
|
33
|
+
logger.error e.backtrace.join("\n")
|
31
34
|
|
32
|
-
render json: { errors: ['Internal server error.'] },
|
33
|
-
status: :internal_server_error
|
35
|
+
render json: { errors: ['Internal server error.'] }, status: :internal_server_error
|
34
36
|
end
|
35
37
|
|
36
38
|
def not_found
|
@@ -24,6 +24,7 @@ module Rhino
|
|
24
24
|
include Rhino::Resource::ActiveRecordExtension::Reference
|
25
25
|
include Rhino::Resource::ActiveRecordExtension::Describe
|
26
26
|
include Rhino::Resource::ActiveRecordExtension::Routing
|
27
|
+
include Rhino::Resource::ActiveRecordExtension::Owner
|
27
28
|
include Rhino::Resource::ActiveRecordExtension::Params
|
28
29
|
include Rhino::Resource::ActiveRecordExtension::Serialization
|
29
30
|
include Rhino::Resource::ActiveRecordExtension::Search
|
data/lib/rhino/resource/owner.rb
CHANGED
data/lib/rhino/resource.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
4
|
-
require_relative
|
5
|
-
require_relative
|
6
|
-
require_relative
|
7
|
-
require_relative
|
8
|
-
require_relative
|
9
|
-
require_relative
|
10
|
-
require_relative
|
3
|
+
require_relative "resource/owner"
|
4
|
+
require_relative "resource/properties"
|
5
|
+
require_relative "resource/reference"
|
6
|
+
require_relative "resource/describe"
|
7
|
+
require_relative "resource/routing"
|
8
|
+
require_relative "resource/params"
|
9
|
+
require_relative "resource/serialization"
|
10
|
+
require_relative "resource/sieves"
|
11
11
|
|
12
|
-
require_relative
|
12
|
+
require_relative "../../app/policies/rhino/crud_policy"
|
13
13
|
|
14
14
|
module Rhino
|
15
15
|
module Resource
|
@@ -25,7 +25,7 @@ module Rhino
|
|
25
25
|
include Rhino::Resource::Sieves
|
26
26
|
|
27
27
|
included do
|
28
|
-
class_attribute :_policy_class
|
28
|
+
class_attribute :_policy_class
|
29
29
|
|
30
30
|
def owner
|
31
31
|
send self.class.resource_owned_by
|
@@ -41,7 +41,11 @@ module Rhino
|
|
41
41
|
|
42
42
|
class_methods do
|
43
43
|
def policy_class
|
44
|
-
_policy_class
|
44
|
+
self._policy_class ||= begin
|
45
|
+
return Rhino::GlobalPolicy if global_owned?
|
46
|
+
|
47
|
+
Rhino::CrudPolicy
|
48
|
+
end
|
45
49
|
end
|
46
50
|
|
47
51
|
def rhino_policy(policy)
|
data/lib/rhino/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rhino_project_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.21.0.beta.
|
4
|
+
version: 0.21.0.beta.47
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Rosevear
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|