class Shoulda::Matchers::ActiveModel::ValidatePresenceOfMatcher

def belongs_to_association_configured_to_be_required?

def belongs_to_association_configured_to_be_required?
  association_options[:optional] == false ||
    association_options[:required] == true
end