Files
nairobi/app/components/proposals/votes_component.rb
Javi Martín 78f372fd0b Move votes partials to components
We're going to change the code quite a bit, and with components we can
easily extract methods when necessary.
2022-02-21 18:47:13 +01:00

11 lines
355 B
Ruby

class Proposals::VotesComponent < ApplicationComponent
attr_reader :proposal, :vote_url, :proposal_votes
delegate :current_user, :link_to_verify_account, :user_signed_in?, :voted_for?, to: :helpers
def initialize(proposal, vote_url:, proposal_votes:)
@proposal = proposal
@vote_url = vote_url
@proposal_votes = proposal_votes
end
end