auto_demeter 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/auto_demeter/methods.rb +5 -1
- data/lib/auto_demeter/version.rb +1 -1
- metadata +1 -1
data/lib/auto_demeter/methods.rb
CHANGED
@@ -18,7 +18,11 @@ module AutoDemeter
|
|
18
18
|
if children_names && (match_data=method_id.to_s.match(reflected_children_regex)) && match_data[1].present?
|
19
19
|
association_name=self.methods.include?(match_data[1]) ? match_data[1] : "#{self.class.name.underscore}_#{match_data[1]}"
|
20
20
|
begin
|
21
|
-
|
21
|
+
if association=send(association_name)
|
22
|
+
association.respond_to?(match_data[2])
|
23
|
+
else
|
24
|
+
match_data[2][0..2] == 'is_'
|
25
|
+
end
|
22
26
|
rescue
|
23
27
|
false
|
24
28
|
end
|
data/lib/auto_demeter/version.rb
CHANGED