Sha256: 2e420748042d767258fd1571eac5607b36a17557afdaea458f4c2f46ec936cfe
Contents?: true
Size: 421 Bytes
Versions: 2
Compression:
Stored size: 421 Bytes
Contents
class LoginEvent < ActiveRecord::Base set_table_name 'login_events' validates_presence_of :ip_address 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
devise_password_sharing_extension-0.0.14 | app/models/login_event.rb |
devise_password_sharing_extension-0.0.13 | app/models/login_event.rb |