Class: Card::Query::ActionQuery

Inherits:
AbstractQuery show all
Defined in:
card/lib/card/query/action_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

#action_by(card) ⇒ Object



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

def action_by card
  tie :act, { act_by: card }, from: :card_act_id
end

#action_on(card) ⇒ Object



22
23
24
# File 'card/lib/card/query/action_query.rb', line 22

def action_on card
  tie :card, card, from: :card_id
end

#add_update_conditionObject



31
32
33
# File 'card/lib/card/query/action_query.rb', line 31

def add_update_condition
  add_condition "#{fld :action_type} = 1"
end

#tableObject



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

def table
  "card_actions"
end

#table_prefixObject



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

def table_prefix
  "cn"
end

#update_action_by(card) ⇒ Object



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

def update_action_by card
  add_update_condition
  action_by card
end

#update_action_on(card) ⇒ Object



26
27
28
29
# File 'card/lib/card/query/action_query.rb', line 26

def update_action_on card
  add_update_condition
  action_on card
end