effective_resources 2.7.3 → 2.7.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81e95260653fd5965100cb1472f50ed8d5132c1fb37574b8f726c62fbb6b7788
|
4
|
+
data.tar.gz: 8a17f54272e74b3ffdeb7ecd14651d6506cb1f4051e15c30429064ca7df02ee9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fd66ded174e4688bd8a432da093828e7f58444269b3ac40a9fb44cd545792137f6942a57d5cfa8190f04e375979ffe345e3800e90b9218e3121a7084b41626d
|
7
|
+
data.tar.gz: d9af4ef456b4de382ff1e947f432e2aa676dc56dfa0ec418735051b9b1bbcffe89c27c82d0613324c79a3829dccecca68720ef2e8052257205954bd6f6d021a2
|
@@ -76,6 +76,9 @@ module ActsAsStatused
|
|
76
76
|
# was_approved?
|
77
77
|
define_method("was_#{sym}?") { send(sym_at).present? }
|
78
78
|
|
79
|
+
# just_approved?
|
80
|
+
define_method("just_#{sym}?") { status == sym.to_s && status_was != sym.to_s }
|
81
|
+
|
79
82
|
# approved_at
|
80
83
|
define_method(sym_at) { self[sym_at.to_s] || status_steps[sym_at] }
|
81
84
|
|
@@ -57,6 +57,10 @@ module ActsAsWizard
|
|
57
57
|
self.class.const_get(:WIZARD_STEPS).keys
|
58
58
|
end
|
59
59
|
|
60
|
+
def all_steps
|
61
|
+
wizard_step_keys
|
62
|
+
end
|
63
|
+
|
60
64
|
def completed_steps
|
61
65
|
wizard_steps.keys
|
62
66
|
end
|
@@ -89,7 +93,7 @@ module ActsAsWizard
|
|
89
93
|
# For use in the summary partials. Does not include summary.
|
90
94
|
def render_steps
|
91
95
|
blacklist = [:start, :billing, :checkout, :submitted, :summary]
|
92
|
-
(required_steps
|
96
|
+
((required_steps | completed_steps) - blacklist).select { |step| has_completed_step?(step) }
|
93
97
|
end
|
94
98
|
|
95
99
|
def wizard_step_title(step)
|
@@ -29,6 +29,10 @@ module Effective
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
+
def belong_tos_names_attributes
|
33
|
+
belong_tos.inject({}) { |h, ass| h[ass.name] = [:belongs_to]; h }
|
34
|
+
end
|
35
|
+
|
32
36
|
def has_manys_attributes
|
33
37
|
has_manys_ids.inject({}) { |h, ass| h[ass] = [:array]; h }
|
34
38
|
end
|
@@ -82,6 +86,7 @@ module Effective
|
|
82
86
|
end
|
83
87
|
|
84
88
|
# All table attributes. includes primary_key and belongs_tos
|
89
|
+
# THINK THIS IS DEPRECATED
|
85
90
|
def table_attributes
|
86
91
|
attributes = (klass.new().attributes rescue nil)
|
87
92
|
return {} unless attributes
|
@@ -123,6 +128,14 @@ module Effective
|
|
123
128
|
sort ? sort_by_model_attributes(attributes) : attributes
|
124
129
|
end
|
125
130
|
|
131
|
+
# Similar to klass_attributes
|
132
|
+
# Used by table_builder
|
133
|
+
def resource_attributes
|
134
|
+
belong_tos_names_attributes
|
135
|
+
.merge(klass_attributes(sort: true))
|
136
|
+
.merge(effective_addresses_attributes)
|
137
|
+
end
|
138
|
+
|
126
139
|
private
|
127
140
|
|
128
141
|
def sort_by_model_attributes(attributes)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|