Sha256: 9124002eda35207ffc275bbd34e4e940cd8e767015083693fb17e25f5a68984c

Contents?: true

Size: 306 Bytes

Versions: 5

Compression:

Stored size: 306 Bytes

Contents

class RubocopEntryCopFilter < Avo::Filters::MultipleSelectFilter
  self.name = "Cop"

  def apply(_request, query, values)
    query.where(cop: values)
  end

  def options
    RubocopEntry
      .select(:cop)
      .distinct
      .order(:cop)
      .map { |entry| [entry.cop, entry.cop] }.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_cop_filter.rb
rails_app_generator-0.3.5 after_templates/application/klueless/app/avo/filters/rubocop_entry_cop_filter.rb
rails_app_generator-0.3.4 after_templates/application/klueless/app/avo/filters/rubocop_entry_cop_filter.rb
rails_app_generator-0.3.3 after_templates/application/klueless/app/avo/filters/rubocop_entry_cop_filter.rb
rails_app_generator-0.3.2 after_templates/application/klueless/app/avo/filters/rubocop_entry_cop_filter.rb