zertico 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/zertico/controller.rb +4 -4
- data/lib/zertico/service.rb +5 -0
- data/lib/zertico/version.rb +1 -1
- data/spec/zertico/controller_spec.rb +13 -0
- metadata +4 -4
data/lib/zertico/controller.rb
CHANGED
@@ -22,12 +22,12 @@ module Zertico
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def show
|
25
|
-
initialize_object find(params[
|
25
|
+
initialize_object find(params[interface_id.to_sym])
|
26
26
|
respond_with(instance_variable_get('@responder'))
|
27
27
|
end
|
28
28
|
|
29
29
|
def edit
|
30
|
-
initialize_object find(params[
|
30
|
+
initialize_object find(params[interface_id.to_sym])
|
31
31
|
respond_with(instance_variable_get('@responder'))
|
32
32
|
end
|
33
33
|
|
@@ -41,7 +41,7 @@ module Zertico
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def update
|
44
|
-
initialize_object modify(params[
|
44
|
+
initialize_object modify(params[interface_id.to_sym], params[interface_name.to_sym])
|
45
45
|
if instance_variable_defined?('@location')
|
46
46
|
respond_with(instance_variable_get('@responder'), :location => instance_variable_get('@location'))
|
47
47
|
else
|
@@ -50,7 +50,7 @@ module Zertico
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def destroy
|
53
|
-
initialize_object delete(params[
|
53
|
+
initialize_object delete(params[interface_id.to_sym])
|
54
54
|
if instance_variable_defined?('@location')
|
55
55
|
respond_with(instance_variable_get('@responder'), :location => instance_variable_get('@location'))
|
56
56
|
else
|
data/lib/zertico/service.rb
CHANGED
data/lib/zertico/version.rb
CHANGED
@@ -3,6 +3,19 @@ require 'spec_helper'
|
|
3
3
|
describe Zertico::Controller do
|
4
4
|
let(:controller) { Zertico::Controller.new }
|
5
5
|
let(:user_controller) { UserController.new }
|
6
|
+
let(:admin_controller) { Admin::UserController.new }
|
7
|
+
|
8
|
+
context 'not being nested' do
|
9
|
+
it 'should find on the correct id' do
|
10
|
+
user_controller.send(:interface_id).should == 'id'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context 'being nested' do
|
15
|
+
it 'should find on the correct id' do
|
16
|
+
admin_controller.send(:interface_id).should == 'user_id'
|
17
|
+
end
|
18
|
+
end
|
6
19
|
|
7
20
|
context 'without a custom service' do
|
8
21
|
it 'should extend Zertico::Service' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zertico
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-09-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -113,7 +113,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: '0'
|
114
114
|
segments:
|
115
115
|
- 0
|
116
|
-
hash:
|
116
|
+
hash: 3377979383132618450
|
117
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
118
|
none: false
|
119
119
|
requirements:
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
version: '0'
|
123
123
|
segments:
|
124
124
|
- 0
|
125
|
-
hash:
|
125
|
+
hash: 3377979383132618450
|
126
126
|
requirements: []
|
127
127
|
rubyforge_project:
|
128
128
|
rubygems_version: 1.8.25
|