zertico 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,13 +17,13 @@ module Zertico
17
17
  end
18
18
 
19
19
  def modify(id, attributes = {})
20
- object = self.find(id)
20
+ object = self.find(id)[interface_name.to_sym]
21
21
  object.update_attributes(attributes)
22
22
  { interface_name.to_sym => object }
23
23
  end
24
24
 
25
25
  def delete(id)
26
- object = self.find(id)
26
+ object = self.find(id)[interface_name.to_sym]
27
27
  object.destroy
28
28
  { interface_name.to_sym => object }
29
29
  end
@@ -31,7 +31,7 @@ module Zertico
31
31
  protected
32
32
 
33
33
  def interface_name
34
- self.name.chomp("Service").underscore
34
+ self.class.name.chomp("Controller").singularize.underscore
35
35
  end
36
36
 
37
37
  def interface_class
@@ -1,3 +1,3 @@
1
1
  module Zertico
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Zertico::Service do
4
- let(:controller) { Zertico::Controller.new }
4
+ let(:controller) { UserController.new }
5
5
  let(:object) { Object.new }
6
6
 
7
7
  context "#all" do
@@ -50,7 +50,7 @@ describe Zertico::Service do
50
50
 
51
51
  context "#modify" do
52
52
  before :each do
53
- controller.stub(:find).with(1).and_return(object)
53
+ controller.stub(:find).with(1).and_return({ :user => object })
54
54
  object.stub(:update_attributes).with({}).and_return(true)
55
55
  controller.stub_chain(:interface_name, :to_sym).and_return(:user)
56
56
  end
@@ -62,7 +62,7 @@ describe Zertico::Service do
62
62
 
63
63
  context "#delete" do
64
64
  before :each do
65
- controller.stub(:find).with(1).and_return(object)
65
+ controller.stub(:find).with(1).and_return({ :user => object })
66
66
  object.stub(:destroy).and_return(true)
67
67
  controller.stub_chain(:interface_name, :to_sym).and_return(:user)
68
68
  end
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.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -83,7 +83,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
83
83
  version: '0'
84
84
  segments:
85
85
  - 0
86
- hash: 910322381840300254
86
+ hash: -1575959469960937020
87
87
  required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  none: false
89
89
  requirements:
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  version: '0'
93
93
  segments:
94
94
  - 0
95
- hash: 910322381840300254
95
+ hash: -1575959469960937020
96
96
  requirements: []
97
97
  rubyforge_project:
98
98
  rubygems_version: 1.8.25