[Nitro] [patch] Some store fixes

Judson Lester nyarly at gmail.com
Wed Mar 14 15:47:39 EDT 2007


On a related note, in spec/store.rb there's a spec: "A store with has
many relationships should calculate size correctly" that implies a
good intention, but I wanted to confirm it before I get to what's
going to be a pervasive fix.

Basically, what's implied is that a Collection object returned by
using the getter for a has_many should keep the options it was passed
when it was created.  In essence, all later views through that
collection should be filtered through those options.  Which makes
complete sense.  From the spec:

article.comments(:size => 2)

I should be able to count on that collection to have at most 2
elements.  Now, it's explicit that if I reload it with other options,
they should take for the reload, but shouldn't be saved.  (there's a
"#gmosx: No!")

So, I imagine that if I reload without options, the original options
should be the defaults.


-- 
Q: How does a hacker escape handcuffs?
A: Backslashes.


More information about the Nitro-general mailing list