zertico 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/zertico/controller.rb +6 -6
- data/lib/zertico/version.rb +1 -1
- data/spec/zertico/controller_spec.rb +3 -3
- metadata +3 -3
data/lib/zertico/controller.rb
CHANGED
@@ -33,8 +33,8 @@ module Zertico
|
|
33
33
|
|
34
34
|
def create
|
35
35
|
initialize_object generate(params[interface_name.to_sym])
|
36
|
-
if instance_variable_defined?('@
|
37
|
-
respond_with(instance_variable_get('@responder'), :
|
36
|
+
if instance_variable_defined?('@location')
|
37
|
+
respond_with(instance_variable_get('@responder'), :location => instance_variable_get('@location'))
|
38
38
|
else
|
39
39
|
respond_with(instance_variable_get('@responder'))
|
40
40
|
end
|
@@ -42,8 +42,8 @@ module Zertico
|
|
42
42
|
|
43
43
|
def update
|
44
44
|
initialize_object modify(params[:id], params[interface_name.to_sym])
|
45
|
-
if instance_variable_defined?('@
|
46
|
-
respond_with(instance_variable_get('@responder'), :
|
45
|
+
if instance_variable_defined?('@location')
|
46
|
+
respond_with(instance_variable_get('@responder'), :location => instance_variable_get('@location'))
|
47
47
|
else
|
48
48
|
respond_with(instance_variable_get('@responder'))
|
49
49
|
end
|
@@ -51,8 +51,8 @@ module Zertico
|
|
51
51
|
|
52
52
|
def destroy
|
53
53
|
initialize_object delete(params[:id])
|
54
|
-
if instance_variable_defined?('@
|
55
|
-
respond_with(instance_variable_get('@responder'), :
|
54
|
+
if instance_variable_defined?('@location')
|
55
|
+
respond_with(instance_variable_get('@responder'), :location => instance_variable_get('@location'))
|
56
56
|
else
|
57
57
|
respond_with(instance_variable_get('@responder'))
|
58
58
|
end
|
data/lib/zertico/version.rb
CHANGED
@@ -32,17 +32,17 @@ describe Zertico::Controller do
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
context 'with a custom
|
35
|
+
context 'with a custom location to redirect' do
|
36
36
|
before :each do
|
37
37
|
controller.stub_chain(:interface_name, :to_sym).and_return(:user)
|
38
38
|
controller.stub(:params).and_return({ :user => 'user' })
|
39
|
-
controller.stub(:generate => { :user => 'user', :
|
39
|
+
controller.stub(:generate => { :user => 'user', :location => 'admin_location' } )
|
40
40
|
controller.stub(:respond_with)
|
41
41
|
controller.create
|
42
42
|
end
|
43
43
|
|
44
44
|
it 'should intialize an object with it' do
|
45
|
-
controller.instance_variable_get('@
|
45
|
+
controller.instance_variable_get('@location').should == 'admin_location'
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
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.5.
|
4
|
+
version: 0.5.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -107,7 +107,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: '0'
|
108
108
|
segments:
|
109
109
|
- 0
|
110
|
-
hash:
|
110
|
+
hash: -1102590572231376672
|
111
111
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
112
|
none: false
|
113
113
|
requirements:
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
version: '0'
|
117
117
|
segments:
|
118
118
|
- 0
|
119
|
-
hash:
|
119
|
+
hash: -1102590572231376672
|
120
120
|
requirements: []
|
121
121
|
rubyforge_project:
|
122
122
|
rubygems_version: 1.8.25
|