add has_one? method and reuse instead of checking macro

Instead of checking for `macro == :has_one` throughout the
codebase we can create a `has_one?` method to match the `belongs_to?`,
`polymorphic?` and other methods.
Merge pull request #15596 from eileencodes/add-has_one-method-and-reuse

add has_one? method and reuse instead of checking macro
reuse available collection? check instead of macro

Reflection has an available method that is used to check if the
reflection is a collection. Any :has_many macro is considered a
collection and `collection?` should be used instead of
`macro == :has_many`.