app/models/skydrive/user.rb in lti_skydrive-0.1.1 vs app/models/skydrive/user.rb in lti_skydrive-1.0.0
- old
+ new
@@ -2,12 +2,12 @@
class User < ActiveRecord::Base
include ActiveModel::ForbiddenAttributesProtection
has_many :api_keys
has_one :token
+ belongs_to :account
- validates :email, presence: true, uniqueness: true
validates :username, presence: true, uniqueness: true
validates :name, presence: true
def session_api_key(params={})
ApiKey.create(
@@ -20,9 +20,9 @@
def cleanup_api_keys
api_keys.inactive.each(&:destroy)
end
def valid_skydrive_token?
- !self.token.nil? && self.token.is_valid?
+ !!self.token && self.token.is_valid?
end
end
end