lib/resourcelogic/singleton.rb in resourcelogic-0.12.2 vs lib/resourcelogic/singleton.rb in resourcelogic-0.12.3
- old
+ new
@@ -13,12 +13,12 @@
return @object if defined?(@object)
if singleton?
if !parent? && respond_to?("current_#{model_name}", true)
@object = send("current_#{model_name}")
- elsif parent? && parent_object.send(model_name)
- @object = parent_object.send(model_name)
+ elsif parent? && parent.send(model_name)
+ @object = parent.send(model_name)
else
super
end
else
super
@@ -33,10 +33,10 @@
end
end
def scope
if singleton? && parent?
- parent_object
+ parent
else
super
end
end