matid-resource_controller 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION.yml
CHANGED
|
@@ -49,7 +49,7 @@ module ResourceController
|
|
|
49
49
|
# end
|
|
50
50
|
#
|
|
51
51
|
def object
|
|
52
|
-
@object ||= end_of_association_chain.send(finder, param) unless param.nil?
|
|
52
|
+
@object ||= end_of_association_chain.send(finder, param) or raise ActiveRecord::RecordNotFound unless param.nil?
|
|
53
53
|
@object
|
|
54
54
|
end
|
|
55
55
|
|
|
@@ -59,7 +59,7 @@ module ResourceController
|
|
|
59
59
|
# Returns the current parent object if a parent object is present.
|
|
60
60
|
#
|
|
61
61
|
def parent_object
|
|
62
|
-
parent? && !parent_singleton? ? parent_model.send(parent_finder, parent_param) : nil
|
|
62
|
+
parent? && !parent_singleton? ? (parent_model.send(parent_finder, parent_param) or raise ActiveRecord::RecordNotFound) : nil
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
# If there is a parent, returns the relevant association proxy. Otherwise returns model.
|