-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Dear @a-chacon ,
following up the discussion in #22 and #23 and #7 , i decided to move the generator stuff into a dedicated issue, in order to enhance transparency and have everything in one place.
I guess, i would like to have it like this:
- have everything like you have right now (bundle add, run the migrations, create initializer).
- i would rename the
rails g rails_url_shortenercommand torails_url_shortener:installto fit the other command (but that is just a minor tweak and not really required)
If a user is happy with this default setup, he can use the lib as intended and nothing changes here.
However, if i would like to customize the models, i would run
-
rails g rails_url_shortener:models- which will basically copy the default models intoapp/models/(or whatever subfolder), so i can customize it. I then would have to manually write an additional migration file, in case i add fields -
rails g rails_url_shortener:controllers- could copy the controllers intoapp/controllers/(or whatever subfolder), so it can be customized (i.e., add a password protection, ...)
The idea would be, to add the gem and leave it there as a regular "production" dependency. Like - for example - devise, most functionality is within the gem, however, i can adjust it, where i need.
Unfortunately, i have never tried working on a rails generator, therefore, i don't think, i can handle that for now (in a proper way that a PR would get accepted ;) ). For now, i am just writing down my ideas