RailsApps / rails_apps_composer

A gem with recipes to create Rails application templates for Rails starter apps.
http://railsapps.github.io/rails_apps_composer/
1.42k stars 306 forks source link

CreateAdminService #332

Closed mib32 closed 9 years ago

mib32 commented 9 years ago

Not really an issue, i'm just really interested what kind of pattern it is? Why to create whole file app/services/create_admin_service.rb for just seeding the admin user? Why not to move it to seeds.rb? Because it not seems to be reusable.

DanielKehoe commented 9 years ago

Separation of concerns. In this case, it makes it easier to maintain Rails Composer because different starter apps require different additions to the seeds.rb file. Another approach is to add all the required code to the seeds.rb file but that would create a messy complex recipe in the rails_apps_composer gem.

mib32 commented 9 years ago

Thanks @DanielKehoe