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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e7041240f181625bb66d7c362635be76947693f8
4
- data.tar.gz: 3cde43da32739b1140bbc15c554e6e3e25798d02
3
+ metadata.gz: afa5fdd8bb51842c65dc780881ebbc5ec18a5866
4
+ data.tar.gz: b75172c5c7fb1060fe6ed7e3ef39d7b06589c418
5
5
  SHA512:
6
- metadata.gz: 5bedfd22dd1f6542f7e6a8ada8fb2913c741401178c64f5c79ed75707d53a1f105b0ddf9b032b7c714c53db400074cab740bb761673419c333f46c7c8b054beb
7
- data.tar.gz: ad2c3746ba5295d0deb6e64bf2dbcb3957226091a1dc1cc62119a519d9f0d0720cc0d812d4e7726bf137ca7b34d122b117dacd2aaa493027a5c606f85909a9ee
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 `resource_type` method to
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 defaults resource_class:
44
+ If your model is namespaced, you should define the zobi_resource_class:
44
45
 
45
46
  ```
46
- def resource_class
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 respond_to?(:build_resource)
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 respond_to?(:resource)
73
+ return resource if self.methods.include?(:resource)
74
74
  zobi_resource_class.find(params[:id])
75
75
  end
76
76
  end
@@ -12,6 +12,12 @@ module Zobi
12
12
  klass.send 'respond_to', :html
13
13
  end
14
14
 
15
+ def new
16
+ end
17
+
18
+ def edit
19
+ end
20
+
15
21
  def create
16
22
  r = zobi_resource_class.create permitted_params[zobi_resource_key]
17
23
  instance_variable_set "@#{resource_key}", r
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Zobi
3
- VERSION = "5.0.0.beta1"
3
+ VERSION = "5.0.0"
4
4
  end
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.beta1
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: 2016-04-20 00:00:00.000000000 Z
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: '4.0'
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: '4.0'
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: 1.3.1
248
+ version: '0'
249
249
  requirements: []
250
250
  rubyforge_project:
251
- rubygems_version: 2.5.1
251
+ rubygems_version: 2.6.11
252
252
  signing_key:
253
253
  specification_version: 4
254
254
  summary: Keep your rails controllers DRY.