firstdraft / draft_generators

Rails generators that help beginners learn to program.
MIT License
2 stars 3 forks source link

Re-organizing draft:account #77

Closed raghubetina closed 4 years ago

raghubetina commented 4 years ago

Putting all of the draft:account actions into one controller, ____AuthenticationController (I believe that this is the pattern Devise follows?); to make it easier to see in one place and understand, and skip the :force____sign_in before_action for signing up/in a person opts in to that.

I believe the older approach grew organically out of adding authentication to an existing tutorial project while I was recording a video (photogram-gui => photogram-signin) and then we codified it in this gem.

I also replace session.fetch() with session[] temporarily because Rails has added fetch itself; our monkeypatch now has different behavior than the canonical method. After this quarter, we'll go back to .fetch. In preparation for that, I replace ActiveRecord::Relation#at(0) with .first so that the gem will ultimately be able to be used without our monkeypatches.

To review:

jelaniwoods commented 4 years ago

@raghubetina wrote some review here: https://github.com/jmw686-appdev/test-new-draft-account/pull/2 Minor comments, LGTM