Class: Card::Query::ActQuery

Inherits:
AbstractQuery show all
Defined in:
lib/card/query/act_query.rb

Overview

support CQL queries that require the card_acts table

Instance Attribute Summary

Attributes inherited from AbstractQuery

#comment, #conditions, #conditions_on_join, #joins, #mods, #negate, #statement, #subqueries, #superquery, #vars

Instance Method Summary collapse

Methods inherited from AbstractQuery

#context, #depth, #full?, #init_instance_vars, #init_query_vars, #initialize, #interpret, #root, #root?, #sql, #subquery

Methods included from Card::Query::AbstractQuery::Tie

#fasten, #fasten_tie, #id_from_val, #inherit_fasten, #left_join?, #negate_join, #restrict, #super_conditions, #superfield, #tie, #tie_subquery, #tie_with_exist, #tie_with_in, #tie_with_join, #tie_with_join_args

Methods included from Card::Query::AbstractQuery::QueryHelper

#add_condition, #current_conjunction, #direct_subqueries, #fld, #next_table_suffix, #subqueries_with_fasten, #table_alias

Constructor Details

This class inherits a constructor from Card::Query::AbstractQuery

Instance Method Details

#act_by(card) ⇒ Object



21
22
23
# File 'lib/card/query/act_query.rb', line 21

def act_by card
  tie :card, card, from: :actor_id
end

#action_on(card) ⇒ Object



13
14
15
# File 'lib/card/query/act_query.rb', line 13

def action_on card
  tie :action, { action_on: card }, to: :card_act_id
end

#tableObject



5
6
7
# File 'lib/card/query/act_query.rb', line 5

def table
  "card_acts"
end

#table_prefixObject



9
10
11
# File 'lib/card/query/act_query.rb', line 9

def table_prefix
  "cx"
end

#update_action_on(card) ⇒ Object



17
18
19
# File 'lib/card/query/act_query.rb', line 17

def update_action_on card
  tie :action, { update_action_on: card }, to: :card_act_id
end