Upgrade notes:
Upgrading the gem
You need to alter the following files:
Gemspec file
You must set the decidim version to 0.8.0 or higher in your gemspec.
...
s.add-dependency "decidim-core", "~> 0.8.0"
...
Gemfile
You must adjust the decidim version in your gem file as well. You also need to add the new engine 'decidim-verifications':
...
gem "decidim", "~> 0.8.0"
gem "decidim-verifications"
...
Finally run bundle update to get the required gems updated.
bundle update --full-index
Updating your sources
Factories
Decidim 0.8.0 has migratied from FactoryGirl gem to FactoryBot. Cause this you need to update your factories. Usually the factories.rb file looks like this:
# frozen_string_literal: true
require 'decidim/faker/localized'
require 'decidim/dev'
FactoryGirl.define do
...
end
You must replace FactoryGirl by FactoryBot. After the change it should look like this:
# frozen_string_literal: true
require 'decidim/faker/localized'
require 'decidim/dev'
FactoryBot.define do
...
end
Spec tests examples
Some examples have changed its name to be more descriptive. In order to have your tests up and running again you must perform the following substitions in the specs folder:
-
include_context "feature" now is include_context "with a feature"
-
include_context "feature admin" now is include_context "when managing a feature as an admin"
Capybara
After I have upgraded to the last version of decidim I have realized that some test that were valid in the previous version now were failing. The reason was the following exception:
RSpec::Core::MultipleExceptionError: unexpected alert open: {Alert text : Are you sure?}
That was caused by a confirmation dialog. In order to get rid of these issue I had to add the following line in the point
where the dialog was supposed to be accepted:
accept_confirm { click_button "Submit" }
Steps to do after migrating your source code
Adapting code for an existing engine
You must remove the external test app and regenerate it:
rm -Rf spec/decidim_dummy_app
bundle exec rails decidim:generate_external_test_app
After regenerating the test app you should recreate the test database as well:
cd spec/decidim_dummy_app
bundle exec rails db:drop
bundle exec rails db:create
bundle exec rails db:migrate
bundle exec rails db:migrate RAILS_ENV=test
bundle exec rails db:seed
Adapting code for an existing Decidim implementation
After updating the decidim gems you should import the new migrations and execute them:
rails decidim:upgraded
rails db:migrate
Additionally you should change the way uglifier is used in your app:
Edit the file config/environments/production.rb and make the following changes:
# Original value
# config.assets.js_compressor = :uglifier
# Enable ES6 support
config.assets.js_compressor = Uglifier.new(harmony: true)
To sum it up
Take a cold beer and enjoy democracy.
Added:
- decidim-accountability: Add result tracing and version diffing #2206
- decidim-assemblies: Show promoted assemblies in the homepage #2162
- decidim-core: Add support for extending the user profile menu. #2193
- decidim-core: Add view hooks so external engines can extend the homepage and other sections with their own code #2114
- decidim-core: Private one to one conversations #2186
- decidim-proposals: Admins can set a minute window after the creation of a proposal in which the proposal can be edited by its author. Once the window has passed, it cannot be edited. #2171
- decidim-verifications: Support for deferred verification methods that require several steps in order to be granted. #2024
Changed:
-
decidim-core: Only require default locale translations for i18n fields #2204
-
decidim-core: Changed
ActiveJob
queue name fromdecidim_events
toevents
for consistency reasons #2229. -
decidim-admin: Replace url to visit_url moderation admin #2129
-
decidim-core: Hide link to register when user is already logged in #2088
-
decidim-proposals: Change "Already voted" to "Unvote" on button hover #2096
-
decidim-verifications: Authorization forms now must be registered using
the new API. If you previously had a custom authorization form registered via:# config/initializers/decidim.rb Decidim.configure do |config| # ... config.authorization_handlers = ["Decidim::MyCensusHandler"] # ... end
You must change it to
# config/initializers/decidim.rb Decidim::Verifications.register_workflow(:my_census_handler) do |auth| auth.form = "Decidim::MyCensusHandler" end
Fixed:
- decidim-core: Fix foundation datepicker es date format #2278
- decidim-admin: Do not let newsletters have videos, as emails can't render them #2257
- decidim-core: Fixes ScopeType relation with Scope #2255
- decidim-core: Fixes to MigrateUserRolesToParticipatoryProcessRoles: avoid using relations and work with id's directly #2223
- decidim-core: Embedded videos were not displaying properly #2198
- decidim-core: Links in emails in development being generated without a port #2237
- decidim-core: Ensure locale is kept between feature pages #2310
- decidim-participatory-processes: Fixes active processes and adds all processes filters #2081