<commit_before>module Tray
  module Calculator
    module Discounters
      class Subscriptions < Discounter
        def call
          return unless @cart.customer
          @cart.customer.subscriptions.each do |subscription|
            next unless subscription.is_available?
            next unless subscription.discount? || subscription.fixed?

            _applicable_registers = applicable_registers(subscription)
            next unless _applicable_registers.count > 0

            if subscription.discount?
              apply_discount_subscription_registers(subscription, _applicable_registers)
            elsif subscription.fixed?
              apply_fixed_subscription_registers(subscription, _applicable_registers)
            end
              
          end
        end

        def applicable_registers(subscription)
          @registers.select do |register|
            next true if subscription.organization_id == register.event.organization_id && register.event.memberships_apply?
          end
        end
<commit_msg>Remove `?` memberships_apply is not a method.<commit_after>module Tray
  module Calculator
    module Discounters
      class Subscriptions < Discounter
        def call
          return unless @cart.customer
          @cart.customer.subscriptions.each do |subscription|
            next unless subscription.is_available?
            next unless subscription.discount? || subscription.fixed?

            _applicable_registers = applicable_registers(subscription)
            next unless _applicable_registers.count > 0

            if subscription.discount?
              apply_discount_subscription_registers(subscription, _applicable_registers)
            elsif subscription.fixed?
              apply_fixed_subscription_registers(subscription, _applicable_registers)
            end
              
          end
        end

        def applicable_registers(subscription)
          @registers.select do |register|
            next true if subscription.organization_id == register.event.organization_id && register.event.memberships_apply
          end
        end

{'fraction_non_alphanumeric': 0.04983388704318937, 'fraction_numerical': 0.0009492168960607499, 'mean_word_length': 2.3354430379746836, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6808574', 'n_tokens_mistral': 503, 'n_tokens_neox': 486, 'n_words': 113}