class Event
Public Class Methods
search(search)
click to toggle source
# File lib/nexmo_developer/app/models/event.rb, line 17 def self.search(search) key = "%#{search}%" columns = %w[title description city country] @events = Event.where( columns.map { |c| "#{c} ilike :search" }.join(' OR '), search: key ).upcoming end
Private Instance Methods
address()
click to toggle source
# File lib/nexmo_developer/app/models/event.rb, line 28 def address # Provide the full country name to the geocoder, # otherwise it thinks that IL is Illinois, not Israel if country country = ISO3166::Country[self.country.downcase] country = country.name if country end [city, country].compact.join(', ') end