Ruby on Rails Monday, December 22, 2014

On Mon, Dec 22, 2014 at 10:41 AM, tom <tomabroad@gmail.com> wrote:

> i need a query which gets all tasks for one or more projects, but only the
> last group of names + values in terms of the timestamp (the most recent
> group)

I'm not sure I exactly understand that, but the easiest way to clarify
(or figure it out yourself) is to write a test.

Start with a fixture or some factory code to generate representative
data. Then write the test that shows exactly your expectation of the
data to be returned. Then write the method that does that :-)

If you're stuck on the last part, you can at least post your example
data and failing test to get better advice.

FWIW,
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yDJyqbF-je9-D9fUNp2DLZ2C-L7HqU0eVv2qVY%2Bk8vP5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment