You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a compound index that includes a belongs-to association. Here's a short example:
class Source
include NoBrainer::Document
has_many :items
end
class Item
include NoBrainer::Document
belongs_to :source
field :gid, required: true, unique: { scope: :source }
index [:source, :gid]
end
NoBrainer.sync_indexes
source = Source.create!
Item.create!(source: source, gid: 'foo')
Item.where(source: source, gid: 'foo').first
If I specify the index as [:source, :gid], the where call gives a warning that no index is used.
If I specify the index as [:source_id, :gid], it tries to use the index, but fails with:
Array keys can only contain numbers, strings, bools, pseudotypes, or arrays (got null of type NULL). (RethinkDB::ReqlNonExistenceError)
Backtrace:
r.table("items").get_all([nil, "foo"], {"index" => :source_id_gid}).count
The text was updated successfully, but these errors were encountered:
I'm trying to create a compound index that includes a belongs-to association. Here's a short example:
If I specify the index as
[:source, :gid]
, thewhere
call gives a warning that no index is used.If I specify the index as
[:source_id, :gid]
, it tries to use the index, but fails with:The text was updated successfully, but these errors were encountered: