<commit_before>module Landable
  class Author < ActiveRecord::Base
    include Landable::TableName
    has_many :access_tokens

    def self.authenticate!(username, token_id)
      author = where(username: username).first
      return unless author
      return unless author.access_tokens.fresh.exists?(token_id)
      author
    end

    def can_read
      access_tokens.fresh.first.can_read? if access_tokens.fresh
    end

    def can_edit
      access_tokens.fresh.first.can_edit? if access_tokens.fresh
    end

    def can_publish
      access_tokens.fresh.first.can_publish? if access_tokens.fresh
    end
  end
end<commit_msg>Remove conditional on can_read?, can_edit? and can_publisH? methods<commit_after>module Landable
  class Author < ActiveRecord::Base
    include Landable::TableName
    has_many :access_tokens

    def self.authenticate!(username, token_id)
      author = where(username: username).first
      return unless author
      return unless author.access_tokens.fresh.exists?(token_id)
      author
    end

    def can_read
      access_tokens.fresh.first.can_read?
    end

    def can_edit
      access_tokens.fresh.first.can_edit?
    end

    def can_publish
      access_tokens.fresh.first.can_publish?
    end
  end
end
{'fraction_non_alphanumeric': 0.06454183266932272, 'fraction_numerical': 0.0, 'mean_word_length': 3.1727574750830563, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4095374', 'n_tokens_mistral': 390, 'n_tokens_neox': 368, 'n_words': 86}