Class: Khronos::Storage::Adapter::ActiveRecord::Schedule
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Khronos::Storage::Adapter::ActiveRecord::Schedule
- Defined in:
- lib/khronos/storage/adapter/activerecord/schedule.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.fetch(time) ⇒ Object
13 14 15 16 17 |
# File 'lib/khronos/storage/adapter/activerecord/schedule.rb', line 13 def fetch(time) self.find_by_sql([ "UPDATE #{self.table_name} SET active = false WHERE at <= ? AND active = true RETURNING *", time ]) end |
Instance Method Details
#callbacks ⇒ Object
24 25 26 |
# File 'lib/khronos/storage/adapter/activerecord/schedule.rb', line 24 def callbacks JSON.parse(read_attribute(:callbacks) || '{}') end |
#callbacks=(options) ⇒ Object
20 21 22 |
# File 'lib/khronos/storage/adapter/activerecord/schedule.rb', line 20 def callbacks=() write_attribute(:callbacks, .to_json) end |