method
create_reflection
v5.0.0.1 -
Show latest stable
- Class:
ActiveRecord::Associations::Builder::Association
create_reflection(model, name, scope, options, extension = nil)public
No documentation available.
# File activerecord/lib/active_record/associations/builder/association.rb, line 36
def self.create_reflection(model, name, scope, options, extension = nil)
raise ArgumentError, "association names must be a Symbol" unless name.kind_of?(Symbol)
if scope.is_a?(Hash)
options = scope
scope = nil
end
validate_options(options)
scope = build_scope(scope, extension)
ActiveRecord::Reflection.create(macro, name, scope, options, model)
end