Class: Decidim::InitiativesVote

Inherits:
ApplicationRecord
  • Object
show all
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

Instance Method Details

#sha1Object

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 "#{authorization_unique_id}#{title}#{description}"
end