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.
@@ -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]) ? k.find(self.send(config[:id])) : nil
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
@@ -3,7 +3,7 @@ module Resourceful
3
3
 
4
4
  MAJOR = 0
5
5
  MINOR = 5
6
- TINY = 9
6
+ TINY = 11
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.5.9
4
+ version: 0.5.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelly Redding