lib/sabisu/event.rb in sabisu-0.1.1 vs lib/sabisu/event.rb in sabisu-0.1.2

- old
+ new

@@ -4,11 +4,11 @@ # class for sensu events class Event # return all docs def self.all(options = {}) options = { skip: 0, limit: nil, sort: [] }.merge(options) - options.delete_if { |k, v| v.nil? || v == [] } + options.delete_if { |_k, v| v.nil? || v == [] } CURRENT_DB.all_docs(options.merge(include_docs: true, start_key: '"a"')) end # Example: Event.search("client:cheftest* AND status:1", :bookmark => 'ABCD36', @@ -31,10 +31,10 @@ sort: [], include_docs: true, ranges: ranges.to_json, counts: counts }.merge(options) - options.delete_if { |k, v| v.nil? || v == [] } + options.delete_if { |_k, v| v.nil? || v == [] } # because couchrest doesn't handle arrays correctly options[:counts] = options[:counts].to_s unless options[:counts].nil? options[:sort] = options[:sort].to_s unless options[:sort].nil? CURRENT_DB.view('_design/sabisu/_search/all_fields', options.merge(q: query))