typical_situation 1.0.2 → 1.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 59384fee031d1440a474689f99be97760aedc645343e4febf4d1356ed05ee801
4
- data.tar.gz: '08b482a57e976dbe1ac86604648a4f237346c09db88c672483dfae604d566cf1'
3
+ metadata.gz: 25d81edd5ff28eb30b117722caf4e497c1c795d598d53ac92af1b007306454d9
4
+ data.tar.gz: 7ebc26384625a9cc513a6c1cd0308ad9339d812694469b1a3114191ee2449bd9
5
5
  SHA512:
6
- metadata.gz: dbcec21abd36a2da29b901bb2ffcb0468b6cf4170b4e974bef1cd640d174813c557fa8a87bddcda23e92c5709ea5c89c4fa39de7968f62ea08d5db6ac99a01a3
7
- data.tar.gz: d12f5d0e3d6408a7060d46704e8dbe47cc516119fd7ae360e863bd3d00592def5e0ce99ac2bd2e6b491575284022469299689fef943368831003da8235c0a5a3
6
+ metadata.gz: 8ed5141d2a0ef301ef1a5b2e07df10c988584c70e9fdcb319499f655b5fba03e19dff789cafd0fb1370bcc2125d916a63711ea51df602cf8fedf2fd853b958cf
7
+ data.tar.gz: f34b42196b747b3ba706d61b72afbbe6eee59d31dfab64e933836a5f9e25f9715ff129dd12aac1eccf975413ee51eb14df4f66ed368a131881d30d777c4ac2a5
@@ -1,4 +1,4 @@
1
- require 'rails/engine'
1
+ require "rails/engine"
2
2
 
3
3
  module TypicalSituation
4
4
  class Engine < Rails::Engine
@@ -29,11 +29,11 @@ module TypicalSituation
29
29
  end
30
30
 
31
31
  def get_resource
32
- if (@resource = find_resource(params[:id]))
32
+ if (@resource = find_resource(id_param))
33
33
  set_single_instance
34
34
  @resource
35
35
  else
36
- raise ActiveRecord::RecordNotFound, "Could not find #{model_class}( id:#{params[:id].inspect} )"
36
+ raise ActiveRecord::RecordNotFound, "Could not find #{model_class}( id:#{id_param.inspect} )"
37
37
  end
38
38
  end
39
39
 
@@ -105,6 +105,12 @@ module TypicalSituation
105
105
  instance_variable_set(:"@#{model_type.to_s.gsub("/", "__").pluralize}", @resources)
106
106
  end
107
107
 
108
+ protected
109
+
110
+ def id_param
111
+ params[:id]
112
+ end
113
+
108
114
  private
109
115
 
110
116
  def apply_sorting(resources)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TypicalSituation
4
- VERSION = "1.0.2"
4
+ VERSION = "1.0.3"
5
5
  end
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'typical_situation/engine'
4
- require 'typical_situation/identity'
5
- require 'typical_situation/permissions'
6
- require 'typical_situation/flash_messages'
7
- require 'typical_situation/actions'
8
- require 'typical_situation/operations'
9
- require 'typical_situation/responses'
3
+ require "typical_situation/engine"
4
+ require "typical_situation/identity"
5
+ require "typical_situation/permissions"
6
+ require "typical_situation/flash_messages"
7
+ require "typical_situation/actions"
8
+ require "typical_situation/operations"
9
+ require "typical_situation/responses"
10
10
 
11
11
  module TypicalSituation
12
12
  class Error < StandardError; end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typical_situation
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mars Hall