Class: Decidim::InitiativesVote
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- Decidim::InitiativesVote
- Includes:
- TranslatableAttributes
- Defined in:
- app/models/decidim/initiatives_vote.rb
Overview
Initiatives can be voted by users and supported by organizations.
Instance Method Summary collapse
- #decrypted_metadata ⇒ Object
-
#sha1 ⇒ Object
Public: Generates a hashed representation of the initiative support.
Instance Method Details
#decrypted_metadata ⇒ Object
41 42 43 |
# File 'app/models/decidim/initiatives_vote.rb', line 41 def @decrypted_metadata ||= ? encryptor.decrypt() : {} end |
#sha1 ⇒ Object
Public: Generates a hashed representation of the initiative support.
Used when exporting the votes as CSV.
34 35 36 37 38 39 |
# File 'app/models/decidim/initiatives_vote.rb', line 34 def sha1 title = translated_attribute(initiative.title) description = translated_attribute(initiative.description) Digest::SHA1.hexdigest "#{}#{title}#{description}" end |