card 1.101.4 → 1.101.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/config/i18n-tasks.yml +0 -5
  4. data/config/initializers/01_core_extensions/array.rb +2 -1
  5. data/config/initializers/01_core_extensions/hash.rb +1 -0
  6. data/config/initializers/01_core_extensions/object.rb +15 -11
  7. data/config/initializers/02_patches/active_job.rb +1 -1
  8. data/config/initializers/02_patches/active_record.rb +1 -3
  9. data/config/initializers/02_patches/better_errors.rb +1 -3
  10. data/config/initializers/02_patches/kaminari.rb +2 -2
  11. data/config/initializers/deck_config.rb +1 -1
  12. data/config/initializers/inflections.rb +1 -0
  13. data/config/initializers/internationalization.rb +23 -21
  14. data/config/initializers/mime_types.rb +1 -0
  15. data/config/initializers/notification.rb +1 -0
  16. data/config/initializers/patches.rb +6 -5
  17. data/config/locales/en.yml +10 -16
  18. data/db/migrate/20110511221913_require_earlier_migrations.rb +1 -0
  19. data/db/migrate/20121111025347_require_1_10_migrations.rb +1 -0
  20. data/db/migrate/20121118114000_split_link_type.rb +1 -0
  21. data/db/migrate/20121118115000_update_link_type.rb +1 -0
  22. data/db/migrate/20130106052640_table_cleanup.rb +2 -2
  23. data/db/migrate/20130109015336_trunk_left.rb +1 -0
  24. data/db/migrate/20130411210957_update_codenames.rb +1 -0
  25. data/db/migrate/20140822073704_create_new_revision_tables.rb +1 -0
  26. data/db/migrate/20141001105348_move_revisions_to_actions.rb +9 -3
  27. data/db/migrate/20141216053032_better_index_names.rb +9 -6
  28. data/db/migrate/20170908114442_create_delayed_jobs.rb +1 -1
  29. data/db/migrate/20170908114452_increase_text_size_for_delayed_jobs.rb +1 -1
  30. data/db/migrate/20180514152037_add_card_virtuals_table.rb +1 -1
  31. data/db/migrate_core_cards/20120611203506_rails_inflection_updates.rb +2 -1
  32. data/db/migrate_core_cards/20130411191151_renaming_for_menu.rb +9 -9
  33. data/db/migrate_core_cards/20130419215612_import_help_text.rb +3 -2
  34. data/db/migrate_core_cards/20130823192433_add_style_cards.rb +5 -5
  35. data/db/migrate_core_cards/20130910183318_move_styles_to_content.rb +3 -2
  36. data/db/migrate_core_cards/20130920291703_update_stylesheets.rb +2 -4
  37. data/db/migrate_core_cards/20131016172445_common_css_patch.rb +1 -3
  38. data/db/migrate_core_cards/20140110193325_reset_account_request_type.rb +1 -3
  39. data/db/migrate_core_cards/20140307231621_user_data_to_cards.rb +12 -8
  40. data/db/migrate_core_cards/20140317035504_account_requests_to_signups.rb +2 -4
  41. data/db/migrate_core_cards/20140512155840_add_script_cards.rb +16 -9
  42. data/db/migrate_core_cards/20140629222005_add_email_cards.rb +19 -11
  43. data/db/migrate_core_cards/20140725180118_config_card_updates.rb +1 -1
  44. data/db/migrate_core_cards/20141115034214_config_descriptions_etc.rb +1 -1
  45. data/db/migrate_core_cards/20141119001955_make_symlinks_relative.rb +1 -1
  46. data/db/migrate_core_cards/20141204061304_watchers_to_following.rb +2 -0
  47. data/db/migrate_core_cards/20141216155251_add_more_following_cards.rb +4 -2
  48. data/db/migrate_core_cards/20150202143810_import_bootstrap_layout.rb +1 -1
  49. data/db/migrate_core_cards/20150220134731_following_to_follow_rule.rb +3 -4
  50. data/db/migrate_core_cards/20150317162412_bootstrap_themes.rb +8 -4
  51. data/db/migrate_core_cards/20150326205655_bootswatch_themes.rb +14 -7
  52. data/db/migrate_core_cards/20150429090551_search_card_context.rb +6 -4
  53. data/db/migrate_core_cards/20150508212032_menu_compatibility.rb +4 -2
  54. data/db/migrate_core_cards/20150510031118_fix_skin_codenames.rb +2 -1
  55. data/db/migrate_core_cards/20150601133433_add_recent_setting_session_card.rb +3 -3
  56. data/db/migrate_core_cards/20150610171702_add_debugger_session_card.rb +2 -1
  57. data/db/migrate_core_cards/20150610180019_add_recaptcha_key_and_admin_info_cards.rb +4 -3
  58. data/db/migrate_core_cards/20150724123438_update_file_and_image_cards.rb +6 -2
  59. data/db/migrate_core_cards/20150807205221_create_references_for_search_cards.rb +1 -1
  60. data/db/migrate_core_cards/20150824135418_update_file_history.rb +2 -0
  61. data/db/migrate_core_cards/20160804112510_reorganize_scripts.rb +1 -1
  62. data/db/migrate_core_cards/20160811115836_rename_stats_to_admin.rb +1 -0
  63. data/db/migrate_core_cards/20160914132636_fix_mod_files.rb +2 -0
  64. data/db/migrate_core_cards/20161102202156_tweak_recaptcha_setting_cards.rb +6 -6
  65. data/db/migrate_core_cards/20161103154836_update_keys.rb +2 -1
  66. data/db/migrate_core_cards/20170209132834_email_test_context.rb +2 -0
  67. data/db/migrate_core_cards/20170314175313_add_notification_event_card.rb +3 -3
  68. data/db/migrate_core_cards/20170515101262_add_advanced_edit_cards.rb +1 -1
  69. data/db/migrate_core_cards/20170608200649_add_input_options_codename.rb +1 -1
  70. data/db/migrate_core_cards/20180712042655_head_rule.rb +3 -4
  71. data/db/migrate_core_cards/20180905061537_migrate_layouts.rb +4 -4
  72. data/db/migrate_core_cards/20181120200937_update_layout.rb +1 -1
  73. data/db/migrate_core_cards/20190320091257_upgrade_recaptcha_to_v3.rb +7 -7
  74. data/db/migrate_core_cards/20190424100531_update_credit_image.rb +1 -0
  75. data/db/migrate_core_cards/20190502130029_add_shark_and_help_desk_role.rb +15 -14
  76. data/db/migrate_core_cards/20190503122739_update_pristine_data.rb +1 -1
  77. data/db/migrate_core_cards/20190625153616_pointer_overhaul.rb +9 -5
  78. data/db/migrate_core_cards/20190718140126_add_guides.rb +3 -3
  79. data/db/migrate_core_cards/20190822093633_move_help_text_to_code.rb +1 -2
  80. data/db/migrate_core_cards/20190823220018_cleanup_for_decko_1_0.rb +1 -1
  81. data/db/migrate_core_cards/20190829093961_cardtype_grouping.rb +7 -7
  82. data/db/migrate_core_cards/20190902193208_input_type.rb +1 -3
  83. data/db/migrate_core_cards/20190909104250_add_cardtype_input_types.rb +2 -2
  84. data/db/migrate_core_cards/20191028135243_add_link_editor_to_tiny_mce_config.rb +1 -0
  85. data/db/migrate_core_cards/20191115160748_history_cleanup.rb +0 -1
  86. data/db/migrate_core_cards/20191118145629_codename_fixes.rb +1 -2
  87. data/db/migrate_core_cards/20200821231558_add_nest_list_type.rb +1 -1
  88. data/db/seed/new/card_actions.yml +2153 -2145
  89. data/db/seed/new/card_acts.yml +3 -3
  90. data/db/seed/new/card_references.yml +900 -858
  91. data/db/seed/new/cards.yml +4869 -4848
  92. data/db/seed/new/schema_migrations_deck_cards.yml +2 -0
  93. data/db/seed/test/fixtures/card_actions.yml +3563 -3547
  94. data/db/seed/test/fixtures/card_acts.yml +675 -675
  95. data/db/seed/test/fixtures/card_changes.yml +103 -103
  96. data/db/seed/test/fixtures/card_references.yml +2165 -2123
  97. data/db/seed/test/fixtures/cards.yml +7862 -7751
  98. data/db/seed/test/fixtures/schema_migrations_deck_cards.yml +2 -0
  99. data/db/test_seed.rb +33 -34
  100. data/lib/card.rb +1 -0
  101. data/lib/card/auth/token.rb +2 -2
  102. data/lib/card/cache.rb +2 -1
  103. data/lib/card/cache/all.rb +5 -0
  104. data/lib/card/cache/card_class.rb +3 -0
  105. data/lib/card/codename.rb +1 -1
  106. data/lib/card/content.rb +4 -8
  107. data/lib/card/content/chunk.rb +1 -1
  108. data/lib/card/content/clean.rb +4 -3
  109. data/lib/card/content/diff.rb +3 -2
  110. data/lib/card/content/diff/l_c_s/processor.rb +1 -1
  111. data/lib/card/content/diff/result.rb +1 -0
  112. data/lib/card/content/parser.rb +2 -2
  113. data/lib/card/content/truncate.rb +6 -6
  114. data/lib/card/director.rb +1 -1
  115. data/lib/card/director/all.rb +2 -2
  116. data/lib/card/director/card_methods.rb +1 -0
  117. data/lib/card/director/event_delay.rb +4 -6
  118. data/lib/card/director/run.rb +2 -0
  119. data/lib/card/director/stages.rb +3 -2
  120. data/lib/card/env/location.rb +4 -3
  121. data/lib/card/fetch.rb +7 -4
  122. data/lib/card/fetch/all.rb +1 -0
  123. data/lib/card/fetch/card_class.rb +35 -27
  124. data/lib/card/fetch/results.rb +9 -0
  125. data/lib/card/fetch/retrieve.rb +2 -0
  126. data/lib/card/fetch/store.rb +1 -0
  127. data/lib/card/format/content.rb +1 -3
  128. data/lib/card/format/error.rb +6 -1
  129. data/lib/card/format/method_delegation.rb +10 -2
  130. data/lib/card/format/nest.rb +2 -1
  131. data/lib/card/format/nest/fetch.rb +2 -0
  132. data/lib/card/format/nesting/mode.rb +1 -1
  133. data/lib/card/format/nesting/subformat.rb +2 -1
  134. data/lib/card/format/render.rb +2 -2
  135. data/lib/card/format/wrapper.rb +1 -1
  136. data/lib/card/lexicon.rb +3 -2
  137. data/lib/card/mark.rb +17 -15
  138. data/lib/card/model/save_helper.rb +3 -3
  139. data/lib/card/name.rb +10 -9
  140. data/lib/card/name/all.rb +3 -0
  141. data/lib/card/name/all/descendants.rb +3 -4
  142. data/lib/card/name/card_class.rb +2 -0
  143. data/lib/card/name/fields_and_traits.rb +4 -2
  144. data/lib/card/name/name_variants.rb +0 -1
  145. data/lib/card/query.rb +17 -17
  146. data/lib/card/query/card_query/interpretation.rb +1 -0
  147. data/lib/card/query/card_query/match_attributes.rb +2 -1
  148. data/lib/card/query/card_query/normalization.rb +1 -0
  149. data/lib/card/query/card_query/reference_attributes.rb +1 -1
  150. data/lib/card/query/join.rb +1 -1
  151. data/lib/card/query/value/match_value.rb +1 -0
  152. data/lib/card/reference/all.rb +7 -2
  153. data/lib/card/rule/all.rb +1 -0
  154. data/lib/card/rule/cache.rb +2 -0
  155. data/lib/card/set/advanced_api.rb +3 -2
  156. data/lib/card/set/event.rb +2 -2
  157. data/lib/card/set/event/all.rb +6 -0
  158. data/lib/card/set/event/delayed_event.rb +6 -6
  159. data/lib/card/set/event/options.rb +1 -0
  160. data/lib/card/set/format/abstract_format/view_definition.rb +1 -0
  161. data/lib/card/set/format/abstract_format/view_opts.rb +1 -0
  162. data/lib/card/set/i18n_scope.rb +4 -2
  163. data/lib/card/set/inheritance.rb +0 -1
  164. data/lib/card/set/loader.rb +0 -2
  165. data/lib/card/set/pattern/base.rb +3 -2
  166. data/lib/card/set/pattern/class_methods.rb +2 -2
  167. data/lib/card/set/required_field.rb +4 -1
  168. data/lib/card/setting.rb +3 -0
  169. data/lib/card/subcards.rb +3 -4
  170. data/lib/card/tasks/card/file_card_creator/abstract_file_card/ruby_file.rb +1 -1
  171. data/lib/card/tasks/card/file_card_creator/output_helper.rb +2 -4
  172. data/lib/card/tasks/card/migrate.rake +2 -2
  173. data/lib/card/view/cache.rb +6 -8
  174. data/lib/card/view/cache/cache_action.rb +1 -2
  175. data/lib/card/view/cache/stub.rb +1 -1
  176. data/lib/card/view/options.rb +3 -3
  177. data/lib/card/view/permission.rb +1 -0
  178. data/lib/cardio.rb +1 -1
  179. data/lib/cardio/migration.rb +1 -1
  180. data/lib/cardio/migration/deck_structure.rb +2 -4
  181. data/lib/cardio/migration/import.rb +2 -2
  182. data/lib/cardio/migration/import/import_data.rb +1 -0
  183. data/lib/cardio/mod.rb +1 -0
  184. data/lib/cardio/mod/load_strategy.rb +2 -4
  185. data/lib/cardio/mod/loader/set_loader.rb +2 -1
  186. data/lib/cardio/mod/module_template.rb +1 -0
  187. data/lib/cardio/modfiles.rb +2 -4
  188. data/lib/cardio/schema.rb +2 -4
  189. data/lib/cardio/utils.rb +1 -0
  190. data/lib/generators/card/format/format_generator.rb +1 -1
  191. data/lib/generators/card/migration/migration_generator.rb +2 -1
  192. data/lib/generators/card/mod/mod_generator.rb +3 -2
  193. data/lib/generators/card/set/set_generator.rb +3 -3
  194. data/lib/generators/card/template/template_generator.rb +1 -1
  195. data/mod/admin/set/self/admin.rb +6 -3
  196. data/mod/admin/set/self/trash.rb +1 -0
  197. data/mod/admin/spec/set/self/admin_spec.rb +4 -4
  198. data/mod/core/set/all/abort.rb +5 -5
  199. data/mod/core/set/all/assign_attributes.rb +5 -8
  200. data/mod/core/set/all/codename.rb +1 -0
  201. data/mod/core/set/all/collection.rb +4 -6
  202. data/mod/core/set/all/content.rb +3 -2
  203. data/mod/core/set/all/contextual_content.rb +2 -4
  204. data/mod/core/set/all/name_events.rb +13 -6
  205. data/mod/core/set/all/reference_events.rb +2 -0
  206. data/mod/core/set/all/states.rb +3 -3
  207. data/mod/core/set/all/subcards.rb +1 -1
  208. data/mod/core/set/all/trash.rb +5 -1
  209. data/mod/core/set/all/type.rb +4 -2
  210. data/mod/core/set/all/utils.rb +1 -1
  211. data/mod/core/spec/set/all/assign_attributes_spec.rb +10 -9
  212. data/mod/core/spec/set/all/clean_me_spec.rb +19 -4
  213. data/mod/core/spec/set/all/collection_spec.rb +1 -1
  214. data/mod/core/spec/set/all/export_spec.rb +1 -0
  215. data/mod/core/spec/set/all/initialize_spec.rb +11 -11
  216. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6dd18af985f887f9ee6235c4da09625f700fbd33db1d62ca8ce2e50e4a745c7
4
- data.tar.gz: 5e20663bf4a06a6c11b20b6311a8be0b7e09e3bac6197608d160c0415e22802a
3
+ metadata.gz: 471e6eb7596b5743e59b50b9158fa16953ba916f328bb10a2e63153fad797eff
4
+ data.tar.gz: 51cf98adab2d3b8bf4c6f9b6a374d31da99da82d14b96eb3fc50634b8948e3d9
5
5
  SHA512:
6
- metadata.gz: 3e76c614cf17af63b8588d1ea249846f4b856924994a1c8ebd35b6515985c7642aff654746a5270fcd69c41c27214b7b65d211032597d7b50dfee9df131f87da
7
- data.tar.gz: 413c7d66e9a44e8db643b4f61222b43bd882f6d9c69e2e2ab1c67c3a0ee143d7c430298bbe82e73b4f9b2aa99bfaa708dc546eb24a1d91f920fc22f47b76f461
6
+ metadata.gz: 6e86bce11c52e5fb214a5df5e09389f8328320c53316e0fba5a6747fe644d5e5468081dbd9d8e22c3a83b7db8b48a8d3cda25340dc0c3e1ec31901cc78c812fa
7
+ data.tar.gz: 68f7a39e5a47dd497c7ab4bc2160d4f125e4a9e617cd1bb3625472ac09b201917ba2f1688f3960cf90ab9064314a281265acea03f63f46bffc10c95ab37585c4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.11.4
1
+ 0.11.5
@@ -58,11 +58,6 @@ search:
58
58
  ## Root directories for relative keys resolution.
59
59
  relative_roots:
60
60
  - .
61
- # - app/controllers
62
- # - app/helpers
63
- # - app/mailers
64
- # - app/presenters
65
- # - app/views
66
61
 
67
62
  ## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting:
68
63
  ## %w(*.jpg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less *.yml *.json)
@@ -7,8 +7,9 @@ module CoreExtensions
7
7
  end.join "\n"
8
8
  end
9
9
 
10
- def to_name
10
+ def cardname
11
11
  Card::Name.compose self
12
12
  end
13
+ alias_method :to_name, :cardname
13
14
  end
14
15
  end
@@ -13,6 +13,7 @@ module CoreExtensions
13
13
 
14
14
  def initialize_nested classes, level=0
15
15
  return classes[level].new if level == classes.size - 1
16
+
16
17
  classes[level].new do |h, k|
17
18
  h[k] = initialize_nested classes, level + 1
18
19
  end
@@ -18,16 +18,20 @@ module CoreExtensions
18
18
  klone
19
19
  end
20
20
 
21
- def send_unless method, *args, &_block
22
- (block_given? ? yield : self) || send(method, *args)
21
+ # @return [Card::Name]
22
+ def cardname
23
+ Card::Name.new self
23
24
  end
25
+ alias_method :to_name, :cardname
24
26
 
25
- def send_if method, *args, &_block
26
- (block_given? ? yield : self) && send(method, *args)
27
+ # @return [Card]
28
+ def card
29
+ Card[cardname]
27
30
  end
28
31
 
29
- def to_name
30
- Card::Name.new self
32
+ # @return [Integer] id of card with name
33
+ def card_id
34
+ cardname.card_id
31
35
  end
32
36
 
33
37
  def name?
@@ -36,7 +40,11 @@ module CoreExtensions
36
40
  # (at least in development mode) but the name cache is persistent.
37
41
  # Hence the name objects in the cache are objects of a different instance of the
38
42
  # Card::Name class and is_a?(Card::Name) will return false
39
- self.is_a? Cardname
43
+ is_a? Cardname
44
+ end
45
+
46
+ def in? other
47
+ other.include? self
40
48
  end
41
49
 
42
50
  def deep_clone_instance_variables
@@ -44,9 +52,5 @@ module CoreExtensions
44
52
  instance_variable_set v, instance_variable_get(v).deep_clone
45
53
  end
46
54
  end
47
-
48
- def in? other
49
- other.include? self
50
- end
51
55
  end
52
56
  end
@@ -69,7 +69,7 @@ module Patches
69
69
  end
70
70
  end
71
71
 
72
- def transform_integer_keys(hash, integer_keys)
72
+ def transform_integer_keys hash, integer_keys
73
73
  hash.transform_keys do |key|
74
74
  if integer_keys.include?(key)
75
75
  key.to_i
@@ -42,9 +42,7 @@ module Patches
42
42
 
43
43
  loop do
44
44
  relation = reorder(table[primary_key].asc).limit(batch_size)
45
- if batch_start
46
- relation = relation.where(table[primary_key].gt(batch_start))
47
- end
45
+ relation = relation.where(table[primary_key].gt(batch_start)) if batch_start
48
46
  items = relation.pluck(*select_columns)
49
47
 
50
48
  break if items.empty?
@@ -21,9 +21,7 @@ module Patches
21
21
  def real_filename_and_line_offset filename
22
22
  File.open(filename) do |file|
23
23
  file.each_line.with_index do |line, i|
24
- if line =~ /pulled from ([\S]+) ~~/
25
- return Regexp.last_match(1), i + 1
26
- end
24
+ return Regexp.last_match(1), i + 1 if line.match?(/pulled from (\S+) ~~/)
27
25
  end
28
26
  end
29
27
  [filename, 0]
@@ -2,7 +2,7 @@ module Patches
2
2
  module Kaminari
3
3
  module Helpers
4
4
  module Tag
5
- def self.included(klass)
5
+ def self.included klass
6
6
  klass.class_eval do
7
7
  remove_method :page_url_for
8
8
  end
@@ -33,7 +33,7 @@ module Patches
33
33
  # to: {other: "params", user: {name: "yuki", page: nil}}
34
34
  # (when @param_name == "user[page]")
35
35
  @param_name.to_s.scan(/\w+/)[0..-2]
36
- .inject(page_params) { |h, k| h[k] }[$&] = nil
36
+ .inject(page_params) { |h, k| h[k] }[Regexp.last_match(0)] = nil
37
37
  end
38
38
 
39
39
  page_params
@@ -1,3 +1,3 @@
1
- if File.exist? 'config/deck.yml'
1
+ if File.exist? "config/deck.yml"
2
2
  Decko.application.config.x = OpenStruct.new(Decko.application.config_for(:deck))
3
3
  end
@@ -1,4 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
+
2
3
  # Be sure to restart your server when you modify this file.
3
4
 
4
5
  # Add new inflection rules using the following format
@@ -4,28 +4,30 @@
4
4
  #
5
5
  # Necessary since 'card' is packaged as a gem which is not an Engine
6
6
 
7
- I18n.load_path += Dir.glob(Pathname(__FILE__).parent.parent.to_s +
8
- "/locales/*.{rb,yml}")
7
+ I18n.load_path += Dir.glob("#{Pathname(__FILE__).parent.parent}/locales/*.{rb,yml}")
9
8
 
10
9
  # see http://svenfuchs.com/2009/7/19/experimental-ruby-i18n-extensions-pluralization-fallbacks-gettext-cache-and-chained-backend
11
- module I18n::Backend::Transformers
12
-
13
- # this variable is a hook to allow dynamic activation/deactivation
14
- @@demark_enable = true
15
-
16
- def translate(*args)
17
- transform_text(super) { |entry| "⟪#{entry}⟫" }
18
- end
19
-
20
- def localize(*args)
21
- transform_text(super) { |entry| "⟦#{entry}⟧" }
22
- end
23
-
24
- def transform_text entry
25
- if @@demark_enable && entry && (entry.is_a? String)
26
- yield(entry)
27
- else
28
- entry
10
+ module I18n
11
+ module Backend
12
+ module Transformers
13
+ # this variable is a hook to allow dynamic activation/deactivation
14
+ @@demark_enable = true
15
+
16
+ def translate *args
17
+ transform_text(super) { |entry| "⟪#{entry}⟫" }
18
+ end
19
+
20
+ def localize *args
21
+ transform_text(super) { |entry| "⟦#{entry}⟧" }
22
+ end
23
+
24
+ def transform_text entry
25
+ if @@demark_enable && entry && (entry.is_a? String)
26
+ yield(entry)
27
+ else
28
+ entry
29
+ end
30
+ end
29
31
  end
30
32
  end
31
33
  end
@@ -39,6 +41,6 @@ end
39
41
  # or ./config/environments/*.rb file.
40
42
 
41
43
  if ENV["DECKO_I18N_DEMARK"]
42
- I18n::Backend::Simple.send(:include, I18n::Backend::Transformers)
44
+ I18n::Backend::Simple.include I18n::Backend::Transformers
43
45
  puts "DECKO_I18N_DEMARK is active"
44
46
  end
@@ -1,4 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
+
2
3
  # Be sure to restart your server when you modify this file.
3
4
  # Add new mime types for use in respond_to blocks:
4
5
 
@@ -1,4 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
+
2
3
  ActiveSupport::Notifications.subscribe(/^card/) do |name, start, finish, _id, payload|
3
4
  Rails.logger.debug "#{(finish - start) * 1000}ms: #{name}: #{payload[:message]}"
4
5
  end
@@ -47,9 +47,11 @@ module ActiveRecord #:nodoc: all
47
47
  end
48
48
  end
49
49
 
50
- module ActiveJob::Arguments #:nodoc: all
51
- class << self
52
- prepend Patches::ActiveJob::Arguments
50
+ module ActiveJob
51
+ module Arguments #:nodoc: all
52
+ class << self
53
+ prepend Patches::ActiveJob::Arguments
54
+ end
53
55
  end
54
56
  end
55
57
 
@@ -61,9 +63,8 @@ module ActiveSupport #:nodoc: all
61
63
  end
62
64
  end
63
65
 
64
-
65
66
  module Zeitwerk #:nodoc: all
66
67
  class Loader
67
68
  prepend Patches::Zeitwerk
68
69
  end
69
- end
70
+ end
@@ -59,22 +59,11 @@ en:
59
59
  core_exception_almost_deleted: Narrowly averted deleting current file
60
60
  core_is_incomplete: is incomplete
61
61
  core_only_admins_codename: only admins can set codename
62
-
63
- # core_label_set_all_cards: All cards
64
- # core_label_set_plus_cards: All "+" cards
65
- # core_label_set_right_cards: All "+%{name}" cards
66
- # core_label_set_rstar_cards: All "+*" cards
67
- # core_label_set_self_card: The card "%{name}"
68
- # core_label_set_star_cards: All "*" cards
69
- # core_label_set_type_cards: All "%{name}" cards
70
- # core_label_set_typeplusright_cards: All "+%{right}" cards on "%{type}" cards
71
- # core_label_setfollow_all_cards: everything
72
- # core_label_setfollow_plus_cards: all "+" cards
73
- # core_label_setfollow_right_cards: all "+%{name}s"
74
- # core_label_setfollow_rstar_cards: all "+*" cards
75
- # core_label_setfollow_star_cards: all "*" cards
76
- # core_label_setfollow_type_cards: all "%{name}s"
77
- # core_label_setfollow_typeplusright_cards: all "+%{right}" on "%{type}s"
62
+ core_rename_and_update: "Rename and Update"
63
+ core_renaming: "Renaming"
64
+ core_rename: "Rename"
65
+ core_rename_confirm: "Are you sure you want to rename"
66
+ core_rename_reference_confirm: "This name is referred to at least %{count} time(s). You may choose to <em>update</em> those references to use the new name."
78
67
 
79
68
  admin_warn: ADMINISTRATOR WARNING
80
69
  admin_email_off: Email delivery is turned off. Change settings in %{path} to send sign up notifications.
@@ -185,3 +174,8 @@ en:
185
174
  rules_templating: Templating
186
175
  rules_webpage: Webpage
187
176
  rules_editing: Editing
177
+
178
+ alias_target_must_be_simple: "must be aliased to a single, valid simple card"
179
+ alias_must_be_simple: "must be a simple (not a compound) card"
180
+ alias_cards_no_children: "Alias cards can't have children"
181
+ alias_redirect_former_name: "redirect former name to new one"
@@ -1,4 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
+
2
3
  class RequireEarlierMigrations < ActiveRecord::Migration[4.2]
3
4
  def self.up
4
5
  raise %(
@@ -1,4 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
+
2
3
  class Require110Migrations < ActiveRecord::Migration[4.2]
3
4
  def self.up
4
5
  raise %(
@@ -1,4 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
+
2
3
  class SplitLinkType < ActiveRecord::Migration[4.2]
3
4
  def up
4
5
  add_column :card_references, :present, :integer
@@ -1,4 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
+
2
3
  class UpdateLinkType < ActiveRecord::Migration[4.2]
3
4
  class TmpReference < ApplicationRecord
4
5
  self.table_name = "card_references"
@@ -1,4 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
+
2
3
  class TableCleanup < ActiveRecord::Migration[4.2]
3
4
  def up
4
5
  drop_table :cardtypes
@@ -20,6 +21,5 @@ class TableCleanup < ActiveRecord::Migration[4.2]
20
21
  remove_column :card_references, :updated_at
21
22
  end
22
23
 
23
- def down
24
- end
24
+ def down; end
25
25
  end
@@ -1,4 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
+
2
3
  class TrunkLeft < ActiveRecord::Migration[4.2]
3
4
  def up
4
5
  rename_column :card_references, :link_type, :ref_type
@@ -1,4 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
+
2
3
  class UpdateCodenames < ActiveRecord::Migration[4.2]
3
4
  def up
4
5
  { content: :structure, edit_help: :help }.each do |oldname, newname|
@@ -1,4 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
+
2
3
  class CreateNewRevisionTables < ActiveRecord::Migration[4.2]
3
4
  def up
4
5
  add_column :cards, :db_content, :text
@@ -8,15 +8,19 @@ class MoveRevisionsToActions < ActiveRecord::Migration[4.2]
8
8
  TmpRevision.joins(left_join).where("cards.id IS NULL").delete_all
9
9
  end
10
10
  end
11
+
11
12
  class TmpAct < ApplicationRecord
12
13
  self.table_name = "card_acts"
13
14
  end
15
+
14
16
  class TmpAction < ApplicationRecord
15
17
  self.table_name = "card_actions"
16
18
  end
19
+
17
20
  class TmpChange < ApplicationRecord
18
21
  self.table_name = "card_changes"
19
22
  end
23
+
20
24
  class TmpCard < ApplicationRecord
21
25
  belongs_to :tmp_revision, foreign_key: :current_revision_id
22
26
  has_many :tmp_actions, foreign_key: :card_id
@@ -30,7 +34,10 @@ class MoveRevisionsToActions < ActiveRecord::Migration[4.2]
30
34
  created = ::Set.new
31
35
 
32
36
  TmpRevision.find_each do |rev|
33
- TmpAct.create({ id: rev.id, card_id: rev.card_id, actor_id: rev.creator_id, acted_at: rev.created_at }, without_protection: true)
37
+ TmpAct.create(
38
+ { id: rev.id, card_id: rev.card_id, actor_id: rev.creator_id,
39
+ acted_at: rev.created_at }, without_protection: true
40
+ )
34
41
  if created.include? rev.card_id
35
42
  TmpAction.connection.execute "INSERT INTO card_actions (id, card_id, card_act_id, action_type) VALUES
36
43
  ('#{rev.id}', '#{rev.card_id}', '#{rev.id}', 1)"
@@ -59,6 +66,5 @@ class MoveRevisionsToActions < ActiveRecord::Migration[4.2]
59
66
  # remove_column :cards, :current_revision
60
67
  end
61
68
 
62
- def down
63
- end
69
+ def down; end
64
70
  end
@@ -6,11 +6,15 @@ class BetterIndexNames < ActiveRecord::Migration[4.2]
6
6
  rename_index :card_actions, "card_act_id_index", "card_actions_card_act_id_index"
7
7
  rename_index :card_actions, "card_id_index", "card_actions_card_id_index"
8
8
 
9
- rename_index :card_changes, "card_action_id_index", "card_changes_card_action_id_index"
9
+ rename_index :card_changes, "card_action_id_index",
10
+ "card_changes_card_action_id_index"
10
11
 
11
- rename_index :card_references, "wiki_references_referenced_card_id", "card_references_referee_id_index"
12
- rename_index :card_references, "wiki_references_referenced_name", "card_references_referee_key_index"
13
- rename_index :card_references, "wiki_references_card_id", "card_references_referer_id_index"
12
+ rename_index :card_references, "wiki_references_referenced_card_id",
13
+ "card_references_referee_id_index"
14
+ rename_index :card_references, "wiki_references_referenced_name",
15
+ "card_references_referee_key_index"
16
+ rename_index :card_references, "wiki_references_card_id",
17
+ "card_references_referer_id_index"
14
18
 
15
19
  rename_index :cards, "cards_key_uniq", "cards_key_index"
16
20
  rename_index :cards, "card_type_index", "cards_type_id_index"
@@ -19,6 +23,5 @@ class BetterIndexNames < ActiveRecord::Migration[4.2]
19
23
  rename_index :cards, "index_cards_on_read_rule_id", "cards_read_rule_id_index"
20
24
  end
21
25
 
22
- def down
23
- end
26
+ def down; end
24
27
  end
@@ -13,7 +13,7 @@ class CreateDelayedJobs < ActiveRecord::Migration[5.1]
13
13
  table.timestamps null: true
14
14
  end
15
15
 
16
- add_index :delayed_jobs, [:priority, :run_at], name: "delayed_jobs_priority"
16
+ add_index :delayed_jobs, %i[priority run_at], name: "delayed_jobs_priority"
17
17
  end
18
18
 
19
19
  def self.down