kelredd-resourceful 0.5.9 → 0.5.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/resourceful/model/base.rb +8 -1
- data/lib/resourceful/version.rb +1 -1
- metadata +1 -1
@@ -144,7 +144,14 @@ module Resourceful
|
|
144
144
|
instance_variable_get("@#{clean_name}") || \
|
145
145
|
instance_variable_set("@#{clean_name}", \
|
146
146
|
if ((k = config[:klass].constantize) && k.respond_to?(:find))
|
147
|
-
self.respond_to?(config[:id])
|
147
|
+
if self.respond_to?(config[:id]) && \
|
148
|
+
(bt_id = self.send(config[:id])) && \
|
149
|
+
!bt_id.nil? && \
|
150
|
+
!bt_id.empty?
|
151
|
+
k.find(bt_id)
|
152
|
+
else
|
153
|
+
nil
|
154
|
+
end
|
148
155
|
else
|
149
156
|
nil
|
150
157
|
end
|
data/lib/resourceful/version.rb
CHANGED