decidim-core 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7aef118b45544583ccef9e497e131abd9ebf17d3
4
- data.tar.gz: 709860181e8c9d539a57b926e227a0f0724f0ef7
3
+ metadata.gz: 57d950df7b4b3bc59a364fae1306993591d25843
4
+ data.tar.gz: 507479b4b86006a2e3f0ea0eabb6c087865ffecb
5
5
  SHA512:
6
- metadata.gz: ccd59cd78c452237c4c5108ff4244dcc083a9fb0e819ed11862bc99f7d1da495ec348df9210d8f25537504cb3bc9d2ce3121a09081f018dc44730457ac327b08
7
- data.tar.gz: 3bfaa063bd3e73479f5acbdd7abc44538a0b318a84aed2282dd3ce2baa490e08e218c4413ff16d96c49911e0fec960a07cbecfe65e89113ce467dff24b48f690
6
+ metadata.gz: 6019e44c765d88dd513921ff1abc67b69911c53228408d5696f7c9be1bdfea47a845af095a0ae93fbe57af9430c6ef940fc9f006f67a9fc497b0415fa1d5777f
7
+ data.tar.gz: 002e8f943ac4dd60dfc627312966bc94574eabdd664073af2ee35a063fa4a4806690ded0134987a5fd591d963fcc3018ff65c6c159f32a0ea42608565704e83f
@@ -4,13 +4,20 @@ class MigrateUserRolesToParticipatoryProcessRoles < ActiveRecord::Migration[5.1]
4
4
  def up
5
5
  participatory_processes = Decidim::ParticipatoryProcess.includes(:organization).all
6
6
  Decidim::User.find_each do |user|
7
- next if user.roles.include? "admin"
7
+ next if user.roles.empty? || user.roles.include?("admin")
8
+
8
9
  processes = participatory_processes.select { |process| process.organization == user.organization }
9
- processes.each do |process|
10
- user.roles.each do |role|
11
- Decidim::ParticipatoryProcessUserRole.find_or_create_by(user: user, process: process, role: role)
10
+ values = processes.map do |process|
11
+ user.roles.map do |role|
12
+ "(#{user.id}, #{process.id}, '#{role}', NOW(), NOW())"
12
13
  end
13
14
  end
15
+
16
+ execute("
17
+ INSERT INTO decidim_admin_participatory_process_user_roles
18
+ (decidim_user_id, decidim_participatory_process_id, role, created_at, updated_at)
19
+ VALUES #{values.join(", ")}
20
+ ")
14
21
  end
15
22
  remove_column :decidim_users, :roles
16
23
  end
@@ -3,7 +3,7 @@
3
3
  # This holds Decidim's version and the Rails version on which it depends.
4
4
  module Decidim
5
5
  def self.version
6
- "0.4.1"
6
+ "0.4.2"
7
7
  end
8
8
 
9
9
  def self.rails_version
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -466,70 +466,70 @@ dependencies:
466
466
  requirements:
467
467
  - - '='
468
468
  - !ruby/object:Gem::Version
469
- version: 0.4.1
469
+ version: 0.4.2
470
470
  type: :runtime
471
471
  prerelease: false
472
472
  version_requirements: !ruby/object:Gem::Requirement
473
473
  requirements:
474
474
  - - '='
475
475
  - !ruby/object:Gem::Version
476
- version: 0.4.1
476
+ version: 0.4.2
477
477
  - !ruby/object:Gem::Dependency
478
478
  name: decidim-dev
479
479
  requirement: !ruby/object:Gem::Requirement
480
480
  requirements:
481
481
  - - '='
482
482
  - !ruby/object:Gem::Version
483
- version: 0.4.1
483
+ version: 0.4.2
484
484
  type: :development
485
485
  prerelease: false
486
486
  version_requirements: !ruby/object:Gem::Requirement
487
487
  requirements:
488
488
  - - '='
489
489
  - !ruby/object:Gem::Version
490
- version: 0.4.1
490
+ version: 0.4.2
491
491
  - !ruby/object:Gem::Dependency
492
492
  name: decidim-proposals
493
493
  requirement: !ruby/object:Gem::Requirement
494
494
  requirements:
495
495
  - - '='
496
496
  - !ruby/object:Gem::Version
497
- version: 0.4.1
497
+ version: 0.4.2
498
498
  type: :development
499
499
  prerelease: false
500
500
  version_requirements: !ruby/object:Gem::Requirement
501
501
  requirements:
502
502
  - - '='
503
503
  - !ruby/object:Gem::Version
504
- version: 0.4.1
504
+ version: 0.4.2
505
505
  - !ruby/object:Gem::Dependency
506
506
  name: decidim-meetings
507
507
  requirement: !ruby/object:Gem::Requirement
508
508
  requirements:
509
509
  - - '='
510
510
  - !ruby/object:Gem::Version
511
- version: 0.4.1
511
+ version: 0.4.2
512
512
  type: :development
513
513
  prerelease: false
514
514
  version_requirements: !ruby/object:Gem::Requirement
515
515
  requirements:
516
516
  - - '='
517
517
  - !ruby/object:Gem::Version
518
- version: 0.4.1
518
+ version: 0.4.2
519
519
  - !ruby/object:Gem::Dependency
520
520
  name: decidim-results
521
521
  requirement: !ruby/object:Gem::Requirement
522
522
  requirements:
523
523
  - - '='
524
524
  - !ruby/object:Gem::Version
525
- version: 0.4.1
525
+ version: 0.4.2
526
526
  type: :development
527
527
  prerelease: false
528
528
  version_requirements: !ruby/object:Gem::Requirement
529
529
  requirements:
530
530
  - - '='
531
531
  - !ruby/object:Gem::Version
532
- version: 0.4.1
532
+ version: 0.4.2
533
533
  description: Adds core features so other engines can hook into the framework.
534
534
  email:
535
535
  - josepjaume@gmail.com