card 1.109.0 → 1.109.1
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/VERSION +1 -1
- data/config/locales/es.yml +2 -3
- data/db/seeds.rb +0 -1
- data/lib/card/auth/current.rb +1 -1
- data/lib/card/auth/permissions.rb +1 -1
- data/lib/card/auth/proxy.rb +2 -2
- data/lib/card/auth/setup.rb +2 -2
- data/lib/card/cache/all.rb +1 -1
- data/lib/card/codename.rb +1 -0
- data/lib/card/env/location_history.rb +9 -10
- data/lib/card/env/support.rb +6 -5
- data/lib/card/format/error.rb +12 -2
- data/lib/card/format/render.rb +51 -47
- data/lib/card/lexicon.rb +5 -2
- data/lib/card/name/all.rb +4 -0
- data/lib/card/query/card_query/relational_attributes.rb +1 -1
- data/lib/card/query/card_query/run.rb +5 -1
- data/lib/card/query/sql_statement.rb +7 -1
- data/lib/card/query.rb +1 -1
- data/lib/card/view/cache/cache_action.rb +8 -2
- data/lib/card/view/cache.rb +16 -14
- data/lib/card/view/options/voo_api.rb +1 -1
- data/lib/card/view/options.rb +1 -0
- data/lib/card/view.rb +1 -1
- data/lib/cardio/mod/eat.rb +1 -4
- data/lib/cardio/seed.rb +1 -1
- data/mod/core/config/locales/de.yml +1 -1
- data/mod/core/config/locales/en.yml +1 -1
- data/mod/core/data/fixtures/real/cards.yml +1 -1
- data/mod/core/data/real.yml +1 -1
- data/mod/core/data/recode.yml +1 -0
- data/mod/core/lib/tasks/card/mod.rake +1 -1
- data/mod/core/lib/tasks/card.rake +2 -1
- data/mod/core/set/all/codename.rb +0 -1
- data/mod/core/set/all/states.rb +6 -10
- data/mod/core/set/all/type.rb +1 -1
- data/mod/core/spec/set/all/admin_spec.rb +1 -1
- data/mod/core/spec/set/all/trash_spec.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbc2d91a4b4e085e2dd391ba227f58cefe096a055354fb5850d5a983db9b389f
|
4
|
+
data.tar.gz: 0c8ced971a5730ae8f4898b967fb3063beb0ba4415957ead6c963619eabd7674
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e92113ce1c6777355ba6f4e0d81936c0b2a80ff8718b50acca6782b9f029268e087183fc2a77c179805a4bb7e12a3b54f025acab6acde19df470f2215e51d1d
|
7
|
+
data.tar.gz: abba860d2387151ba48e3690fddb88c552e31c7770aa7a37fc75006db47f667a422a8632950e2e162742428f461144330a4d0e2487637c99889312106a07d18c
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.19.
|
1
|
+
0.19.1
|
data/config/locales/es.yml
CHANGED
@@ -133,7 +133,7 @@ es:
|
|
133
133
|
type:
|
134
134
|
error_cant_change_errors: "de %{name} no se puede cambiar; creando nuevos errores %{type_id}: %{error_messages}"
|
135
135
|
error_no_such_type: No hay tal tipo
|
136
|
-
|
136
|
+
error_structured: no se puede cambiar porque %{name} es una plantilla dificil de %{type_name}
|
137
137
|
utils:
|
138
138
|
exception_almost_deleted: Se evitó de forma muy estrecha eliminar el archivo actual
|
139
139
|
set_pattern:
|
@@ -302,8 +302,7 @@ es:
|
|
302
302
|
unsupported_view: vista (%{view}) no soportado para %{cardname}
|
303
303
|
not_found_named: No pudo encontrar %{cardname}.
|
304
304
|
not_found_no_name: la tarjeta solicitada
|
305
|
-
server_error: "\
|
306
|
-
se_hitch: 'Wagn Hitch :('
|
305
|
+
server_error: "\nError del Servidor. Yuck, perdon por eso.\nPara decirnos más y seguir la solución,\nagregue un ticket de soporte en %{ticket_link}\n"
|
307
306
|
se_sorry: Error del Servidor. Yuck, perdón por eso.
|
308
307
|
se_ticket: <a href="%{ticket_link}">Agregue un ticket de soporte</a> para decirnos más y seguir la solución.
|
309
308
|
denial: Permiso denegado
|
data/db/seeds.rb
CHANGED
data/lib/card/auth/current.rb
CHANGED
data/lib/card/auth/proxy.rb
CHANGED
@@ -23,9 +23,9 @@ class Card
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
# operate with the permissions of
|
26
|
+
# operate with the permissions of DeckoBot (administrator)
|
27
27
|
def as_bot &block
|
28
|
-
as Card::
|
28
|
+
as Card::DeckoBotID, &block
|
29
29
|
end
|
30
30
|
|
31
31
|
# id of proxy user
|
data/lib/card/auth/setup.rb
CHANGED
@@ -41,8 +41,8 @@ class Card
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def user_account_cql
|
44
|
-
# every deck starts with two accounts:
|
45
|
-
{ right: :account, creator_id: ["ne", Card::
|
44
|
+
# every deck starts with two accounts: DeckoBot and Anonymous
|
45
|
+
{ right: :account, creator_id: ["ne", Card::DeckoBotID] }
|
46
46
|
end
|
47
47
|
|
48
48
|
def user_account_count
|
data/lib/card/cache/all.rb
CHANGED
data/lib/card/codename.rb
CHANGED
@@ -10,10 +10,10 @@ class Card
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def save_location card
|
13
|
-
return unless save_location?
|
13
|
+
return unless save_location? card
|
14
14
|
|
15
|
-
|
16
|
-
location_history.push
|
15
|
+
location = request ? request.original_url : location_for_history(card)
|
16
|
+
location_history.push(location).uniq!
|
17
17
|
end
|
18
18
|
|
19
19
|
def previous_location
|
@@ -21,11 +21,8 @@ class Card
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def discard_locations_for card
|
24
|
-
|
25
|
-
|
26
|
-
if (url_key = url_key_for_location(loc))
|
27
|
-
url_key.to_name.key == card.key
|
28
|
-
end
|
24
|
+
session[:history] = location_history.reject do |l|
|
25
|
+
location_cardname(l) == card.name
|
29
26
|
end.compact
|
30
27
|
end
|
31
28
|
|
@@ -43,11 +40,13 @@ class Card
|
|
43
40
|
Env::Location.card_path card.name.url_key
|
44
41
|
end
|
45
42
|
|
46
|
-
def
|
47
|
-
|
43
|
+
def location_cardname location
|
44
|
+
URI.parse(location).path.sub(/^\//, "").sub(/\/.*$/, "")&.cardname
|
48
45
|
end
|
49
46
|
|
50
47
|
def save_location? card
|
48
|
+
# return false unless Auth.signed_in? || Cardio.config.allow_anonymous_cookies
|
49
|
+
|
51
50
|
!Env.ajax? && Env.html? && card.known? && (card.codename != :signin)
|
52
51
|
end
|
53
52
|
end
|
data/lib/card/env/support.rb
CHANGED
@@ -22,16 +22,17 @@ class Card
|
|
22
22
|
if session.is_a? Hash
|
23
23
|
@session = {}
|
24
24
|
elsif request
|
25
|
-
|
25
|
+
update_session_options drop: false
|
26
26
|
controller.reset_session
|
27
|
-
# destroy_cookie unless Cardio.config.
|
27
|
+
# destroy_cookie unless Cardio.config.allow_anonymous_cookies
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
def
|
32
|
-
return unless request
|
31
|
+
def update_session_options drop: nil
|
32
|
+
return unless request
|
33
|
+
return if Cardio.config.allow_anonymous_cookies
|
33
34
|
|
34
|
-
request.session_options[:drop] =
|
35
|
+
request.session_options[:drop] = drop.nil? ? !Auth.signed_in? : drop
|
35
36
|
end
|
36
37
|
|
37
38
|
# private
|
data/lib/card/format/error.rb
CHANGED
@@ -17,8 +17,8 @@ class Card
|
|
17
17
|
|
18
18
|
def view_for_unknown setting_view
|
19
19
|
if main? && voo.root?
|
20
|
-
root.error_status =
|
21
|
-
|
20
|
+
root.error_status = page_status_for_unknown
|
21
|
+
page_view_for_unknown
|
22
22
|
else
|
23
23
|
setting_view || :unknown
|
24
24
|
end
|
@@ -39,11 +39,21 @@ class Card
|
|
39
39
|
yield
|
40
40
|
end
|
41
41
|
|
42
|
+
private
|
43
|
+
|
42
44
|
def rescue_view e, view
|
43
45
|
method = loud_error? ? :loud_error : :quiet_error
|
44
46
|
send method, e, view
|
45
47
|
end
|
46
48
|
|
49
|
+
def page_status_for_unknown
|
50
|
+
404
|
51
|
+
end
|
52
|
+
|
53
|
+
def page_view_for_unknown
|
54
|
+
:not_found
|
55
|
+
end
|
56
|
+
|
47
57
|
def error_cardname _exception
|
48
58
|
if card&.name.present?
|
49
59
|
safe_name
|
data/lib/card/format/render.rb
CHANGED
@@ -41,6 +41,57 @@ class Card
|
|
41
41
|
add_debug_info view, method, rendered
|
42
42
|
end
|
43
43
|
|
44
|
+
def pretty_path source_location
|
45
|
+
"#{source_location.first.gsub(%r{^.+mod\d+-([^/]+)},
|
46
|
+
'\1: ')}:#{source_location.second}"
|
47
|
+
end
|
48
|
+
|
49
|
+
# see {Abstract::Format}
|
50
|
+
# (:default), :yes, :deep, :always, :never
|
51
|
+
def view_cache_setting view
|
52
|
+
voo&.cache || view_setting(:cache, view) || :default
|
53
|
+
end
|
54
|
+
|
55
|
+
def view_setting setting_name, view
|
56
|
+
try Card::Set::Format.view_setting_method_name(view, setting_name)
|
57
|
+
end
|
58
|
+
|
59
|
+
def stub_render cached_content
|
60
|
+
return cached_content if Cardio.config.view_cache == :debug
|
61
|
+
|
62
|
+
# stub_debugging do
|
63
|
+
expand_stubs cached_content
|
64
|
+
# end
|
65
|
+
end
|
66
|
+
|
67
|
+
def view_method view
|
68
|
+
unless supports_view? view
|
69
|
+
raise Card::Error::UserError, unsupported_view_error_message(view)
|
70
|
+
end
|
71
|
+
|
72
|
+
method Card::Set::Format.view_method_name(view)
|
73
|
+
end
|
74
|
+
|
75
|
+
def supports_view? view
|
76
|
+
respond_to? Card::Set::Format.view_method_name(view)
|
77
|
+
end
|
78
|
+
|
79
|
+
def current_view view
|
80
|
+
old_view = @current_view
|
81
|
+
@current_view = view
|
82
|
+
yield
|
83
|
+
ensure
|
84
|
+
@current_view = old_view
|
85
|
+
end
|
86
|
+
|
87
|
+
def stub_nest stub_hash
|
88
|
+
prepare_stub_nest(stub_hash) do |stub_card, view_opts|
|
89
|
+
nest stub_card, view_opts, stub_hash[:format_opts]
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
private
|
94
|
+
|
44
95
|
def wrap_and_render view
|
45
96
|
current_view(view) { with_wrapper { final_render view } }
|
46
97
|
rescue StandardError => e
|
@@ -64,27 +115,6 @@ class Card
|
|
64
115
|
Env.params[:debug] == "view"
|
65
116
|
end
|
66
117
|
|
67
|
-
def pretty_path source_location
|
68
|
-
"#{source_location.first.gsub(%r{^.+mod\d+-([^/]+)},
|
69
|
-
'\1: ')}:#{source_location.second}"
|
70
|
-
end
|
71
|
-
|
72
|
-
# see {Abstract::Format}
|
73
|
-
# (:default), :yes, :deep, :always, :never
|
74
|
-
def view_cache_setting view
|
75
|
-
voo&.cache || view_setting(:cache, view) || :default
|
76
|
-
end
|
77
|
-
|
78
|
-
def view_setting setting_name, view
|
79
|
-
try Card::Set::Format.view_setting_method_name(view, setting_name)
|
80
|
-
end
|
81
|
-
|
82
|
-
def stub_render cached_content
|
83
|
-
# stub_debugging do
|
84
|
-
expand_stubs cached_content
|
85
|
-
# end
|
86
|
-
end
|
87
|
-
|
88
118
|
# def stub_debugging
|
89
119
|
# result = yield
|
90
120
|
# if Rails.env.development? && result.is_a?(String) && result =~ /StUb/
|
@@ -118,32 +148,6 @@ class Card
|
|
118
148
|
conto.to_s
|
119
149
|
end
|
120
150
|
end
|
121
|
-
|
122
|
-
def view_method view
|
123
|
-
unless supports_view? view
|
124
|
-
raise Card::Error::UserError, unsupported_view_error_message(view)
|
125
|
-
end
|
126
|
-
|
127
|
-
method Card::Set::Format.view_method_name(view)
|
128
|
-
end
|
129
|
-
|
130
|
-
def supports_view? view
|
131
|
-
respond_to? Card::Set::Format.view_method_name(view)
|
132
|
-
end
|
133
|
-
|
134
|
-
def current_view view
|
135
|
-
old_view = @current_view
|
136
|
-
@current_view = view
|
137
|
-
yield
|
138
|
-
ensure
|
139
|
-
@current_view = old_view
|
140
|
-
end
|
141
|
-
|
142
|
-
def stub_nest stub_hash
|
143
|
-
prepare_stub_nest(stub_hash) do |stub_card, view_opts|
|
144
|
-
nest stub_card, view_opts, stub_hash[:format_opts]
|
145
|
-
end
|
146
|
-
end
|
147
151
|
end
|
148
152
|
end
|
149
153
|
end
|
data/lib/card/lexicon.rb
CHANGED
@@ -18,9 +18,12 @@ class Card
|
|
18
18
|
# param name [String]
|
19
19
|
# @return [Integer]
|
20
20
|
def id name
|
21
|
-
return
|
21
|
+
return if name.blank?
|
22
22
|
|
23
|
-
|
23
|
+
name = name.to_name
|
24
|
+
return if name.relative_fragment?
|
25
|
+
|
26
|
+
(lex = name_to_lex name) && lex_to_id(lex)
|
24
27
|
end
|
25
28
|
|
26
29
|
def cache
|
data/lib/card/name/all.rb
CHANGED
@@ -4,7 +4,7 @@ class Card
|
|
4
4
|
# interpret CQL attributes that relate multiple cards
|
5
5
|
# each method below corresponds to a relational CQL term
|
6
6
|
#
|
7
|
-
# NOTE: methods using "restrict" can
|
7
|
+
# NOTE: methods using "restrict" can be executed without
|
8
8
|
# tying in an additional query if the val in question can be
|
9
9
|
# reduced to an id.
|
10
10
|
module RelationalAttributes
|
@@ -38,7 +38,7 @@ class Card
|
|
38
38
|
case
|
39
39
|
when respond_to?(:"#{retrn}_result") then :"#{retrn}_result"
|
40
40
|
when retrn.match?(/id$/) then :id_result
|
41
|
-
when retrn.match?(
|
41
|
+
when retrn.match?(/^_\w+/) then :name_result
|
42
42
|
when retrn == "key" then :key_result
|
43
43
|
else :default_result
|
44
44
|
end
|
@@ -52,6 +52,10 @@ class Card
|
|
52
52
|
record[field]
|
53
53
|
end
|
54
54
|
|
55
|
+
def content_result record, _pattern
|
56
|
+
record["db_content"]
|
57
|
+
end
|
58
|
+
|
55
59
|
def id_result record, field
|
56
60
|
record[field].to_i
|
57
61
|
end
|
@@ -24,6 +24,7 @@ class Card
|
|
24
24
|
@fields = fields
|
25
25
|
@tables = tables
|
26
26
|
@joins = joins
|
27
|
+
@indexes = indexes
|
27
28
|
@where = where
|
28
29
|
@group = group
|
29
30
|
@order = order
|
@@ -33,7 +34,8 @@ class Card
|
|
33
34
|
|
34
35
|
def to_s
|
35
36
|
[
|
36
|
-
comment, select, from,
|
37
|
+
comment, select, from,
|
38
|
+
@joins, @indexes, @where, @group, @order, @limit_and_offset
|
37
39
|
].compact.join " "
|
38
40
|
end
|
39
41
|
|
@@ -103,6 +105,10 @@ class Card
|
|
103
105
|
end
|
104
106
|
end
|
105
107
|
|
108
|
+
def indexes
|
109
|
+
"USE INDEX (#{Array.wrap(@mods[:index]).join ', '})" if @mods[:index]
|
110
|
+
end
|
111
|
+
|
106
112
|
def full_syntax
|
107
113
|
@query.full? ? yield : return
|
108
114
|
end
|
data/lib/card/query.rb
CHANGED
@@ -83,7 +83,7 @@ class Card
|
|
83
83
|
# "dir" is DEPRECATED in favor of sort_dir
|
84
84
|
# "sort" is DEPRECATED in favor of sort_by, except in cases where sort's value
|
85
85
|
# is a hash
|
86
|
-
MODIFIERS = %i[conj return sort_by sort_as sort_dir sort dir group limit offset]
|
86
|
+
MODIFIERS = %i[conj return index sort_by sort_as sort_dir sort dir group limit offset]
|
87
87
|
.each_with_object({}) { |v, h| h[v] = nil }
|
88
88
|
|
89
89
|
OPERATORS =
|
@@ -74,7 +74,13 @@ class Card
|
|
74
74
|
|
75
75
|
# @return [Symbol]
|
76
76
|
def active_cache_action
|
77
|
-
|
77
|
+
if caching == :deep && cache_setting != :never
|
78
|
+
:yield
|
79
|
+
elsif active_cache_ok?
|
80
|
+
active_cache_action_from_setting
|
81
|
+
else
|
82
|
+
:stub
|
83
|
+
end
|
78
84
|
end
|
79
85
|
|
80
86
|
# @return [True/False]
|
@@ -120,7 +126,7 @@ class Card
|
|
120
126
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
121
127
|
# SHARED METHODS
|
122
128
|
|
123
|
-
# @return [Symbol] :
|
129
|
+
# @return [Symbol] :always, :deep, or :never
|
124
130
|
def cache_setting
|
125
131
|
@cache_setting ||= format.view_cache_setting requested_view
|
126
132
|
end
|
data/lib/card/view/cache.rb
CHANGED
@@ -215,15 +215,20 @@ class Card
|
|
215
215
|
# If view is cached, retrieve it. Otherwise render and store it.
|
216
216
|
# Uses the primary cache API.
|
217
217
|
def cache_fetch &block
|
218
|
-
|
218
|
+
with_caching do
|
219
219
|
ensure_cache_key
|
220
|
+
# Rails.logger.debug "Fetching::: #{cache_key}"
|
220
221
|
self.class.cache.fetch cache_key, &block
|
221
222
|
end
|
222
223
|
end
|
223
224
|
|
224
225
|
# keep track of nested cache fetching
|
225
|
-
|
226
|
-
self.class.
|
226
|
+
def with_caching &block
|
227
|
+
self.class.with_caching(cache_setting, &block)
|
228
|
+
end
|
229
|
+
|
230
|
+
def caching
|
231
|
+
self.class.caching
|
227
232
|
end
|
228
233
|
|
229
234
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
@@ -293,24 +298,20 @@ class Card
|
|
293
298
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
294
299
|
# cache-related Card::View class methods
|
295
300
|
module ClassMethods
|
301
|
+
def caching
|
302
|
+
@caching
|
303
|
+
end
|
304
|
+
|
296
305
|
def cache
|
297
306
|
Card::Cache[Card::View]
|
298
307
|
end
|
299
308
|
|
300
309
|
def caching?
|
301
|
-
|
310
|
+
!caching.nil?
|
302
311
|
end
|
303
312
|
|
304
|
-
def
|
305
|
-
|
306
|
-
|
307
|
-
caching_mode setting, &block
|
308
|
-
end
|
309
|
-
|
310
|
-
private
|
311
|
-
|
312
|
-
def caching_mode setting
|
313
|
-
old_caching = @caching
|
313
|
+
def with_caching setting
|
314
|
+
old_caching = caching
|
314
315
|
# puts "OPEN CACHING from #{old_caching} to #{setting}" unless @caching == :deep
|
315
316
|
@caching = setting unless @caching == :deep
|
316
317
|
yield
|
@@ -318,6 +319,7 @@ class Card
|
|
318
319
|
# puts "CLOSE CACHING from #{@caching} to #{old_caching}"
|
319
320
|
@caching = old_caching
|
320
321
|
end
|
322
|
+
|
321
323
|
end
|
322
324
|
end
|
323
325
|
end
|
@@ -165,7 +165,7 @@ class Card
|
|
165
165
|
|
166
166
|
# adds the wrappers assigned to ok_view in view definition
|
167
167
|
def process_view_wrappers
|
168
|
-
view_wrappers = format.view_setting(:wrap, ok_view)
|
168
|
+
view_wrappers = format.view_setting(:wrap, ok_view) if requested_view
|
169
169
|
return unless view_wrappers.present?
|
170
170
|
|
171
171
|
@live_options[:wrap] = Array.wrap(@live_options[:wrap])
|
data/lib/card/view/options.rb
CHANGED
@@ -52,6 +52,7 @@ class Card
|
|
52
52
|
:structure, # overrides the content of the card
|
53
53
|
:title, # overrides the name of the card
|
54
54
|
:variant, # override the standard name with a different variant
|
55
|
+
:joint, # what joins the parts of a compound name ("+" by default)
|
55
56
|
:input_type, # inline_nests makes a form within standard content (Symbol)
|
56
57
|
:type, # set the default type of new cards
|
57
58
|
:size, # set an image size
|
data/lib/card/view.rb
CHANGED
@@ -76,7 +76,7 @@ class Card
|
|
76
76
|
# be overridden, eg for the main view (top view of the main card on a page)
|
77
77
|
# @return [Symbol] view name
|
78
78
|
def requested_view
|
79
|
-
@requested_view ||= View.normalize
|
79
|
+
@requested_view ||= View.normalize(live_options[:view] || @raw_view)
|
80
80
|
end
|
81
81
|
|
82
82
|
# the final view. can be different from @requested_view when there are
|
data/lib/cardio/mod/eat.rb
CHANGED
@@ -46,9 +46,6 @@ module Cardio
|
|
46
46
|
|
47
47
|
def track edible
|
48
48
|
rescuing edible do
|
49
|
-
# n = edible[:name]
|
50
|
-
# binding.pry if (n.is_a? Array) && n.first.to_s == "main_menu"
|
51
|
-
# puts "eating: #{edible}" if @verbose
|
52
49
|
card = yield
|
53
50
|
puts "eaten: #{card.name}".cyan if @verbose
|
54
51
|
end
|
@@ -63,7 +60,7 @@ module Cardio
|
|
63
60
|
end
|
64
61
|
|
65
62
|
def current_user item_user
|
66
|
-
Card::Auth.current_id = item_user&.card_id || @user_id || Card::
|
63
|
+
Card::Auth.current_id = item_user&.card_id || @user_id || Card::DeckoBotID
|
67
64
|
end
|
68
65
|
|
69
66
|
def time_machine value, &block
|
data/lib/cardio/seed.rb
CHANGED
@@ -8,7 +8,7 @@ de:
|
|
8
8
|
core_error_cant_alter: Typ kann nicht geändert werden; es gibt noch %{name} Karten
|
9
9
|
core_error_cant_change_errors: "von %{name} kann nicht geändert werden; Fehler beim Erstellen von neuen %{type_id}: %{error_messages}"
|
10
10
|
core_error_code_in_use: Codename %{codename} ist bereits vergeben
|
11
|
-
|
11
|
+
core_error_structured: kann nicht geändert werden, weil %{name} ist eine Vorlage für %{type_name}
|
12
12
|
core_error_indestructible: "%{name} ist eine unzerstörbare Regel"
|
13
13
|
core_error_invalid_character_in_cardtype: "folgende Zeichen sind nicht erlaubt: %{banned}"
|
14
14
|
core_error_name_exists: muss eindeutig sein; '%{name}' gibt es bereits.
|
@@ -9,7 +9,7 @@ en:
|
|
9
9
|
core_error_cant_change_errors: "of %{name} can't be changed; errors creating new %{type_id}: %{error_messages}"
|
10
10
|
core_error_code_in_use: codename %{codename} already in use
|
11
11
|
core_codename_must_be_simple: only simple cards can have codenames
|
12
|
-
|
12
|
+
core_error_structured: can't be changed because %{name} is structured as a %{type_name}
|
13
13
|
core_error_indestructible: "%{name} is an indestructible rule"
|
14
14
|
core_error_invalid_character_in_cardtype: "may not contain any of the following characters: %{banned}"
|
15
15
|
core_error_name_exists: must be unique; '%{name}' already exists.
|
data/mod/core/data/real.yml
CHANGED
data/mod/core/data/recode.yml
CHANGED
@@ -30,7 +30,7 @@ namespace :card do
|
|
30
30
|
desc "install all mods"
|
31
31
|
task install: :environment do
|
32
32
|
puts "installing mods"
|
33
|
-
Card::Auth.signin :
|
33
|
+
Card::Auth.signin :decko_bot.card
|
34
34
|
# Cardio.config.compress_assets = true # should not be here, imo #efm
|
35
35
|
Cardio::Mod.ensure_installed
|
36
36
|
end
|
@@ -13,7 +13,8 @@ namespace :card do
|
|
13
13
|
ENV["NO_RAILS_CACHE"] = "true"
|
14
14
|
run_tasks ["migrate:port", "migrate:schema", "migrate:recode",
|
15
15
|
:eat, "migrate:transform",
|
16
|
-
"mod:uninstall", "mod:install", "mod:symlink", :reset]
|
16
|
+
"mod:uninstall", "mod:install", "mod:symlink", :reset]
|
17
|
+
# , with_benchmark: true
|
17
18
|
end
|
18
19
|
end
|
19
20
|
|
data/mod/core/set/all/states.rb
CHANGED
@@ -85,15 +85,11 @@ end
|
|
85
85
|
|
86
86
|
# has not been edited directly by human users. bleep blorp.
|
87
87
|
def pristine?
|
88
|
-
if new_card?
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
true
|
94
|
-
else
|
95
|
-
!user_changes?
|
96
|
-
end
|
88
|
+
return true if new_card?
|
89
|
+
return false if subcards? && subcards.cards.find(&:altered?)
|
90
|
+
return true if (created_at == updated_at) && (creator_id == DeckoBotID)
|
91
|
+
|
92
|
+
!user_changes?
|
97
93
|
end
|
98
94
|
|
99
95
|
def altered?
|
@@ -101,5 +97,5 @@ def altered?
|
|
101
97
|
end
|
102
98
|
|
103
99
|
def user_changes?
|
104
|
-
actions.joins(:act).where("card_acts.actor_id != ?",
|
100
|
+
actions.joins(:act).where("card_acts.actor_id != ?", DeckoBotID).exists?
|
105
101
|
end
|
data/mod/core/set/all/type.rb
CHANGED
@@ -19,7 +19,7 @@ event :validate_type, :validate, changed: :type_id, on: :save do
|
|
19
19
|
|
20
20
|
if structure&.assigns_type? && type_id != structure.type_id
|
21
21
|
errors.add :type,
|
22
|
-
t(:
|
22
|
+
t(:core_error_structured, name: name, type_name: structure.type_name)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -26,7 +26,7 @@ RSpec.describe Card::Set::All::Admin do
|
|
26
26
|
"link_list",
|
27
27
|
"local_script_folder_group", "local_script_manifest_group",
|
28
28
|
"local_style_folder_group",
|
29
|
-
"nest_list", "
|
29
|
+
"nest_list", "role",
|
30
30
|
"local_style_manifest_group", "bootswatch_skin",
|
31
31
|
"date", "notification_template", "session", "basic",
|
32
32
|
"search_type", "signup")
|
@@ -178,9 +178,9 @@ end
|
|
178
178
|
# NOT WORKING, BUT IT SHOULD
|
179
179
|
# describe Card, "a part of an unremovable card" do
|
180
180
|
# before do
|
181
|
-
# Card::Auth.as(Card::
|
181
|
+
# Card::Auth.as(Card::DeckoBotID)
|
182
182
|
# # this ugly setup makes it so A+Admin is the actual user with edits..
|
183
|
-
# Card["
|
183
|
+
# Card["Decko Bot"].update! name: "A+Decko Bot"
|
184
184
|
# end
|
185
185
|
# it "does not be removable" do
|
186
186
|
# @a = Card['A']
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.109.
|
4
|
+
version: 1.109.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan McCutchen
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.19.
|
20
|
+
version: 0.19.1
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.19.
|
27
|
+
version: 0.19.1
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|