mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
14 lines
240 B
Ruby
14 lines
240 B
Ruby
class Message < ActiveRecord::Base
|
|
belongs_to :registrar
|
|
|
|
before_create -> { self.queued = true }
|
|
|
|
scope :queued, -> { where(queued: true) }
|
|
|
|
validates :body, presence: true
|
|
|
|
def dequeue
|
|
self.queued = false
|
|
save
|
|
end
|
|
end
|