decidim-core 0.27.4 → 0.27.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/activity_cell.rb +2 -2
- data/app/cells/decidim/card_cell.rb +2 -2
- data/app/cells/decidim/card_m/top.erb +1 -1
- data/app/cells/decidim/card_m_cell.rb +1 -1
- data/app/cells/decidim/scopes_picker/scope_picker_values.erb +1 -1
- data/app/cells/decidim/tags_cell.rb +3 -1
- data/app/cells/decidim/upload_modal/modal.erb +4 -1
- data/app/cells/decidim/upload_modal_cell.rb +8 -4
- data/app/cells/decidim/user_profile_cell.rb +1 -1
- data/app/cells/decidim/version_cell.rb +1 -1
- data/app/cells/decidim/versions_list_cell.rb +1 -1
- data/app/commands/decidim/create_omniauth_registration.rb +2 -4
- data/app/commands/decidim/endorse_resource.rb +2 -0
- data/app/commands/decidim/messaging/reply_to_conversation.rb +3 -0
- data/app/commands/decidim/messaging/start_conversation.rb +3 -0
- data/app/commands/decidim/search.rb +1 -1
- data/app/commands/decidim/unendorse_resource.rb +1 -1
- data/app/controllers/concerns/decidim/devise_authentication_methods.rb +36 -0
- data/app/controllers/concerns/decidim/force_authentication.rb +6 -2
- data/app/controllers/concerns/decidim/paginable.rb +1 -1
- data/app/controllers/decidim/devise/omniauth_registrations_controller.rb +1 -22
- data/app/controllers/decidim/devise/registrations_controller.rb +1 -1
- data/app/controllers/decidim/devise/sessions_controller.rb +1 -24
- data/app/controllers/decidim/links_controller.rb +1 -1
- data/app/controllers/decidim/searches_controller.rb +1 -1
- data/app/controllers/decidim/user_timeline_controller.rb +1 -1
- data/app/controllers/decidim/widgets_controller.rb +6 -0
- data/app/events/decidim/welcome_notification_event.rb +6 -9
- data/app/forms/decidim/account_form.rb +1 -1
- data/app/forms/decidim/notifications_settings_form.rb +0 -8
- data/app/forms/decidim/registration_form.rb +1 -1
- data/app/helpers/decidim/cells_paginate_helper.rb +1 -1
- data/app/helpers/decidim/check_boxes_tree_helper.rb +4 -4
- data/app/helpers/decidim/decidim_form_helper.rb +1 -0
- data/app/helpers/decidim/newsletters_helper.rb +83 -16
- data/app/helpers/decidim/omniauth_helper.rb +2 -0
- data/app/helpers/decidim/resource_helper.rb +3 -1
- data/app/helpers/decidim/sanitize_helper.rb +9 -0
- data/app/helpers/decidim/short_link_helper.rb +1 -1
- data/app/helpers/decidim/user_profile_helper.rb +7 -2
- data/app/jobs/decidim/download_your_data_export_job.rb +2 -1
- data/app/jobs/decidim/open_data_job.rb +2 -0
- data/app/mailers/decidim/messaging/conversation_mailer.rb +3 -72
- data/app/models/decidim/push_notification_message.rb +39 -0
- data/app/models/decidim/user.rb +9 -1
- data/app/packs/images/decidim/icons.svg +1 -1
- data/app/packs/images/decidim/vendor/social-share-button/x.svg +6 -0
- data/app/packs/src/decidim/autocomplete.js +11 -2
- data/app/packs/src/decidim/data_picker.js +1 -0
- data/app/packs/src/decidim/direct_uploads/upload_field.js +6 -4
- data/app/packs/src/decidim/direct_uploads/upload_modal.js +10 -8
- data/app/packs/src/decidim/direct_uploads/uploader.js +4 -1
- data/app/packs/src/decidim/geocoding/attach_input.js +4 -1
- data/app/packs/src/decidim/geocoding/provider/here.js +17 -21
- data/app/packs/src/decidim/geocoding/provider/photon.js +1 -1
- data/app/packs/src/decidim/input_hashtags.js +1 -1
- data/app/packs/src/decidim/input_mentions.js +1 -1
- data/app/packs/src/decidim/input_multiple_mentions.js +1 -1
- data/app/packs/src/decidim/utilities/text.js +17 -0
- data/app/packs/src/decidim/vizzs/index.js +1 -1
- data/app/packs/stylesheets/decidim/_variables.scss +1 -1
- data/app/packs/stylesheets/decidim/plugins/leaflet.scss +118 -114
- data/app/packs/stylesheets/decidim/vendor/_social_share_button.scss +4 -0
- data/app/presenters/decidim/admin_log/oauth_application_resource_presenter.rb +1 -1
- data/app/presenters/decidim/notification_to_mailer_presenter.rb +9 -0
- data/app/services/decidim/events_manager.rb +6 -0
- data/app/services/decidim/push_notification_message_sender.rb +36 -0
- data/app/services/decidim/send_push_notification.rb +22 -8
- data/app/views/decidim/devise/registrations/new.html.erb +2 -2
- data/app/views/decidim/notifications_digest_mailer/_email_content.html.erb +7 -0
- data/app/views/decidim/notifications_settings/show.html.erb +1 -1
- data/app/views/decidim/scopes/_scopes_picker_input.html.erb +1 -1
- data/app/views/decidim/searches/_filters.html.erb +3 -1
- data/app/views/decidim/shared/_address_details.html.erb +2 -2
- data/app/views/decidim/shared/_share_modal.html.erb +1 -1
- data/app/views/decidim/shared/participatory_space_filters/_filters.html.erb +1 -1
- data/app/views/layouts/decidim/_js_configuration.html.erb +1 -0
- data/app/views/layouts/decidim/_social_media_links.html.erb +2 -2
- data/config/locales/ar.yml +12 -16
- data/config/locales/bg.yml +77 -15
- data/config/locales/ca.yml +34 -30
- data/config/locales/cs.yml +18 -14
- data/config/locales/de.yml +62 -58
- data/config/locales/el.yml +11 -16
- data/config/locales/en.yml +5 -1
- data/config/locales/eo.yml +2 -3
- data/config/locales/es-MX.yml +15 -11
- data/config/locales/es-PY.yml +15 -11
- data/config/locales/es.yml +30 -26
- data/config/locales/eu.yml +500 -342
- data/config/locales/fi-plain.yml +7 -3
- data/config/locales/fi.yml +21 -17
- data/config/locales/fr-CA.yml +17 -13
- data/config/locales/fr.yml +12 -8
- data/config/locales/ga-IE.yml +5 -5
- data/config/locales/gl.yml +5 -19
- data/config/locales/he-IL.yml +1 -0
- data/config/locales/hu.yml +63 -23
- data/config/locales/id-ID.yml +4 -19
- data/config/locales/is-IS.yml +4 -2
- data/config/locales/it.yml +15 -17
- data/config/locales/ja.yml +26 -22
- data/config/locales/lb.yml +15 -17
- data/config/locales/lt.yml +55 -10
- data/config/locales/lv.yml +4 -16
- data/config/locales/nl.yml +12 -12
- data/config/locales/no.yml +8 -10
- data/config/locales/pl.yml +151 -1
- data/config/locales/pt-BR.yml +267 -22
- data/config/locales/pt.yml +8 -10
- data/config/locales/ro-RO.yml +4 -10
- data/config/locales/ru.yml +13 -17
- data/config/locales/sk.yml +7 -17
- data/config/locales/sl.yml +0 -5
- data/config/locales/sq-AL.yml +1 -0
- data/config/locales/sv.yml +55 -17
- data/config/locales/th-TH.yml +1 -0
- data/config/locales/tr-TR.yml +18 -15
- data/config/locales/uk.yml +17 -14
- data/config/locales/zh-CN.yml +6 -10
- data/config/locales/zh-TW.yml +0 -9
- data/db/migrate/20231027142329_change_default_value_for_decidim_endorsements.rb +11 -0
- data/db/seeds.rb +1 -0
- data/decidim-core.gemspec +78 -0
- data/lib/decidim/acts_as_tree.rb +14 -1
- data/lib/decidim/asset_router/storage.rb +4 -0
- data/lib/decidim/attribute_encryptor.rb +6 -4
- data/lib/decidim/core/engine.rb +7 -3
- data/lib/decidim/core/test/factories.rb +309 -95
- data/lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb +6 -26
- data/lib/decidim/core/test/shared_examples/amendable/amendment_promoted_event_examples.rb +8 -26
- data/lib/decidim/core/test/shared_examples/comments_examples.rb +56 -0
- data/lib/decidim/core/test/shared_examples/embed_resource_examples.rb +187 -11
- data/lib/decidim/core/test/shared_examples/errors.rb +2 -0
- data/lib/decidim/core/test/shared_examples/has_attachment_collections.rb +8 -6
- data/lib/decidim/core/test/shared_examples/has_attachments.rb +4 -4
- data/lib/decidim/core/test/shared_examples/has_category.rb +27 -0
- data/lib/decidim/core/test/shared_examples/has_reference.rb +1 -1
- data/lib/decidim/core/test/shared_examples/has_space_in_mcell_examples.rb +1 -2
- data/lib/decidim/core/test/shared_examples/resource_endorsed_event_examples.rb +6 -3
- data/lib/decidim/core/test/shared_examples/resource_locator_presenter_examples.rb +134 -0
- data/lib/decidim/core/test/shared_examples/searchable_results_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/simple_event.rb +50 -2
- data/lib/decidim/core/test.rb +1 -0
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/core.rb +2 -1
- data/lib/decidim/endorsable.rb +1 -1
- data/lib/decidim/engine_router.rb +17 -4
- data/lib/decidim/events/base_event.rb +5 -2
- data/lib/decidim/events/simple_event.rb +3 -17
- data/lib/decidim/exporters.rb +10 -1
- data/lib/decidim/form_builder.rb +1 -0
- data/lib/decidim/has_category.rb +3 -3
- data/lib/decidim/has_conversations.rb +91 -0
- data/lib/decidim/participable.rb +17 -0
- data/lib/decidim/view_model.rb +1 -0
- data/lib/decidim/webpacker/webpack/.modernizrrc +9 -0
- data/lib/premailer/adapter/decidim.rb +5 -4
- data/lib/tasks/decidim_reminders_tasks.rake +1 -0
- data/lib/tasks/upgrade/decidim_deduplicate_endorsements.rake +53 -0
- data/lib/tasks/upgrade/decidim_fix_categorization.rake +15 -0
- data/lib/tasks/upgrade/decidim_fix_short_url_resolver.rake +22 -0
- metadata +37 -32
- data/app/helpers/decidim/layout_helper.rb.orig +0 -225
- data/app/packs/stylesheets/decidim/modules/_dropdown_menu.scss +0 -9
- data/app/views/decidim/devise/registrations/new.html.erb.orig +0 -231
- /data/{config/environment.rb → app/packs/images/decidim/.keep} +0 -0
@@ -8,8 +8,39 @@ require "decidim/participatory_processes/test/factories"
|
|
8
8
|
require "decidim/assemblies/test/factories"
|
9
9
|
require "decidim/comments/test/factories"
|
10
10
|
|
11
|
-
def
|
12
|
-
|
11
|
+
def generate_component_name(locales, manifest_name, skip_injection: false)
|
12
|
+
prepend = skip_injection ? "" : "<script>alert(\"#{manifest_name}\");</script>"
|
13
|
+
|
14
|
+
Decidim::Components::Namer.new(locales, manifest_name).i18n_name.transform_values { |v| [prepend, v].compact_blank.join(" ") }
|
15
|
+
end
|
16
|
+
|
17
|
+
def generate_localized_description(field = nil, skip_injection: false, before: "<p>", after: "</p>")
|
18
|
+
Decidim::Faker::Localized.wrapped(before, after) do
|
19
|
+
generate_localized_title(field, skip_injection: skip_injection)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def generate_localized_word(field = nil, skip_injection: false)
|
24
|
+
skip_injection = true if field.nil?
|
25
|
+
Decidim::Faker::Localized.localized do
|
26
|
+
if skip_injection
|
27
|
+
Faker::Lorem.word
|
28
|
+
else
|
29
|
+
"<script>alert(\"#{field}\");</script> #{Faker::Lorem.word}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def generate_localized_title(field = nil, skip_injection: false)
|
35
|
+
skip_injection = true if field.nil?
|
36
|
+
|
37
|
+
Decidim::Faker::Localized.localized do
|
38
|
+
if skip_injection
|
39
|
+
generate(:title)
|
40
|
+
else
|
41
|
+
"<script>alert(\"#{field}\");</script> #{generate(:title)}"
|
42
|
+
end
|
43
|
+
end
|
13
44
|
end
|
14
45
|
|
15
46
|
FactoryBot.define do
|
@@ -54,21 +85,29 @@ FactoryBot.define do
|
|
54
85
|
end
|
55
86
|
|
56
87
|
factory :category, class: "Decidim::Category" do
|
57
|
-
|
58
|
-
|
88
|
+
transient do
|
89
|
+
skip_injection { false }
|
90
|
+
end
|
91
|
+
|
92
|
+
name { generate_localized_title(:category_name, skip_injection: skip_injection) }
|
93
|
+
description { generate_localized_description(:category_description, skip_injection: skip_injection) }
|
59
94
|
weight { 0 }
|
60
95
|
|
61
96
|
association :participatory_space, factory: :participatory_process
|
62
97
|
end
|
63
98
|
|
64
99
|
factory :subcategory, parent: :category do
|
65
|
-
|
100
|
+
transient do
|
101
|
+
skip_injection { false }
|
102
|
+
end
|
103
|
+
parent { build(:category, skip_injection: skip_injection) }
|
66
104
|
|
67
105
|
participatory_space { parent.participatory_space }
|
68
106
|
end
|
69
107
|
|
70
108
|
factory :organization, class: "Decidim::Organization" do
|
71
109
|
transient do
|
110
|
+
skip_injection { false }
|
72
111
|
create_static_pages { true }
|
73
112
|
end
|
74
113
|
|
@@ -81,7 +120,7 @@ FactoryBot.define do
|
|
81
120
|
youtube_handler { Faker::Hipster.word }
|
82
121
|
github_handler { Faker::Hipster.word }
|
83
122
|
sequence(:host) { |n| "#{n}.lvh.me" }
|
84
|
-
description {
|
123
|
+
description { generate_localized_description(:organization_description, skip_injection: skip_injection) }
|
85
124
|
favicon { Decidim::Dev.test_file("icon.png", "image/png") }
|
86
125
|
default_locale { Decidim.default_locale }
|
87
126
|
available_locales { Decidim.available_locales }
|
@@ -95,7 +134,7 @@ FactoryBot.define do
|
|
95
134
|
user_groups_enabled { true }
|
96
135
|
send_welcome_notification { true }
|
97
136
|
comments_max_length { 1000 }
|
98
|
-
admin_terms_of_use_body {
|
137
|
+
admin_terms_of_use_body { generate_localized_description(:admin_terms_of_service_body, skip_injection: skip_injection) }
|
99
138
|
force_users_to_authenticate_before_access_organization { false }
|
100
139
|
machine_translation_display_priority { "original" }
|
101
140
|
external_domain_whitelist { ["example.org", "twitter.com", "facebook.com", "youtube.com", "github.com", "mytesturl.me"] }
|
@@ -118,12 +157,15 @@ FactoryBot.define do
|
|
118
157
|
after(:create) do |organization, evaluator|
|
119
158
|
if evaluator.create_static_pages
|
120
159
|
tos_page = Decidim::StaticPage.find_by(slug: "terms-and-conditions", organization: organization)
|
121
|
-
create(:static_page, :tos, organization: organization) if tos_page.nil?
|
160
|
+
create(:static_page, :tos, organization: organization, skip_injection: evaluator.skip_injection) if tos_page.nil?
|
122
161
|
end
|
123
162
|
end
|
124
163
|
end
|
125
164
|
|
126
165
|
factory :user, class: "Decidim::User" do
|
166
|
+
transient do
|
167
|
+
skip_injection { false }
|
168
|
+
end
|
127
169
|
email { generate(:email) }
|
128
170
|
name { generate(:name) }
|
129
171
|
nickname { generate(:nickname) }
|
@@ -132,7 +174,7 @@ FactoryBot.define do
|
|
132
174
|
tos_agreement { "1" }
|
133
175
|
avatar { Decidim::Dev.test_file("avatar.jpg", "image/jpeg") }
|
134
176
|
personal_url { Faker::Internet.url }
|
135
|
-
about {
|
177
|
+
about { generate_localized_title(:user_about, skip_injection: skip_injection) }
|
136
178
|
confirmation_sent_at { Time.current }
|
137
179
|
accepted_tos_version { organization.tos_version }
|
138
180
|
notifications_sending_frequency { "real_time" }
|
@@ -181,7 +223,7 @@ FactoryBot.define do
|
|
181
223
|
|
182
224
|
trait :officialized do
|
183
225
|
officialized_at { Time.current }
|
184
|
-
officialized_as { generate_localized_title }
|
226
|
+
officialized_as { generate_localized_title(:officialized_as, skip_injection: skip_injection) }
|
185
227
|
end
|
186
228
|
|
187
229
|
after(:build) do |user, evaluator|
|
@@ -194,17 +236,24 @@ FactoryBot.define do
|
|
194
236
|
end
|
195
237
|
|
196
238
|
factory :participatory_space_private_user, class: "Decidim::ParticipatorySpacePrivateUser" do
|
239
|
+
transient do
|
240
|
+
skip_injection { false }
|
241
|
+
end
|
197
242
|
user
|
198
|
-
privatable_to { create
|
243
|
+
privatable_to { create(:participatory_process, organization: user.organization, skip_injection: skip_injection) }
|
199
244
|
end
|
200
245
|
|
201
246
|
factory :assembly_private_user, class: "Decidim::ParticipatorySpacePrivateUser" do
|
247
|
+
transient do
|
248
|
+
skip_injection { false }
|
249
|
+
end
|
202
250
|
user
|
203
|
-
privatable_to { create
|
251
|
+
privatable_to { create(:assembly, organization: user.organization, skip_injection: skip_injection) }
|
204
252
|
end
|
205
253
|
|
206
254
|
factory :user_group, class: "Decidim::UserGroup" do
|
207
255
|
transient do
|
256
|
+
skip_injection { false }
|
208
257
|
document_number { "#{Faker::Number.number(digits: 8)}X" }
|
209
258
|
phone { Faker::PhoneNumber.phone_number }
|
210
259
|
rejected_at { nil }
|
@@ -214,7 +263,7 @@ FactoryBot.define do
|
|
214
263
|
sequence(:name) { |n| "#{Faker::Company.name} #{n}" }
|
215
264
|
email { generate(:user_group_email) }
|
216
265
|
nickname { generate(:nickname) }
|
217
|
-
about {
|
266
|
+
about { generate_localized_title(:user_group_about, skip_injection: skip_injection) }
|
218
267
|
organization
|
219
268
|
avatar { Decidim::Dev.test_file("avatar.jpg", "image/jpeg") } # Keep after organization
|
220
269
|
|
@@ -255,21 +304,27 @@ FactoryBot.define do
|
|
255
304
|
next if users.empty?
|
256
305
|
|
257
306
|
creator = users.shift
|
258
|
-
create(:user_group_membership, user: creator, user_group: user_group, role: :creator)
|
307
|
+
create(:user_group_membership, user: creator, user_group: user_group, role: :creator, skip_injection: evaluator.skip_injection)
|
259
308
|
|
260
309
|
users.each do |user|
|
261
|
-
create(:user_group_membership, user: user, user_group: user_group, role: :admin)
|
310
|
+
create(:user_group_membership, user: user, user_group: user_group, role: :admin, skip_injection: evaluator.skip_injection)
|
262
311
|
end
|
263
312
|
end
|
264
313
|
end
|
265
314
|
|
266
315
|
factory :user_group_membership, class: "Decidim::UserGroupMembership" do
|
267
|
-
|
316
|
+
transient do
|
317
|
+
skip_injection { false }
|
318
|
+
end
|
319
|
+
user { create(:user, :confirmed, organization: user_group.organization, skip_injection: skip_injection) }
|
268
320
|
role { :creator }
|
269
321
|
user_group
|
270
322
|
end
|
271
323
|
|
272
324
|
factory :identity, class: "Decidim::Identity" do
|
325
|
+
transient do
|
326
|
+
skip_injection { false }
|
327
|
+
end
|
273
328
|
provider { "facebook" }
|
274
329
|
sequence(:uid)
|
275
330
|
user
|
@@ -277,6 +332,9 @@ FactoryBot.define do
|
|
277
332
|
end
|
278
333
|
|
279
334
|
factory :authorization, class: "Decidim::Authorization" do
|
335
|
+
transient do
|
336
|
+
skip_injection { false }
|
337
|
+
end
|
280
338
|
sequence(:name) { |n| "dummy_authorization_#{n}" }
|
281
339
|
user
|
282
340
|
metadata { {} }
|
@@ -292,10 +350,13 @@ FactoryBot.define do
|
|
292
350
|
end
|
293
351
|
|
294
352
|
factory :static_page, class: "Decidim::StaticPage" do
|
353
|
+
transient do
|
354
|
+
skip_injection { false }
|
355
|
+
end
|
295
356
|
slug { generate(:slug) }
|
296
|
-
title { generate_localized_title }
|
297
|
-
content {
|
298
|
-
organization { build(:organization) }
|
357
|
+
title { generate_localized_title(:static_page_title, skip_injection: skip_injection) }
|
358
|
+
content { generate_localized_description(:static_page_content, skip_injection: skip_injection) }
|
359
|
+
organization { build(:organization, skip_injection: skip_injection) }
|
299
360
|
allow_public_access { false }
|
300
361
|
|
301
362
|
trait :default do
|
@@ -311,8 +372,8 @@ FactoryBot.define do
|
|
311
372
|
end
|
312
373
|
|
313
374
|
trait :with_topic do
|
314
|
-
after(:create) do |static_page|
|
315
|
-
topic = create(:static_page_topic, organization: static_page.organization)
|
375
|
+
after(:create) do |static_page, evaluator|
|
376
|
+
topic = create(:static_page_topic, organization: static_page.organization, skip_injection: evaluator.skip_injection)
|
316
377
|
static_page.topic = topic
|
317
378
|
static_page.save
|
318
379
|
end
|
@@ -320,24 +381,33 @@ FactoryBot.define do
|
|
320
381
|
end
|
321
382
|
|
322
383
|
factory :static_page_topic, class: "Decidim::StaticPageTopic" do
|
323
|
-
|
324
|
-
|
384
|
+
transient do
|
385
|
+
skip_injection { false }
|
386
|
+
end
|
387
|
+
title { generate_localized_title(:static_page_topic_title, skip_injection: skip_injection) }
|
388
|
+
description { generate_localized_description(:static_page_topic_description, skip_injection: skip_injection) }
|
325
389
|
organization
|
326
390
|
end
|
327
391
|
|
328
392
|
factory :attachment_collection, class: "Decidim::AttachmentCollection" do
|
329
|
-
|
330
|
-
|
393
|
+
transient do
|
394
|
+
skip_injection { false }
|
395
|
+
end
|
396
|
+
name { generate_localized_title(:attachment_collection_name, skip_injection: skip_injection) }
|
397
|
+
description { generate_localized_title(:attachment_collection_description, skip_injection: skip_injection) }
|
331
398
|
weight { Faker::Number.number(digits: 1) }
|
332
399
|
|
333
400
|
association :collection_for, factory: :participatory_process
|
334
401
|
end
|
335
402
|
|
336
403
|
factory :attachment, class: "Decidim::Attachment" do
|
337
|
-
|
338
|
-
|
404
|
+
transient do
|
405
|
+
skip_injection { false }
|
406
|
+
end
|
407
|
+
title { generate_localized_title(:attachment_title, skip_injection: skip_injection) }
|
408
|
+
description { generate_localized_title(:attachment_description, skip_injection: skip_injection) }
|
339
409
|
weight { Faker::Number.number(digits: 1) }
|
340
|
-
attached_to { build(:participatory_process) }
|
410
|
+
attached_to { build(:participatory_process, skip_injection: skip_injection) }
|
341
411
|
content_type { "image/jpeg" }
|
342
412
|
file { Decidim::Dev.test_file("city.jpeg", "image/jpeg") } # Keep after attached_to
|
343
413
|
file_size { 108_908 }
|
@@ -355,22 +425,24 @@ FactoryBot.define do
|
|
355
425
|
|
356
426
|
factory :component, class: "Decidim::Component" do
|
357
427
|
transient do
|
358
|
-
|
428
|
+
skip_injection { false }
|
429
|
+
organization { create(:organization, skip_injection: skip_injection) }
|
359
430
|
end
|
360
431
|
|
361
|
-
name { generate_localized_title }
|
362
|
-
participatory_space { create(:participatory_process, organization: organization) }
|
432
|
+
name { generate_localized_title(:component_name, skip_injection: skip_injection) }
|
433
|
+
participatory_space { create(:participatory_process, organization: organization, skip_injection: skip_injection) }
|
363
434
|
manifest_name { "dummy" }
|
364
435
|
published_at { Time.current }
|
365
436
|
settings do
|
366
437
|
{
|
367
|
-
dummy_global_translatable_text: generate_localized_title
|
438
|
+
dummy_global_translatable_text: generate_localized_title(:dummy_global_translatable_text, skip_injection: skip_injection),
|
439
|
+
comments_max_length: participatory_space.organization.comments_max_length || organization.comments_max_length
|
368
440
|
}
|
369
441
|
end
|
370
442
|
|
371
443
|
default_step_settings do
|
372
444
|
{
|
373
|
-
dummy_step_translatable_text: generate_localized_title
|
445
|
+
dummy_step_translatable_text: generate_localized_title(:dummy_step_translatable_text, skip_injection: skip_injection)
|
374
446
|
}
|
375
447
|
end
|
376
448
|
|
@@ -408,7 +480,8 @@ FactoryBot.define do
|
|
408
480
|
create(:participatory_process_step,
|
409
481
|
active: true,
|
410
482
|
end_date: 1.month.from_now,
|
411
|
-
participatory_process: participatory_space
|
483
|
+
participatory_process: participatory_space,
|
484
|
+
skip_injection: skip_injection)
|
412
485
|
participatory_space.reload
|
413
486
|
participatory_space.steps.reload
|
414
487
|
end
|
@@ -451,20 +524,29 @@ FactoryBot.define do
|
|
451
524
|
end
|
452
525
|
|
453
526
|
factory :scope_type, class: "Decidim::ScopeType" do
|
454
|
-
|
527
|
+
transient do
|
528
|
+
skip_injection { false }
|
529
|
+
end
|
530
|
+
name { generate_localized_word(:scope_type_name, skip_injection: skip_injection) }
|
455
531
|
plural { Decidim::Faker::Localized.literal(name.values.first.pluralize) }
|
456
532
|
organization
|
457
533
|
end
|
458
534
|
|
459
535
|
factory :scope, class: "Decidim::Scope" do
|
536
|
+
transient do
|
537
|
+
skip_injection { false }
|
538
|
+
end
|
460
539
|
name { Decidim::Faker::Localized.literal(generate(:scope_name)) }
|
461
540
|
code { generate(:scope_code) }
|
462
|
-
scope_type { create(:scope_type, organization: organization) }
|
463
|
-
organization { parent ? parent.organization : build(:organization) }
|
541
|
+
scope_type { create(:scope_type, organization: organization, skip_injection: skip_injection) }
|
542
|
+
organization { parent ? parent.organization : build(:organization, skip_injection: skip_injection) }
|
464
543
|
end
|
465
544
|
|
466
545
|
factory :subscope, parent: :scope do
|
467
|
-
|
546
|
+
transient do
|
547
|
+
skip_injection { false }
|
548
|
+
end
|
549
|
+
parent { build(:scope, skip_injection: skip_injection) }
|
468
550
|
|
469
551
|
before(:create) do |object|
|
470
552
|
object.parent.save unless object.parent.persisted?
|
@@ -472,84 +554,105 @@ FactoryBot.define do
|
|
472
554
|
end
|
473
555
|
|
474
556
|
factory :area_type, class: "Decidim::AreaType" do
|
475
|
-
|
557
|
+
transient do
|
558
|
+
skip_injection { false }
|
559
|
+
end
|
560
|
+
name { generate_localized_word(:area_type_name, skip_injection: skip_injection) }
|
476
561
|
plural { Decidim::Faker::Localized.literal(name.values.first.pluralize) }
|
477
562
|
organization
|
478
563
|
end
|
479
564
|
|
480
565
|
factory :area, class: "Decidim::Area" do
|
566
|
+
transient do
|
567
|
+
skip_injection { false }
|
568
|
+
end
|
481
569
|
name { Decidim::Faker::Localized.literal(generate(:area_name)) }
|
482
570
|
organization
|
483
571
|
end
|
484
572
|
|
485
573
|
factory :coauthorship, class: "Decidim::Coauthorship" do
|
486
|
-
|
574
|
+
transient do
|
575
|
+
skip_injection { false }
|
576
|
+
end
|
577
|
+
coauthorable { create(:dummy_resource, skip_injection: skip_injection) }
|
487
578
|
transient do
|
488
579
|
organization { coauthorable.component.participatory_space.organization }
|
489
580
|
end
|
490
|
-
author { create(:user, :confirmed, organization: organization) }
|
581
|
+
author { create(:user, :confirmed, organization: organization, skip_injection: skip_injection) }
|
491
582
|
end
|
492
583
|
|
493
584
|
factory :dummy_resource, class: "Decidim::DummyResources::DummyResource" do
|
494
585
|
transient do
|
586
|
+
skip_injection { false }
|
495
587
|
users { nil }
|
496
588
|
# user_groups correspondence to users is by sorting order
|
497
589
|
user_groups { [] }
|
498
590
|
end
|
499
|
-
title {
|
500
|
-
component { create(:
|
501
|
-
author { create(:user, :confirmed, organization: component.organization) }
|
502
|
-
scope { create(:scope, organization: component.organization) }
|
591
|
+
title { generate_localized_title(:dummy_resource_title, skip_injection: skip_injection) }
|
592
|
+
component { create(:dummy_component, skip_injection: skip_injection) }
|
593
|
+
author { create(:user, :confirmed, organization: component.organization, skip_injection: skip_injection) }
|
594
|
+
scope { create(:scope, organization: component.organization, skip_injection: skip_injection) }
|
503
595
|
|
504
596
|
trait :published do
|
505
597
|
published_at { Time.current }
|
506
598
|
end
|
507
599
|
|
508
600
|
trait :with_endorsements do
|
509
|
-
after :create do |resource|
|
601
|
+
after :create do |resource, evaluator|
|
510
602
|
5.times.collect do
|
511
|
-
create(:endorsement, resource: resource,
|
603
|
+
create(:endorsement, resource: resource, skip_injection: evaluator.skip_injection,
|
604
|
+
author: build(:user, organization: resource.component.organization, skip_injection: evaluator.skip_injection))
|
512
605
|
end
|
513
606
|
end
|
514
607
|
end
|
515
608
|
end
|
516
609
|
|
517
610
|
factory :nested_dummy_resource, class: "Decidim::DummyResources::NestedDummyResource" do
|
611
|
+
transient do
|
612
|
+
skip_injection { false }
|
613
|
+
end
|
518
614
|
title { generate(:name) }
|
519
|
-
dummy_resource { create(:dummy_resource) }
|
615
|
+
dummy_resource { create(:dummy_resource, skip_injection: skip_injection) }
|
520
616
|
end
|
521
617
|
|
522
618
|
factory :coauthorable_dummy_resource, class: "Decidim::DummyResources::CoauthorableDummyResource" do
|
523
|
-
title { generate(:name) }
|
524
|
-
component { create(:component, manifest_name: "dummy") }
|
525
|
-
|
526
619
|
transient do
|
527
|
-
|
620
|
+
skip_injection { false }
|
621
|
+
|
622
|
+
authors_list { [create(:user, organization: component.organization, skip_injection: skip_injection)] }
|
528
623
|
end
|
624
|
+
title { generate(:name) }
|
625
|
+
component { create(:component, manifest_name: "dummy", skip_injection: skip_injection) }
|
529
626
|
|
530
627
|
after :build do |resource, evaluator|
|
531
628
|
evaluator.authors_list.each do |coauthor|
|
532
629
|
resource.coauthorships << if coauthor.is_a?(::Decidim::UserGroup)
|
533
|
-
build(:coauthorship, author: coauthor.users.first, user_group: coauthor, coauthorable: resource,
|
630
|
+
build(:coauthorship, author: coauthor.users.first, user_group: coauthor, coauthorable: resource,
|
631
|
+
organization: evaluator.component.organization, skip_injection: evaluator.skip_injection)
|
534
632
|
else
|
535
|
-
build(:coauthorship, author: coauthor, coauthorable: resource,
|
633
|
+
build(:coauthorship, author: coauthor, coauthorable: resource,
|
634
|
+
organization: evaluator.component.organization, skip_injection: evaluator.skip_injection)
|
536
635
|
end
|
537
636
|
end
|
538
637
|
end
|
539
638
|
end
|
540
639
|
|
541
640
|
factory :resource_link, class: "Decidim::ResourceLink" do
|
641
|
+
transient do
|
642
|
+
skip_injection { false }
|
643
|
+
end
|
542
644
|
name { generate(:slug) }
|
543
|
-
to { build(:dummy_resource) }
|
544
|
-
from { build(:dummy_resource, component: to.component) }
|
645
|
+
to { build(:dummy_resource, skip_injection: skip_injection) }
|
646
|
+
from { build(:dummy_resource, component: to.component, skip_injection: skip_injection) }
|
545
647
|
end
|
546
648
|
|
547
649
|
factory :newsletter, class: "Decidim::Newsletter" do
|
548
650
|
transient do
|
549
|
-
|
651
|
+
skip_injection { false }
|
652
|
+
body { generate_localized_description(:newsletter_body, skip_injection: skip_injection) }
|
550
653
|
end
|
551
654
|
|
552
|
-
author { build(:user, :confirmed, organization: organization) }
|
655
|
+
author { build(:user, :confirmed, organization: organization, skip_injection: skip_injection) }
|
553
656
|
organization
|
554
657
|
|
555
658
|
subject { generate_localized_title }
|
@@ -561,7 +664,8 @@ FactoryBot.define do
|
|
561
664
|
organization: evaluator.organization,
|
562
665
|
scoped_resource_id: newsletter.id,
|
563
666
|
manifest_name: "basic_only_text",
|
564
|
-
settings: evaluator.body.transform_keys { |key| "body_#{key}" }
|
667
|
+
settings: evaluator.body.transform_keys { |key| "body_#{key}" },
|
668
|
+
skip_injection: evaluator.skip_injection
|
565
669
|
)
|
566
670
|
end
|
567
671
|
|
@@ -571,7 +675,10 @@ FactoryBot.define do
|
|
571
675
|
end
|
572
676
|
|
573
677
|
factory :moderation, class: "Decidim::Moderation" do
|
574
|
-
|
678
|
+
transient do
|
679
|
+
skip_injection { false }
|
680
|
+
end
|
681
|
+
reportable { build(:dummy_resource, skip_injection: skip_injection) }
|
575
682
|
participatory_space { reportable.component.participatory_space }
|
576
683
|
|
577
684
|
trait :hidden do
|
@@ -580,35 +687,47 @@ FactoryBot.define do
|
|
580
687
|
end
|
581
688
|
|
582
689
|
factory :report, class: "Decidim::Report" do
|
690
|
+
transient do
|
691
|
+
skip_injection { false }
|
692
|
+
end
|
583
693
|
moderation
|
584
|
-
user { build(:user, organization: moderation.reportable.organization) }
|
694
|
+
user { build(:user, organization: moderation.reportable.organization, skip_injection: skip_injection) }
|
585
695
|
reason { "spam" }
|
586
696
|
end
|
587
697
|
|
588
698
|
factory :impersonation_log, class: "Decidim::ImpersonationLog" do
|
589
|
-
|
590
|
-
|
699
|
+
transient do
|
700
|
+
skip_injection { false }
|
701
|
+
end
|
702
|
+
admin { build(:user, :admin, skip_injection: skip_injection) }
|
703
|
+
user { build(:user, :managed, organization: admin.organization, skip_injection: skip_injection) }
|
591
704
|
started_at { 10.minutes.ago }
|
592
705
|
end
|
593
706
|
|
594
707
|
factory :follow, class: "Decidim::Follow" do
|
708
|
+
transient do
|
709
|
+
skip_injection { false }
|
710
|
+
end
|
595
711
|
user do
|
596
712
|
build(
|
597
713
|
:user,
|
598
|
-
organization: followable.try(:organization) || build(:organization)
|
714
|
+
organization: followable.try(:organization) || build(:organization, skip_injection: skip_injection)
|
599
715
|
)
|
600
716
|
end
|
601
|
-
followable { build(:dummy_resource) }
|
717
|
+
followable { build(:dummy_resource, skip_injection: skip_injection) }
|
602
718
|
end
|
603
719
|
|
604
720
|
factory :notification, class: "Decidim::Notification" do
|
721
|
+
transient do
|
722
|
+
skip_injection { false }
|
723
|
+
end
|
605
724
|
user do
|
606
725
|
build(
|
607
726
|
:user,
|
608
|
-
organization: resource.try(:organization) || build(:organization)
|
727
|
+
organization: resource.try(:organization) || build(:organization, skip_injection: skip_injection)
|
609
728
|
)
|
610
729
|
end
|
611
|
-
resource { build(:dummy_resource) }
|
730
|
+
resource { build(:dummy_resource, skip_injection: skip_injection) }
|
612
731
|
event_name { resource.class.name.underscore.tr("/", ".") }
|
613
732
|
event_class { "Decidim::DummyResourceEvent" }
|
614
733
|
extra do
|
@@ -618,16 +737,60 @@ FactoryBot.define do
|
|
618
737
|
end
|
619
738
|
end
|
620
739
|
|
740
|
+
factory :conversation, class: "Decidim::Messaging::Conversation" do
|
741
|
+
transient do
|
742
|
+
skip_injection { false }
|
743
|
+
end
|
744
|
+
|
745
|
+
originator { build(:user) }
|
746
|
+
interlocutors { [build(:user)] }
|
747
|
+
body { Faker::Lorem.sentence }
|
748
|
+
user
|
749
|
+
|
750
|
+
after(:create) do |object|
|
751
|
+
object.participants ||= [originator + interlocutors].flatten
|
752
|
+
end
|
753
|
+
|
754
|
+
initialize_with { Decidim::Messaging::Conversation.start(originator: originator, interlocutors: interlocutors, body: body, user: user) }
|
755
|
+
end
|
756
|
+
|
757
|
+
factory :message, class: "Decidim::Messaging::Message" do
|
758
|
+
transient do
|
759
|
+
skip_injection { false }
|
760
|
+
end
|
761
|
+
|
762
|
+
body { generate_localized_description(:message_body) }
|
763
|
+
conversation
|
764
|
+
|
765
|
+
before(:create) do |object|
|
766
|
+
object.sender ||= object.conversation.participants.take
|
767
|
+
end
|
768
|
+
end
|
769
|
+
|
770
|
+
factory :push_notification_message, class: "Decidim::PushNotificationMessage" do
|
771
|
+
transient do
|
772
|
+
skip_injection { false }
|
773
|
+
end
|
774
|
+
|
775
|
+
recipient { build(:user) }
|
776
|
+
conversation { create(:conversation) }
|
777
|
+
message { generate_localized_description(:push_notification_message_message) }
|
778
|
+
|
779
|
+
skip_create
|
780
|
+
initialize_with { Decidim::PushNotificationMessage.new(recipient: recipient, conversation: conversation, message: message) }
|
781
|
+
end
|
782
|
+
|
621
783
|
factory :action_log, class: "Decidim::ActionLog" do
|
622
784
|
transient do
|
785
|
+
skip_injection { false }
|
623
786
|
extra_data { {} }
|
624
787
|
end
|
625
788
|
|
626
789
|
organization { user.organization }
|
627
790
|
user
|
628
|
-
participatory_space { build
|
629
|
-
component { build
|
630
|
-
resource { build(:dummy_resource, component: component) }
|
791
|
+
participatory_space { build(:participatory_process, organization: organization, skip_injection: skip_injection) }
|
792
|
+
component { build(:component, participatory_space: participatory_space, skip_injection: skip_injection) }
|
793
|
+
resource { build(:dummy_resource, component: component, skip_injection: skip_injection) }
|
631
794
|
action { "create" }
|
632
795
|
visibility { "admin-only" }
|
633
796
|
extra do
|
@@ -653,6 +816,9 @@ FactoryBot.define do
|
|
653
816
|
end
|
654
817
|
|
655
818
|
factory :oauth_application, class: "Decidim::OAuthApplication" do
|
819
|
+
transient do
|
820
|
+
skip_injection { false }
|
821
|
+
end
|
656
822
|
organization
|
657
823
|
sequence(:name) { |n| "OAuth application #{n}" }
|
658
824
|
sequence(:organization_name) { |n| "OAuth application owner #{n}" }
|
@@ -663,8 +829,11 @@ FactoryBot.define do
|
|
663
829
|
end
|
664
830
|
|
665
831
|
factory :oauth_access_token, class: "Doorkeeper::AccessToken" do
|
666
|
-
|
667
|
-
|
832
|
+
transient do
|
833
|
+
skip_injection { false }
|
834
|
+
end
|
835
|
+
resource_owner_id { create(:user, organization: application.organization, skip_injection: skip_injection).id }
|
836
|
+
application { build(:oauth_application, skip_injection: skip_injection) }
|
668
837
|
token { SecureRandom.hex(32) }
|
669
838
|
expires_in { 1.month.from_now }
|
670
839
|
created_at { Time.current }
|
@@ -672,7 +841,10 @@ FactoryBot.define do
|
|
672
841
|
end
|
673
842
|
|
674
843
|
factory :searchable_resource, class: "Decidim::SearchableResource" do
|
675
|
-
|
844
|
+
transient do
|
845
|
+
skip_injection { false }
|
846
|
+
end
|
847
|
+
resource { build(:dummy_resource, skip_injection: skip_injection) }
|
676
848
|
resource_id { resource.id }
|
677
849
|
resource_type { resource.class.name }
|
678
850
|
organization { resource.component.organization }
|
@@ -684,6 +856,9 @@ FactoryBot.define do
|
|
684
856
|
end
|
685
857
|
|
686
858
|
factory :content_block, class: "Decidim::ContentBlock" do
|
859
|
+
transient do
|
860
|
+
skip_injection { false }
|
861
|
+
end
|
687
862
|
organization
|
688
863
|
scope_name { :homepage }
|
689
864
|
manifest_name { :hero }
|
@@ -697,24 +872,33 @@ FactoryBot.define do
|
|
697
872
|
end
|
698
873
|
|
699
874
|
factory :hashtag, class: "Decidim::Hashtag" do
|
875
|
+
transient do
|
876
|
+
skip_injection { false }
|
877
|
+
end
|
700
878
|
name { generate(:hashtag_name) }
|
701
879
|
organization
|
702
880
|
end
|
703
881
|
|
704
882
|
factory :metric, class: "Decidim::Metric" do
|
883
|
+
transient do
|
884
|
+
skip_injection { false }
|
885
|
+
end
|
705
886
|
organization
|
706
887
|
day { Time.zone.today }
|
707
888
|
metric_type { "random_metric" }
|
708
889
|
cumulative { 2 }
|
709
890
|
quantity { 1 }
|
710
891
|
category { create :category }
|
711
|
-
participatory_space { create
|
712
|
-
related_object { create
|
892
|
+
participatory_space { create(:participatory_process, organization: organization, skip_injection: skip_injection) }
|
893
|
+
related_object { create(:component, participatory_space: participatory_space, skip_injection: skip_injection) }
|
713
894
|
end
|
714
895
|
|
715
896
|
factory :amendment, class: "Decidim::Amendment" do
|
716
|
-
|
717
|
-
|
897
|
+
transient do
|
898
|
+
skip_injection { false }
|
899
|
+
end
|
900
|
+
amendable { build(:dummy_resource, skip_injection: skip_injection) }
|
901
|
+
emendation { build(:dummy_resource, skip_injection: skip_injection) }
|
718
902
|
amender { emendation.try(:creator_author) || emendation.try(:author) }
|
719
903
|
state { "evaluating" }
|
720
904
|
|
@@ -728,29 +912,44 @@ FactoryBot.define do
|
|
728
912
|
end
|
729
913
|
|
730
914
|
factory :user_report, class: "Decidim::UserReport" do
|
915
|
+
transient do
|
916
|
+
skip_injection { false }
|
917
|
+
end
|
731
918
|
reason { "spam" }
|
732
|
-
moderation { create(:user_moderation, user: user) }
|
919
|
+
moderation { create(:user_moderation, user: user, skip_injection: skip_injection) }
|
733
920
|
user { build(:user) }
|
734
921
|
end
|
735
922
|
|
736
923
|
factory :user_moderation, class: "Decidim::UserModeration" do
|
737
|
-
|
924
|
+
transient do
|
925
|
+
skip_injection { false }
|
926
|
+
end
|
927
|
+
user { build(:user, skip_injection: skip_injection) }
|
738
928
|
end
|
739
929
|
|
740
930
|
factory :endorsement, class: "Decidim::Endorsement" do
|
741
|
-
|
742
|
-
|
931
|
+
transient do
|
932
|
+
skip_injection { false }
|
933
|
+
end
|
934
|
+
resource { build(:dummy_resource, skip_injection: skip_injection) }
|
935
|
+
author { resource.try(:creator_author) || resource.try(:author) || build(:user, organization: resource.organization, skip_injection: skip_injection) }
|
743
936
|
end
|
744
937
|
|
745
938
|
factory :user_group_endorsement, class: "Decidim::Endorsement" do
|
746
|
-
|
747
|
-
|
748
|
-
|
939
|
+
transient do
|
940
|
+
skip_injection { false }
|
941
|
+
end
|
942
|
+
resource { build(:dummy_resource, skip_injection: skip_injection) }
|
943
|
+
author { build(:user, organization: resource.organization, skip_injection: skip_injection) }
|
944
|
+
user_group { create(:user_group, verified_at: Time.current, organization: resource.organization, users: [author], skip_injection: skip_injection) }
|
749
945
|
end
|
750
946
|
|
751
947
|
factory :share_token, class: "Decidim::ShareToken" do
|
752
|
-
|
753
|
-
|
948
|
+
transient do
|
949
|
+
skip_injection { false }
|
950
|
+
end
|
951
|
+
token_for { build(:component, skip_injection: skip_injection) }
|
952
|
+
user { build(:user, organization: token_for.organization, skip_injection: skip_injection) }
|
754
953
|
|
755
954
|
before(:create) do |object|
|
756
955
|
object.organization ||= object.token_for.organization
|
@@ -767,33 +966,48 @@ FactoryBot.define do
|
|
767
966
|
end
|
768
967
|
|
769
968
|
factory :editor_image, class: "Decidim::EditorImage" do
|
969
|
+
transient do
|
970
|
+
skip_injection { false }
|
971
|
+
end
|
770
972
|
organization
|
771
|
-
author { create(:user, :admin, :confirmed, organization: organization) }
|
973
|
+
author { create(:user, :admin, :confirmed, organization: organization, skip_injection: skip_injection) }
|
772
974
|
file { Decidim::Dev.test_file("city.jpeg", "image/jpeg") }
|
773
975
|
end
|
774
976
|
|
775
977
|
factory :reminder, class: "Decidim::Reminder" do
|
776
|
-
|
777
|
-
|
978
|
+
transient do
|
979
|
+
skip_injection { false }
|
980
|
+
end
|
981
|
+
user { build(:user, skip_injection: skip_injection) }
|
982
|
+
component { build(:dummy_component, organization: user.organization, skip_injection: skip_injection) }
|
778
983
|
end
|
779
984
|
|
780
985
|
factory :reminder_record, class: "Decidim::ReminderRecord" do
|
781
|
-
|
782
|
-
|
986
|
+
transient do
|
987
|
+
skip_injection { false }
|
988
|
+
end
|
989
|
+
reminder { create(:reminder, skip_injection: skip_injection) }
|
990
|
+
remindable { build(:dummy_resource, skip_injection: skip_injection) }
|
783
991
|
end
|
784
992
|
|
785
993
|
factory :reminder_delivery, class: "Decidim::ReminderDelivery" do
|
786
|
-
|
994
|
+
transient do
|
995
|
+
skip_injection { false }
|
996
|
+
end
|
997
|
+
reminder { create(:reminder, skip_injection: skip_injection) }
|
787
998
|
end
|
788
999
|
|
789
1000
|
factory :short_link, class: "Decidim::ShortLink" do
|
790
|
-
|
1001
|
+
transient do
|
1002
|
+
skip_injection { false }
|
1003
|
+
end
|
1004
|
+
target { create(:component, manifest_name: "dummy", skip_injection: skip_injection) }
|
791
1005
|
route_name { nil }
|
792
1006
|
params { {} }
|
793
1007
|
|
794
|
-
before(:create) do |object|
|
1008
|
+
before(:create) do |object, evaluator|
|
795
1009
|
object.organization ||= object.target if object.target.is_a?(Decidim::Organization)
|
796
|
-
object.organization ||= object.target.try(:organization) || create(:organization)
|
1010
|
+
object.organization ||= object.target.try(:organization) || create(:organization, skip_injection: evaluator.skip_injection)
|
797
1011
|
object.identifier ||= Decidim::ShortLink.unique_identifier_within(object.organization)
|
798
1012
|
object.mounted_engine_name ||=
|
799
1013
|
if object.target.respond_to?(:participatory_space)
|