lib/resource_controller/helpers/nested.rb in matid-resource_controller-0.7.1 vs lib/resource_controller/helpers/nested.rb in matid-resource_controller-0.7.2
- old
+ new
@@ -57,10 +57,10 @@
end
# Returns the current parent object if a parent object is present.
#
def parent_object
- parent? && !parent_singleton? ? parent_model.send(parent_finder, parent_param) : nil
+ parent? && !parent_singleton? ? (parent_model.send(parent_finder, parent_param) or raise ActiveRecord::RecordNotFound) : nil
end
# If there is a parent, returns the relevant association proxy. Otherwise returns model.
#
def end_of_association_chain