2018-11-20 20:47:30 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
module ValidAttribute
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
# Checks whether an attribute has failed validation or not
|
|
|
|
#
|
|
|
|
# +attribute+ The symbolised name of the attribute i.e :name
|
|
|
|
def valid_attribute?(attribute)
|
|
|
|
self.errors.empty? || self.errors.messages[attribute].nil?
|
|
|
|
end
|
|
|
|
end
|