Module: Zena::Use::QueryComment::ClassMethods
- Defined in:
- lib/zena/use/query_comment.rb
Instance Method Summary collapse
-
#do_find(count, query) ⇒ Object
Find a node and propagate visitor.
Instance Method Details
#do_find(count, query) ⇒ Object
Find a node and propagate visitor
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/zena/use/query_comment.rb', line 17 def do_find(count, query) case count when :all res = find_by_sql(query) res.empty? ? nil : res when :first find_by_sql(query).first when :count count_by_sql(query) else nil end end |