Class: Revelry::Content::PseudoContentVersion
- Inherits:
-
Object
- Object
- Revelry::Content::PseudoContentVersion
- Includes:
- ActiveModel::Model
- Defined in:
- app/models/revelry/content/content.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#model ⇒ Object
Returns the value of attribute model.
-
#rollback_version_id ⇒ Object
Returns the value of attribute rollback_version_id.
Instance Method Summary collapse
- #as_json(opts = {}) ⇒ Object
- #created_at ⇒ Object
- #event ⇒ Object
- #item_id ⇒ Object
- #item_type ⇒ Object
- #reify ⇒ Object
- #whodunnit ⇒ Object
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'app/models/revelry/content/content.rb', line 3 def id @id end |
#model ⇒ Object
Returns the value of attribute model.
3 4 5 |
# File 'app/models/revelry/content/content.rb', line 3 def model @model end |
#rollback_version_id ⇒ Object
Returns the value of attribute rollback_version_id.
3 4 5 |
# File 'app/models/revelry/content/content.rb', line 3 def rollback_version_id @rollback_version_id end |
Instance Method Details
#as_json(opts = {}) ⇒ Object
29 30 31 32 33 |
# File 'app/models/revelry/content/content.rb', line 29 def as_json(opts = {}) Jbuilder.new do |json| json.(self, :id, :item_type, :item_id, :event, :whodunnit, :rollback_version_id, :created_at, :reify, :errors) end.attributes! end |
#created_at ⇒ Object
25 26 27 |
# File 'app/models/revelry/content/content.rb', line 25 def created_at model.updated_at + 1.second end |
#event ⇒ Object
9 10 11 |
# File 'app/models/revelry/content/content.rb', line 9 def event 'update' end |
#item_id ⇒ Object
17 18 19 |
# File 'app/models/revelry/content/content.rb', line 17 def item_id model.id end |
#item_type ⇒ Object
13 14 15 |
# File 'app/models/revelry/content/content.rb', line 13 def item_type model.class.name end |
#reify ⇒ Object
21 22 23 |
# File 'app/models/revelry/content/content.rb', line 21 def reify model end |
#whodunnit ⇒ Object
5 6 7 |
# File 'app/models/revelry/content/content.rb', line 5 def whodunnit model.last_whodunnit end |