Class: Revision
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Revision
- Includes:
- Redis::Objects, Stateflow
- Defined in:
- app/models/revision.rb
Instance Method Summary collapse
Instance Method Details
#enqueue! ⇒ Object
25 26 27 28 29 |
# File 'app/models/revision.rb', line 25 def enqueue! enqueue save! ReviseWorker.perform_async(id) end |
#moderate! ⇒ Object
88 89 90 91 92 |
# File 'app/models/revision.rb', line 88 def moderate! return if moderated? update_attribute(:moderated, true) enqueue! end |
#perform? ⇒ Boolean
94 95 96 97 98 99 100 101 102 103 |
# File 'app/models/revision.rb', line 94 def perform? result = gateway.librarize.send_revision(self, data.read) if result[:success] return :done else self.update_attribute(:error, result[:error]) return :error end end |
#title ⇒ Object
METHODS
84 85 86 |
# File 'app/models/revision.rb', line 84 def title "#{gateway.title}: #{I18n.l date}" end |