zobi 5.0.0.beta1 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -6
- data/lib/zobi/controlled_access.rb +2 -2
- data/lib/zobi/inherited.rb +6 -0
- data/lib/zobi/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afa5fdd8bb51842c65dc780881ebbc5ec18a5866
|
4
|
+
data.tar.gz: b75172c5c7fb1060fe6ed7e3ef39d7b06589c418
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5acca2f474c5132ac6e5593b43cb450af0246b0cf7ca41d5d10b5ac6e7842ba6cdfc5908408486eb6da6519bff5ee824b6c2f97a736a71def99c471b8cc24bc
|
7
|
+
data.tar.gz: f201cf4662029e4e7a794b8e4e9c3b73b163c5ac742da3a1293353e6bd361cf88d4895ab6a4c735d58edec8ad19224263bc40fc004840c67e36f9ebf4180b60f
|
data/README.md
CHANGED
@@ -16,7 +16,8 @@ How to use it?
|
|
16
16
|
Add it in your `Gemfile` and run `bundle install`:
|
17
17
|
|
18
18
|
```ruby
|
19
|
-
gem 'zobi', '~> 4.0.2'
|
19
|
+
gem 'zobi', '~> 4.0.2' # Rails 4
|
20
|
+
gem 'zobi', '~> 5.0.0.rc1' # Rails 5
|
20
21
|
```
|
21
22
|
|
22
23
|
Next, include Zobi module in your controller and set modules you want to
|
@@ -37,14 +38,14 @@ This module historically use
|
|
37
38
|
|
38
39
|
Now it only defines create/update/destroy methods to easily build CRUD backend.
|
39
40
|
|
40
|
-
If your controller is namespaced, you should define the `
|
41
|
-
override its generic behavior.
|
41
|
+
If your controller is namespaced, you should define the `zobi_resource_name`
|
42
|
+
method to override its generic behavior.
|
42
43
|
|
43
|
-
If your model is namespaced, you should define the
|
44
|
+
If your model is namespaced, you should define the zobi_resource_class:
|
44
45
|
|
45
46
|
```
|
46
|
-
def
|
47
|
-
::User::Address`
|
47
|
+
def zobi_resource_class
|
48
|
+
::User::Address`
|
48
49
|
end
|
49
50
|
```
|
50
51
|
|
@@ -65,12 +65,12 @@ module Zobi
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def controlled_access_build_resource
|
68
|
-
return build_resource if
|
68
|
+
return build_resource if self.methods.include?(:build_resource)
|
69
69
|
zobi_resource_class.new params[zobi_resource_class.to_s.to_sym]
|
70
70
|
end
|
71
71
|
|
72
72
|
def controlled_access_resource
|
73
|
-
return resource if
|
73
|
+
return resource if self.methods.include?(:resource)
|
74
74
|
zobi_resource_class.find(params[:id])
|
75
75
|
end
|
76
76
|
end
|
data/lib/zobi/inherited.rb
CHANGED
data/lib/zobi/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zobi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.0
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- klacointe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '5.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '5.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec-rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -243,12 +243,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
243
243
|
version: '0'
|
244
244
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
245
245
|
requirements:
|
246
|
-
- - "
|
246
|
+
- - ">="
|
247
247
|
- !ruby/object:Gem::Version
|
248
|
-
version:
|
248
|
+
version: '0'
|
249
249
|
requirements: []
|
250
250
|
rubyforge_project:
|
251
|
-
rubygems_version: 2.
|
251
|
+
rubygems_version: 2.6.11
|
252
252
|
signing_key:
|
253
253
|
specification_version: 4
|
254
254
|
summary: Keep your rails controllers DRY.
|