Sha256: a7cdfdc55ba376a96ffafac49e49825aac8119ab775eb8642968245bbeb5c922

Contents?: true

Size: 249 Bytes

Versions: 5

Compression:

Stored size: 249 Bytes

Contents

module ScopableByCity
  extend Authz::Scopables::Base

  def self.available_keywords
    City.all.pluck(:name) + ['All']
  end

  def self.resolve_keyword(keyword, requester)
    City.where('LOWER(name) IS ?', keyword.downcase).pluck(:id)
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
authz-0.0.1.alpha5 spec/dummy/app/scopables/scopable_by_city.rb
authz-0.0.1.alpha4 spec/dummy/app/scopables/scopable_by_city.rb
authz-0.0.1.alpha3 spec/dummy/app/scopables/scopable_by_city.rb
authz-0.0.1.alpha2 spec/dummy/app/scopables/scopable_by_city.rb
authz-0.0.1.alpha spec/dummy/app/scopables/scopable_by_city.rb