foreign_key(infer_from_inverse_of: true) 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/reflection.rb, line 513
      def foreign_key(infer_from_inverse_of: true)
        @foreign_key ||= if options[:query_constraints]
          options[:query_constraints].map { |fk| fk.to_s.freeze }.freeze
        elsif options[:foreign_key]
          options[:foreign_key].to_s
        else
          derived_fk = derive_foreign_key(infer_from_inverse_of: infer_from_inverse_of)

          if active_record.has_query_constraints?
            derived_fk = derive_fk_query_constraints(derived_fk)
          end

          derived_fk
        end
      end
Register or log in to add new notes.