kelredd-resourceful 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,6 +20,11 @@ module Resourceful
20
20
  unless klass.to_s.constantize.respond_to?(:find)
21
21
  raise NotImplementedError, "has_many expects #{klass} to be findable (ie mixin the Findable helper)"
22
22
  end
23
+ fk = config.delete(:foreign_key) || "#{self.class.name.downcase.to_s.gsub(/^.*::/, '')}_id"
24
+ unless config[fk]
25
+ fk_method = config.delete(:foreign_key_method) || 'id'
26
+ config[fk] = self.send(fk_method)
27
+ end
23
28
  instance_variable_get("@#{clean_name}") || \
24
29
  instance_variable_set("@#{clean_name}", \
25
30
  klass.to_s.constantize.find(:all, config, force)
@@ -3,7 +3,7 @@ module Resourceful
3
3
 
4
4
  MAJOR = 0
5
5
  MINOR = 6
6
- TINY = 2
6
+ TINY = 3
7
7
 
8
8
  def self.to_s # :nodoc:
9
9
  [MAJOR, MINOR, TINY].join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kelredd-resourceful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelly Redding
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-01 00:00:00 -07:00
12
+ date: 2009-09-02 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -107,6 +107,7 @@ files:
107
107
  - lib/resourceful.rb
108
108
  has_rdoc: false
109
109
  homepage: ""
110
+ licenses:
110
111
  post_install_message:
111
112
  rdoc_options:
112
113
  - --main
@@ -128,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
129
  requirements: []
129
130
 
130
131
  rubyforge_project:
131
- rubygems_version: 1.2.0
132
+ rubygems_version: 1.3.5
132
133
  signing_key:
133
134
  specification_version: 3
134
135
  summary: A ruby gem to abstract web resource handling.