Class: Creeper::Extensions::DelayedModel
- Inherits:
-
Object
- Object
- Creeper::Extensions::DelayedModel
- Includes:
- Worker
- Defined in:
- lib/creeper/extensions/active_record.rb
Overview
Adds a ‘delay’ method to ActiveRecord to offload arbitrary method execution to Creeper. Examples:
User.delay.delete_inactive User.recent_signups.each { |user| user.delay.mark_as_awesome }
Instance Method Summary collapse
Methods included from Worker
Instance Method Details
#perform(yml) ⇒ Object
14 15 16 17 |
# File 'lib/creeper/extensions/active_record.rb', line 14 def perform(yml) (target, method_name, args) = YAML.load(yml) target.send(method_name, *args) end |