Method: Zena::Use::QueryNode::Compiler#resolve_missing_table
- Defined in:
- lib/zena/use/query_node.rb
#resolve_missing_table(query, table_name, table_alias) ⇒ Object
This is used to avoid finding random indexed objects or links in clauses with and without link filters like this: “image or icon” (‘image’ is a filter in ‘parent’ scope, ‘icon’ is a relation found through links).
474 475 476 477 478 479 480 481 482 483 484 485 |
# File 'lib/zena/use/query_node.rb', line 474 def resolve_missing_table(query, table_name, table_alias) if table_name =~ /^idx_nodes/ # index tables query.where.insert 0, "#{table_alias}.node_id = 0" elsif table_name == 'links' || table_name =~ /^idx_/ # index tables query.where.insert 0, "#{table_alias}.id = 0" else # Raise an error super end end |