The project is in a healthy, maintained state
To-Do
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 5.1.2
~> 0.3.19
 Project Readme

Decidim::StratifiedSortitions

Usage

Simply include it in your Decidim instance.

Installation

Add this line to your application's Gemfile:

gem 'decidim-stratified_sortitions'

And then execute:

bundle

System Dependencies

This module uses the COIN-OR CBC solver for the LEXIMIN fair selection algorithm. You need to install CBC on your system:

Ubuntu/Debian:

sudo apt install coinor-cbc coinor-libcbc-dev

macOS (Homebrew):

brew install cbc

Fedora/RHEL:

sudo dnf install coin-or-Cbc coin-or-Cbc-devel

Import migrations

After installing the gem you must import and execute the migrations bundled with the gem:

bundle exec rails decidim_stratified_sortitions:install:migrations
bundle exec rails db:migrate

Usage

Decidim::StratifiedSortitions allows fair sortitions in two ways.

  1. Generate all the panels and extract the samples at once.
  2. Execute the sortition in two phases

See Decidim::StratifiedSortitions::FairSortitionService for more details on how to each workflow works.

Running tests

Create a dummy app in your application (if not present):

bundle exec rake test_app
cd spec/decidim_dummy_app/
bundle exec rails decidim_stratified_sortitions:install:migrations
RAILS_ENV=test bundle exec rails db:migrate

And run tests:

# Run all tests
bundle exec rspec spec

# Run only performance tests
bundle exec rspec --tag performance

# Run all tests except performance (default)
bundle exec rspec --tag ~performance

# Run also slow tests
bundle exec rspec --tag performance --tag slow

Contributing

See Decidim.

License

See Decidim.