rails_admin_charts 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e62900d965ae0d4923160d4b8eb68bffb75fd44b
4
- data.tar.gz: b6e3aef9a8d190c871da55c078e458fcf2da9e0a
3
+ metadata.gz: db0b3e972b9cfcab8a3b6f33ad7b2539774dfd8f
4
+ data.tar.gz: 67db7414135137a4ef09611433d14bae39d2a5da
5
5
  SHA512:
6
- metadata.gz: fdf82ac4b2b2666eee840f66d1a5e84516751a7049c4d722c0164fa897fdaf84ec2df97d4be99359f4961d45d9de6b11ee23112ed3aac157dbdd7b011f37e0e4
7
- data.tar.gz: 80420584ed3204599738d3041372322e5ff673688bdbb79ea3942960375a3f68feca06224721c83db86d474df960a1a839f1e01c1e6121d412cdd36c37fa1a51
6
+ metadata.gz: a4b3dc2e3dccbe0a776c5b33920f7d2c1aad5fd2818bc0c426d174a7668ca7c3e2276c782722adb5f49fd9a679bc58d59789514916e52f994a36e306ad2ad80d
7
+ data.tar.gz: 811669e9900a626f72d42e0baad0d576d2cf4f5bc75439b931b2be20b7c9759caebb6b3601d59ba8eaadb4c4bbe079fd873d0666ac4b360ee59645cbe82104c8
data/README.md CHANGED
@@ -10,7 +10,7 @@ Run:
10
10
 
11
11
  $ bundle install
12
12
 
13
- This will include the lazy_high_charts gem and add the assets to the pipeline.
13
+ This will include the lazy_high_charts gem and add the assets to the pipeline. NB: remember to recompile assets if adding this to staging or production environments.
14
14
 
15
15
  In your RailsAdmin initializer (`app/config/initializers/rails_admin.rb`), enable the action by adding:
16
16
 
@@ -9,12 +9,13 @@ module RailsAdminCharts
9
9
  module ClassMethods
10
10
  def total_records_since(since = 30.days.ago)
11
11
  totals, before_count = self.group('DATE(created_at)').count, self.where('created_at < ?', since.to_date).count
12
- (since.to_date..Date.today).each_with_object([]) { |day, a| a << (a.last || before_count) + (totals[day.to_s] || 0) }
12
+ # TODO separate MySQL/Postgres approaches using ActiveRecord::Base.connection.adapter_name or check hash key is_a? String/Date
13
+ (since.to_date..Date.today).each_with_object([]) { |day, a| a << (a.last || before_count) + (totals[day] || totals[day.to_s] || 0) }
13
14
  end
14
15
 
15
16
  def delta_records_since(since = 30.days.ago)
16
17
  deltas = self.group('DATE(created_at)').count
17
- (since.to_date..Date.today).map { |date| deltas[date.to_s] || 0 }
18
+ (since.to_date..Date.today).map { |date| deltas[date] || deltas[date.to_s] || 0 }
18
19
  end
19
20
 
20
21
  def graph_data(since=30.days.ago)
@@ -1,3 +1,3 @@
1
1
  module RailsAdminCharts
2
- VERSION = '0.0.8'
2
+ VERSION = '0.0.9'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_admin_charts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Geraghty