Sha256: 3808ec1d27ad63cb22b3dad1241e444af44e5eaac20316e7b1bf16fed7c09efc
Contents?: true
Size: 1.29 KB
Versions: 17
Compression:
Stored size: 1.29 KB
Contents
module Shamu module Events module ActiveRecord # The model used to store the event messages in the database. class Message < ::ActiveRecord::Base self.table_name = "shamu_event_messages" self.primary_key = "id" # ============================================================================ # @!group Attributes # # @!attribute # @return [String] id of the message a UUID. # @!attribute # @return [Integer] channel_id # @!attribute # @return [String] message the serialized message. # @!attribute # @return [DateTime] timestamp when the event was submitted. # # @!endgroup Attributes # ============================================================================ # @!group Scope # # @!attribute # @return [ActiveRecord::Relation] messages posted to the given channel. scope :by_channel, ->( name ) { where( channel: name ) } # @!attribute # @return [ActiveRecord::Relation] messages posted after the given created_at. scope :since, ->( created_at ) { where( arel_table[:created_at].gt( created_at ) ) } # # @!endgroup Scope end end end end
Version data entries
17 entries across 17 versions & 1 rubygems