Class: Card::Query::ActionQuery
- Inherits:
-
AbstractQuery
- Object
- AbstractQuery
- Card::Query::ActionQuery
- Defined in:
- lib/card/query/action_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
- #action_by(card) ⇒ Object
- #action_on(card) ⇒ Object
- #add_update_condition ⇒ Object
- #table ⇒ Object
- #table_prefix ⇒ Object
- #update_action_by(card) ⇒ Object
- #update_action_on(card) ⇒ Object
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?, #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, #subqueries_with_fasten, #table_alias, #table_seq
Constructor Details
This class inherits a constructor from Card::Query::AbstractQuery
Instance Method Details
#action_by(card) ⇒ Object
13 14 15 |
# File '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 'lib/card/query/action_query.rb', line 22 def action_on card tie :card, card, from: :card_id end |
#add_update_condition ⇒ Object
31 32 33 |
# File 'lib/card/query/action_query.rb', line 31 def add_update_condition add_condition "#{fld :action_type} = 1" end |
#table ⇒ Object
5 6 7 |
# File 'lib/card/query/action_query.rb', line 5 def table "card_actions" end |
#table_prefix ⇒ Object
9 10 11 |
# File 'lib/card/query/action_query.rb', line 9 def table_prefix "cn" end |
#update_action_by(card) ⇒ Object
17 18 19 20 |
# File '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 'lib/card/query/action_query.rb', line 26 def update_action_on card add_update_condition action_on card end |