rollups 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0ec70ee09b71a3a86cb895a6ebb08da1a10fcce3387a713e48f459bd6b3b1b2
4
- data.tar.gz: df6c597429334dac4f29d2da102a01818d8bad8bf7f42b3e93801b11cee6d2bf
3
+ metadata.gz: b33b1111b50f1f8fcc5b6982932a09c840ca4f4a81191380737e8cdf68775c9e
4
+ data.tar.gz: 85d9688173df57cd7ab8eb40a4def91adde625303df8374a397e2e136820256f
5
5
  SHA512:
6
- metadata.gz: 64b0b3d9f3f81292de5753c2514bbe6d976fdcd2a4636c3563c1e8ba6e45d0f4b44a00b5dbf239dbb811decbb28695cade962f304edebc19518c383fbe04fac0
7
- data.tar.gz: 6a096a113be0c7a1a1ab543f43110c1894d418f53163cd3c632baa1a53e311ffd3947a7ccddecc0b7333257cb35a874d8cd1192289e83e1e03e619a3b7c0cfaa
6
+ metadata.gz: f64fac7253c86ae3bbc92086551f8c76cb565d5d0630b700707ffd059630bb60017469be586126bc54051ca8df6ccfdfbb42664eacefc982e9618457f4e5e65b
7
+ data.tar.gz: a7971f424d126c532f03208cf7fb9f72d505787dd3251df33db10d6487d39e29ab6de7d55249d064c9153d50cf2bb07a29a0a3124c1c1111cb585560565b6418
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.2 (2021-06-07)
2
+
3
+ - Fixed deprecation warning with Active Record 6.1
4
+
1
5
  ## 0.1.1 (2020-09-09)
2
6
 
3
7
  - Fixed results for earlier versions of MySQL
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Works great with [Ahoy](https://github.com/ankane/ahoy) and [Searchjoy](https://github.com/ankane/searchjoy)
6
6
 
7
- [![Build Status](https://travis-ci.org/ankane/rollup.svg?branch=master)](https://travis-ci.org/ankane/rollup)
7
+ [![Build Status](https://github.com/ankane/rollup/workflows/build/badge.svg?branch=master)](https://github.com/ankane/rollup/actions)
8
8
 
9
9
  ## Installation
10
10
 
@@ -12,7 +12,7 @@ class RollupsGenerator < Rails::Generators::Base
12
12
  end
13
13
 
14
14
  def migration_source
15
- case ActiveRecord::Base.connection_config[:adapter].to_s
15
+ case adapter
16
16
  when /postg/i
17
17
  "dimensions.rb"
18
18
  else
@@ -23,4 +23,12 @@ class RollupsGenerator < Rails::Generators::Base
23
23
  def migration_version
24
24
  "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
25
25
  end
26
+
27
+ def adapter
28
+ if ActiveRecord::VERSION::STRING.to_f >= 6.1
29
+ ActiveRecord::Base.connection_db_config.adapter.to_s
30
+ else
31
+ ActiveRecord::Base.connection_config[:adapter].to_s
32
+ end
33
+ end
26
34
  end
data/lib/rollup.rb CHANGED
@@ -75,10 +75,7 @@ class Rollup < ActiveRecord::Base
75
75
  # feels cleaner than overriding _read_attribute
76
76
  def inspect
77
77
  if Utils.date_interval?(interval)
78
- previous_time = time_before_type_cast
79
- previous_time = previous_time.to_s(:db) if previous_time.is_a?(Time)
80
- previous_time = previous_time + " 00:00:00" if previous_time.length == 10
81
- super.sub("time: \"#{previous_time}\"", "time: \"#{time.to_s(:db)}\"")
78
+ super.sub(/time: "[^"]+"/, "time: \"#{time.to_s(:db)}\"")
82
79
  else
83
80
  super
84
81
  end
@@ -1,5 +1,5 @@
1
1
  class Rollup
2
2
  # not used in gemspec to avoid superclass mismatch
3
3
  # be sure to update there as well
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rollups
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-10 00:00:00.000000000 Z
11
+ date: 2021-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -136,7 +136,7 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
- description:
139
+ description:
140
140
  email: andrew@chartkick.com
141
141
  executables: []
142
142
  extensions: []
@@ -158,7 +158,7 @@ homepage: https://github.com/ankane/rollup
158
158
  licenses:
159
159
  - MIT
160
160
  metadata: {}
161
- post_install_message:
161
+ post_install_message:
162
162
  rdoc_options: []
163
163
  require_paths:
164
164
  - lib
@@ -173,8 +173,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  - !ruby/object:Gem::Version
174
174
  version: '0'
175
175
  requirements: []
176
- rubygems_version: 3.1.2
177
- signing_key:
176
+ rubygems_version: 3.2.3
177
+ signing_key:
178
178
  specification_version: 4
179
179
  summary: Rollup time-series data in Rails
180
180
  test_files: []