lib/ddr/alerts/message_context.rb in ddr-alerts-0.2.0 vs lib/ddr/alerts/message_context.rb in ddr-alerts-0.3.0
- old
+ new
@@ -1,11 +1,11 @@
module Ddr
module Alerts
class MessageContext < ActiveRecord::Base
- CONTEXT_REPOSITORY = 'repository'.freeze
CONTEXT_DDR = 'ddr'.freeze
- CONTEXTS = [ CONTEXT_REPOSITORY, CONTEXT_DDR ].freeze
+ CONTEXT_REPOSITORY = 'repository'.freeze
+ CONTEXTS = Set.new([ CONTEXT_DDR, CONTEXT_REPOSITORY ]).freeze
validates :context, inclusion: { in: CONTEXTS }
belongs_to :message, inverse_of: :contexts
\ No newline at end of file