Class: DailyAffirmation::Validators::PresenceValidator
- Inherits:
-
DailyAffirmation::Validator
- Object
- DailyAffirmation::Validator
- DailyAffirmation::Validators::PresenceValidator
- Defined in:
- lib/daily_affirmation/validators/presence_validator.rb
Overview
This affirmation ensures an attribute is present.
Instance Method Summary collapse
Methods inherited from DailyAffirmation::Validator
Constructor Details
This class inherits a constructor from DailyAffirmation::Validator
Instance Method Details
#error_message ⇒ Object
11 12 13 14 15 |
# File 'lib/daily_affirmation/validators/presence_validator.rb', line 11 def @error_message ||= ( :presence, :default => "#{attribute} can't be blank" ) end |
#valid? ⇒ Boolean
7 8 9 |
# File 'lib/daily_affirmation/validators/presence_validator.rb', line 7 def valid? @valid ||= present? end |