Skip to content

Commit

Permalink
Add parameter in query (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurajaime committed Jun 29, 2023
1 parent 24e615e commit b6d71b0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.MD
@@ -1,5 +1,8 @@
# CHANGELOG

## v0.27.1.4
- FIX: add compatibilty cross older Ruby versions by adding the hash value in the parameter.

## v0.27.1.3
- FIX: ignore CensusDatum#extras if not set.

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
decidim-file_authorization_handler (0.27.1.2)
decidim-file_authorization_handler (0.27.1.4)
decidim (~> 0.27.1)
decidim-admin (~> 0.27.1)
rails (>= 5.2)
Expand Down
Expand Up @@ -5,15 +5,17 @@ module FileAuthorizationHandler
class RemoveDuplicatesJob < ApplicationJob
queue_as :default

# rubocop:disable Style/HashSyntax
def perform(organization)
duplicated_census(organization).pluck(:id_document).each do |id_document|
CensusDatum.inside(organization)
.where(id_document:)
.where(id_document: id_document)
.order(id: :desc)
.all[1..]
.each(&:delete)
end
end
# rubocop:enable Style/HashSyntax

private

Expand Down
2 changes: 1 addition & 1 deletion lib/decidim/file_authorization_handler/version.rb
Expand Up @@ -7,6 +7,6 @@ module FileAuthorizationHandler
# Uses the latest matching Decidim version for
# - major, minor and patch
# - the optional extra number is related to this module's patches
VERSION = "#{DECIDIM_VERSION}.3".freeze
VERSION = "#{DECIDIM_VERSION}.4".freeze
end
end

0 comments on commit b6d71b0

Please sign in to comment.