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
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 7
4
- :patch: 1
4
+ :patch: 2
5
5
  :build:
@@ -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.
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 1
9
- version: 0.7.1
8
+ - 2
9
+ version: 0.7.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mateusz Drozdzynski