lib/massive/status.rb in massive-0.1.1 vs lib/massive/status.rb in massive-0.2.0
- old
+ new
@@ -9,15 +9,15 @@
field :cancelled_at, type: Time
field :last_error, type: String
field :retries, type: Integer, default: 0
- scope :started, ne(started_at: nil)
- scope :not_started, where(started_at: nil)
- scope :completed, ne(finished_at: nil)
- scope :not_completed, where(finished_at: nil)
- scope :failed, ne(failed_at: nil)
- scope :cancelled, ne(cancelled_at: nil)
+ scope :started, -> { ne(started_at: nil) }
+ scope :not_started, -> { where(started_at: nil) }
+ scope :completed, -> { ne(finished_at: nil) }
+ scope :not_completed, -> { where(finished_at: nil) }
+ scope :failed, -> { ne(failed_at: nil) }
+ scope :cancelled, -> { ne(cancelled_at: nil) }
end
def start!
update_attributes(attributes_to_reset)
end