Sha256: 3073f5587b374c4665f86dea8736338ba75a60874251528795c4124165a8755f

Contents?: true

Size: 317 Bytes

Versions: 5

Compression:

Stored size: 317 Bytes

Contents

class RubocopEntryStatusFilter < Avo::Filters::SelectFilter
  self.name = "Status"

  def apply(_request, query, value)
    query.where(status: value)
  end

  def options
    RubocopEntry
      .select(:status)
      .distinct
      .order(:status)
      .map { |entry| [entry.status, entry.status] }.to_h
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails_app_generator-0.3.6 after_templates/application/klueless/app/avo/filters/rubocop_entry_status_filter.rb
rails_app_generator-0.3.5 after_templates/application/klueless/app/avo/filters/rubocop_entry_status_filter.rb
rails_app_generator-0.3.4 after_templates/application/klueless/app/avo/filters/rubocop_entry_status_filter.rb
rails_app_generator-0.3.3 after_templates/application/klueless/app/avo/filters/rubocop_entry_status_filter.rb
rails_app_generator-0.3.2 after_templates/application/klueless/app/avo/filters/rubocop_entry_status_filter.rb