app/models/landable/author.rb in landable-1.13.1 vs app/models/landable/author.rb in landable-1.13.2
- old
+ new
@@ -2,10 +2,11 @@
class Author < ActiveRecord::Base
include Landable::TableName
has_many :access_tokens
def self.authenticate!(username, token_id)
- return unless author = where(username: username).first
+ author = where(username: username).first
+ return unless author
return unless author.access_tokens.fresh.exists?(token_id)
author
end
end
end