Ruby on Rails Monday, January 31, 2011

On Jan 31, 2011, at 3:10 AM, elitalon wrote:
> Some questions come to mind: do you recommend to make a commit after
> applying a migration? Isn't a migration some kind of commit itself?

While in general putting generated artifacts into a repo isn't usually a good idea, I always keep things like the schema in source control, so I do a commit after each migration is run. Personally I've been committing after creating the migration script and then after running it. It might make more sense to treat that as an atomic unit of work and make it a single commit, though.

> I also know that some people begin with the view, then develop the model
> and in the end implement the controller, so what do you recommend?

Start with the cucumber/capybara test. Then create a route, then the simplest controller action and view to make the test pass. If there is any complexity to any of the above, write an rspec test first, then write the code to make it pass. If the controller has too much complexity, either get the tests passing and then refactor to the model, or possibly start with tests for a model object and then call it from the controller. For example, I needed to geocode addresses the other day and after writing the cucumber test, route and controller I immediately added a model object called location to wrap that complexity and rspec tests (with fakeweb and vcr) to ensure it worked as expected.

Best Wishes,
Peter

>
> Thank you!!
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment