RefugeRestrooms / refugerestrooms

REFUGE restrooms indexes and maps safe restroom locations for trans, intersex, and gender nonconforming individuals.
http://www.refugerestrooms.org
GNU Affero General Public License v3.0
894 stars 261 forks source link

Prevent upvoting or downvoting multiple times on the same restroom #520

Open translatorzepp opened 5 years ago

translatorzepp commented 5 years ago

Context

Summary of Changes

Concerns

Checklist

Screenshots

After

already-voted
DeeDeeG commented 5 years ago

Thank you for this!

Hopefully @mi-wood or @tkwidmer can take a look at this, since they have dealt with this part of the code more than me. But on first look, this appears pretty good!

I'm not familiar with the Rails session concept, so I'll perhaps take a look into that before merging.

In any case... Happy Hacktoberfest! :jack_o_lantern: :computer: :sparkles: :fallen_leaf:

DeeDeeG commented 5 years ago

Here are some resources about the Rails session feature...

Tutorials, explainers and how-to's: https://www.justinweiss.com/articles/how-rails-sessions-work/ https://www.theodinproject.com/courses/ruby-on-rails/lessons/sessions-cookies-and-authentication https://www.tutorialspoint.com/ruby-on-rails/rails-session-cookies.htm

Official docs: https://guides.rubyonrails.org/action_controller_overview.html#session https://guides.rubyonrails.org/security.html#sessions