Sha256: 26efd1e750f25af8f70a2951a4c0b9f49b6c713a563c5fbeb235e97095511597

Contents?: true

Size: 250 Bytes

Versions: 5

Compression:

Stored size: 250 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.5 spec/dummy/app/scopables/scopable_by_city.rb
authz-0.0.4 spec/dummy/app/scopables/scopable_by_city.rb
authz-0.0.3 spec/dummy/app/scopables/scopable_by_city.rb
authz-0.0.2 spec/dummy/app/scopables/scopable_by_city.rb
authz-0.0.1 spec/dummy/app/scopables/scopable_by_city.rb