aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/builder/has_many.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/associations/builder/has_many.rb')
-rw-r--r--activerecord/lib/active_record/associations/builder/has_many.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations/builder/has_many.rb b/activerecord/lib/active_record/associations/builder/has_many.rb
new file mode 100644
index 0000000000..5b9617bc6d
--- /dev/null
+++ b/activerecord/lib/active_record/associations/builder/has_many.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module ActiveRecord::Associations::Builder # :nodoc:
+ class HasMany < CollectionAssociation #:nodoc:
+ def self.macro
+ :has_many
+ end
+
+ def self.valid_options(options)
+ super + [:primary_key, :dependent, :as, :through, :source, :source_type, :inverse_of, :counter_cache, :join_table, :foreign_type, :index_errors]
+ end
+
+ def self.valid_dependent_options
+ [:destroy, :delete_all, :nullify, :restrict_with_error, :restrict_with_exception]
+ end
+ end
+end