logical_model 0.2.14 → 0.2.15

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.14
1
+ 0.2.15
@@ -260,9 +260,9 @@ class LogicalModel
260
260
  end
261
261
  end
262
262
 
263
- def self.delete(id, params={})
263
+ def destroy(params={})
264
264
  run_callbacks :destroy do
265
- _delete(id, params)
265
+ _destroy(params)
266
266
  end
267
267
  end
268
268
 
@@ -545,7 +545,7 @@ class LogicalModel
545
545
  #
546
546
  # Usage:
547
547
  # Person.delete(params[:id])
548
- def self._delete(id, params={})
548
+ def self.delete(id, params={})
549
549
 
550
550
  params = self.merge_key(params)
551
551
 
@@ -572,7 +572,7 @@ class LogicalModel
572
572
  #
573
573
  # Usage:
574
574
  # @person.destroy
575
- def destroy(params={})
575
+ def _destroy(params={})
576
576
  self.class.delete(self.id,params)
577
577
  end
578
578
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "logical_model"
8
- s.version = "0.2.14"
8
+ s.version = "0.2.15"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dwayne Macgowan"]
@@ -179,6 +179,24 @@ describe "LogicalModel User client" do
179
179
  expect{u.update(id: 1)}.to raise_error('before_save_called')
180
180
  end
181
181
  end
182
+ describe "before_destroy" do
183
+ before do
184
+ class User < LogicalModel
185
+ before_destroy :raise_message
186
+
187
+ def raise_message
188
+ raise 'before_destroy_called'
189
+ end
190
+ end
191
+ end
192
+ it "should not be called on User.delete" do
193
+ expect{User.delete(1)}.not_to raise_error('before_destroy_called')
194
+ end
195
+ it "should be called on #destroy" do
196
+ u = User.new
197
+ expect{u.destroy}.to raise_error('before_destroy_called')
198
+ end
199
+ end
182
200
  end
183
201
 
184
202
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logical_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.14
4
+ version: 0.2.15
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-26 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
16
- requirement: &80561480 !ruby/object:Gem::Requirement
16
+ requirement: &74451060 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *80561480
24
+ version_requirements: *74451060
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activesupport
27
- requirement: &80560810 !ruby/object:Gem::Requirement
27
+ requirement: &74450420 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *80560810
35
+ version_requirements: *74450420
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: typhoeus
38
- requirement: &80560160 !ruby/object:Gem::Requirement
38
+ requirement: &74449870 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.2.4
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *80560160
46
+ version_requirements: *74449870
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: kaminari
49
- requirement: &80559670 !ruby/object:Gem::Requirement
49
+ requirement: &74449280 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.13.0
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *80559670
57
+ version_requirements: *74449280
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: activerecord
60
- requirement: &80559210 !ruby/object:Gem::Requirement
60
+ requirement: &74448640 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *80559210
68
+ version_requirements: *74448640
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: shoulda
71
- requirement: &80558570 !ruby/object:Gem::Requirement
71
+ requirement: &74448040 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *80558570
79
+ version_requirements: *74448040
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: bundler
82
- requirement: &80557790 !ruby/object:Gem::Requirement
82
+ requirement: &74447280 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 1.0.10
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *80557790
90
+ version_requirements: *74447280
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: jeweler
93
- requirement: &80557150 !ruby/object:Gem::Requirement
93
+ requirement: &74446520 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 1.6.4
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *80557150
101
+ version_requirements: *74446520
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: rcov
104
- requirement: &80556600 !ruby/object:Gem::Requirement
104
+ requirement: &74445870 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *80556600
112
+ version_requirements: *74445870
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: sqlite3-ruby
115
- requirement: &80556090 !ruby/object:Gem::Requirement
115
+ requirement: &74445300 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *80556090
123
+ version_requirements: *74445300
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: sinatra
126
- requirement: &80555250 !ruby/object:Gem::Requirement
126
+ requirement: &74414950 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ~>
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: 1.2.6
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *80555250
134
+ version_requirements: *74414950
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: json
137
- requirement: &80494210 !ruby/object:Gem::Requirement
137
+ requirement: &74413470 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ! '>='
@@ -142,10 +142,10 @@ dependencies:
142
142
  version: '0'
143
143
  type: :development
144
144
  prerelease: false
145
- version_requirements: *80494210
145
+ version_requirements: *74413470
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: rspec-rails
148
- requirement: &80493490 !ruby/object:Gem::Requirement
148
+ requirement: &74412580 !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements:
151
151
  - - ! '>='
@@ -153,10 +153,10 @@ dependencies:
153
153
  version: '0'
154
154
  type: :development
155
155
  prerelease: false
156
- version_requirements: *80493490
156
+ version_requirements: *74412580
157
157
  - !ruby/object:Gem::Dependency
158
158
  name: guard-rspec
159
- requirement: &80491780 !ruby/object:Gem::Requirement
159
+ requirement: &74412060 !ruby/object:Gem::Requirement
160
160
  none: false
161
161
  requirements:
162
162
  - - ! '>='
@@ -164,10 +164,10 @@ dependencies:
164
164
  version: '0'
165
165
  type: :development
166
166
  prerelease: false
167
- version_requirements: *80491780
167
+ version_requirements: *74412060
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: rb-inotify
170
- requirement: &80491160 !ruby/object:Gem::Requirement
170
+ requirement: &74411420 !ruby/object:Gem::Requirement
171
171
  none: false
172
172
  requirements:
173
173
  - - ! '>='
@@ -175,10 +175,10 @@ dependencies:
175
175
  version: '0'
176
176
  type: :development
177
177
  prerelease: false
178
- version_requirements: *80491160
178
+ version_requirements: *74411420
179
179
  - !ruby/object:Gem::Dependency
180
180
  name: libnotify
181
- requirement: &80490650 !ruby/object:Gem::Requirement
181
+ requirement: &74410840 !ruby/object:Gem::Requirement
182
182
  none: false
183
183
  requirements:
184
184
  - - ! '>='
@@ -186,7 +186,7 @@ dependencies:
186
186
  version: '0'
187
187
  type: :development
188
188
  prerelease: false
189
- version_requirements: *80490650
189
+ version_requirements: *74410840
190
190
  description: LogicalModel allows to use a resource as a model. It is based on web
191
191
  presentation http://www.slideshare.net/ihower/serviceoriented-design-and-implement-with-rails3
192
192
  email: dwaynemac@gmail.com
@@ -234,7 +234,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
234
234
  version: '0'
235
235
  segments:
236
236
  - 0
237
- hash: -518643309
237
+ hash: -931436209
238
238
  required_rubygems_version: !ruby/object:Gem::Requirement
239
239
  none: false
240
240
  requirements: