<commit_before>class User < ActiveRecord::Base
  include Concerns::User::Authentication
  include Concerns::User::Validations

  has_one :customer_identity

  serialize :github_omniauth_hash, Hash

  acts_as_voter

  def to_param
    username
  end

  def portfolio_url
    "https://github.com/search?q=user%3A#{username}+codelab&type=Repositories"
  end

  def subscribed?
    !!try(:customer_identity).try(:subscription)
  end
end<commit_msg>added subscribed scope to user<commit_after>class User < ActiveRecord::Base
  include Concerns::User::Authentication
  include Concerns::User::Validations

  has_one :customer_identity

  serialize :github_omniauth_hash, Hash

  acts_as_voter

  scope :subscribed, -> {
    where(
      id: CustomerIdentity.where(
        id: Subscription.pluck(:customer_identity_id)
      ).pluck(:user_id)
    )
  }

  def to_param
    username
  end

  def portfolio_url
    "https://github.com/search?q=user%3A#{username}+codelab&type=Repositories"
  end

  def subscribed?
    !!try(:customer_identity).try(:subscription)
  end
end
{'fraction_non_alphanumeric': 0.10046948356807511, 'fraction_numerical': 0.0018779342723004694, 'mean_word_length': 4.438775510204081, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 2, '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': '5478937', 'n_tokens_mistral': 361, 'n_tokens_neox': 343, 'n_words': 63}