<commit_before>require 'active_support/concern'

module PuntoPagosRails
  module ResourceExtension
    extend ActiveSupport::Concern

    included do
      has_many :transactions, class_name: 'PuntoPagosRails::Transaction', foreign_key: :resource_id
    end

    module ClassMethods
      # TODO
    end
  end
end<commit_msg>feat(ResourceExtension): add paid? method to known about resource payment state<commit_after>require 'active_support/concern'

module PuntoPagosRails
  module ResourceExtension
    extend ActiveSupport::Concern

    included do
      has_many :transactions, class_name: 'PuntoPagosRails::Transaction', foreign_key: :resource_id

      def paid?
        return false unless self.transactions.any?
        self.transactions.last.completed?
      end
    end

    module ClassMethods
      # TODO
    end
  end
end
{'fraction_non_alphanumeric': 0.05980861244019139, 'fraction_numerical': 0.0, 'mean_word_length': 3.702247191011236, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6428699', 'n_tokens_mistral': 242, 'n_tokens_neox': 237, 'n_words': 62}