lib/templates/mongoid_inbox.rb in inboxable-0.1.1 vs lib/templates/mongoid_inbox.rb in inboxable-0.1.2
- old
+ new
@@ -17,9 +17,13 @@
attr_accessor :allow_processing
as_enum :status, %i[pending processed failed], field: { type: String, default: 'pending' }, map: :string
+ statuses.each_key do |key|
+ scope key, -> { where(status_cd: key) }
+ end
+
validates :processor_class_name, presence: true
after_create :process, if: proc { |resource| resource.allow_processing == true }
def increment_attempt