Skip to content

Commit

Permalink
add base_query method in codes_controller
Browse files Browse the repository at this point in the history
  • Loading branch information
ElviaBth committed Apr 22, 2024
1 parent dad30e6 commit c1dbcb0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 30 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,14 @@ module Decidim
module AnonymousCodes
module Admin
class CodesController < ApplicationController
include Decidim::Admin::Paginable
include TranslatableAttributes
include Decidim::AnonymousCodes::Admin::Filterable
include Decidim::Admin::Filterable

helper_method :tokens, :code_group, :export_jobs

def index
enforce_permission_to :view, :anonymous_code_token

@tokens = paginate(tokens.order(created_at: :desc))
end

def collection
@tokens = paginate(query.result)
end

def new
Expand Down Expand Up @@ -68,6 +63,10 @@ def export

private

def base_query
tokens
end

def tokens
AnonymousCodes::Token.for(code_group)
end
Expand Down

0 comments on commit c1dbcb0

Please sign in to comment.