Class: Peoplefinder::Version
- Inherits:
-
PaperTrail::Version
- Object
- PaperTrail::Version
- Peoplefinder::Version
- Defined in:
- app/models/peoplefinder/version.rb
Instance Method Summary collapse
- #alteration? ⇒ Boolean
- #creation? ⇒ Boolean
- #destruction? ⇒ Boolean
- #event_description ⇒ Object
- #membership? ⇒ Boolean
- #undo ⇒ Object
Instance Method Details
#alteration? ⇒ Boolean
14 15 16 |
# File 'app/models/peoplefinder/version.rb', line 14 def alteration? event == 'update' end |
#creation? ⇒ Boolean
6 7 8 |
# File 'app/models/peoplefinder/version.rb', line 6 def creation? event == 'create' end |
#destruction? ⇒ Boolean
10 11 12 |
# File 'app/models/peoplefinder/version.rb', line 10 def destruction? event == 'destroy' end |
#event_description ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/models/peoplefinder/version.rb', line 27 def event_description if creation? "New #{ item_type }" elsif destruction? "Deleted #{ item_type }" elsif alteration? "#{ item_type } Edited" end end |
#membership? ⇒ Boolean
18 19 20 |
# File 'app/models/peoplefinder/version.rb', line 18 def membership? item_type == 'Peoplefinder::Membership' end |
#undo ⇒ Object
22 23 24 25 |
# File 'app/models/peoplefinder/version.rb', line 22 def undo return if membership? creation? ? item.destroy : reify.save end |