crudable-rails 1.0.0 → 1.1.1

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: c3bce80de66d640b96222a505af0357771fe9657d14ae853649bbdf7c78778bc
4
- data.tar.gz: 435d8c280e42996182578d23065d2905ca39aa6608e324b410eac295933a33aa
3
+ metadata.gz: 4e8935bb8ca55fa4e8ea8d05dd03f2d00cf76f7a841eee278ccda7056a2313a0
4
+ data.tar.gz: a5d77487ae883137104dfbf3c106aab943f680b3155eac5e0465aa3ab92a996a
5
5
  SHA512:
6
- metadata.gz: be090adbbbf6dce74144fa5c5ee435fb17f85dc674505ab4244101db8bbdb35cb634a8da2e662f76e83dca14d0b411effbcad0dafa263ca98c1c044e0f1e84f6
7
- data.tar.gz: 1175cca36ec335d808dbe2f7740efd2e9c6043b58b7cf45a7fbe753f0e315b7873a44fbf9ee56256766157468a4b92855a48c44ce8f1c7001bf66959efe3b104
6
+ metadata.gz: 16e2a3e25a99a4b438ffffa733720cefc83b0b4753caee45eba76ff2d1006b79adcd35eba42801d43c3e8103d3c5cab6b76ae11ee8fd54af50938ec6cd9ba871
7
+ data.tar.gz: 9a91c72be66032f5e837ececca16e4ccf463466cad8ed368ea028b5ba22508c3bb8991d9001ad1dfc03ba6d85b3f320212c491da92bd91973b70dce584e45dfa
@@ -104,7 +104,7 @@ module Crudable
104
104
  end
105
105
 
106
106
  def authorizable_scope
107
- defined?(Pundit) ? policy_scope(resource_class) : resource_class.all
107
+ defined?(Pundit) ? policy_scope(resource_namespace + [resource_class]) : resource_class.all
108
108
  end
109
109
 
110
110
  def paginate_resource?
@@ -35,7 +35,7 @@ module Crudable
35
35
  end
36
36
 
37
37
  def authorize_resource(method = action_name)
38
- authorize authorizable_resource, "#{method}?".to_sym
38
+ authorize resource_namespace + [authorizable_resource], "#{method}?".to_sym
39
39
  end
40
40
 
41
41
  def authorizable_resource
@@ -62,7 +62,7 @@ module Crudable
62
62
  def resource_namespace
63
63
  namespaces = name.split('::')
64
64
  namespaces.pop
65
- namespaces.map { |n| n.downcase.to_sym }
65
+ namespaces.map { |n| n.underscore.to_sym }
66
66
  end
67
67
  end
68
68
  end
@@ -3,6 +3,6 @@
3
3
  # Crudable Version
4
4
  module Crudable
5
5
  module Rails
6
- VERSION = '1.0.0'
6
+ VERSION = '1.1.1'
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crudable-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomislav Simnett
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-14 00:00:00.000000000 Z
11
+ date: 2024-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -61,7 +61,7 @@ homepage: https://gitlab.com/initforthe/crudable-rails
61
61
  licenses:
62
62
  - MIT
63
63
  metadata: {}
64
- post_install_message:
64
+ post_install_message:
65
65
  rdoc_options: []
66
66
  require_paths:
67
67
  - lib
@@ -76,8 +76,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  requirements: []
79
- rubygems_version: 3.3.26
80
- signing_key:
79
+ rubygems_version: 3.5.9
80
+ signing_key:
81
81
  specification_version: 4
82
82
  summary: CRUD operations for Rails controllers
83
83
  test_files: []