Files
nairobi/app/components/proposals/votes_component.rb
Javi Martín 70f717e564 Use current user in votes components
Just like we do in most places; we almost never use `user_signed_in?`.
2022-02-21 18:47:13 +01:00

14 lines
328 B
Ruby

class Proposals::VotesComponent < ApplicationComponent
attr_reader :proposal
delegate :current_user, :link_to_verify_account, to: :helpers
def initialize(proposal, vote_url: nil)
@proposal = proposal
@vote_url = vote_url
end
def vote_url
@vote_url || vote_proposal_path(proposal, value: "yes")
end
end