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

Constant Summary

Constants inherited from AbstractQuery

Card::Query::AbstractQuery::ROOT_VAR_DEFAULTS

Instance Attribute Summary

Attributes inherited from AbstractQuery

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

Instance Method Summary collapse

Methods inherited from AbstractQuery

#context, #depth, #full?, #initialize, #interpret, #root, #root?, #sql, #sql_statement, #subquery

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

#fasten, #fasten_tie, #id_from_val, #inherit_fasten, #left_join?, #list_of_ids?, #negate_join, #op_and_id_or_ids_from_val, #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, #subqueries_with_fasten, #table_alias, #table_seq

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