Skip to content

Commit

Permalink
Revert "chore(deps): update dependency ruby to v3.1.2 (#299)"
Browse files Browse the repository at this point in the history
this is needed due to codecov first needing to be merged
This reverts commit d0daac4.
  • Loading branch information
lodewiges committed Oct 24, 2024
1 parent d0daac4 commit 120d37c
Show file tree
Hide file tree
Showing 80 changed files with 201 additions and 201 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.2
3.0.4
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

FROM ruby:3.1.2-alpine@sha256:0b91e98c4613c2287bb7274a1584ea141b68960fb6b0edd7fe32127dc888d1a0
FROM ruby:3.0.4-alpine@sha256:d5c7b1207fdfc7a39125c2a33929b974077f6cd1dfdaaca3750d114e5febf32e

ARG BUILD_HASH='unknown'
ENV BUILD_HASH=$BUILD_HASH
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ GEM
debug_inspector (>= 0.0.1)
bootsnap (1.11.1)
msgpack (~> 1.2)
brakeman (5.2.3)
brakeman (5.2.1)
builder (3.2.4)
bullet (7.0.1)
activesupport (>= 3.0.0)
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/v1/books_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def isbn_lookup # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
author = ActionView::Base.full_sanitizer.sanitize(info['authors'].to_sentence)
description = ActionView::Base.full_sanitizer.sanitize(info['description'])
cover_photo = get_cover_photo(volume['id'])
data = { title:, author:, description:, isbn:,
cover_photo: }
data = { title: title, author: author, description: description, isbn: isbn,
cover_photo: cover_photo }
render json: data
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/v1/daily_verses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def parse_verse(response)
reference = ActionView::Base.full_sanitizer.sanitize(data['source'])
content = ActionView::Base.full_sanitizer.sanitize(data['text']['bgt'])
{ data: [{ id: 1, type: 'daily_verse', attributes:
{ copyright:, reference:, content: } }] }
{ copyright: copyright, reference: reference, content: content } }] }
end

def ttl_to_midnight
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/mail_alias_sync_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def moderation_route
default_options = Rails.application.config.action_mailer.default_url_options
path = '/api/rails/action_mailbox/improvmx/inbound_emails'

uri = URI::Generic.build(default_options.merge(path:))
uri = URI::Generic.build(default_options.merge(path: path))
uri.user = 'actionmailbox'
uri.password = Rails.application.credentials.action_mailbox.fetch(:ingress_password)

Expand Down
2 changes: 1 addition & 1 deletion app/jobs/slack_message_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ class SlackMessageJob < ApplicationJob
queue_as :default

def perform(message, channel: nil)
ping(message, channel:)
ping(message, channel: channel)
end
end
6 changes: 3 additions & 3 deletions app/mailboxes/moderated_mailbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ def process # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
# Since mail.to contains all recipients, and this function is called once per moderated
# recipient we need to check if a stored mail has already been created for this inbound_email
message_id = inbound_email.message_id
inbound_email_ids = ActionMailbox::InboundEmail.select('id').where(message_id:)
inbound_email_ids = ActionMailbox::InboundEmail.select('id').where(message_id: message_id)
next if StoredMail.with_deleted
.where(mail_alias:)
.where(mail_alias: mail_alias)
.exists?(inbound_email_id: inbound_email_ids)

stored_mail = StoredMail.create(mail_alias:, inbound_email:)
stored_mail = StoredMail.create(mail_alias: mail_alias, inbound_email: inbound_email)

mail_alias.moderators.each do |moderator|
MailModerationMailer.request_for_moderation_email(moderator, stored_mail).deliver_later
Expand Down
2 changes: 1 addition & 1 deletion app/mailers/mail_moderation_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ def reminder_for_moderation_email(moderator, stored_mail)
def to_moderation_url(stored_mail)
default_options = Rails.application.config.action_mailer.default_url_options
path = "/mail-moderations/#{stored_mail.id}"
URI::Generic.build(default_options.merge(path:)).to_s
URI::Generic.build(default_options.merge(path: path)).to_s
end
end
2 changes: 1 addition & 1 deletion app/mailers/user_cleanup_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ def cleanup_email(will_archive_users, archived_users)
' staan op het punt gearchiveerd te worden'
subject = 'Er zijn gebruikers gearchiveerd!' if @will_archive_users.empty?

mail to: '[email protected];[email protected]', subject:
mail to: '[email protected];[email protected]', subject: subject
end
end
2 changes: 1 addition & 1 deletion app/models/activity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def to_ical # rubocop:disable Metrics/AbcSize
def copy_author_and_group_to_form!
return unless form

form.update(author:, group:)
form.update(author: author, group: group)
end

def small_changes_allowed_on_present_responses
Expand Down
2 changes: 1 addition & 1 deletion app/models/article.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def owners
def only_one_pinned_article
return unless pinned?

matches = Article.pinned.where.not(id:)
matches = Article.pinned.where.not(id: id)
errors.add(:pinned, 'cannot have more than one pinned article') if matches.exists?
end
end
4 changes: 2 additions & 2 deletions app/models/debit/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def add_transaction(sdd, amount, mandate) # rubocop:disable Metrics/MethodLength
sdd.add_transaction(
name: mandate.iban_holder,
iban: IBANTools::IBAN.new(mandate.iban).code,
amount:,
amount: amount,
mandate_id: mandate.id,
mandate_date_of_signature: mandate.start_date,
reference: date,
Expand All @@ -51,7 +51,7 @@ def add_transaction(sdd, amount, mandate) # rubocop:disable Metrics/MethodLength
end

def user_amount(user)
user_amount = transactions.where(user:).sum(&:amount)
user_amount = transactions.where(user: user).sum(&:amount)
return user_amount if user_amount.positive?
return if user_amount.zero?

Expand Down
6 changes: 3 additions & 3 deletions app/models/debit/mandate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ class Mandate < ApplicationRecord
now: Time.zone.now)
})

scope :mandates_for, (->(user) { where(user:) })
scope :mandates_for, (->(user) { where(user: user) })

private

def unique_on_time_interval?
return true unless Debit::Mandate.where.not(id:).where(user_id:)
return true unless Debit::Mandate.where.not(id: id).where(user_id: user_id)
.exists?([':start_date BETWEEN start_date AND end_date OR
:end_date BETWEEN start_date AND end_date OR
start_date BETWEEN :start_date AND :end_date OR
end_date BETWEEN :start_date AND :end_date OR
(start_date < :start_date AND end_date IS NULL) OR
(start_date > :start_date AND :end_date IS NULL)',
{ start_date:, end_date: }])
{ start_date: start_date, end_date: end_date }])

errors.add(:mandate, 'is not unique on time interval')
false
Expand Down
2 changes: 1 addition & 1 deletion app/models/debit/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ class Transaction < ApplicationRecord
validates :description, presence: true
validates :amount, presence: true

scope :transactions_for, (->(user) { where(user:) })
scope :transactions_for, (->(user) { where(user: user) })
end
end
2 changes: 1 addition & 1 deletion app/models/forum/thread.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def closed?
end

def read?(user)
thread = Forum::ReadThread.find_or_create_by(thread: self, user:)
thread = Forum::ReadThread.find_or_create_by(thread: self, user: user)
thread.post == posts.last
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/import/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def hash_to_list(hash, user)
amount = normalize_amount(amount, description, user)
next if amount.nil? || amount.zero?

transaction = Debit::Transaction.new(description:, amount:,
collection: @collection, user:)
transaction = Debit::Transaction.new(description: description, amount: amount,
collection: @collection, user: user)
(transactions << transaction) && next if transaction.valid?

@errors.add(:import_file, "Transaction #{description} for user #{user.username} is invalid")
Expand Down
2 changes: 1 addition & 1 deletion app/models/import/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def save!(live_run) # rubocop:disable Metrics/MethodLength
def save_user_to_group(user, group)
return unless user && group

Membership.create(user:, group:, start_date: Time.zone.now)
Membership.create(user: user, group: group, start_date: Time.zone.now)
end

def valid? # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
Expand Down
4 changes: 2 additions & 2 deletions app/models/membership.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ class Membership < ApplicationRecord
private

def unique_on_time_interval?
return true unless Membership.where.not(id:).where(group_id:, user_id:)
return true unless Membership.where.not(id: id).where(group_id: group_id, user_id: user_id)
.exists?([':start_date BETWEEN start_date AND end_date OR
:end_date BETWEEN start_date AND end_date OR
start_date BETWEEN :start_date AND :end_date OR
end_date BETWEEN :start_date AND :end_date OR
(start_date < :start_date AND end_date IS NULL) OR
(start_date > :start_date AND :end_date IS NULL)',
{ start_date:, end_date: }])
{ start_date: start_date, end_date: end_date }])

errors.add(:membership, 'is not unique on time interval')
false
Expand Down
3 changes: 2 additions & 1 deletion app/models/photo_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class PhotoTag < ApplicationRecord
private

def user_not_already_tagged
existing_tag = PhotoTag.where(photo_id:, tagged_user_id:).where.not(id:).exists?
existing_tag = PhotoTag.where(photo_id: photo_id,
tagged_user_id: tagged_user_id).where.not(id: id).exists?
errors.add(:tagged_user, 'has already been tagged in this photo') if existing_tag
end
end
2 changes: 1 addition & 1 deletion app/models/poll.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Poll < ApplicationRecord
def copy_author_to_form!
return unless form

form.update(author:)
form.update(author: author)
end

def form_has_at_most_one_question
Expand Down
2 changes: 1 addition & 1 deletion app/models/quickpost_message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class QuickpostMessage < ApplicationRecord
private

def publish_to_message_bus
attributes = { id:, author_id: author.id, message:, created_at: }
attributes = { id: id, author_id: author.id, message: message, created_at: created_at }
MessageBus.publish('/quickpost_messages', attributes.to_json, group_ids: [0])
end
end
4 changes: 2 additions & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class User < ApplicationRecord # rubocop:disable Metrics/ClassLength
scope
})
scope :active_users_for_group, (lambda { |group|
joins(:memberships).merge(Membership.active.where(group:))
joins(:memberships).merge(Membership.active.where(group: group))
})

def full_name
Expand Down Expand Up @@ -153,7 +153,7 @@ def current_group_member?(group)
end

def activation_url
params = { activation_token: }
params = { activation_token: activation_token }
default_options = Rails.application.config.action_mailer.default_url_options
URI::Generic.build(default_options.merge(path: "/users/#{id}/activate-account",
query: params.to_query)).to_s
Expand Down
2 changes: 1 addition & 1 deletion app/processors/v1/form/closed_question_answer_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def recreate_resource
resource_id = params[:resource_id]
data = params[:data]

resource = resource_klass.find_by_key(resource_id, context:)
resource = resource_klass.find_by_key(resource_id, context: context)

result = resource.replace_fields(data)

Expand Down
2 changes: 1 addition & 1 deletion app/processors/v1/form/open_question_answer_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def recreate_resource
resource_id = params[:resource_id]
data = params[:data]

resource = resource_klass.find_by_key(resource_id, context:)
resource = resource_klass.find_by_key(resource_id, context: context)

result = resource.replace_fields(data)

Expand Down
2 changes: 1 addition & 1 deletion app/processors/v1/form/response_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def recreate_resource
resource_id = params[:resource_id]
data = params[:data]

resource = resource_klass.find_by_key(resource_id, context:)
resource = resource_klass.find_by_key(resource_id, context: context)

result = resource.replace_fields(data)

Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20170408130108_decouple_activities_and_forms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def change

def migrate_data_from_form_to_activities
Form::Form.all.each do |form|
activity = Activity.find_by(form:)
activity = Activity.find_by(form: form)
next unless activity

activity.assign_attributes(title: form.title, description: form.description,
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20180224135619_add_mandate_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def up # rubocop:disable Metrics/AbcSize
end

User.all.each do |user|
Debit::Mandate.create(user:, uid: user.id,
Debit::Mandate.create(user: user, uid: user.id,
iban: user.iban,
iban_holder: user.iban_holder,
start_date: Time.zone.now)
Expand Down
26 changes: 13 additions & 13 deletions db/seeds/content.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

articles.each do |article|
members.sample(6).each do |user|
FactoryBot.create(:article_comment, article:, author: user)
FactoryBot.create(:article_comment, article: article, author: user)
end
end

Expand Down Expand Up @@ -67,19 +67,19 @@
closed_questions = FactoryBot.create_list(:closed_question, 4, form: activity.form)

closed_questions.each do |question|
FactoryBot.create_list(:closed_question_option, 3, question:)
FactoryBot.create_list(:closed_question_option, 3, question: question)
end

members.sample(3).each do |user|
response = FactoryBot.create(:response, form: activity.form, user:)
response = FactoryBot.create(:response, form: activity.form, user: user)

closed_questions.each do |question|
FactoryBot.create(:closed_question_answer, option: question.options.sample,
response:)
response: response)
end

open_questions.each do |open_question|
FactoryBot.create(:open_question_answer, question: open_question, response:)
FactoryBot.create(:open_question_answer, question: open_question, response: response)
end
end
end
Expand All @@ -93,15 +93,15 @@
closed_questions = FactoryBot.create_list(:closed_question, 1, form: poll.form)

closed_questions.each do |question|
FactoryBot.create_list(:closed_question_option, 3, question:)
FactoryBot.create_list(:closed_question_option, 3, question: question)
end

members.sample(3).each do |user|
response = FactoryBot.create(:response, form: poll.form, user:)
response = FactoryBot.create(:response, form: poll.form, user: user)

closed_questions.each do |question|
FactoryBot.create(:closed_question_answer, option: question.options.sample,
response:)
response: response)
end
end
end
Expand All @@ -113,21 +113,21 @@

forum_categories.each do |category|
members.sample(4).each do |member|
forum_threads << FactoryBot.create(:thread, author: member, category:)
forum_threads << FactoryBot.create(:thread, author: member, category: category)
end
end

forum_threads.each do |thread|
forum_posts << FactoryBot.create(:post, thread:, author: thread.author)
forum_posts << FactoryBot.create(:post, thread: thread, author: thread.author)
members.sample(24).each do |member|
forum_posts << FactoryBot.create(:post, thread:, author: member)
forum_posts << FactoryBot.create(:post, thread: thread, author: member)
end
end

bestuur = Group.find_by(name: 'Bestuur').users

bestuur.each do |user|
FactoryBot.create(:board_room_presence, user:)
FactoryBot.create(:board_room_presence, user: user)
end

FactoryBot.create_list(:static_page, 3)
Expand All @@ -137,7 +137,7 @@

collections.each do |collection|
members.sample(8).each do |member|
FactoryBot.create(:transaction, collection:, user: member)
FactoryBot.create(:transaction, collection: collection, user: member)
end
end

Expand Down
Loading

0 comments on commit 120d37c

Please sign in to comment.