From a39c2e0c34e6db5fc52a780f2f7fee65a142818f Mon Sep 17 00:00:00 2001 From: ayuki_j Date: Thu, 8 Apr 2021 14:28:05 +0900 Subject: [PATCH 1/8] update Ruby version --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3e3d20fed5..400d553115 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM node:10.23.0-alpine as node -FROM ruby:2.6.6-alpine +FROM ruby:2.7.3-alpine RUN apk update \ && apk add --no-cache --virtual build-dependencies \ @@ -30,7 +30,7 @@ ARG RAILS_ENV="production" ENV LANG=C.UTF-8 \ LC_ALL=C.UTF-8 \ BUNDLER_JOBS=4 \ - BUNDLER_VERSION=1.17.3 \ + BUNDLER_VERSION=2.1.4 \ APP_HOME=/app \ RAILS_ENV=${RAILS_ENV} \ SECRET_KEY_BASE=placeholder \ From 12b04b23d2670077bd35078b4534cb7abf60524d Mon Sep 17 00:00:00 2001 From: ayuki_j Date: Thu, 8 Apr 2021 14:29:03 +0900 Subject: [PATCH 2/8] update decidim to v0.24 --- .github/workflows/rails-test.yml | 4 +- .rubocop.yml | 36 +-- Gemfile | 4 +- Gemfile.lock | 506 +++++++++++++++++-------------- 4 files changed, 290 insertions(+), 260 deletions(-) diff --git a/.github/workflows/rails-test.yml b/.github/workflows/rails-test.yml index b45fe024df..5ebe0966e9 100644 --- a/.github/workflows/rails-test.yml +++ b/.github/workflows/rails-test.yml @@ -32,10 +32,10 @@ jobs: run: | sudo apt-get update -y sudo apt-get -yqq install libpq-dev postgresql-client - - name: Set up Ruby 2.6 + - name: Set up Ruby 2.7 uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6 + ruby-version: 2.7 bundler-cache: true - name: Build and Test with RSpec env: diff --git a/.rubocop.yml b/.rubocop.yml index 18650a7536..ca983a8055 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -65,7 +65,7 @@ AllCops: # If a value is specified for TargetRubyVersion then it is used. # Else if .ruby-version exists and it contains an MRI version it is used. # Otherwise we fallback to the oldest officially supported Ruby version (2.0). - TargetRubyVersion: 2.5 + TargetRubyVersion: 2.7 RSpec: Patterns: @@ -89,7 +89,7 @@ Style/Alias: - prefer_alias_method # Align the elements of a hash literal if they span more than one line. -Layout/AlignHash: +Layout/HashAlignment: # Alignment of entries using hash rocket as separator. Valid values are: # # key - left alignment of keys @@ -152,7 +152,7 @@ Layout/AlignHash: - ignore_implicit - ignore_explicit -Layout/AlignParameters: +Layout/ParameterAlignment: # Alignment of parameters in multi-line method calls. # # The `with_first_parameter` style aligns the following lines along the same @@ -267,20 +267,6 @@ Style/BlockDelimiters: - proc - it -Style/BracesAroundHashParameters: - EnforcedStyle: no_braces - SupportedStyles: - # The `braces` style enforces braces around all method parameters that are - # hashes. - - braces - # The `no_braces` style checks that the last parameter doesn't have braces - # around it. - - no_braces - # The `context_dependent` style checks that the last parameter doesn't have - # braces around it, but requires braces if the second to last parameter is - # also a hash literal. - - context_dependent - # Indentation of `when`. Layout/CaseIndentation: EnforcedStyle: case @@ -473,7 +459,7 @@ Naming/FileName: # files with a shebang in the first line). IgnoreExecutableScripts: true -Layout/IndentFirstArgument: +Layout/FirstArgumentIndentation: EnforcedStyle: special_for_inner_method_call_in_parentheses SupportedStyles: # The first parameter should always be indented one step more than the @@ -561,7 +547,7 @@ Layout/IndentationWidth: Width: 2 # Checks the indentation of the first element in an array literal. -Layout/IndentFirstArrayElement: +Layout/FirstArrayElementIndentation: # The value `special_inside_parentheses` means that array literals with # brackets that have their opening bracket on the same line as a surrounding # opening round parenthesis, shall have their first element indented relative @@ -583,13 +569,13 @@ Layout/IndentFirstArrayElement: IndentationWidth: ~ # Checks the indentation of assignment RHS, when on a different line from LHS -Layout/IndentAssignment: +Layout/AssignmentIndentation: # By default, the indentation width from Style/IndentationWidth is used # But it can be overridden by setting this parameter IndentationWidth: ~ # Checks the indentation of the first key in a hash literal. -Layout/IndentFirstHashElement: +Layout/FirstHashElementIndentation: # The value `special_inside_parentheses` means that hash literals with braces # that have their opening brace on the same line as a surrounding opening # round parenthesis, shall have their first key indented relative to the @@ -801,12 +787,12 @@ Naming/PredicateName: - has_ - have_ # Predicate name prefixes that should be removed. - NamePrefixBlacklist: + ForbiddenPrefixes: - is_ - have_ # Predicate names which, despite having a blacklisted prefix, or no ?, # should still be accepted - NameWhitelist: + AllowedMethods: - is_a? # Exclude Rspec specs because there is a strong convetion to write spec # helpers in the form of `have_something` or `be_something`. @@ -987,7 +973,7 @@ Style/TernaryParentheses: - require_no_parentheses AllowSafeAssignment: true -Layout/TrailingBlankLines: +Layout/TrailingEmptyLines: EnforcedStyle: final_newline SupportedStyles: - final_newline @@ -1037,7 +1023,7 @@ Style/TrivialAccessors: # Commonly used in DSLs AllowDSLWriters: false IgnoreClassMethods: false - Whitelist: + AllowedMethods: - to_ary - to_a - to_c diff --git a/Gemfile b/Gemfile index e5a522850d..09ab98884c 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source "https://rubygems.org" ruby RUBY_VERSION -gem "decidim", git: "https://github.com/decidim/decidim.git", branch: "release/0.23-stable" +gem "decidim", git: "https://github.com/decidim/decidim.git", branch: "release/0.24-stable" # gem "decidim", "0.21" # gem "decidim-consultations", "0.23.0.dev" @@ -31,7 +31,7 @@ group :development, :test do gem "byebug", "~> 11.0", platform: :mri gem "figaro" - gem "decidim-dev", git: "https://github.com/decidim/decidim.git", branch: "release/0.23-stable" + gem "decidim-dev", git: "https://github.com/decidim/decidim.git", branch: "release/0.24-stable" gem "dotenv-rails" gem "factory_bot_rails" gem "rspec-rails" diff --git a/Gemfile.lock b/Gemfile.lock index 3071282f80..0f16383f68 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,79 +1,78 @@ GIT remote: https://github.com/decidim/decidim.git - revision: 912bb8b483fd030b9d81299da1d8a92a85037ea3 - branch: release/0.23-stable + revision: dbf54e01397ea3f443525ddec84910846ea987c3 + branch: release/0.24-stable specs: - decidim (0.23.0.dev) - decidim-accountability (= 0.23.0.dev) - decidim-admin (= 0.23.0.dev) - decidim-api (= 0.23.0.dev) - decidim-assemblies (= 0.23.0.dev) - decidim-blogs (= 0.23.0.dev) - decidim-budgets (= 0.23.0.dev) - decidim-comments (= 0.23.0.dev) - decidim-core (= 0.23.0.dev) - decidim-debates (= 0.23.0.dev) - decidim-forms (= 0.23.0.dev) - decidim-generators (= 0.23.0.dev) - decidim-meetings (= 0.23.0.dev) - decidim-pages (= 0.23.0.dev) - decidim-participatory_processes (= 0.23.0.dev) - decidim-proposals (= 0.23.0.dev) - decidim-sortitions (= 0.23.0.dev) - decidim-surveys (= 0.23.0.dev) - decidim-system (= 0.23.0.dev) - decidim-templates (= 0.23.0.dev) - decidim-verifications (= 0.23.0.dev) - decidim-accountability (0.23.0.dev) - decidim-comments (= 0.23.0.dev) - decidim-core (= 0.23.0.dev) + decidim (0.24.0) + decidim-accountability (= 0.24.0) + decidim-admin (= 0.24.0) + decidim-api (= 0.24.0) + decidim-assemblies (= 0.24.0) + decidim-blogs (= 0.24.0) + decidim-budgets (= 0.24.0) + decidim-comments (= 0.24.0) + decidim-core (= 0.24.0) + decidim-debates (= 0.24.0) + decidim-forms (= 0.24.0) + decidim-generators (= 0.24.0) + decidim-meetings (= 0.24.0) + decidim-pages (= 0.24.0) + decidim-participatory_processes (= 0.24.0) + decidim-proposals (= 0.24.0) + decidim-sortitions (= 0.24.0) + decidim-surveys (= 0.24.0) + decidim-system (= 0.24.0) + decidim-templates (= 0.24.0) + decidim-verifications (= 0.24.0) + decidim-accountability (0.24.0) + decidim-comments (= 0.24.0) + decidim-core (= 0.24.0) kaminari (~> 1.2, >= 1.2.1) searchlight (~> 4.1) - decidim-admin (0.23.0.dev) + decidim-admin (0.24.0) active_link_to (~> 1.0) - decidim-core (= 0.23.0.dev) + decidim-core (= 0.24.0) devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 1.7) - jquery-rails (~> 4.3) - sassc (~> 2.3.0) + jquery-rails (~> 4.4) + sassc (~> 2.4.0) sassc-rails (~> 2.1.2) - decidim-api (0.23.0.dev) + decidim-api (0.24.0) graphiql-rails (~> 1.4, < 1.5) - graphql (~> 1.9) + graphql (~> 1.12, >= 1.12.3) rack-cors (~> 1.0) - redcarpet (~> 3.4) + redcarpet (~> 3.5, >= 3.5.1) sprockets-es6 (~> 0.9.2) - decidim-assemblies (0.23.0.dev) - decidim-core (= 0.23.0.dev) - decidim-blogs (0.23.0.dev) - decidim-admin (= 0.23.0.dev) - decidim-comments (= 0.23.0.dev) - decidim-core (= 0.23.0.dev) - httparty (~> 0.17) + decidim-assemblies (0.24.0) + decidim-core (= 0.24.0) + decidim-blogs (0.24.0) + decidim-admin (= 0.24.0) + decidim-comments (= 0.24.0) + decidim-core (= 0.24.0) jquery-tmpl-rails (~> 1.1) kaminari (~> 1.2, >= 1.2.1) - decidim-budgets (0.23.0.dev) - decidim-comments (= 0.23.0.dev) - decidim-core (= 0.23.0.dev) + decidim-budgets (0.24.0) + decidim-comments (= 0.24.0) + decidim-core (= 0.24.0) kaminari (~> 1.2, >= 1.2.1) searchlight (~> 4.1) - decidim-comments (0.23.0.dev) - decidim-core (= 0.23.0.dev) - jquery-rails (~> 4.3) - redcarpet (~> 3.4) - decidim-core (0.23.0.dev) + decidim-comments (0.24.0) + decidim-core (= 0.24.0) + jquery-rails (~> 4.4) + redcarpet (~> 3.5, >= 3.5.1) + decidim-core (0.24.0) active_link_to (~> 1.0) - anchored (>= 1.1.0) + anchored (~> 1.1) autoprefixer-rails (~> 8.0) batch-loader (~> 1.2) browser (~> 2.7) - carrierwave (~> 1.3) + carrierwave (~> 2.2.1) cells-erb (~> 0.1.0) cells-rails (~> 0.0.9) charlock_holmes (~> 0.7) date_validator (~> 0.9.0) - decidim-api (= 0.23.0.dev) + decidim-api (= 0.24.0) devise (~> 4.7) devise-i18n (~> 1.2) diffy (~> 3.3) @@ -81,12 +80,13 @@ GIT doorkeeper-i18n (~> 4.0) etherpad-lite (~> 0.3) file_validators (~> 2.1) + fog-local (~> 0.6) foundation-rails (~> 6.6, < 6.7) foundation_rails_helper (~> 3.0) - geocoder (>= 1.5) + geocoder (~> 1.5) hashdiff (>= 0.4.0, < 2.0.0) invisible_captcha (~> 0.12) - jquery-rails (~> 4.3) + jquery-rails (~> 4.4) kaminari (~> 1.2, >= 1.2.1) loofah (~> 2.3.1) mini_magick (~> 4.9) @@ -101,15 +101,15 @@ GIT pg (~> 1.1.4, < 2) pg_search (~> 2.2) premailer-rails (~> 1.10) - rack (>= 2.2.3) + rack (~> 2.2, >= 2.2.3) rack-attack (~> 6.0) - rails (>= 5.2.4.4, < 6.0.x) + rails (~> 5.2.5) rails-i18n (~> 5.0) rectify (~> 0.13.0) redis (~> 4.1) request_store (~> 1.5.0) rubyzip (~> 2.0) - sassc (~> 2.3.0) + sassc (~> 2.4.0) sassc-rails (~> 2.1.2) seven_zip_ruby (~> 1.3) social-share-button (~> 1.2, >= 1.2.1) @@ -120,90 +120,91 @@ GIT uglifier (~> 4.1) valid_email2 (~> 2.1) wisper (~> 2.0) - decidim-debates (0.23.0.dev) - decidim-comments (= 0.23.0.dev) - decidim-core (= 0.23.0.dev) + decidim-debates (0.24.0) + decidim-comments (= 0.24.0) + decidim-core (= 0.24.0) kaminari (~> 1.2, >= 1.2.1) searchlight (~> 4.1) - decidim-dev (0.23.0.dev) + decidim-dev (0.24.0) byebug (~> 11.0) capybara (~> 3.24) db-query-matchers (~> 0.9.0) - decidim (= 0.23.0.dev) + decidim (= 0.24.0) erb_lint (~> 0.0.28) factory_bot_rails (~> 4.8) i18n-tasks (~> 0.9.18) mdl (~> 0.5) - nokogiri (>= 1.10.8) - puma (>= 4.3) + nokogiri (~> 1.11, >= 1.11.1) + puffing-billy (~> 2.4.0) + puma (~> 5.0) rails-controller-testing (~> 1.0) rspec-cells (~> 0.3.4) rspec-html-matchers (~> 0.9.1) rspec-rails (~> 3.7) rspec-retry (~> 0.6.2) rspec_junit_formatter (~> 0.3.0) - rubocop (~> 0.71.0) + rubocop (~> 0.92.0) rubocop-rails (~> 2.0) rubocop-rspec (~> 1.21) selenium-webdriver (~> 3.142) simplecov (~> 0.19.0) simplecov-cobertura (~> 1.3.1) system_test_html_screenshots (~> 0.1.1) + vcr (~> 6.0) webmock (~> 3.6) wisper-rspec (~> 1.0) - decidim-forms (0.23.0.dev) - decidim-core (= 0.23.0.dev) + decidim-forms (0.24.0) + decidim-core (= 0.24.0) wicked_pdf (~> 1.4) wkhtmltopdf-binary (~> 0.12) - decidim-generators (0.23.0.dev) - decidim-core (= 0.23.0.dev) - decidim-meetings (0.23.0.dev) + decidim-generators (0.24.0) + decidim-core (= 0.24.0) + decidim-meetings (0.24.0) cells-erb (~> 0.1.0) cells-rails (~> 0.0.9) - decidim-core (= 0.23.0.dev) - decidim-forms (= 0.23.0.dev) - httparty (~> 0.17) + decidim-core (= 0.24.0) + decidim-forms (= 0.24.0) icalendar (~> 2.5) jquery-tmpl-rails (~> 1.1) kaminari (~> 1.2, >= 1.2.1) searchlight (~> 4.1) - decidim-pages (0.23.0.dev) - decidim-core (= 0.23.0.dev) - decidim-participatory_processes (0.23.0.dev) - decidim-core (= 0.23.0.dev) - decidim-proposals (0.23.0.dev) + decidim-pages (0.24.0) + decidim-core (= 0.24.0) + decidim-participatory_processes (0.24.0) + decidim-core (= 0.24.0) + decidim-proposals (0.24.0) acts_as_list (~> 0.9) cells-erb (~> 0.1.0) cells-rails (~> 0.0.9) - decidim-comments (= 0.23.0.dev) - decidim-core (= 0.23.0.dev) - doc2text (~> 0.4.2) + decidim-comments (= 0.24.0) + decidim-core (= 0.24.0) + doc2text (~> 0.4.3) kaminari (~> 1.2, >= 1.2.1) ransack (~> 2.1.1) - redcarpet (~> 3.4) - decidim-sortitions (0.23.0.dev) - decidim-admin (= 0.23.0.dev) - decidim-comments (= 0.23.0.dev) - decidim-core (= 0.23.0.dev) - decidim-proposals (= 0.23.0.dev) - decidim-surveys (0.23.0.dev) - decidim-core (= 0.23.0.dev) - decidim-forms (= 0.23.0.dev) - decidim-templates (= 0.23.0.dev) - decidim-system (0.23.0.dev) + redcarpet (~> 3.5, >= 3.5.1) + decidim-sortitions (0.24.0) + decidim-admin (= 0.24.0) + decidim-comments (= 0.24.0) + decidim-core (= 0.24.0) + decidim-proposals (= 0.24.0) + decidim-surveys (0.24.0) + decidim-core (= 0.24.0) + decidim-forms (= 0.24.0) + decidim-templates (= 0.24.0) + decidim-system (0.24.0) active_link_to (~> 1.0) - decidim-core (= 0.23.0.dev) + decidim-core (= 0.24.0) devise (~> 4.7) devise-i18n (~> 1.2) devise_invitable (~> 1.7) - jquery-rails (~> 4.3) - sassc (~> 2.3.0) + jquery-rails (~> 4.4) + sassc (~> 2.4.0) sassc-rails (~> 2.1.2) - decidim-templates (0.23.0.dev) - decidim-core (= 0.23.0.dev) - decidim-forms (= 0.23.0.dev) - decidim-verifications (0.23.0.dev) - decidim-core (= 0.23.0.dev) + decidim-templates (0.24.0) + decidim-core (= 0.24.0) + decidim-forms (= 0.24.0) + decidim-verifications (0.24.0) + decidim-core (= 0.24.0) PATH remote: decidim-user_extension @@ -216,25 +217,25 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (5.2.4.4) - actionpack (= 5.2.4.4) + actioncable (5.2.5) + actionpack (= 5.2.5) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.4.4) - actionpack (= 5.2.4.4) - actionview (= 5.2.4.4) - activejob (= 5.2.4.4) + actionmailer (5.2.5) + actionpack (= 5.2.5) + actionview (= 5.2.5) + activejob (= 5.2.5) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.4.4) - actionview (= 5.2.4.4) - activesupport (= 5.2.4.4) + actionpack (5.2.5) + actionview (= 5.2.5) + activesupport (= 5.2.5) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.4.4) - activesupport (= 5.2.4.4) + actionview (5.2.5) + activesupport (= 5.2.5) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -242,20 +243,20 @@ GEM active_link_to (1.0.5) actionpack addressable - activejob (5.2.4.4) - activesupport (= 5.2.4.4) + activejob (5.2.5) + activesupport (= 5.2.5) globalid (>= 0.3.6) - activemodel (5.2.4.4) - activesupport (= 5.2.4.4) - activerecord (5.2.4.4) - activemodel (= 5.2.4.4) - activesupport (= 5.2.4.4) + activemodel (5.2.5) + activesupport (= 5.2.5) + activerecord (5.2.5) + activemodel (= 5.2.5) + activesupport (= 5.2.5) arel (>= 9.0) - activestorage (5.2.4.4) - actionpack (= 5.2.4.4) - activerecord (= 5.2.4.4) - marcel (~> 0.3.1) - activesupport (5.2.4.4) + activestorage (5.2.5) + actionpack (= 5.2.5) + activerecord (= 5.2.5) + marcel (~> 1.0.0) + activesupport (5.2.5) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -266,7 +267,7 @@ GEM public_suffix (>= 2.0.2, < 5.0) anchored (1.1.0) arel (9.0.0) - ast (2.4.1) + ast (2.4.2) autoprefixer-rails (8.6.5) execjs axiom-types (0.1.1) @@ -279,7 +280,7 @@ GEM execjs (~> 2.0) batch-loader (1.5.0) bcrypt (3.1.16) - better_html (1.0.15) + better_html (1.0.16) actionview (>= 4.0) activesupport (>= 4.0) ast (~> 2.0) @@ -288,23 +289,27 @@ GEM parser (>= 2.4) smart_properties bindex (0.8.1) - bootsnap (1.4.8) + bootsnap (1.7.3) msgpack (~> 1.0) browser (2.7.1) builder (3.2.4) byebug (11.1.3) - capybara (3.33.0) + capybara (3.35.3) addressable mini_mime (>= 0.1.3) nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) - regexp_parser (~> 1.5) + regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - carrierwave (1.3.1) - activemodel (>= 4.0.0) - activesupport (>= 4.0.0) - mime-types (>= 1.16) + carrierwave (2.2.1) + activemodel (>= 5.0.0) + activesupport (>= 5.0.0) + addressable (~> 2.6) + image_processing (~> 1.1) + marcel (~> 1.0.0) + mini_mime (>= 0.1.3) + ssrf_filter (~> 1.0) cells (4.1.7) declarative-builder (< 0.2.0) declarative-option (< 0.2.0) @@ -317,7 +322,7 @@ GEM actionpack (>= 3.0) cells (>= 4.1.6, < 5.0.0) charlock_holmes (0.7.7) - chef-utils (16.6.14) + chef-utils (16.12.3) childprocess (3.0.0) coercible (1.0.0) descendants_tracker (~> 0.0.1) @@ -328,11 +333,13 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.1.7) + concurrent-ruby (1.1.8) connection_pool (2.2.3) - crack (0.4.4) + cookiejar (0.3.3) + crack (0.4.5) + rexml crass (1.0.6) - css_parser (1.7.1) + css_parser (1.9.0) addressable date_validator (0.9.0) activemodel @@ -343,10 +350,10 @@ GEM declarative-builder (0.1.0) declarative-option (< 0.2.0) declarative-option (0.1.0) - deface (1.5.3) + deface (1.8.1) nokogiri (>= 1.6) polyglot - rails (>= 4.1) + rails (>= 5.2) rainbow (>= 2.1.0) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) @@ -356,40 +363,53 @@ GEM railties (>= 4.1.0) responders warden (~> 1.2.3) - devise-i18n (1.9.2) + devise-i18n (1.9.3) devise (>= 4.7.1) devise_invitable (1.7.5) actionmailer (>= 4.1.0) devise (>= 4.0.0) diff-lcs (1.4.4) diffy (3.4.0) - doc2text (0.4.2) - nokogiri (~> 1.10.0) - rubyzip (~> 2.0.0) - docile (1.3.2) + doc2text (0.4.3) + nokogiri (~> 1.11.1) + rubyzip (~> 2.3.0) + docile (1.3.5) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - doorkeeper (5.4.0) + doorkeeper (5.5.1) railties (>= 5) doorkeeper-i18n (4.0.1) dotenv (2.7.6) dotenv-rails (2.7.6) dotenv (= 2.7.6) railties (>= 3.2) + em-http-request (1.1.7) + addressable (>= 2.3.4) + cookiejar (!= 0.3.1) + em-socksify (>= 0.3) + eventmachine (>= 1.0.3) + http_parser.rb (>= 0.6.0) + em-socksify (0.3.2) + eventmachine (>= 1.0.0.beta.4) + em-synchrony (1.0.6) + eventmachine (>= 1.0.0.beta.1) equalizer (0.0.11) - erb_lint (0.0.30) + erb_lint (0.0.37) activesupport better_html (~> 1.0.7) html_tokenizer + parser (>= 2.7.1.4) rainbow - rubocop (~> 0.51) + rubocop smart_properties erbse (0.1.4) temple - erubi (1.9.0) + erubi (1.10.0) etherpad-lite (0.3.0) rest-client (>= 1.6) - excon (0.78.0) + eventmachine (1.2.7) + eventmachine_httpserver (0.2.1) + excon (0.79.0) execjs (2.7.0) factory_bot (4.11.1) activesupport (>= 3.0.0) @@ -398,16 +418,18 @@ GEM railties (>= 3.0.0) faker (1.9.6) i18n (>= 0.7) - faraday (1.1.0) + faraday (1.3.0) + faraday-net_http (~> 1.0) multipart-post (>= 1.2, < 3) ruby2_keywords - ffi (1.13.1) + faraday-net_http (1.0.1) + ffi (1.15.0) figaro (1.2.0) thor (>= 0.14.0, < 2) file_validators (2.3.0) activemodel (>= 3.2) mime-types (>= 1.0) - fog-aws (3.6.7) + fog-aws (3.10.0) fog-core (~> 2.1) fog-json (~> 1.1) fog-xml (~> 0.1) @@ -420,6 +442,8 @@ GEM fog-json (1.2.0) fog-core multi_json (~> 1.10) + fog-local (0.6.0) + fog-core (>= 1.27, < 3.0) fog-xml (0.1.3) fog-core nokogiri (>= 1.5.11, < 2.0.0) @@ -434,13 +458,13 @@ GEM activesupport (>= 4.1, < 6.0) railties (>= 4.1, < 6.0) tzinfo (~> 1.2, >= 1.2.2) - geocoder (1.6.4) + geocoder (1.6.6) globalid (0.4.2) activesupport (>= 4.2.0) graphiql-rails (1.4.11) railties sprockets-rails - graphql (1.11.5) + graphql (1.12.7) hashdiff (1.0.1) hashie (4.1.0) highline (2.0.3) @@ -449,12 +473,10 @@ GEM http-accept (1.7.0) http-cookie (1.0.3) domain_name (~> 0.5) - httparty (0.18.1) - mime-types (~> 3.0) - multi_xml (>= 0.5.2) - i18n (1.8.5) + http_parser.rb (0.6.0) + i18n (1.8.10) concurrent-ruby (~> 1.0) - i18n-tasks (0.9.31) + i18n-tasks (0.9.34) activesupport (>= 4.0.2) ast (>= 2.1.0) erubi @@ -464,14 +486,16 @@ GEM rails-i18n rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) - icalendar (2.7.0) + icalendar (2.7.1) ice_cube (~> 0.16) ice_cube (0.16.3) ice_nine (0.11.2) + image_processing (1.12.1) + mini_magick (>= 4.9.5, < 5) + ruby-vips (>= 2.0.17, < 3) invisible_captcha (0.13.0) rails (>= 3.2.0) ipaddress (0.8.3) - jaro_winkler (1.5.4) jquery-rails (4.4.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) @@ -491,7 +515,7 @@ GEM activerecord kaminari-core (= 1.2.1) kaminari-core (1.2.1) - kramdown (2.3.0) + kramdown (2.3.1) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) @@ -503,7 +527,7 @@ GEM actionmailer (>= 3.2) letter_opener (~> 1.0) railties (>= 3.2) - listen (3.2.1) + listen (3.5.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) loofah (2.3.1) @@ -511,8 +535,7 @@ GEM nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) - marcel (0.3.3) - mimemagic (~> 0.3.2) + marcel (1.0.1) mdl (0.11.0) kramdown (~> 2.3) kramdown-parser-gfm (~> 1.1) @@ -522,32 +545,33 @@ GEM method_source (1.0.0) mime-types (3.3.1) mime-types-data (~> 3.2015) - mime-types-data (3.2020.0512) + mime-types-data (3.2021.0225) mimemagic (0.3.10) nokogiri (~> 1) rake - mini_magick (4.10.1) - mini_mime (1.0.2) - mini_portile2 (2.4.0) - minitest (5.14.2) + mini_magick (4.11.0) + mini_mime (1.1.0) + mini_portile2 (2.5.0) + minitest (5.14.4) mixlib-cli (2.1.8) mixlib-config (3.0.9) tomlrb - mixlib-shellout (3.1.6) + mixlib-shellout (3.2.5) chef-utils - msgpack (1.3.3) + msgpack (1.4.2) multi_json (1.15.0) multi_xml (0.6.0) multipart-post (2.1.1) mustache (1.1.1) netrc (0.11.0) newrelic_rpm (6.15.0) - nio4r (2.5.4) + nio4r (2.5.7) nobspw (0.6.2) - nokogiri (1.10.10) - mini_portile2 (~> 2.4.0) - oauth (0.5.4) - oauth2 (1.4.4) + nokogiri (1.11.3) + mini_portile2 (~> 2.5.0) + racc (~> 1.4) + oauth (0.5.6) + oauth2 (1.4.7) faraday (>= 0.8, < 2.0) jwt (>= 1.0, < 3.0) multi_json (~> 1.3) @@ -558,16 +582,17 @@ GEM rack (>= 1.6.2, < 3) omniauth-facebook (5.0.0) omniauth-oauth2 (~> 1.2) - omniauth-google-oauth2 (0.8.0) + omniauth-google-oauth2 (0.8.2) jwt (>= 2.0) - omniauth (>= 1.1.1) + oauth2 (~> 1.1) + omniauth (~> 1.1) omniauth-oauth2 (>= 1.6) - omniauth-oauth (1.1.0) + omniauth-oauth (1.2.0) oauth - omniauth (~> 1.0) - omniauth-oauth2 (1.7.0) + omniauth (>= 1.0, < 3) + omniauth-oauth2 (1.7.1) oauth2 (~> 1.4) - omniauth (~> 1.9) + omniauth (>= 1.9, < 3) omniauth-rails_csrf_protection (0.1.2) actionpack (>= 4.2) omniauth (>= 1.3.1) @@ -578,11 +603,11 @@ GEM paper_trail (10.3.1) activerecord (>= 4.2) request_store (~> 1.1) - parallel (1.19.2) - parser (2.7.2.0) + parallel (1.20.1) + parser (3.0.1.0) ast (~> 2.4.1) pg (1.1.4) - pg_search (2.3.4) + pg_search (2.3.5) activerecord (>= 5.2) activesupport (>= 5.2) polyglot (0.3.5) @@ -594,10 +619,19 @@ GEM actionmailer (>= 3) premailer (~> 1.7, >= 1.7.9) public_suffix (4.0.6) - puma (5.0.2) + puffing-billy (2.4.1) + addressable (~> 2.5) + em-http-request (~> 1.1, >= 1.1.0) + em-synchrony + eventmachine (~> 1.2) + eventmachine_httpserver + http_parser.rb (~> 0.6.0) + multi_json + puma (5.2.2) nio4r (~> 2.0) + racc (1.5.2) rack (2.2.3) - rack-attack (6.3.1) + rack-attack (6.5.0) rack (>= 1.0, < 3) rack-cors (1.1.1) rack (>= 2.0.0) @@ -605,18 +639,18 @@ GEM rack rack-test (1.1.0) rack (>= 1.0, < 3) - rails (5.2.4.4) - actioncable (= 5.2.4.4) - actionmailer (= 5.2.4.4) - actionpack (= 5.2.4.4) - actionview (= 5.2.4.4) - activejob (= 5.2.4.4) - activemodel (= 5.2.4.4) - activerecord (= 5.2.4.4) - activestorage (= 5.2.4.4) - activesupport (= 5.2.4.4) + rails (5.2.5) + actioncable (= 5.2.5) + actionmailer (= 5.2.5) + actionpack (= 5.2.5) + actionview (= 5.2.5) + activejob (= 5.2.5) + activemodel (= 5.2.5) + activerecord (= 5.2.5) + activestorage (= 5.2.5) + activesupport (= 5.2.5) bundler (>= 1.3.0) - railties (= 5.2.4.4) + railties (= 5.2.5) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) @@ -630,14 +664,14 @@ GEM rails-i18n (5.1.3) i18n (>= 0.7, < 2) railties (>= 5.0, < 6) - railties (5.2.4.4) - actionpack (= 5.2.4.4) - activesupport (= 5.2.4.4) + railties (5.2.5) + actionpack (= 5.2.5) + activesupport (= 5.2.5) method_source rake (>= 0.8.7) thor (>= 0.19.0, < 2.0) rainbow (3.0.0) - rake (13.0.1) + rake (13.0.3) ransack (2.1.1) actionpack (>= 5.0) activerecord (>= 5.0) @@ -652,9 +686,9 @@ GEM activesupport (>= 4.1.0) virtus (~> 1.0.5) wisper (>= 1.6.1) - redcarpet (3.5.0) - redis (4.2.2) - regexp_parser (1.8.2) + redcarpet (3.5.1) + redis (4.2.5) + regexp_parser (2.1.1) request_store (1.5.0) rack (>= 1.4) responders (3.0.1) @@ -665,7 +699,7 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rexml (3.2.4) + rexml (3.2.5) rspec (3.9.0) rspec-core (~> 3.9.0) rspec-expectations (~> 3.9.0) @@ -675,7 +709,7 @@ GEM rspec-rails (< 5.0) rspec-core (3.9.3) rspec-support (~> 3.9.3) - rspec-expectations (3.9.2) + rspec-expectations (3.9.4) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) rspec-html-matchers (0.9.4) @@ -694,31 +728,39 @@ GEM rspec-support (~> 3.9.0) rspec-retry (0.6.2) rspec-core (> 3.3) - rspec-support (3.9.3) + rspec-support (3.9.4) rspec_junit_formatter (0.3.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (0.71.0) - jaro_winkler (~> 1.5.1) + rubocop (0.92.0) parallel (~> 1.10) - parser (>= 2.6) + parser (>= 2.7.1.5) rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.7) + rexml + rubocop-ast (>= 0.5.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 1.7) - rubocop-rails (2.0.1) + unicode-display_width (>= 1.4.0, < 2.0) + rubocop-ast (1.4.1) + parser (>= 2.7.1.5) + rubocop-rails (2.9.1) + activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 0.70.0) - rubocop-rspec (1.41.0) - rubocop (>= 0.68.1) + rubocop (>= 0.90.0, < 2.0) + rubocop-rspec (1.44.1) + rubocop (~> 0.87) + rubocop-ast (>= 0.7.1) ruby-ole (1.2.12.2) - ruby-progressbar (1.10.1) - ruby2_keywords (0.0.2) - rubyzip (2.0.0) + ruby-progressbar (1.11.0) + ruby-vips (2.1.0) + ffi (~> 1.12) + ruby2_keywords (0.0.4) + rubyzip (2.3.0) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - sassc (2.3.0) + sassc (2.4.0) ffi (~> 1.9) sassc-rails (2.1.2) railties (>= 4.0.0) @@ -736,17 +778,17 @@ GEM rack (>= 1.5.0) rack-protection (>= 1.5.0) redis (>= 3.3.5, < 5) - simplecov (0.19.0) + simplecov (0.19.1) docile (~> 1.1) simplecov-html (~> 0.11) simplecov-cobertura (1.3.1) simplecov (~> 0.8) simplecov-html (0.12.3) smart_properties (1.15.0) - social-share-button (1.2.3) + social-share-button (1.2.4) coffee-rails - spreadsheet (1.2.6) - ruby-ole (>= 1.0) + spreadsheet (1.2.8) + ruby-ole spring (2.1.1) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) @@ -762,19 +804,20 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) + ssrf_filter (1.0.7) system_test_html_screenshots (0.1.2) actionpack (>= 5.2, < 6.0.a) temple (0.8.2) - terminal-table (1.8.0) + terminal-table (3.0.0) unicode-display_width (~> 1.1, >= 1.1.1) - thor (1.0.1) + thor (1.1.0) thread_safe (0.3.6) tilt (2.0.10) - tomlrb (1.3.0) + tomlrb (2.0.1) truncato (0.7.11) htmlentities (~> 4.3.1) nokogiri (>= 1.7.0, <= 2.0) - tzinfo (1.2.7) + tzinfo (1.2.9) thread_safe (~> 0.1) uber (0.1.0) uglifier (4.2.0) @@ -782,10 +825,11 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.7.7) - unicode-display_width (1.6.1) + unicode-display_width (1.7.0) valid_email2 (2.3.1) activemodel (>= 3.2) mail (~> 2.5) + vcr (6.0.0) virtus (1.0.5) axiom-types (~> 0.1) coercible (~> 1.0) @@ -798,7 +842,7 @@ GEM activemodel (>= 5.0) bindex (>= 0.4.0) railties (>= 5.0) - webmock (3.9.3) + webmock (3.12.2) addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) @@ -846,7 +890,7 @@ DEPENDENCIES zip-zip RUBY VERSION - ruby 2.6.6p146 + ruby 2.7.3p183 BUNDLED WITH - 1.17.3 + 2.1.4 From c0a3f7adf0658a5d96e81b2aca83f745c1a3b25e Mon Sep 17 00:00:00 2001 From: ayuki_j Date: Thu, 8 Apr 2021 14:29:17 +0900 Subject: [PATCH 3/8] fix rspec --- config/environments/development.rb | 2 +- config/i18n-tasks.yml | 133 ++++++++++++++++++ .../decidim-user_extension.gemspec | 4 + spec/i18n_spec.rb | 34 +++++ spec/rails_helper.rb | 2 +- 5 files changed, 173 insertions(+), 2 deletions(-) create mode 100644 config/i18n-tasks.yml create mode 100644 spec/i18n_spec.rb diff --git a/config/environments/development.rb b/config/environments/development.rb index 3e3ec5102d..cf0050df11 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -16,7 +16,7 @@ # Enable/disable caching. By default caching is disabled. # Run rails dev:cache to toggle caching. - if Rails.root.join("tmp", "caching-dev.txt").exist? + if Rails.root.join("tmp/caching-dev.txt").exist? config.action_controller.perform_caching = true config.cache_store = :memory_store diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml new file mode 100644 index 0000000000..8a76e9b02f --- /dev/null +++ b/config/i18n-tasks.yml @@ -0,0 +1,133 @@ +# i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks + +# The "main" locale. +base_locale: en +## All available locales are inferred from the data by default. Alternatively, specify them explicitly: +# locales: [es, fr] +## Reporting locale, default: en. Available: en, ru. +# internal_locale: en + +# Read and write translations. +data: + ## Translations are read from the file system. Supported format: YAML, JSON. + ## Provide a custom adapter: + # adapter: I18n::Tasks::Data::FileSystem + + # Locale files or `File.find` patterns where translations are read from: + read: + ## Default: + # - config/locales/%{locale}.yml + ## More files: + # - config/locales/**/*.%{locale}.yml + + # Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom: + # `i18n-tasks normalize -p` will force move the keys according to these rules + write: + ## For example, write devise and simple form keys to their respective files: + # - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml'] + ## Catch-all default: + # - config/locales/%{locale}.yml + + # External locale data (e.g. gems). + # This data is not considered unused and is never written to. + external: + ## Example (replace %#= with %=): + # - "<%#= %x[bundle info vagrant --path].chomp %>/templates/locales/%{locale}.yml" + + ## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class. + # router: conservative_router + + yaml: + write: + # do not wrap lines at 80 characters + line_width: -1 + + ## Pretty-print JSON: + # json: + # write: + # indent: ' ' + # space: ' ' + # object_nl: "\n" + # array_nl: "\n" + +# Find translate calls +search: + ## Paths or `File.find` patterns to search in: + # paths: + # - app/ + + ## Root directories for relative keys resolution. + # relative_roots: + # - app/controllers + # - app/helpers + # - app/mailers + # - app/presenters + # - app/views + + ## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting: + ## %w(*.jpg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less *.yml *.json) + exclude: + - app/assets/images + - app/assets/fonts + - app/assets/videos + + ## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`: + ## If specified, this settings takes priority over `exclude`, but `exclude` still applies. + # only: ["*.rb", "*.html.slim"] + + ## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`. + # strict: true + + ## Multiple scanners can be used. Their results are merged. + ## The options specified above are passed down to each scanner. Per-scanner options can be specified as well. + ## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example + +## Translation Services +# translation: +# # Google Translate +# # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate +# google_translate_api_key: "AbC-dEf5" +# # DeepL Pro Translate +# # Get an API key and subscription at https://www.deepl.com/pro to use DeepL Pro +# deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A" + +## Do not consider these keys missing: +# ignore_missing: +# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}' +# - '{devise,simple_form}.*' + +## Consider these keys used: +# ignore_unused: +# - 'activerecord.attributes.*' +# - '{devise,kaminari,will_paginate}.*' +# - 'simple_form.{yes,no}' +# - 'simple_form.{placeholders,hints,labels}.*' +# - 'simple_form.{error_notification,required}.:' + +## Exclude these keys from the `i18n-tasks eq-base' report: +# ignore_eq_base: +# all: +# - common.ok +# fr,es: +# - common.brand + +## Exclude these keys from the `i18n-tasks check-consistent-interpolations` report: +# ignore_inconsistent_interpolations: +# - 'activerecord.attributes.*' + +## Ignore these keys completely: +# ignore: +# - kaminari.* + +## Sometimes, it isn't possible for i18n-tasks to match the key correctly, +## e.g. in case of a relative key defined in a helper method. +## In these cases you can use the built-in PatternMapper to map patterns to keys, e.g.: +# +# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper', +# only: %w(*.html.haml *.html.slim), +# patterns: [['= title\b', '.page_title']] %> +# +# The PatternMapper can also match key literals via a special %{key} interpolation, e.g.: +# +# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper', +# patterns: [['\bSpree\.t[( ]\s*%{key}', 'spree.%{key}']] %> diff --git a/decidim-user_extension/decidim-user_extension.gemspec b/decidim-user_extension/decidim-user_extension.gemspec index 11cff9367d..cbd25cc5e2 100644 --- a/decidim-user_extension/decidim-user_extension.gemspec +++ b/decidim-user_extension/decidim-user_extension.gemspec @@ -1,5 +1,9 @@ # frozen_string_literal: true +Gem::Specification.new do |spec| + spec.required_ruby_version = ">= 2.7.0" +end + $LOAD_PATH.push File.expand_path("lib", __dir__) require "decidim/user_extension/version" diff --git a/spec/i18n_spec.rb b/spec/i18n_spec.rb new file mode 100644 index 0000000000..2db6251600 --- /dev/null +++ b/spec/i18n_spec.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +require "i18n/tasks" + +RSpec.describe I18n do + let(:i18n) { I18n::Tasks::BaseTask.new } + let(:missing_keys) { i18n.missing_keys } + let(:unused_keys) { i18n.unused_keys } + let(:inconsistent_interpolations) { i18n.inconsistent_interpolations } + + it "does not have missing keys" do + expect(missing_keys).to be_empty, + "Missing #{missing_keys.leaves.count} i18n keys, run `i18n-tasks missing' to show them" + end + + it "does not have unused keys" do + expect(unused_keys).to be_empty, + "#{unused_keys.leaves.count} unused i18n keys, run `i18n-tasks unused' to show them" + end + + it "files are normalized" do + non_normalized = i18n.non_normalized_paths + error_message = "The following files need to be normalized:\n" \ + "#{non_normalized.map { |path| " #{path}" }.join("\n")}\n" \ + "Please run `i18n-tasks normalize' to fix" + expect(non_normalized).to be_empty, error_message + end + + it "does not have inconsistent interpolations" do + error_message = "#{inconsistent_interpolations.leaves.count} i18n keys have inconsistent interpolations.\n" \ + "Run `i18n-tasks check-consistent-interpolations' to show them" + expect(inconsistent_interpolations).to be_empty, error_message + end +end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 4e557cee54..50317642b0 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -21,7 +21,7 @@ # directory. Alternatively, in the individual `*_spec.rb` files, manually # require only the support files necessary. # -Dir[Rails.root.join("spec", "support", "**", "*.rb")].each { |f| require f } +Dir[Rails.root.join("spec/support/**/*.rb")].sort.each { |f| require f } # Checks for pending migrations and applies them before tests are run. # If you are not using ActiveRecord, you can remove these lines. From a9e61b899f15f19d7f21cd443d61acd53eeaf192 Mon Sep 17 00:00:00 2001 From: ayuki_j Date: Thu, 8 Apr 2021 14:46:03 +0900 Subject: [PATCH 4/8] update decidim migration --- Gemfile | 6 +- ...w_statistics_from_organizations.decidim.rb | 8 ++ ...create_decidim_user_moderations.decidim.rb | 13 +++ ...252_create_decidim_user_reports.decidim.rb | 17 ++++ ...pension_fields_to_decidim_users.decidim.rb | 9 ++ ...create_decidim_user_suspensions.decidim.rb | 15 ++++ ..._suspension_id_to_decidim_users.decidim.rb | 8 ++ ...reported_content_to_moderations.decidim.rb | 8 ++ ...dd_locale_to_moderation_reports.decidim.rb | 8 ++ ...encrypt_authorization_metadatas.decidim.rb | 36 ++++++++ ...w_public_access_to_static_pages.decidim.rb | 18 ++++ ..._table_block_user_functionality.decidim.rb | 9 ++ ..._fields_for_block_functionality.decidim.rb | 10 +++ ...d_email_on_moderations_to_users.decidim.rb | 8 ++ ..._all_sessions_for_deleted_users.decidim.rb | 12 +++ ...llowable_counter_cache_to_users.decidim.rb | 17 ++++ ...idim_forms_questionnaires.decidim_forms.rb | 17 ++++ ...o_decidim_forms_questions.decidim_forms.rb | 8 ++ ...cations_conflicts.decidim_verifications.rb | 16 ++++ ..._groups.decidim_participatory_processes.rb | 8 ++ ..._groups.decidim_participatory_processes.rb | 14 +++ ..._groups.decidim_participatory_processes.rb | 40 +++++++++ ..._groups.decidim_participatory_processes.rb | 8 ++ ...ocesses.decidim_participatory_processes.rb | 8 ++ ...ocesses.decidim_participatory_processes.rb | 17 ++++ ...ht_field_to_assembly.decidim_assemblies.rb | 8 ++ ..._cache_to_assemblies.decidim_assemblies.rb | 17 ++++ ...add_online_meeting_url.decidim_meetings.rb | 8 ++ ...77_add_type_of_meeting.decidim_meetings.rb | 8 ++ ...ngs_registration_terms.decidim_meetings.rb | 30 +++++++ ...pe_and_url_to_meetings.decidim_meetings.rb | 20 +++++ ...lt_to_decidim_meetings.decidim_meetings.rb | 9 ++ ...nter_cache_to_meetings.decidim_meetings.rb | 17 ++++ ..._proposals_after_copy.decidim_proposals.rb | 15 ++++ ...er_cache_to_proposals.decidim_proposals.rb | 17 ++++ ..._collaborative_drafts.decidim_proposals.rb | 17 ++++ ..._for_copied_proposals.decidim_proposals.rb | 19 ++++ ...ounter_cache_to_budgets.decidim_budgets.rb | 17 ++++ ...scope_to_debates_debate.decidim_debates.rb | 8 ++ ...8054288_archive_debates.decidim_debates.rb | 9 ++ ..._revert_archive_debates.decidim_debates.rb | 9 ++ ...ounter_cache_to_debates.decidim_debates.rb | 17 ++++ ...le_counter_cache_to_blogs.decidim_blogs.rb | 17 ++++ db/schema.rb | 87 ++++++++++++++++++- 44 files changed, 681 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20210408054250_remove_show_statistics_from_organizations.decidim.rb create mode 100644 db/migrate/20210408054251_create_decidim_user_moderations.decidim.rb create mode 100644 db/migrate/20210408054252_create_decidim_user_reports.decidim.rb create mode 100644 db/migrate/20210408054253_add_suspension_fields_to_decidim_users.decidim.rb create mode 100644 db/migrate/20210408054254_create_decidim_user_suspensions.decidim.rb create mode 100644 db/migrate/20210408054255_add_current_suspension_id_to_decidim_users.decidim.rb create mode 100644 db/migrate/20210408054256_add_reported_content_to_moderations.decidim.rb create mode 100644 db/migrate/20210408054257_add_locale_to_moderation_reports.decidim.rb create mode 100644 db/migrate/20210408054258_encrypt_authorization_metadatas.decidim.rb create mode 100644 db/migrate/20210408054259_add_allow_public_access_to_static_pages.decidim.rb create mode 100644 db/migrate/20210408054260_update_table_block_user_functionality.decidim.rb create mode 100644 db/migrate/20210408054261_rename_decidim_user_fields_for_block_functionality.decidim.rb create mode 100644 db/migrate/20210408054262_add_email_on_moderations_to_users.decidim.rb create mode 100644 db/migrate/20210408054263_invalidate_all_sessions_for_deleted_users.decidim.rb create mode 100644 db/migrate/20210408054264_add_followable_counter_cache_to_users.decidim.rb create mode 100644 db/migrate/20210408054265_add_salt_to_decidim_forms_questionnaires.decidim_forms.rb create mode 100644 db/migrate/20210408054266_add_max_characters_to_decidim_forms_questions.decidim_forms.rb create mode 100644 db/migrate/20210408054267_create_decidim_verifications_conflicts.decidim_verifications.rb create mode 100644 db/migrate/20210408054268_add_hashtag_to_participatory_process_groups.decidim_participatory_processes.rb create mode 100644 db/migrate/20210408054269_add_metadata_columns_to_participatory_process_groups.decidim_participatory_processes.rb create mode 100644 db/migrate/20210408054270_rename_name_column_to_title_in_decidim_participatory_process_groups.decidim_participatory_processes.rb create mode 100644 db/migrate/20210408054271_add_promoted_flag_to_decidim_participatory_process_groups.decidim_participatory_processes.rb create mode 100644 db/migrate/20210408054272_add_weight_field_to_participatory_processes.decidim_participatory_processes.rb create mode 100644 db/migrate/20210408054273_add_followable_counter_cache_to_participatory_processes.decidim_participatory_processes.rb create mode 100644 db/migrate/20210408054274_add_weight_field_to_assembly.decidim_assemblies.rb create mode 100644 db/migrate/20210408054275_add_followable_counter_cache_to_assemblies.decidim_assemblies.rb create mode 100644 db/migrate/20210408054276_add_online_meeting_url.decidim_meetings.rb create mode 100644 db/migrate/20210408054277_add_type_of_meeting.decidim_meetings.rb create mode 100644 db/migrate/20210408054278_fix_meetings_registration_terms.decidim_meetings.rb create mode 100644 db/migrate/20210408054279_add_registration_type_and_url_to_meetings.decidim_meetings.rb create mode 100644 db/migrate/20210408054280_add_salt_to_decidim_meetings.decidim_meetings.rb create mode 100644 db/migrate/20210408054281_add_followable_counter_cache_to_meetings.decidim_meetings.rb create mode 100644 db/migrate/20210408054282_fix_answered_proposals_after_copy.decidim_proposals.rb create mode 100644 db/migrate/20210408054283_add_followable_counter_cache_to_proposals.decidim_proposals.rb create mode 100644 db/migrate/20210408054284_add_followable_counter_cache_to_collaborative_drafts.decidim_proposals.rb create mode 100644 db/migrate/20210408054285_fix_counters_for_copied_proposals.decidim_proposals.rb create mode 100644 db/migrate/20210408054286_add_followable_counter_cache_to_budgets.decidim_budgets.rb create mode 100644 db/migrate/20210408054287_add_scope_to_debates_debate.decidim_debates.rb create mode 100644 db/migrate/20210408054288_archive_debates.decidim_debates.rb create mode 100644 db/migrate/20210408054289_revert_archive_debates.decidim_debates.rb create mode 100644 db/migrate/20210408054290_add_followable_counter_cache_to_debates.decidim_debates.rb create mode 100644 db/migrate/20210408054291_add_followable_counter_cache_to_blogs.decidim_blogs.rb diff --git a/Gemfile b/Gemfile index 09ab98884c..5aa73acd9b 100644 --- a/Gemfile +++ b/Gemfile @@ -6,9 +6,9 @@ ruby RUBY_VERSION gem "decidim", git: "https://github.com/decidim/decidim.git", branch: "release/0.24-stable" -# gem "decidim", "0.21" -# gem "decidim-consultations", "0.23.0.dev" -# gem "decidim-initiatives", "0.23.0.dev" +# gem "decidim", "0.24" +# gem "decidim-consultations", "0.24.0.dev" +# gem "decidim-initiatives", "0.24.0.dev" gem "bootsnap", "~> 1.3" diff --git a/db/migrate/20210408054250_remove_show_statistics_from_organizations.decidim.rb b/db/migrate/20210408054250_remove_show_statistics_from_organizations.decidim.rb new file mode 100644 index 0000000000..cb77c106bc --- /dev/null +++ b/db/migrate/20210408054250_remove_show_statistics_from_organizations.decidim.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20200929171508) + +class RemoveShowStatisticsFromOrganizations < ActiveRecord::Migration[5.2] + def change + remove_column :decidim_organizations, :show_statistics + end +end diff --git a/db/migrate/20210408054251_create_decidim_user_moderations.decidim.rb b/db/migrate/20210408054251_create_decidim_user_moderations.decidim.rb new file mode 100644 index 0000000000..61c5d18d7f --- /dev/null +++ b/db/migrate/20210408054251_create_decidim_user_moderations.decidim.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20201010124755) + +class CreateDecidimUserModerations < ActiveRecord::Migration[5.2] + def change + create_table :decidim_user_moderations do |t| + t.belongs_to :decidim_user, foreign_key: true + t.integer :report_count, default: 0, null: false + + t.timestamps + end + end +end diff --git a/db/migrate/20210408054252_create_decidim_user_reports.decidim.rb b/db/migrate/20210408054252_create_decidim_user_reports.decidim.rb new file mode 100644 index 0000000000..79bdadbc38 --- /dev/null +++ b/db/migrate/20210408054252_create_decidim_user_reports.decidim.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20201010124756) + +class CreateDecidimUserReports < ActiveRecord::Migration[5.2] + def change + create_table :decidim_user_reports do |t| + t.integer :user_moderation_id, foreign_key: true + t.integer :user_id, null: false + t.string :reason + t.text :details + + t.timestamps + end + add_foreign_key :decidim_user_reports, :decidim_user_moderations, column: :user_moderation_id + add_foreign_key :decidim_user_reports, :decidim_users, column: :user_id + end +end diff --git a/db/migrate/20210408054253_add_suspension_fields_to_decidim_users.decidim.rb b/db/migrate/20210408054253_add_suspension_fields_to_decidim_users.decidim.rb new file mode 100644 index 0000000000..d839896095 --- /dev/null +++ b/db/migrate/20210408054253_add_suspension_fields_to_decidim_users.decidim.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20201010224433) + +class AddSuspensionFieldsToDecidimUsers < ActiveRecord::Migration[5.2] + def change + add_column :decidim_users, :suspended, :boolean, default: false, null: false + add_column :decidim_users, :suspended_at, :datetime + end +end diff --git a/db/migrate/20210408054254_create_decidim_user_suspensions.decidim.rb b/db/migrate/20210408054254_create_decidim_user_suspensions.decidim.rb new file mode 100644 index 0000000000..68b453af99 --- /dev/null +++ b/db/migrate/20210408054254_create_decidim_user_suspensions.decidim.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20201011074641) + +class CreateDecidimUserSuspensions < ActiveRecord::Migration[5.2] + def change + create_table :decidim_user_suspensions do |t| + t.belongs_to :decidim_user, foreign_key: true + t.integer :suspending_user_id + t.text :justification + + t.timestamps + end + add_foreign_key :decidim_user_suspensions, :decidim_users, column: :suspending_user_id + end +end diff --git a/db/migrate/20210408054255_add_current_suspension_id_to_decidim_users.decidim.rb b/db/migrate/20210408054255_add_current_suspension_id_to_decidim_users.decidim.rb new file mode 100644 index 0000000000..fa5752e23e --- /dev/null +++ b/db/migrate/20210408054255_add_current_suspension_id_to_decidim_users.decidim.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20201011081626) + +class AddCurrentSuspensionIdToDecidimUsers < ActiveRecord::Migration[5.2] + def change + add_column :decidim_users, :suspension_id, :integer + end +end diff --git a/db/migrate/20210408054256_add_reported_content_to_moderations.decidim.rb b/db/migrate/20210408054256_add_reported_content_to_moderations.decidim.rb new file mode 100644 index 0000000000..d37af03902 --- /dev/null +++ b/db/migrate/20210408054256_add_reported_content_to_moderations.decidim.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20201013071533) + +class AddReportedContentToModerations < ActiveRecord::Migration[5.2] + def change + add_column :decidim_moderations, :reported_content, :text + end +end diff --git a/db/migrate/20210408054257_add_locale_to_moderation_reports.decidim.rb b/db/migrate/20210408054257_add_locale_to_moderation_reports.decidim.rb new file mode 100644 index 0000000000..36bca7b34f --- /dev/null +++ b/db/migrate/20210408054257_add_locale_to_moderation_reports.decidim.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20201019074554) + +class AddLocaleToModerationReports < ActiveRecord::Migration[5.2] + def change + add_column :decidim_reports, :locale, :string + end +end diff --git a/db/migrate/20210408054258_encrypt_authorization_metadatas.decidim.rb b/db/migrate/20210408054258_encrypt_authorization_metadatas.decidim.rb new file mode 100644 index 0000000000..0583061b0b --- /dev/null +++ b/db/migrate/20210408054258_encrypt_authorization_metadatas.decidim.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20201127114444) + +class EncryptAuthorizationMetadatas < ActiveRecord::Migration[5.2] + def up + Decidim::Authorization.all.each do |auth| + # Re-setting these values will internally convert the hash values to + # encypted values + auth.update!( + metadata: auth.metadata, + verification_metadata: auth.verification_metadata + ) + end + end + + def down + Decidim::Authorization.all.each do |auth| + # rubocop:disable Rails/SkipsModelValidations + auth.update_columns( + metadata: decrypt_hash(auth.metadata), + verification_metadata: decrypt_hash(auth.verification_metadata) + ) + # rubocop:enable Rails/SkipsModelValidations + end + end + + private + + def decrypt_hash(hash) + hash.transform_values do |value| + ActiveSupport::JSON.decode(Decidim::AttributeEncryptor.decrypt(value)) + rescue ActiveSupport::MessageEncryptor::InvalidMessage, ActiveSupport::MessageVerifier::InvalidSignature + value + end + end +end diff --git a/db/migrate/20210408054259_add_allow_public_access_to_static_pages.decidim.rb b/db/migrate/20210408054259_add_allow_public_access_to_static_pages.decidim.rb new file mode 100644 index 0000000000..5ca91ad021 --- /dev/null +++ b/db/migrate/20210408054259_add_allow_public_access_to_static_pages.decidim.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20201128130723) + +class AddAllowPublicAccessToStaticPages < ActiveRecord::Migration[5.2] + def change + add_column :decidim_static_pages, :allow_public_access, :boolean, null: false, default: false + + reversible do |direction| + direction.up do + # rubocop:disable Rails/SkipsModelValidations + Decidim::StaticPage.where(slug: "terms-and-conditions").update_all( + allow_public_access: true + ) + # rubocop:enable Rails/SkipsModelValidations + end + end + end +end diff --git a/db/migrate/20210408054260_update_table_block_user_functionality.decidim.rb b/db/migrate/20210408054260_update_table_block_user_functionality.decidim.rb new file mode 100644 index 0000000000..a5b9c0e172 --- /dev/null +++ b/db/migrate/20210408054260_update_table_block_user_functionality.decidim.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20201218144706) + +class UpdateTableBlockUserFunctionality < ActiveRecord::Migration[5.2] + def change + rename_column :decidim_user_suspensions, :suspending_user_id, :blocking_user_id + rename_table :decidim_user_suspensions, :decidim_user_blocks + end +end diff --git a/db/migrate/20210408054261_rename_decidim_user_fields_for_block_functionality.decidim.rb b/db/migrate/20210408054261_rename_decidim_user_fields_for_block_functionality.decidim.rb new file mode 100644 index 0000000000..ef43862c4b --- /dev/null +++ b/db/migrate/20210408054261_rename_decidim_user_fields_for_block_functionality.decidim.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20201218145252) + +class RenameDecidimUserFieldsForBlockFunctionality < ActiveRecord::Migration[5.2] + def change + rename_column :decidim_users, :suspended, :blocked + rename_column :decidim_users, :suspended_at, :blocked_at + rename_column :decidim_users, :suspension_id, :block_id + end +end diff --git a/db/migrate/20210408054262_add_email_on_moderations_to_users.decidim.rb b/db/migrate/20210408054262_add_email_on_moderations_to_users.decidim.rb new file mode 100644 index 0000000000..c04978d8df --- /dev/null +++ b/db/migrate/20210408054262_add_email_on_moderations_to_users.decidim.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20210208134328) + +class AddEmailOnModerationsToUsers < ActiveRecord::Migration[5.2] + def change + add_column :decidim_users, :email_on_moderations, :boolean, default: true + end +end diff --git a/db/migrate/20210408054263_invalidate_all_sessions_for_deleted_users.decidim.rb b/db/migrate/20210408054263_invalidate_all_sessions_for_deleted_users.decidim.rb new file mode 100644 index 0000000000..b4acff929e --- /dev/null +++ b/db/migrate/20210408054263_invalidate_all_sessions_for_deleted_users.decidim.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20210302150803) + +class InvalidateAllSessionsForDeletedUsers < ActiveRecord::Migration[5.2] + def up + Decidim::User.reset_column_information + + Decidim::User.where.not(deleted_at: nil).find_each(&:invalidate_all_sessions!) + end + + def down; end +end diff --git a/db/migrate/20210408054264_add_followable_counter_cache_to_users.decidim.rb b/db/migrate/20210408054264_add_followable_counter_cache_to_users.decidim.rb new file mode 100644 index 0000000000..1f0e0029b7 --- /dev/null +++ b/db/migrate/20210408054264_add_followable_counter_cache_to_users.decidim.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true +# This migration comes from decidim (originally 20210310120640) + +class AddFollowableCounterCacheToUsers < ActiveRecord::Migration[5.2] + def change + add_column :decidim_users, :follows_count, :integer, null: false, default: 0, index: true + + reversible do |dir| + dir.up do + Decidim::User.reset_column_information + Decidim::User.find_each do |record| + record.class.reset_counters(record.id, :follows) + end + end + end + end +end diff --git a/db/migrate/20210408054265_add_salt_to_decidim_forms_questionnaires.decidim_forms.rb b/db/migrate/20210408054265_add_salt_to_decidim_forms_questionnaires.decidim_forms.rb new file mode 100644 index 0000000000..9af15d62ea --- /dev/null +++ b/db/migrate/20210408054265_add_salt_to_decidim_forms_questionnaires.decidim_forms.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true +# This migration comes from decidim_forms (originally 20201110152921) + +class AddSaltToDecidimFormsQuestionnaires < ActiveRecord::Migration[5.2] + class Questionnaire < ApplicationRecord + self.table_name = :decidim_forms_questionnaires + end + + def change + add_column :decidim_forms_questionnaires, :salt, :string + + Questionnaire.find_each do |questionnaire| + questionnaire.salt = Decidim::Tokenizer.random_salt + questionnaire.save! + end + end +end diff --git a/db/migrate/20210408054266_add_max_characters_to_decidim_forms_questions.decidim_forms.rb b/db/migrate/20210408054266_add_max_characters_to_decidim_forms_questions.decidim_forms.rb new file mode 100644 index 0000000000..b24ef1e36a --- /dev/null +++ b/db/migrate/20210408054266_add_max_characters_to_decidim_forms_questions.decidim_forms.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +# This migration comes from decidim_forms (originally 20210208094442) + +class AddMaxCharactersToDecidimFormsQuestions < ActiveRecord::Migration[5.2] + def change + add_column :decidim_forms_questions, :max_characters, :integer, default: 0 + end +end diff --git a/db/migrate/20210408054267_create_decidim_verifications_conflicts.decidim_verifications.rb b/db/migrate/20210408054267_create_decidim_verifications_conflicts.decidim_verifications.rb new file mode 100644 index 0000000000..53b9daba03 --- /dev/null +++ b/db/migrate/20210408054267_create_decidim_verifications_conflicts.decidim_verifications.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true +# This migration comes from decidim_verifications (originally 20201028161118) + +class CreateDecidimVerificationsConflicts < ActiveRecord::Migration[5.2] + def change + create_table :decidim_verifications_conflicts do |t| + t.references :current_user, index: { name: "authorization_current_user" }, foreign_key: { to_table: :decidim_users } + t.references :managed_user, index: { name: "authorization_managed_user" }, foreign_key: { to_table: :decidim_users } + t.integer :times, default: 0 + t.string :unique_id + t.boolean :solved, default: false + + t.timestamps + end + end +end diff --git a/db/migrate/20210408054268_add_hashtag_to_participatory_process_groups.decidim_participatory_processes.rb b/db/migrate/20210408054268_add_hashtag_to_participatory_process_groups.decidim_participatory_processes.rb new file mode 100644 index 0000000000..c6186cab45 --- /dev/null +++ b/db/migrate/20210408054268_add_hashtag_to_participatory_process_groups.decidim_participatory_processes.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +# This migration comes from decidim_participatory_processes (originally 20201007215105) + +class AddHashtagToParticipatoryProcessGroups < ActiveRecord::Migration[5.2] + def change + add_column :decidim_participatory_process_groups, :hashtag, :string + end +end diff --git a/db/migrate/20210408054269_add_metadata_columns_to_participatory_process_groups.decidim_participatory_processes.rb b/db/migrate/20210408054269_add_metadata_columns_to_participatory_process_groups.decidim_participatory_processes.rb new file mode 100644 index 0000000000..0efe84f5f4 --- /dev/null +++ b/db/migrate/20210408054269_add_metadata_columns_to_participatory_process_groups.decidim_participatory_processes.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true +# This migration comes from decidim_participatory_processes (originally 20201008154315) + +class AddMetadataColumnsToParticipatoryProcessGroups < ActiveRecord::Migration[5.2] + def change + add_column :decidim_participatory_process_groups, :group_url, :string + add_column :decidim_participatory_process_groups, :developer_group, :jsonb + add_column :decidim_participatory_process_groups, :local_area, :jsonb + add_column :decidim_participatory_process_groups, :meta_scope, :jsonb + add_column :decidim_participatory_process_groups, :target, :jsonb + add_column :decidim_participatory_process_groups, :participatory_scope, :jsonb + add_column :decidim_participatory_process_groups, :participatory_structure, :jsonb + end +end diff --git a/db/migrate/20210408054270_rename_name_column_to_title_in_decidim_participatory_process_groups.decidim_participatory_processes.rb b/db/migrate/20210408054270_rename_name_column_to_title_in_decidim_participatory_process_groups.decidim_participatory_processes.rb new file mode 100644 index 0000000000..3efa4e7172 --- /dev/null +++ b/db/migrate/20210408054270_rename_name_column_to_title_in_decidim_participatory_process_groups.decidim_participatory_processes.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true +# This migration comes from decidim_participatory_processes (originally 20201013105520) + +class RenameNameColumnToTitleInDecidimParticipatoryProcessGroups < ActiveRecord::Migration[5.2] + def up + rename_column :decidim_participatory_process_groups, :name, :title + PaperTrail::Version.where(item_type: "Decidim::ParticipatoryProcessGroup").each do |version| + # rubocop:disable Rails/SkipsModelValidations + version.update_attribute(:object_changes, version.object_changes.gsub(/^name:/, "title:")) if version.object_changes.present? + # rubocop:enable Rails/SkipsModelValidations + + next unless version.object.present? && version.object.has_key?("name") + + object = version.object + object["title"] = object.delete("name") + + # rubocop:disable Rails/SkipsModelValidations + version.update_attribute(:object, object) + # rubocop:enable Rails/SkipsModelValidations + end + end + + def down + PaperTrail::Version.where(item_type: "Decidim::ParticipatoryProcessGroup").each do |version| + # rubocop:disable Rails/SkipsModelValidations + version.update_attribute(:object_changes, version.object_changes.gsub(/^title:/, "name:")) if version.object_changes.present? + # rubocop:enable Rails/SkipsModelValidations + + next unless version.object.present? && version.object.has_key?("title") + + object = version.object + object["name"] = object.delete("title") + + # rubocop:disable Rails/SkipsModelValidations + version.update_attribute(:object, object) + # rubocop:enable Rails/SkipsModelValidations + end + rename_column :decidim_participatory_process_groups, :title, :name + end +end diff --git a/db/migrate/20210408054271_add_promoted_flag_to_decidim_participatory_process_groups.decidim_participatory_processes.rb b/db/migrate/20210408054271_add_promoted_flag_to_decidim_participatory_process_groups.decidim_participatory_processes.rb new file mode 100644 index 0000000000..e63002a094 --- /dev/null +++ b/db/migrate/20210408054271_add_promoted_flag_to_decidim_participatory_process_groups.decidim_participatory_processes.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +# This migration comes from decidim_participatory_processes (originally 20201030133444) + +class AddPromotedFlagToDecidimParticipatoryProcessGroups < ActiveRecord::Migration[5.2] + def change + add_column :decidim_participatory_process_groups, :promoted, :boolean, default: false, index: true + end +end diff --git a/db/migrate/20210408054272_add_weight_field_to_participatory_processes.decidim_participatory_processes.rb b/db/migrate/20210408054272_add_weight_field_to_participatory_processes.decidim_participatory_processes.rb new file mode 100644 index 0000000000..f9a3d2af29 --- /dev/null +++ b/db/migrate/20210408054272_add_weight_field_to_participatory_processes.decidim_participatory_processes.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +# This migration comes from decidim_participatory_processes (originally 20210204154593) + +class AddWeightFieldToParticipatoryProcesses < ActiveRecord::Migration[5.2] + def change + add_column :decidim_participatory_processes, :weight, :integer, null: false, default: true + end +end diff --git a/db/migrate/20210408054273_add_followable_counter_cache_to_participatory_processes.decidim_participatory_processes.rb b/db/migrate/20210408054273_add_followable_counter_cache_to_participatory_processes.decidim_participatory_processes.rb new file mode 100644 index 0000000000..188adcdf03 --- /dev/null +++ b/db/migrate/20210408054273_add_followable_counter_cache_to_participatory_processes.decidim_participatory_processes.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true +# This migration comes from decidim_participatory_processes (originally 20210310120750) + +class AddFollowableCounterCacheToParticipatoryProcesses < ActiveRecord::Migration[5.2] + def change + add_column :decidim_participatory_processes, :follows_count, :integer, null: false, default: 0, index: true + + reversible do |dir| + dir.up do + Decidim::ParticipatoryProcess.reset_column_information + Decidim::ParticipatoryProcess.find_each do |record| + record.class.reset_counters(record.id, :follows) + end + end + end + end +end diff --git a/db/migrate/20210408054274_add_weight_field_to_assembly.decidim_assemblies.rb b/db/migrate/20210408054274_add_weight_field_to_assembly.decidim_assemblies.rb new file mode 100644 index 0000000000..d111eb0b30 --- /dev/null +++ b/db/migrate/20210408054274_add_weight_field_to_assembly.decidim_assemblies.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +# This migration comes from decidim_assemblies (originally 20210204152393) + +class AddWeightFieldToAssembly < ActiveRecord::Migration[5.2] + def change + add_column :decidim_assemblies, :weight, :integer, null: false, default: true + end +end diff --git a/db/migrate/20210408054275_add_followable_counter_cache_to_assemblies.decidim_assemblies.rb b/db/migrate/20210408054275_add_followable_counter_cache_to_assemblies.decidim_assemblies.rb new file mode 100644 index 0000000000..f56e5f345f --- /dev/null +++ b/db/migrate/20210408054275_add_followable_counter_cache_to_assemblies.decidim_assemblies.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true +# This migration comes from decidim_assemblies (originally 20210310120444) + +class AddFollowableCounterCacheToAssemblies < ActiveRecord::Migration[5.2] + def change + add_column :decidim_assemblies, :follows_count, :integer, null: false, default: 0, index: true + + reversible do |dir| + dir.up do + Decidim::Assembly.reset_column_information + Decidim::Assembly.find_each do |record| + record.class.reset_counters(record.id, :follows) + end + end + end + end +end diff --git a/db/migrate/20210408054276_add_online_meeting_url.decidim_meetings.rb b/db/migrate/20210408054276_add_online_meeting_url.decidim_meetings.rb new file mode 100644 index 0000000000..0536c129e1 --- /dev/null +++ b/db/migrate/20210408054276_add_online_meeting_url.decidim_meetings.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +# This migration comes from decidim_meetings (originally 20201006140511) + +class AddOnlineMeetingUrl < ActiveRecord::Migration[5.2] + def change + add_column :decidim_meetings_meetings, :online_meeting_url, :string + end +end diff --git a/db/migrate/20210408054277_add_type_of_meeting.decidim_meetings.rb b/db/migrate/20210408054277_add_type_of_meeting.decidim_meetings.rb new file mode 100644 index 0000000000..a429f8884b --- /dev/null +++ b/db/migrate/20210408054277_add_type_of_meeting.decidim_meetings.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +# This migration comes from decidim_meetings (originally 20201009124057) + +class AddTypeOfMeeting < ActiveRecord::Migration[5.2] + def change + add_column :decidim_meetings_meetings, :type_of_meeting, :string, default: "in_person" + end +end diff --git a/db/migrate/20210408054278_fix_meetings_registration_terms.decidim_meetings.rb b/db/migrate/20210408054278_fix_meetings_registration_terms.decidim_meetings.rb new file mode 100644 index 0000000000..314b6c036b --- /dev/null +++ b/db/migrate/20210408054278_fix_meetings_registration_terms.decidim_meetings.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# This migration comes from decidim_meetings (originally 20201016065302) + +class FixMeetingsRegistrationTerms < ActiveRecord::Migration[5.2] + def up + reset_column_information + + PaperTrail.request(enabled: false) do + Decidim::Meetings::Meeting.find_each do |meeting| + next if meeting.component.nil? + # Only user-created meetings have this problem + next if meeting.official? + + # Since user-created meetings have no way to override the `registration_terms` field + # and it's supposed to use the component defaults, + # we can safely override this. + meeting.registration_terms = meeting.component.settings.default_registration_terms + meeting.save! + end + end + reset_column_information + end + + def down; end + + def reset_column_information + Decidim::Meetings::Meeting.reset_column_information + Decidim::Component.reset_column_information + end +end diff --git a/db/migrate/20210408054279_add_registration_type_and_url_to_meetings.decidim_meetings.rb b/db/migrate/20210408054279_add_registration_type_and_url_to_meetings.decidim_meetings.rb new file mode 100644 index 0000000000..e564d4ab83 --- /dev/null +++ b/db/migrate/20210408054279_add_registration_type_and_url_to_meetings.decidim_meetings.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true +# This migration comes from decidim_meetings (originally 20201016112641) + +class AddRegistrationTypeAndUrlToMeetings < ActiveRecord::Migration[5.2] + class Meetings < ApplicationRecord + self.table_name = :decidim_meetings_meetings + include Decidim::HasComponent + end + + def change + add_column :decidim_meetings_meetings, :registration_type, :string, null: false, default: "registration_disabled" + add_column :decidim_meetings_meetings, :registration_url, :string + + Meetings.reset_column_information + Meetings.find_each do |meeting| + meeting.registration_type = "on_this_platform" if meeting.decidim_author_type == "Decidim::Organization" + meeting.save! + end + end +end diff --git a/db/migrate/20210408054280_add_salt_to_decidim_meetings.decidim_meetings.rb b/db/migrate/20210408054280_add_salt_to_decidim_meetings.decidim_meetings.rb new file mode 100644 index 0000000000..d715040283 --- /dev/null +++ b/db/migrate/20210408054280_add_salt_to_decidim_meetings.decidim_meetings.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true +# This migration comes from decidim_meetings (originally 20201111133246) + +class AddSaltToDecidimMeetings < ActiveRecord::Migration[5.2] + def change + add_column :decidim_meetings_meetings, :salt, :string + # we leave old entries empty to maintain the old pad reference + end +end diff --git a/db/migrate/20210408054281_add_followable_counter_cache_to_meetings.decidim_meetings.rb b/db/migrate/20210408054281_add_followable_counter_cache_to_meetings.decidim_meetings.rb new file mode 100644 index 0000000000..fa6d92436f --- /dev/null +++ b/db/migrate/20210408054281_add_followable_counter_cache_to_meetings.decidim_meetings.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true +# This migration comes from decidim_meetings (originally 20210310120731) + +class AddFollowableCounterCacheToMeetings < ActiveRecord::Migration[5.2] + def change + add_column :decidim_meetings_meetings, :follows_count, :integer, null: false, default: 0, index: true + + reversible do |dir| + dir.up do + Decidim::Meetings::Meeting.reset_column_information + Decidim::Meetings::Meeting.find_each do |record| + record.class.reset_counters(record.id, :follows) + end + end + end + end +end diff --git a/db/migrate/20210408054282_fix_answered_proposals_after_copy.decidim_proposals.rb b/db/migrate/20210408054282_fix_answered_proposals_after_copy.decidim_proposals.rb new file mode 100644 index 0000000000..93105d84b8 --- /dev/null +++ b/db/migrate/20210408054282_fix_answered_proposals_after_copy.decidim_proposals.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true +# This migration comes from decidim_proposals (originally 20210127115628) + +class FixAnsweredProposalsAfterCopy < ActiveRecord::Migration[5.2] + def change + proposals_after_copy = Decidim::ResourceLink.where(from_type: "Decidim::Proposals::Proposal").pluck(:from_id) + + result = Decidim::Proposals::Proposal.where.not(state_published_at: nil).where(state: nil, id: proposals_after_copy) + + result.find_each do |proposal| + proposal.state_published_at = nil + proposal.save! + end + end +end diff --git a/db/migrate/20210408054283_add_followable_counter_cache_to_proposals.decidim_proposals.rb b/db/migrate/20210408054283_add_followable_counter_cache_to_proposals.decidim_proposals.rb new file mode 100644 index 0000000000..0eb81ad057 --- /dev/null +++ b/db/migrate/20210408054283_add_followable_counter_cache_to_proposals.decidim_proposals.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true +# This migration comes from decidim_proposals (originally 20210310102839) + +class AddFollowableCounterCacheToProposals < ActiveRecord::Migration[5.2] + def change + add_column :decidim_proposals_proposals, :follows_count, :integer, null: false, default: 0, index: true + + reversible do |dir| + dir.up do + Decidim::Proposals::Proposal.reset_column_information + Decidim::Proposals::Proposal.find_each do |record| + record.class.reset_counters(record.id, :follows) + end + end + end + end +end diff --git a/db/migrate/20210408054284_add_followable_counter_cache_to_collaborative_drafts.decidim_proposals.rb b/db/migrate/20210408054284_add_followable_counter_cache_to_collaborative_drafts.decidim_proposals.rb new file mode 100644 index 0000000000..1d9209c421 --- /dev/null +++ b/db/migrate/20210408054284_add_followable_counter_cache_to_collaborative_drafts.decidim_proposals.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true +# This migration comes from decidim_proposals (originally 20210310120812) + +class AddFollowableCounterCacheToCollaborativeDrafts < ActiveRecord::Migration[5.2] + def change + add_column :decidim_proposals_collaborative_drafts, :follows_count, :integer, null: false, default: 0, index: true + + reversible do |dir| + dir.up do + Decidim::Proposals::CollaborativeDraft.reset_column_information + Decidim::Proposals::CollaborativeDraft.find_each do |record| + record.class.reset_counters(record.id, :follows) + end + end + end + end +end diff --git a/db/migrate/20210408054285_fix_counters_for_copied_proposals.decidim_proposals.rb b/db/migrate/20210408054285_fix_counters_for_copied_proposals.decidim_proposals.rb new file mode 100644 index 0000000000..505c8efd47 --- /dev/null +++ b/db/migrate/20210408054285_fix_counters_for_copied_proposals.decidim_proposals.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true +# This migration comes from decidim_proposals (originally 20210318082934) + +class FixCountersForCopiedProposals < ActiveRecord::Migration[5.2] + def up + copies_ids = Decidim::ResourceLink.where( + name: "copied_from_component", + from_type: "Decidim::Proposals::Proposal", + to_type: "Decidim::Proposals::Proposal" + ).pluck(:to_id) + + Decidim::Proposals::Proposal.where(id: copies_ids).find_each do |record| + record.class.reset_counters(record.id, :follows) + record.update_comments_count + end + end + + def down; end +end diff --git a/db/migrate/20210408054286_add_followable_counter_cache_to_budgets.decidim_budgets.rb b/db/migrate/20210408054286_add_followable_counter_cache_to_budgets.decidim_budgets.rb new file mode 100644 index 0000000000..8b8d0454a7 --- /dev/null +++ b/db/migrate/20210408054286_add_followable_counter_cache_to_budgets.decidim_budgets.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true +# This migration comes from decidim_budgets (originally 20210310120613) + +class AddFollowableCounterCacheToBudgets < ActiveRecord::Migration[5.2] + def change + add_column :decidim_budgets_projects, :follows_count, :integer, null: false, default: 0, index: true + + reversible do |dir| + dir.up do + Decidim::Budgets::Project.reset_column_information + Decidim::Budgets::Project.find_each do |record| + record.class.reset_counters(record.id, :follows) + end + end + end + end +end diff --git a/db/migrate/20210408054287_add_scope_to_debates_debate.decidim_debates.rb b/db/migrate/20210408054287_add_scope_to_debates_debate.decidim_debates.rb new file mode 100644 index 0000000000..2aa45964d6 --- /dev/null +++ b/db/migrate/20210408054287_add_scope_to_debates_debate.decidim_debates.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +# This migration comes from decidim_debates (originally 20200930145546) + +class AddScopeToDebatesDebate < ActiveRecord::Migration[5.2] + def change + add_reference :decidim_debates_debates, :decidim_scope, foreign_key: true, index: true + end +end diff --git a/db/migrate/20210408054288_archive_debates.decidim_debates.rb b/db/migrate/20210408054288_archive_debates.decidim_debates.rb new file mode 100644 index 0000000000..886ddfff71 --- /dev/null +++ b/db/migrate/20210408054288_archive_debates.decidim_debates.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true +# This migration comes from decidim_debates (originally 20201126112752) + +class ArchiveDebates < ActiveRecord::Migration[5.2] + def change + add_column :decidim_debates_debates, :archived_at, :datetime + add_index :decidim_debates_debates, :archived_at + end +end diff --git a/db/migrate/20210408054289_revert_archive_debates.decidim_debates.rb b/db/migrate/20210408054289_revert_archive_debates.decidim_debates.rb new file mode 100644 index 0000000000..a5432420de --- /dev/null +++ b/db/migrate/20210408054289_revert_archive_debates.decidim_debates.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true +# This migration comes from decidim_debates (originally 20210125101735) + +class RevertArchiveDebates < ActiveRecord::Migration[5.2] + def change + remove_index :decidim_debates_debates, :archived_at + remove_column :decidim_debates_debates, :archived_at + end +end diff --git a/db/migrate/20210408054290_add_followable_counter_cache_to_debates.decidim_debates.rb b/db/migrate/20210408054290_add_followable_counter_cache_to_debates.decidim_debates.rb new file mode 100644 index 0000000000..a91eb4d2e0 --- /dev/null +++ b/db/migrate/20210408054290_add_followable_counter_cache_to_debates.decidim_debates.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true +# This migration comes from decidim_debates (originally 20210310120652) + +class AddFollowableCounterCacheToDebates < ActiveRecord::Migration[5.2] + def change + add_column :decidim_debates_debates, :follows_count, :integer, null: false, default: 0, index: true + + reversible do |dir| + dir.up do + Decidim::Debates::Debate.reset_column_information + Decidim::Debates::Debate.find_each do |record| + record.class.reset_counters(record.id, :follows) + end + end + end + end +end diff --git a/db/migrate/20210408054291_add_followable_counter_cache_to_blogs.decidim_blogs.rb b/db/migrate/20210408054291_add_followable_counter_cache_to_blogs.decidim_blogs.rb new file mode 100644 index 0000000000..6542c75575 --- /dev/null +++ b/db/migrate/20210408054291_add_followable_counter_cache_to_blogs.decidim_blogs.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true +# This migration comes from decidim_blogs (originally 20210310120514) + +class AddFollowableCounterCacheToBlogs < ActiveRecord::Migration[5.2] + def change + add_column :decidim_blogs_posts, :follows_count, :integer, null: false, default: 0, index: true + + reversible do |dir| + dir.up do + Decidim::Blogs::Post.reset_column_information + Decidim::Blogs::Post.find_each do |record| + record.class.reset_counters(record.id, :follows) + end + end + end + end +end diff --git a/db/schema.rb b/db/schema.rb index aae4115de2..7add9b38f7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2020_10_29_125846) do +ActiveRecord::Schema.define(version: 2021_04_08_054291) do # These are extensions that must be enabled in order to support this database enable_extension "ltree" @@ -170,6 +170,8 @@ t.string "youtube_handler" t.string "github_handler" t.bigint "decidim_assemblies_type_id" + t.integer "weight", default: 1, null: false + t.integer "follows_count", default: 0, null: false t.index ["decidim_area_id"], name: "index_decidim_assemblies_on_decidim_area_id" t.index ["decidim_assemblies_type_id"], name: "index_decidim_assemblies_on_decidim_assemblies_type_id" t.index ["decidim_organization_id", "slug"], name: "index_unique_assembly_slug_and_organization", unique: true @@ -273,6 +275,7 @@ t.integer "decidim_user_group_id" t.integer "endorsements_count", default: 0, null: false t.integer "comments_count", default: 0, null: false + t.integer "follows_count", default: 0, null: false t.index ["decidim_author_id", "decidim_author_type"], name: "index_decidim_blogs_posts_on_decidim_author" t.index ["decidim_component_id"], name: "index_decidim_blogs_posts_on_decidim_component_id" t.index ["decidim_user_group_id"], name: "index_decidim_blogs_posts_on_decidim_user_group_id" @@ -320,6 +323,7 @@ t.bigint "decidim_budgets_budget_id" t.date "selected_at" t.integer "comments_count", default: 0, null: false + t.integer "follows_count", default: 0, null: false t.index ["decidim_budgets_budget_id"], name: "index_decidim_budgets_projects_on_decidim_budgets_budget_id" t.index ["decidim_scope_id"], name: "index_decidim_budgets_projects_on_decidim_scope_id" end @@ -453,9 +457,12 @@ t.datetime "last_comment_at" t.integer "last_comment_by_id" t.string "last_comment_by_type" + t.bigint "decidim_scope_id" + t.integer "follows_count", default: 0, null: false t.index ["closed_at"], name: "index_decidim_debates_debates_on_closed_at" t.index ["decidim_author_id", "decidim_author_type"], name: "index_decidim_debates_debates_on_decidim_author" t.index ["decidim_component_id"], name: "index_decidim_debates_debates_on_decidim_component_id" + t.index ["decidim_scope_id"], name: "index_decidim_debates_debates_on_decidim_scope_id" t.index ["decidim_user_group_id"], name: "index_decidim_debates_debates_on_decidim_user_group_id" t.index ["endorsements_count"], name: "idx_decidim_debates_debates_on_endorsemnts_count" end @@ -550,6 +557,7 @@ t.datetime "published_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.string "salt" t.index ["questionnaire_for_type", "questionnaire_for_id"], name: "index_decidim_forms_questionnaires_questionnaire_for" end @@ -563,6 +571,7 @@ t.integer "max_choices" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.integer "max_characters", default: 0 t.index ["decidim_questionnaire_id"], name: "index_decidim_forms_questions_on_decidim_questionnaire_id" t.index ["position"], name: "index_decidim_forms_questions_on_position" end @@ -673,6 +682,12 @@ t.string "decidim_author_type" t.integer "decidim_user_group_id" t.integer "comments_count", default: 0, null: false + t.string "online_meeting_url" + t.string "type_of_meeting", default: "in_person" + t.string "registration_type", default: "registration_disabled", null: false + t.string "registration_url" + t.string "salt" + t.integer "follows_count", default: 0, null: false t.index ["decidim_author_id", "decidim_author_type"], name: "index_decidim_meetings_meetings_on_author" t.index ["decidim_author_id"], name: "index_decidim_meetings_meetings_on_decidim_author_id" t.index ["decidim_component_id"], name: "index_decidim_meetings_meetings_on_decidim_component_id" @@ -776,6 +791,7 @@ t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "decidim_participatory_space_type", null: false + t.text "reported_content" t.index ["decidim_participatory_space_id", "decidim_participatory_space_type"], name: "decidim_moderations_participatory_space" t.index ["decidim_reportable_type", "decidim_reportable_id"], name: "decidim_moderations_reportable", unique: true t.index ["hidden_at"], name: "decidim_moderations_hidden_at" @@ -819,7 +835,6 @@ t.jsonb "description" t.string "logo" t.string "twitter_handler" - t.boolean "show_statistics", default: true t.string "favicon" t.string "instagram_handler" t.string "facebook_handler" @@ -878,12 +893,21 @@ end create_table "decidim_participatory_process_groups", id: :serial, force: :cascade do |t| - t.jsonb "name", null: false + t.jsonb "title", null: false t.jsonb "description", null: false t.string "hero_image" t.integer "decidim_organization_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.string "hashtag" + t.string "group_url" + t.jsonb "developer_group" + t.jsonb "local_area" + t.jsonb "meta_scope" + t.jsonb "target" + t.jsonb "participatory_scope" + t.jsonb "participatory_structure" + t.boolean "promoted", default: false t.index ["decidim_organization_id"], name: "decidim_participatory_process_group_organization" end @@ -947,6 +971,8 @@ t.bigint "decidim_area_id" t.bigint "decidim_scope_type_id" t.boolean "show_metrics", default: true + t.integer "weight", default: 1, null: false + t.integer "follows_count", default: 0, null: false t.index ["decidim_area_id"], name: "index_decidim_participatory_processes_on_decidim_area_id" t.index ["decidim_organization_id", "slug"], name: "index_unique_process_slug_and_organization", unique: true t.index ["decidim_organization_id"], name: "index_decidim_processes_on_decidim_organization_id" @@ -1004,6 +1030,7 @@ t.datetime "updated_at", null: false t.integer "coauthorships_count", default: 0, null: false t.integer "comments_count", default: 0, null: false + t.integer "follows_count", default: 0, null: false t.index ["body"], name: "decidim_proposals_collaborative_draft_body_search" t.index ["decidim_component_id"], name: "decidim_proposals_collaborative_drafts_on_decidim_component_id" t.index ["decidim_scope_id"], name: "decidim_proposals_collaborative_drafts_on_decidim_scope_id" @@ -1070,6 +1097,7 @@ t.jsonb "title" t.jsonb "body" t.integer "comments_count", default: 0, null: false + t.integer "follows_count", default: 0, null: false t.index "md5((body)::text)", name: "decidim_proposals_proposal_body_search" t.index "md5((title)::text)", name: "decidim_proposals_proposal_title_search" t.index ["created_at"], name: "index_decidim_proposals_proposals_on_created_at" @@ -1096,6 +1124,7 @@ t.text "details" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.string "locale" t.index ["decidim_moderation_id", "decidim_user_id"], name: "decidim_reports_moderation_user_unique", unique: true t.index ["decidim_moderation_id"], name: "decidim_reports_moderation" t.index ["decidim_user_id"], name: "decidim_reports_user" @@ -1227,6 +1256,7 @@ t.integer "weight" t.boolean "show_in_footer", default: false, null: false t.bigint "topic_id" + t.boolean "allow_public_access", default: false, null: false t.index ["decidim_organization_id"], name: "index_decidim_static_pages_on_decidim_organization_id" t.index ["topic_id"], name: "index_decidim_static_pages_on_topic_id" end @@ -1253,6 +1283,15 @@ t.index ["reset_password_token"], name: "index_decidim_system_admins_on_reset_password_token", unique: true end + create_table "decidim_user_blocks", force: :cascade do |t| + t.bigint "decidim_user_id" + t.integer "blocking_user_id" + t.text "justification" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["decidim_user_id"], name: "index_decidim_user_blocks_on_decidim_user_id" + end + create_table "decidim_user_group_memberships", id: :serial, force: :cascade do |t| t.integer "decidim_user_id", null: false t.integer "decidim_user_group_id", null: false @@ -1266,6 +1305,23 @@ t.index ["role", "decidim_user_group_id"], name: "decidim_group_membership_one_creator_per_group", unique: true, where: "((role)::text = 'creator'::text)" end + create_table "decidim_user_moderations", force: :cascade do |t| + t.bigint "decidim_user_id" + t.integer "report_count", default: 0, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["decidim_user_id"], name: "index_decidim_user_moderations_on_decidim_user_id" + end + + create_table "decidim_user_reports", force: :cascade do |t| + t.integer "user_moderation_id" + t.integer "user_id", null: false + t.string "reason" + t.text "details" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "decidim_users", id: :serial, force: :cascade do |t| t.string "email", default: "", null: false t.string "encrypted_password", default: "", null: false @@ -1320,6 +1376,11 @@ t.datetime "officialized_at" t.jsonb "officialized_as" t.datetime "admin_terms_accepted_at" + t.boolean "blocked", default: false, null: false + t.datetime "blocked_at" + t.integer "block_id" + t.boolean "email_on_moderations", default: true + t.integer "follows_count", default: 0, null: false t.index ["confirmation_token"], name: "index_decidim_users_on_confirmation_token", unique: true t.index ["decidim_organization_id"], name: "index_decidim_users_on_decidim_organization_id" t.index ["email", "decidim_organization_id"], name: "index_decidim_users_on_email_and_decidim_organization_id", unique: true, where: "((deleted_at IS NULL) AND (managed = false) AND ((type)::text = 'Decidim::User'::text))" @@ -1334,6 +1395,18 @@ t.index ["unlock_token"], name: "index_decidim_users_on_unlock_token", unique: true end + create_table "decidim_verifications_conflicts", force: :cascade do |t| + t.bigint "current_user_id" + t.bigint "managed_user_id" + t.integer "times", default: 0 + t.string "unique_id" + t.boolean "solved", default: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["current_user_id"], name: "authorization_current_user" + t.index ["managed_user_id"], name: "authorization_managed_user" + end + create_table "decidim_verifications_csv_data", force: :cascade do |t| t.string "email" t.bigint "decidim_organization_id" @@ -1413,6 +1486,7 @@ add_foreign_key "decidim_budgets_orders", "decidim_budgets_budgets" add_foreign_key "decidim_budgets_projects", "decidim_budgets_budgets" add_foreign_key "decidim_categorizations", "decidim_categories" + add_foreign_key "decidim_debates_debates", "decidim_scopes" add_foreign_key "decidim_identities", "decidim_organizations" add_foreign_key "decidim_newsletters", "decidim_users", column: "author_id" add_foreign_key "decidim_participatory_process_steps", "decidim_participatory_processes" @@ -1423,7 +1497,14 @@ add_foreign_key "decidim_scopes", "decidim_scope_types", column: "scope_type_id" add_foreign_key "decidim_scopes", "decidim_scopes", column: "parent_id" add_foreign_key "decidim_static_pages", "decidim_organizations" + add_foreign_key "decidim_user_blocks", "decidim_users" + add_foreign_key "decidim_user_blocks", "decidim_users", column: "blocking_user_id" + add_foreign_key "decidim_user_moderations", "decidim_users" + add_foreign_key "decidim_user_reports", "decidim_user_moderations", column: "user_moderation_id" + add_foreign_key "decidim_user_reports", "decidim_users", column: "user_id" add_foreign_key "decidim_users", "decidim_organizations" + add_foreign_key "decidim_verifications_conflicts", "decidim_users", column: "current_user_id" + add_foreign_key "decidim_verifications_conflicts", "decidim_users", column: "managed_user_id" add_foreign_key "decidim_verifications_csv_data", "decidim_organizations" add_foreign_key "oauth_access_grants", "decidim_users", column: "resource_owner_id" add_foreign_key "oauth_access_grants", "oauth_applications", column: "application_id" From 89e713b1e3e4eebfa095ec2f6541beaf6619bfd7 Mon Sep 17 00:00:00 2001 From: ayuki_j Date: Thu, 8 Apr 2021 14:46:59 +0900 Subject: [PATCH 5/8] remove not recommended option --- config/boot.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/config/boot.rb b/config/boot.rb index 4ab87a74c2..c154378b5c 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -11,8 +11,6 @@ cache_dir: File.expand_path(File.join("..", "tmp", "cache"), __dir__), development_mode: env == "development", load_path_cache: true, - autoload_paths_cache: true, - disable_trace: false, compile_cache_iseq: !ENV["SIMPLECOV"], compile_cache_yaml: true ) From 5a232b228816520704b49a2b6941965a49c8cd2b Mon Sep 17 00:00:00 2001 From: ayuki_j Date: Thu, 8 Apr 2021 15:57:01 +0900 Subject: [PATCH 6/8] update faker --- Gemfile | 2 +- Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 5aa73acd9b..b7dc00c417 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,7 @@ gem "bootsnap", "~> 1.3" gem "puma", ">= 4.3.5" gem "uglifier", "~> 4.1" -gem "faker", "~> 1.9" +gem "faker", "~> 2.0" gem "wicked_pdf", "~> 1.4" diff --git a/Gemfile.lock b/Gemfile.lock index 0f16383f68..7722860676 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -416,8 +416,8 @@ GEM factory_bot_rails (4.11.1) factory_bot (~> 4.11.1) railties (>= 3.0.0) - faker (1.9.6) - i18n (>= 0.7) + faker (2.17.0) + i18n (>= 1.6, < 2) faraday (1.3.0) faraday-net_http (~> 1.0) multipart-post (>= 1.2, < 3) @@ -871,7 +871,7 @@ DEPENDENCIES deface dotenv-rails factory_bot_rails - faker (~> 1.9) + faker (~> 2.0) figaro fog-aws letter_opener_web (~> 1.3) From 89c6347fd90c73bcb619eb7cdcc5f7a10ca4db8b Mon Sep 17 00:00:00 2001 From: ayuki_j Date: Fri, 9 Apr 2021 00:52:29 +0900 Subject: [PATCH 7/8] update local --- config/locales/ja.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 4ab760dd23..94263fa24c 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -33,8 +33,8 @@ ja: name_or_nickname_or_email_cont: "%{collection} をメール、表示名、アカウントIDで検索します。" authorization_handlers: user_extension_authorization_handler: - explanation: 'ユーザー拡張属性保持用' - name: 'ユーザー拡張属性' + explanation: ユーザー拡張属性保持用 + name: ユーザー拡張属性 components: add_comment_form: account_message: ログイン または 新規登録 することでコメントできます。 @@ -122,6 +122,9 @@ ja: filters: explanations: no_active_nor_upcoming_callout: アクティブな参加型プロセスも今後の参加型プロセスもありません。ここでは過去の参加型プロセスのリストを示します。 + profiles: + show: + send_private_message: プライベートメッセージを送信 proposals: application_helper: filter_origin_values: From c334cad33c39d816a59d64ac990eafda1b73c5ad Mon Sep 17 00:00:00 2001 From: ayuki_j Date: Fri, 9 Apr 2021 15:52:12 +0900 Subject: [PATCH 8/8] update --- config/cable.yml | 1 + spec/i18n_spec.rb | 34 ---------------------------------- 2 files changed, 1 insertion(+), 34 deletions(-) delete mode 100644 spec/i18n_spec.rb diff --git a/config/cable.yml b/config/cable.yml index dc9270f13f..54e5293bbd 100644 --- a/config/cable.yml +++ b/config/cable.yml @@ -7,3 +7,4 @@ test: production: adapter: redis url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> + channel_prefix: decidim_app_production diff --git a/spec/i18n_spec.rb b/spec/i18n_spec.rb deleted file mode 100644 index 2db6251600..0000000000 --- a/spec/i18n_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -require "i18n/tasks" - -RSpec.describe I18n do - let(:i18n) { I18n::Tasks::BaseTask.new } - let(:missing_keys) { i18n.missing_keys } - let(:unused_keys) { i18n.unused_keys } - let(:inconsistent_interpolations) { i18n.inconsistent_interpolations } - - it "does not have missing keys" do - expect(missing_keys).to be_empty, - "Missing #{missing_keys.leaves.count} i18n keys, run `i18n-tasks missing' to show them" - end - - it "does not have unused keys" do - expect(unused_keys).to be_empty, - "#{unused_keys.leaves.count} unused i18n keys, run `i18n-tasks unused' to show them" - end - - it "files are normalized" do - non_normalized = i18n.non_normalized_paths - error_message = "The following files need to be normalized:\n" \ - "#{non_normalized.map { |path| " #{path}" }.join("\n")}\n" \ - "Please run `i18n-tasks normalize' to fix" - expect(non_normalized).to be_empty, error_message - end - - it "does not have inconsistent interpolations" do - error_message = "#{inconsistent_interpolations.leaves.count} i18n keys have inconsistent interpolations.\n" \ - "Run `i18n-tasks check-consistent-interpolations' to show them" - expect(inconsistent_interpolations).to be_empty, error_message - end -end