jamesgolick/friendly — Issue #30: Scope chaining is throwing MissingIndex error
Author: dhruvg
Created: 2011-11-03 05:55:28+00:00
State: open

I have a document with two indexes:

class Foo
include Friendly::Document

attribute :bar, Integer
attribute :baz, Integer

indexes :bar
indexes :baz

named_scope :scope1, :bar => 1
named_scope :scope2, :baz => 2
end

Foo.bar.all works!
Foo.baz.all works!

Foo.bar.baz.all throws a MissingIndex error:

Friendly::MissingIndex: No index found to satisfy: #[2]}, @page=1, @per_page=nil, @limit=nil, @offset=nil, @order=#:created_at, @descending=>true, @nulls=>nil>, @preserve_order=nil>

Why is this happening? Any ideas for fix?