kelredd-resourceful 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -21,10 +21,8 @@ module Resourceful
|
|
21
21
|
raise NotImplementedError, "has_many expects #{klass} to be findable (ie mixin the Findable helper)"
|
22
22
|
end
|
23
23
|
fk = config.delete(:foreign_key) || "#{self.class.name.downcase.to_s.gsub(/^.*::/, '')}_id"
|
24
|
-
|
25
|
-
|
26
|
-
config[fk] = self.send(fk_method)
|
27
|
-
end
|
24
|
+
fk_method = config.delete(:foreign_key_method) || 'id'
|
25
|
+
config[fk] = self.send(fk_method)
|
28
26
|
instance_variable_get("@#{clean_name}") || \
|
29
27
|
instance_variable_set("@#{clean_name}", \
|
30
28
|
klass.to_s.constantize.find(:all, config, force)
|
data/lib/resourceful/version.rb
CHANGED