kelredd-resourceful 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -114,8 +114,12 @@ module Resourceful
|
|
114
114
|
def fetch_attribute(clean_name, config, content_method)
|
115
115
|
instance_variable_get("@#{clean_name}") || \
|
116
116
|
instance_variable_set("@#{clean_name}", \
|
117
|
-
if (
|
118
|
-
|
117
|
+
if (a = attribute(config))
|
118
|
+
begin
|
119
|
+
self.class.get_value(a, config).send(content_method)
|
120
|
+
rescue Exception => err
|
121
|
+
a
|
122
|
+
end
|
119
123
|
else
|
120
124
|
a
|
121
125
|
end
|
@@ -45,7 +45,7 @@ module Resourceful
|
|
45
45
|
raise NotImplementedError, "has_many expects #{klass} to be findable (ie mixin the Findable helper)"
|
46
46
|
end
|
47
47
|
fk = self.send(foreign_key)
|
48
|
-
if fk.nil? || fk.empty?
|
48
|
+
if fk.nil? || (fk.respond_to?('empty?') && fk.empty?)
|
49
49
|
nil
|
50
50
|
else
|
51
51
|
instance_variable_get("@#{clean_name}") || \
|
data/lib/resourceful/version.rb
CHANGED
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.
|
4
|
+
version: 0.6.5
|
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-
|
12
|
+
date: 2009-09-03 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|