method

belongs_to_options

Importance_0
v7.0.0 - Show latest stable - 0 notes - Class: HasAndBelongsToMany
belongs_to_options(options) private

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/has_and_belongs_to_many.rb, line 96
      def belongs_to_options(options)
        rhs_options = {}

        if options.key? :class_name
          rhs_options[:foreign_key] = options[:class_name].to_s.foreign_key
          rhs_options[:class_name] = options[:class_name]
        end

        if options.key? :association_foreign_key
          rhs_options[:foreign_key] = options[:association_foreign_key]
        end

        rhs_options
      end
Register or log in to add new notes.