thingspeak/app/models/user.rb

32 lines
800 B
Ruby
Raw Normal View History

2011-03-27 22:56:15 +02:00
class User < ActiveRecord::Base
has_many :channels
acts_as_authentic
def self.find_by_login_or_email(login)
User.find_by_login(login) || User.find_by_email(login)
end
end
# == Schema Information
#
# Table name: users
#
# id :integer(4) not null, primary key
# login :string(255) not null
# email :string(255) not null
# crypted_password :string(255) not null
# password_salt :string(255) not null
# persistence_token :string(255) not null
# perishable_token :string(255) not null
# current_login_at :datetime
# last_login_at :datetime
# current_login_ip :string(255)
# last_login_ip :string(255)
# created_at :datetime
# updated_at :datetime
# time_zone :string(255)
#