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
-
#sha1 ⇒ Object
PUBLIC.
Instance Method Details
#sha1 ⇒ Object
PUBLIC
Generates a hashed representation of the initiative support.
34 35 36 37 38 39 40 41 |
# File 'app/models/decidim/initiatives_vote.rb', line 34 def sha1 return unless decidim_user_group_id.nil? title = translated_attribute(initiative.title) description = translated_attribute(initiative.description) Digest::SHA1.hexdigest "#{}#{title}#{description}" end |