firstdraft / draft_generators

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

Add `draft:account` generator #67

Closed jelaniwoods closed 4 years ago

jelaniwoods commented 5 years ago

Resolve #65

This branch adds the draft:account generator.

Creates:

This generator will add an email and password_digest column only if if you don't pass them in.

Add this to your Gemfile:

gem 'draft_generators', github: 'firstdraft/draft_generators', branch: "jw-add-account-generator"

Example usage:

rails g draft:account user username:string bio:text private:boolean

Another example usage:

rails g draft:account member email:string password_digest:string bio:text private:boolean
pmckernin commented 5 years ago

Looks good to me!!

raghubetina commented 5 years ago

@jelaniwoods Great work. I generated an account and am leaving comments here:

https://github.com/raghubetina/test-account-gen/pull/1

raghubetina commented 5 years ago

I'm still getting the line-ending thing (as of commit bf63ce28).

warning: CRLF will be replaced by LF in app/controllers/leader_sessions_controller.rb.
The file will have its original line endings in your working directory
warning: CRLF will be replaced by LF in app/controllers/leaders_controller.rb.
The file will have its original line endings in your working directory
warning: CRLF will be replaced by LF in app/views/leader_sessions/sign_up.html.erb.
The file will have its original line endings in your working directory
warning: CRLF will be replaced by LF in app/views/leaders/edit_account.html.erb.
The file will have its original line endings in your working directory
jelaniwoods commented 5 years ago

@raghubetina That's frustrating. I don't know what else is switching the line endings back, because I definitely switched them at one point.

image

I'll work more on that.

raghubetina commented 5 years ago

@jelaniwoods More great work. I left comments on this PR after generating a new account:

https://github.com/raghubetina/test-account-gen/pull/2/files

LoganDSPrice commented 5 years ago

New changes look good to me!

raghubetina commented 5 years ago

@jelaniwoods I re-generated the same resource and made a few comments here:

https://github.com/raghubetina/test-account-gen/pull/3

raghubetina commented 4 years ago

@jelaniwoods Terrific work, overall. Some minor nitpicks on whitespace, etc, are here:

https://github.com/raghubetina/review_draft_generators_67/pull/1

raghubetina commented 4 years ago

@jelaniwoods Very nice.

jelaniwoods commented 4 years ago

@raghubetina I made the updates you suggested.

raghubetina commented 4 years ago

@jelaniwoods Very close! A couple more comments here:

https://github.com/raghubetina/test-account-gen/pull/5

jelaniwoods commented 4 years ago

@raghubetina I've updated the forms to match the convention of the resource generator (label for/input ids having _box and names being _from_query). Also, all the .fetch use Strings, except for the current_user method that uses the Symbol that was stored in the add_cookie action.