Class: UserStatus
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- UserStatus
- Defined in:
- app/models/user_status.rb
Constant Summary collapse
- MAX_DESCRIPTION_LENGTH =
100
Instance Method Summary collapse
Instance Method Details
#emoji_exists ⇒ Object
17 18 19 |
# File 'app/models/user_status.rb', line 17 def emoji_exists errors.add(:emoji, :invalid) if emoji && !Emoji.exists?(emoji) end |
#ends_at_greater_than_set_at ⇒ Object
21 22 23 24 25 |
# File 'app/models/user_status.rb', line 21 def ends_at_greater_than_set_at if ends_at && set_at > ends_at errors.add(:ends_at, I18n.t("user_status.errors.ends_at_should_be_greater_than_set_at")) end end |
#expired? ⇒ Boolean
13 14 15 |
# File 'app/models/user_status.rb', line 13 def expired? ends_at && ends_at < Time.zone.now end |