instance method create_belongs_to_reflection

Ruby on Rails 3.0.20

Since v2.2.3 Last seen in v3.0.20 Private

Available in: v2.2.3 v2.3.18 v3.0.20

Signature

create_belongs_to_reflection(association_id, options)

No documentation comment.

Parameters

association_id req
options req
Source
# File activerecord/lib/active_record/associations.rb, line 1774
        def create_belongs_to_reflection(association_id, options)
          options.assert_valid_keys(valid_keys_for_belongs_to_association)
          reflection = create_reflection(:belongs_to, association_id, options, self)

          if options[:polymorphic]
            reflection.options[:foreign_type] ||= reflection.class_name.underscore + "_type"
          end

          reflection
        end

Defined in activerecord/lib/active_record/associations.rb line 1774 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Associations::ClassMethods

Type at least 2 characters to search.

↑↓ navigate · open · esc close