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