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 +4 -4
- data/lib/typical_situation/engine.rb +1 -1
- data/lib/typical_situation/operations.rb +8 -2
- data/lib/typical_situation/version.rb +1 -1
- data/lib/typical_situation.rb +7 -7
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 25d81edd5ff28eb30b117722caf4e497c1c795d598d53ac92af1b007306454d9
|
|
4
|
+
data.tar.gz: 7ebc26384625a9cc513a6c1cd0308ad9339d812694469b1a3114191ee2449bd9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8ed5141d2a0ef301ef1a5b2e07df10c988584c70e9fdcb319499f655b5fba03e19dff789cafd0fb1370bcc2125d916a63711ea51df602cf8fedf2fd853b958cf
|
|
7
|
+
data.tar.gz: f34b42196b747b3ba706d61b72afbbe6eee59d31dfab64e933836a5f9e25f9715ff129dd12aac1eccf975413ee51eb14df4f66ed368a131881d30d777c4ac2a5
|
|
@@ -29,11 +29,11 @@ module TypicalSituation
|
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def get_resource
|
|
32
|
-
if (@resource = find_resource(
|
|
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:#{
|
|
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)
|
data/lib/typical_situation.rb
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
4
|
-
require
|
|
5
|
-
require
|
|
6
|
-
require
|
|
7
|
-
require
|
|
8
|
-
require
|
|
9
|
-
require
|
|
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
|