removed sqlite3 dependency as it causes heroku to fail [ci skip]
This commit is contained in:
parent
34df3e88b3
commit
3d23031a31
|
@ -30,7 +30,6 @@ Gem::Specification.new do |s|
|
||||||
s.add_development_dependency 'rdoc', '>= 2.4.2'
|
s.add_development_dependency 'rdoc', '>= 2.4.2'
|
||||||
s.add_development_dependency 'rspec-rails'
|
s.add_development_dependency 'rspec-rails'
|
||||||
s.add_development_dependency 'simplecov'
|
s.add_development_dependency 'simplecov'
|
||||||
s.add_development_dependency 'sqlite3'
|
|
||||||
s.add_development_dependency 'systemu'
|
s.add_development_dependency 'systemu'
|
||||||
s.add_development_dependency 'minitest'
|
s.add_development_dependency 'minitest'
|
||||||
s.add_development_dependency 'minitest-rails'
|
s.add_development_dependency 'minitest-rails'
|
||||||
|
|
|
@ -9,10 +9,23 @@ module Impressionist
|
||||||
# Overides impressionist_count in order to provied
|
# Overides impressionist_count in order to provied
|
||||||
# mongoid compability
|
# mongoid compability
|
||||||
def impressionist_count(options={})
|
def impressionist_count(options={})
|
||||||
options.reverse_merge!(:filter=>:request_hash, :start_date=>nil, :end_date=>Time.now)
|
options.
|
||||||
imps = options[:start_date].blank? ? impressions : impressions.between(created_at: options[:start_date]..options[:end_date])
|
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 = 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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue