method

create_reflection

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: Association
create_reflection(model, name, scope, options, &block) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/associations/builder/association.rb, line 40
    def self.create_reflection(model, name, scope, options, &block)
      raise ArgumentError, "association names must be a Symbol" unless name.kind_of?(Symbol)

      validate_options(options)

      extension = define_extensions(model, name, &block)
      options[:extend] = [*options[:extend], extension] if extension

      scope = build_scope(scope)

      ActiveRecord::Reflection.create(macro, name, scope, options, model)
    end
Register or log in to add new notes.