Skip to content

Commit

Permalink
Setup migrations and models (#13)
Browse files Browse the repository at this point in the history
* add migrations

* change grade to weight

* totals name

* hooks (wip)

* add total weight cache
  • Loading branch information
microstudi authored Oct 10, 2023
1 parent 5a99411 commit 5c7a1ba
Show file tree
Hide file tree
Showing 13 changed files with 355 additions and 88 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ gem "decidim-decidim_awesome", path: "."
gem "bootsnap", "~> 1.4"

gem "puma", ">= 5.5.1"
gem "uglifier", "~> 4.1"

gem "faker", "~> 2.14"

Expand Down
170 changes: 83 additions & 87 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,63 +9,63 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.7.4)
actionpack (= 6.1.7.4)
activesupport (= 6.1.7.4)
actioncable (6.1.7.6)
actionpack (= 6.1.7.6)
activesupport (= 6.1.7.6)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.7.4)
actionpack (= 6.1.7.4)
activejob (= 6.1.7.4)
activerecord (= 6.1.7.4)
activestorage (= 6.1.7.4)
activesupport (= 6.1.7.4)
actionmailbox (6.1.7.6)
actionpack (= 6.1.7.6)
activejob (= 6.1.7.6)
activerecord (= 6.1.7.6)
activestorage (= 6.1.7.6)
activesupport (= 6.1.7.6)
mail (>= 2.7.1)
actionmailer (6.1.7.4)
actionpack (= 6.1.7.4)
actionview (= 6.1.7.4)
activejob (= 6.1.7.4)
activesupport (= 6.1.7.4)
actionmailer (6.1.7.6)
actionpack (= 6.1.7.6)
actionview (= 6.1.7.6)
activejob (= 6.1.7.6)
activesupport (= 6.1.7.6)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.7.4)
actionview (= 6.1.7.4)
activesupport (= 6.1.7.4)
actionpack (6.1.7.6)
actionview (= 6.1.7.6)
activesupport (= 6.1.7.6)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.7.4)
actionpack (= 6.1.7.4)
activerecord (= 6.1.7.4)
activestorage (= 6.1.7.4)
activesupport (= 6.1.7.4)
actiontext (6.1.7.6)
actionpack (= 6.1.7.6)
activerecord (= 6.1.7.6)
activestorage (= 6.1.7.6)
activesupport (= 6.1.7.6)
nokogiri (>= 1.8.5)
actionview (6.1.7.4)
activesupport (= 6.1.7.4)
actionview (6.1.7.6)
activesupport (= 6.1.7.6)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_link_to (1.0.5)
actionpack
addressable
activejob (6.1.7.4)
activesupport (= 6.1.7.4)
activejob (6.1.7.6)
activesupport (= 6.1.7.6)
globalid (>= 0.3.6)
activemodel (6.1.7.4)
activesupport (= 6.1.7.4)
activerecord (6.1.7.4)
activemodel (= 6.1.7.4)
activesupport (= 6.1.7.4)
activestorage (6.1.7.4)
actionpack (= 6.1.7.4)
activejob (= 6.1.7.4)
activerecord (= 6.1.7.4)
activesupport (= 6.1.7.4)
activemodel (6.1.7.6)
activesupport (= 6.1.7.6)
activerecord (6.1.7.6)
activemodel (= 6.1.7.6)
activesupport (= 6.1.7.6)
activestorage (6.1.7.6)
actionpack (= 6.1.7.6)
activejob (= 6.1.7.6)
activerecord (= 6.1.7.6)
activesupport (= 6.1.7.6)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.7.4)
activesupport (6.1.7.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand All @@ -76,7 +76,7 @@ GEM
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
axe-core-api (4.7.0)
axe-core-api (4.8.0)
dumb_delegator
virtus
axe-core-rspec (4.1.0)
Expand All @@ -87,6 +87,7 @@ GEM
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
base64 (0.1.1)
batch-loader (1.5.0)
bcrypt (3.1.19)
better_html (1.0.16)
Expand Down Expand Up @@ -132,7 +133,7 @@ GEM
actionpack (>= 5.0)
cells (>= 4.1.6, < 5.0.0)
charlock_holmes (0.7.7)
chef-utils (18.2.7)
chef-utils (18.3.0)
concurrent-ruby
childprocess (4.1.0)
codecov (0.6.0)
Expand All @@ -151,7 +152,7 @@ GEM
crack (0.4.5)
rexml
crass (1.0.6)
css_parser (1.14.0)
css_parser (1.16.0)
addressable
date (3.3.3)
date_validator (0.12.0)
Expand Down Expand Up @@ -338,7 +339,7 @@ GEM
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
devise-i18n (1.11.0)
devise-i18n (1.12.0)
devise (>= 4.9.0)
devise_invitable (2.0.8)
actionmailer (>= 5.0)
Expand All @@ -365,8 +366,8 @@ GEM
temple
erubi (1.12.0)
escape_utils (1.3.0)
excon (0.100.0)
execjs (2.8.1)
excon (0.104.0)
execjs (2.9.1)
extended-markdown-filter (0.7.0)
html-pipeline (~> 2.9)
factory_bot (4.11.1)
Expand All @@ -376,11 +377,12 @@ GEM
railties (>= 3.0.0)
faker (2.23.0)
i18n (>= 1.8.11, < 2)
faraday (2.7.10)
faraday (2.7.11)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
ffi (1.15.5)
ffi (1.16.3)
file_validators (3.0.0)
activemodel (>= 3.2)
mime-types (>= 1.0)
Expand All @@ -399,8 +401,8 @@ GEM
railties (>= 4.1, < 7.1)
gemoji (3.0.1)
geocoder (1.8.2)
globalid (1.1.0)
activesupport (>= 5.0)
globalid (1.2.1)
activesupport (>= 6.1)
graphql (1.12.24)
graphql-docs (2.1.0)
commonmarker (~> 0.16)
Expand Down Expand Up @@ -479,7 +481,7 @@ GEM
net-smtp
marcel (1.0.2)
matrix (0.4.2)
mdl (0.12.0)
mdl (0.13.0)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.1)
mixlib-cli (~> 2.1, >= 2.1.1)
Expand All @@ -488,10 +490,10 @@ GEM
method_source (1.0.0)
mime-types (3.5.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2023.0808)
mime-types-data (3.2023.1003)
mini_magick (4.12.0)
mini_mime (1.1.5)
minitest (5.19.0)
minitest (5.20.0)
mixlib-cli (2.1.8)
mixlib-config (3.0.27)
tomlrb
Expand All @@ -500,18 +502,16 @@ GEM
msgpack (1.7.2)
multi_xml (0.6.0)
mustache (1.1.1)
net-imap (0.3.7)
net-imap (0.4.0)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
timeout
net-smtp (0.3.3)
net-smtp (0.4.0)
net-protocol
nio4r (2.5.9)
nokogiri (1.14.5-arm64-darwin)
racc (~> 1.4)
nokogiri (1.14.5-x86_64-linux)
racc (~> 1.4)
oauth (1.1.0)
Expand Down Expand Up @@ -557,7 +557,7 @@ GEM
parallel (1.23.0)
parallel_tests (3.13.0)
parallel
parser (3.2.2.3)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
pg (1.1.4)
Expand All @@ -583,24 +583,24 @@ GEM
rack (>= 2.0.0)
rack-protection (3.1.0)
rack (~> 2.2, >= 2.2.4)
rack-proxy (0.7.6)
rack-proxy (0.7.7)
rack
rack-test (2.1.0)
rack (>= 1.3)
rails (6.1.7.4)
actioncable (= 6.1.7.4)
actionmailbox (= 6.1.7.4)
actionmailer (= 6.1.7.4)
actionpack (= 6.1.7.4)
actiontext (= 6.1.7.4)
actionview (= 6.1.7.4)
activejob (= 6.1.7.4)
activemodel (= 6.1.7.4)
activerecord (= 6.1.7.4)
activestorage (= 6.1.7.4)
activesupport (= 6.1.7.4)
rails (6.1.7.6)
actioncable (= 6.1.7.6)
actionmailbox (= 6.1.7.6)
actionmailer (= 6.1.7.6)
actionpack (= 6.1.7.6)
actiontext (= 6.1.7.6)
actionview (= 6.1.7.6)
activejob (= 6.1.7.6)
activemodel (= 6.1.7.6)
activerecord (= 6.1.7.6)
activestorage (= 6.1.7.6)
activesupport (= 6.1.7.6)
bundler (>= 1.15.0)
railties (= 6.1.7.4)
railties (= 6.1.7.6)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
Expand All @@ -615,9 +615,9 @@ GEM
rails-i18n (6.0.0)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 7)
railties (6.1.7.4)
actionpack (= 6.1.7.4)
activesupport (= 6.1.7.4)
railties (6.1.7.6)
actionpack (= 6.1.7.6)
activesupport (= 6.1.7.6)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand Down Expand Up @@ -730,28 +730,26 @@ GEM
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
spring (>= 1.2, < 3.0)
sprockets (4.2.0)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
ssrf_filter (1.1.1)
temple (0.10.2)
ssrf_filter (1.1.2)
temple (0.10.3)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.2.2)
thread_safe (0.3.6)
tilt (2.2.0)
tilt (2.3.0)
timeout (0.4.0)
tomlrb (2.0.3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uber (0.1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (2.4.2)
unicode-display_width (2.5.0)
valid_email2 (2.3.1)
activemodel (>= 3.2)
mail (~> 2.5)
Expand All @@ -770,12 +768,12 @@ GEM
rexml (~> 3.2)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.2.0)
web-console (4.2.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webmock (3.18.1)
webmock (3.19.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand All @@ -790,17 +788,16 @@ GEM
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
wicked_pdf (2.6.3)
wicked_pdf (2.7.0)
activesupport
wisper (2.0.1)
wisper-rspec (1.1.0)
wkhtmltopdf-binary (0.12.6.6)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.11)
zeitwerk (2.6.12)

PLATFORMS
arm64-darwin-22
x86_64-linux

DEPENDENCIES
Expand All @@ -817,11 +814,10 @@ DEPENDENCIES
rubocop-faker
spring (~> 2.0)
spring-watcher-listen (~> 2.0.0)
uglifier (~> 4.1)
web-console

RUBY VERSION
ruby 3.0.5p211
ruby 3.0.6p216

BUNDLED WITH
2.2.33
2.3.20
13 changes: 13 additions & 0 deletions app/models/concerns/decidim/decidim_awesome/has_vote_weight.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module Decidim
module DecidimAwesome
module HasVoteWeight
extend ActiveSupport::Concern

included do
has_one :vote_weight, foreign_key: "proposal_vote_id", class_name: "Decidim::DecidimAwesome::VoteWeight", dependent: :destroy
end
end
end
end
Loading

0 comments on commit 5c7a1ba

Please sign in to comment.