lasha 0.2.6 → 0.2.7
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/lasha/version.rb +1 -1
- data/lib/lasha.rb +4 -6
- 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: e129bf80b045a8204652ab9563b6b5013d79085076e1aa7b2d136c0fd195f348
|
4
|
+
data.tar.gz: 5ebe50a6e11ceedda1f557f2cc628c3e341c0ebafe167fdbe89792be0367a4a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d05c0043757063688ef52ad80b4afdd50cbec8de3738e3cd1841d1edfba2555a6dbb8dde67378f0074a81562bcc67afb3c6fc189e5aff859bc7b472eb6e4bae1
|
7
|
+
data.tar.gz: e3be2b56c4c34639c061f1dca1dcca0ce0e8ad953938ab56efedef2a5f3c9d0f22f3230404293168e6b0b353dc1fb5693501dd2191445085083332a552e951fd
|
data/lib/lasha/version.rb
CHANGED
data/lib/lasha.rb
CHANGED
@@ -18,7 +18,7 @@ module Lasha
|
|
18
18
|
attributes: attributes,
|
19
19
|
actions: set_or_guess_actions(actions, controller)
|
20
20
|
}
|
21
|
-
raise ArgumentError
|
21
|
+
raise ArgumentError unless index_data_valid?(**index_data_hash)
|
22
22
|
|
23
23
|
index_data_hash
|
24
24
|
rescue ArgumentError => e
|
@@ -49,14 +49,13 @@ module Lasha
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
def self.
|
53
|
-
truthy_array = []
|
52
|
+
def self.index_data_valid?(**index_data_hash)
|
54
53
|
index_data_hash.each do |key, value|
|
55
54
|
case key
|
56
55
|
when :model
|
57
|
-
|
56
|
+
(value.present? || index_data_hash[:collection].present?)
|
58
57
|
when :actions
|
59
|
-
|
58
|
+
(value - @index_actions).blank?
|
60
59
|
# when :namespace
|
61
60
|
# truthy_array << false
|
62
61
|
# when :collection
|
@@ -65,6 +64,5 @@ module Lasha
|
|
65
64
|
# truthy_array << false
|
66
65
|
end
|
67
66
|
end
|
68
|
-
truthy_array.include?(true)
|
69
67
|
end
|
70
68
|
end
|