inherited_resources_helpers 0.0.8 → 0.0.9

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.
@@ -30,7 +30,9 @@ module InheritedResources
30
30
  target ||= config[:parent_class] || resource_class
31
31
  param = config[:param] || :id
32
32
 
33
- if target.is_a?(Symbol)
33
+ if name == resources_configuration[:self][:instance_name]
34
+ define_method(name) { resource }
35
+ elsif target.is_a?(Symbol)
34
36
  define_method(name) { send(target).send(config[:collection_name], params[param]).first }
35
37
  else
36
38
  define_method(name) { target.send(config[:finder] || :find, params[param]) }
@@ -1,3 +1,3 @@
1
1
  module InheritedResourcesHelpers
2
- VERSION = '0.0.8'
2
+ VERSION = '0.0.9'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inherited_resources_helpers
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- version: 0.0.8
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sven Fuchs
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-22 00:00:00 +02:00
18
+ date: 2010-09-29 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21