<commit_before>module Stall
  module Models
    module AddressOwnership
      extend ActiveSupport::Concern

      included do
        self.table_name = 'stall_address_ownerships'

        belongs_to :address
        accepts_nested_attributes_for :address

        belongs_to :addressable, polymorphic: true
      end

      [:shipping, :billing].each do |type|
        define_method(:"mark_as_#{ type }") do
          if (ownership = addressable.address_ownership_for(type)) && ownership != self
            ownership.send(:"#{ type }=", false)
          end<commit_msg>add address_wonership#address inverse_of relation option<commit_after>module Stall
  module Models
    module AddressOwnership
      extend ActiveSupport::Concern

      included do
        self.table_name = 'stall_address_ownerships'

        belongs_to :address, inverse_of: :addressable_ownership
        accepts_nested_attributes_for :address

        belongs_to :addressable, polymorphic: true
      end

      [:shipping, :billing].each do |type|
        define_method(:"mark_as_#{ type }") do
          if (ownership = addressable.address_ownership_for(type)) && ownership != self
            ownership.send(:"#{ type }=", false)
          end
{'fraction_non_alphanumeric': 0.08681408681408681, 'fraction_numerical': 0.0, 'mean_word_length': 2.9292604501607715, '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': '881', 'n_tokens_mistral': 353, 'n_tokens_neox': 344, 'n_words': 79}