Module: Zena::Use::QueryNode::ClassMethods
- Includes:
- Acts::Secure::SecureResult
- Defined in:
- lib/zena/use/query_node.rb
Overview
ModelMethods
Instance Method Summary collapse
-
#do_find(count, query) ⇒ Object
Find a node and propagate visitor.
-
#query_group ⇒ Object
Return the name of the group used for custom queries.
- #sfind(sqliss, arity = :all) ⇒ Object
Methods included from Acts::Secure::SecureResult
#construct_id_map, #secure_result
Instance Method Details
#do_find(count, query) ⇒ Object
Find a node and propagate visitor
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/zena/use/query_node.rb', line 91 def do_find(count, query) case count when :all res = find_by_sql(query) secure_result(res) when :first res = find_by_sql(query).first secure_result(res) when :count # query can be a number when we use the 'query' helper to count. query.kind_of?(Fixnum) ? query : count_by_sql(query) else nil end end |
#query_group ⇒ Object
Return the name of the group used for custom queries
79 80 81 |
# File 'lib/zena/use/query_node.rb', line 79 def query_group visitor.site.host end |