simple_resource 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ 0.6.1 (January 26, 2013)
4
+
5
+ * Fix resource_form_path helper when using namespaces
6
+
3
7
  0.6.0 (January 17, 2013)
4
8
 
5
9
  * Moved before_filter :authenticate_user! to BaseController
@@ -108,21 +108,11 @@ module SimpleResource
108
108
  table_classes.join(" ").strip
109
109
  end
110
110
 
111
- def controller_namespaces
112
- namespaces = controller_path.split("/")
113
- namespaces.pop
114
- namespaces
115
- end
116
-
117
111
  def resource_form_path
118
- if controller_namespaces.empty?
119
- if !resource.new_record?
120
- resource_path
121
- else
122
- collection_path
123
- end
112
+ if resource.new_record?
113
+ collection_path
124
114
  else
125
- controller_namespaces | [resource]
115
+ resource_path
126
116
  end
127
117
  end
128
118
 
@@ -1,3 +1,3 @@
1
1
  module SimpleResource
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -231,26 +231,6 @@ describe SimpleResource::BaseHelper do
231
231
  end
232
232
  end
233
233
 
234
- describe "#controller_namespaces" do
235
- context "when no namespaces exist" do
236
- it "returns an empty array" do
237
- helper.controller_namespaces.should be_empty
238
- end
239
- end
240
-
241
- context "when namespace exists" do
242
- before :each do
243
- @controller = Backend::LanguagesController.new
244
- @controller.request = ActionDispatch::TestRequest.new
245
- @controller.instance_variable_set("@language", language)
246
- end
247
-
248
- it "returns namespace in array" do
249
- helper.controller_namespaces.should == ["backend"]
250
- end
251
- end
252
- end
253
-
254
234
  describe "#resource_form_path" do
255
235
  describe "new action" do
256
236
  before :each do
@@ -276,7 +256,7 @@ describe SimpleResource::BaseHelper do
276
256
  end
277
257
 
278
258
  it "returns path with namespace" do
279
- helper.resource_form_path.should == ["backend", @language]
259
+ helper.resource_form_path.should eq("/backend/languages")
280
260
  end
281
261
  end
282
262
  end
@@ -304,7 +284,7 @@ describe SimpleResource::BaseHelper do
304
284
  end
305
285
 
306
286
  it "returns path with namespace" do
307
- helper.resource_form_path.should == ["backend", language]
287
+ helper.resource_form_path.should eq("/backend/languages/#{language.id}")
308
288
  end
309
289
  end
310
290
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
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-01-17 00:00:00.000000000 Z
12
+ date: 2013-01-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -318,7 +318,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
318
318
  version: '0'
319
319
  segments:
320
320
  - 0
321
- hash: -4426232147146396932
321
+ hash: 1104561883811713693
322
322
  required_rubygems_version: !ruby/object:Gem::Requirement
323
323
  none: false
324
324
  requirements:
@@ -327,10 +327,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
327
327
  version: '0'
328
328
  segments:
329
329
  - 0
330
- hash: -4426232147146396932
330
+ hash: 1104561883811713693
331
331
  requirements: []
332
332
  rubyforge_project:
333
- rubygems_version: 1.8.24
333
+ rubygems_version: 1.8.25
334
334
  signing_key:
335
335
  specification_version: 3
336
336
  summary: Simplified resource handling for Rails.