method
belongs_to_options
v4.2.7 -
Show latest stable
- Class:
ActiveRecord::Associations::Builder::HasAndBelongsToMany
belongs_to_options(options)private
No documentation available.
# File activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb, line 113
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