removed sqlite3 dependency as it causes heroku to fail [ci skip]

This commit is contained in:
Antonio C Nalesso Moreira 2013-09-06 02:25:34 +01:00
parent 34df3e88b3
commit 3d23031a31
2 changed files with 16 additions and 4 deletions

View File

@ -30,7 +30,6 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rdoc', '>= 2.4.2'
s.add_development_dependency 'rspec-rails'
s.add_development_dependency 'simplecov'
s.add_development_dependency 'sqlite3'
s.add_development_dependency 'systemu'
s.add_development_dependency 'minitest'
s.add_development_dependency 'minitest-rails'

View File

@ -9,10 +9,23 @@ module Impressionist
# Overides impressionist_count in order to provied
# mongoid compability
def impressionist_count(options={})
options.reverse_merge!(:filter=>:request_hash, :start_date=>nil, :end_date=>Time.now)
imps = options[:start_date].blank? ? impressions : impressions.between(created_at: options[:start_date]..options[:end_date])
options.
reverse_merge!(
:filter=>:request_hash,
:start_date=>nil,
:end_date=>Time.now)
imps = options[:start_date].blank?
? impressions :
impressions.
between(created_at: options[:start_date]..options[:end_date])
filter = options[:filter]
filter == :all ? imps.count : imps.where(filter.ne => nil).distinct(filter).count
filter == :all ?
imps.count :
imps.where(filter.ne => nil).
distinct(filter).count
end
end