Sha256: c8cbb44bbcdc366a78f5b4177b53707b320528b9828fcf45fc98991c8b3d1d2e

Contents?: true

Size: 749 Bytes

Versions: 5

Compression:

Stored size: 749 Bytes

Contents

# frozen_string_literal: true

require 'activemodel/associations'
require 'eac_rails_utils/patches/rails_5_2'

module EacRailsUtils
  module Models
    module TablelessAssociations
      module Hooks
        class << self
          def init
            init_rails_5_2 if ::EacRailsUtils::Patches::Rails52.enabled?
          end

          def init_rails_5_2 # rubocop:disable Naming/VariableNumber
            rails_5_2_fix_activemodel_associations_methods
          end

          def rails_5_2_fix_activemodel_associations_methods
            %i[belongs_to has_many].each do |method|
              ::EacRailsUtils::Patches::Rails52::ActiveModelAssociationMethodFix.new(method)
            end
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
eac_rails_utils-0.24.0 lib/eac_rails_utils/patches/active_model_associations.rb
eac_rails_utils-0.23.4 lib/eac_rails_utils/patches/active_model_associations.rb
eac_rails_utils-0.23.3 lib/eac_rails_utils/patches/active_model_associations.rb
eac_rails_utils-0.23.2 lib/eac_rails_utils/patches/active_model_associations.rb
eac_rails_utils-0.23.1 lib/eac_rails_utils/patches/active_model_associations.rb