Welcome to mirror list, hosted at ThFree Co, Russian Federation.

has_one.rb « builder « associations « active_record « gem_extensions « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 91765db8a5a4c590e5390f5e75f6631ae86bc5bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

module GemExtensions
  module ActiveRecord
    module Associations
      module Builder
        module HasOne
          extend ActiveSupport::Concern

          class_methods do
            def valid_options(options)
              valid = super
              valid += [:disable_joins] if options[:disable_joins] && options[:through]
              valid
            end
          end
        end
      end
    end
  end
end