Sha256: 2c4b7431a103ec52ecd0f2121e27d827b6b170aafe78e462a4ba8c20b327cd86
Contents?: true
Size: 752 Bytes
Versions: 24
Compression:
Stored size: 752 Bytes
Contents
# frozen_string_literal: true module ActiveRecord::Associations::Builder # :nodoc: class HasMany < CollectionAssociation # :nodoc: def self.macro :has_many end def self.valid_options(options) valid = super + [:counter_cache, :join_table, :index_errors, :as, :through] valid += [:foreign_type] if options[:as] valid += [:source, :source_type, :disable_joins] if options[:through] valid += [:ensuring_owner_was] if options[:dependent] == :destroy_async valid end def self.valid_dependent_options [:destroy, :delete_all, :nullify, :restrict_with_error, :restrict_with_exception, :destroy_async] end private_class_method :macro, :valid_options, :valid_dependent_options end end
Version data entries
24 entries across 24 versions & 2 rubygems