On Nov 24, 2010, at 7:14 AM, Gert Thiel wrote:

> Dear fellow Hobo users.
> 
> Using the Rails i18n 0.4.2 gem including I18n::Backend::ActiveRecord I
> discovered that Hobo 1.0.2 kills Rails' chained scopes feature.
> 
> Model.scoped({ :conditions => {:field1 =>
> value} }).scoped({ :conditions => {:field2 => another_value} })
> 
> should return only record filtered by both :field1 and :field2. But if
> I use Hobo I get all records with :field2 = another_value.
> 
> With Hobo only the very last scope of every scope chain survives.
> 
> I created a spec to prove my point:
> 
> https://github.com/GertThiel/HoboKillsRailsChainedScopes
> 
> You can observe the bug with Hobo included in the Gemfile or resolve
> the bug by omitting Hobo from the Gemfile.
> 
> BTW: This is the part of code of I18n::Backend::ActiveRecord which
> suffers from the bug:
> 
> https://github.com/svenfuchs/i18n/blob/v0.4.2/lib/i18n/backend/active_record.rb#L34
> 
> I'm sorry to have to report such a severe bug.
> 

Not sure what's causing this, but I've got some more info.

- tried it with Hobo 1.0.1 and Rails 2.3.10: spec fails

- tried a different model (a default User model) with Hobo 1.0.1 and Rails 
2.3.10, to rule out anything weird with Translation: spec fails

- tried it with Hobo 1.0.1 and Rails 2.3.5 (had to de-bundler the test app): 
SPEC PASSES


So either this is a Rails bug (which I find unlikely) or something's breaking 
when we patch AssociationCollection (?)

--Matt Jones

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to