app/controllers/neutral/votes_controller.rb in neutral-0.0.7 vs app/controllers/neutral/votes_controller.rb in neutral-0.0.8
- old
+ new
@@ -32,17 +32,17 @@
def require_login?
raise Errors::RequireLogin if Neutral.config.require_login && !current_voter
end
def can_change?
- raise Errors::CannotChange unless Neutral.config.can_change && authorized?
+ raise Errors::CannotChange unless Neutral.config.can_change && owner?
end
def vote_params
params.require(:vote).permit(:voteable_type, :voteable_id, :value).merge voter_id: current_voter.try(:id)
end
- def authorized?
+ def owner?
current_voter == vote.voter
end
end
end