Sha256: ebe7843df7aca16e33fc577219157cfd29edf50493e15368f177c73c304725b6
Contents?: true
Size: 816 Bytes
Versions: 61
Compression:
Stored size: 816 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] valid += [:as, :foreign_type] if options[:as] valid += [:through, :source, :source_type] if options[:through] valid += [:ensuring_owner_was] if options[:dependent] == :destroy_async valid += [:disable_joins] if options[:disable_joins] && options[:through] 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
61 entries across 58 versions & 8 rubygems