Sha256: 74363194e0a05d80ebc57fb3a9d3cd1b8059a363908cacf33b043eec9712f83f

Contents?: true

Size: 432 Bytes

Versions: 1

Compression:

Stored size: 432 Bytes

Contents

class LoginEvent < ActiveRecord::Base
  self.table_name = 'login_events'

  validates :ip_address, presence: true

  # attr_accessible :ip_address, :latitude, :longitude
  # attr_accessible :city, :country_code, :region_name

  def self.cities_in_the_last(time_frame = 2.hours)
    select('DISTINCT login_events.city').
    where('login_events.city IS NOT NULL').
    where('login_events.created_at >= ?', time_frame.ago)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
devise_password_sharing_extension-0.1.4 app/models/login_event.rb