github-ds 0.5.2 → 0.5.3

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
  SHA256:
3
- metadata.gz: 4b95473248771ff3545335efd43524ac0cabeb2f2ec8ec838f7f7537149e9c5e
4
- data.tar.gz: dbf07fa010c19fde19540f22f54e0f6f5fec6d4861b31cac059f92c081f7d9bd
3
+ metadata.gz: 67fbdfde76841e4bcdc3394cb89a3a153e2f37a40a96f94802fad44044f2930b
4
+ data.tar.gz: 969a49dd12b5014c55e789af20113430016df5210c9c2cecc2987f7352e00327
5
5
  SHA512:
6
- metadata.gz: 433f178728cbc1c7748e3b0b7985781bb8d39aabb338169cbc08eb6a954a914a80796b6bcbeda711d1a1de8c0bb87809102b7022c07e2ba97f381bafcdf0c450
7
- data.tar.gz: 47586ed750c3af0cbbf0dc34820c99da0c9c69f81946a4f505ba9100c9368ab16e094e0483c7cf37692ad4c0db317b1c0b499c34c5e536e9fb62a1f3e1e4fd1f
6
+ metadata.gz: 28dd029a03c1e1d7c37e9780103edadb28f55ae0c99d3397016ecbcbb9e0dc15254a3e1755890c5d1ecc3d9a202263f901b86d9694f06d66e5c44c1b2611e6b6
7
+ data.tar.gz: 264bbc44d409b3470fcb20eb665cf2620afdd144b22ac0845e13eba94ebb782f198fd654a992b09de6133daaa6141e536b8d7d237b327378cfacb6f63a56e32e
@@ -0,0 +1,36 @@
1
+ name: CI
2
+
3
+ on:
4
+ push: {}
5
+ pull_request:
6
+ branches: [ master ]
7
+
8
+ jobs:
9
+ test:
10
+ services:
11
+ mysql:
12
+ image: mysql:5.7
13
+ env:
14
+ MYSQL_ALLOW_EMPTY_PASSWORD: yes
15
+ MYSQL_DATABASE: github_ds_test
16
+ MYSQL_ROOT_PASSWORD: ""
17
+ ports:
18
+ - "3306:3306"
19
+ options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
20
+
21
+ runs-on: ubuntu-latest
22
+ strategy:
23
+ matrix:
24
+ ruby-version: ['2.7', '3.0']
25
+ rails-version: ['7.0.0.alpha2', '6.1.0']
26
+ env:
27
+ RAILS_VERSION: ${{ matrix.rails-version }}
28
+ steps:
29
+ - uses: actions/checkout@v2
30
+ - name: Set up Ruby
31
+ uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
32
+ with:
33
+ ruby-version: ${{ matrix.ruby-version }}
34
+ bundler-cache: true
35
+ - name: Run tests
36
+ run: bundle exec rake
data/README.md CHANGED
@@ -217,7 +217,7 @@ Nothing currently on our radar other than continued maintenance. Have a big idea
217
217
 
218
218
  | pic | @mention |
219
219
  |---|---|
220
- | ![@charliesome](https://avatars3.githubusercontent.com/u/179065?s=64) | [@charliesome](https://github.com/charliesome) |
220
+ | ![@haileysome](https://avatars3.githubusercontent.com/u/179065?s=64) | [@haileysome](https://github.com/haileysome) |
221
221
  | ![@jnunemaker](https://avatars3.githubusercontent.com/u/235?s=64) | [@jnunemaker](https://github.com/jnunemaker) |
222
222
  | ![@miguelff](https://avatars3.githubusercontent.com/u/210307?s=64) | [@miguelff](https://github.com/miguelff) |
223
223
  | ![@zerowidth](https://avatars3.githubusercontent.com/u/3999?s=64) | [@zerowidth](https://github.com/zerowidth) |
@@ -1,5 +1,5 @@
1
1
  module GitHub
2
2
  module DS
3
- VERSION = "0.5.2"
3
+ VERSION = '0.5.3'
4
4
  end
5
5
  end
data/lib/github/sql.rb CHANGED
@@ -381,7 +381,7 @@ module GitHub
381
381
 
382
382
  when DateTime, Time, Date
383
383
  enforce_timezone do
384
- connection.quote value.to_s(:db)
384
+ connection.quote value.to_formatted_s(:db)
385
385
  end
386
386
 
387
387
  when true
@@ -402,15 +402,25 @@ module GitHub
402
402
 
403
403
  # Private: Forces ActiveRecord's default timezone for duration of block.
404
404
  def enforce_timezone(&block)
405
+ on_rails_7 = ActiveRecord.respond_to?(:default_timezone)
405
406
  begin
406
407
  if @force_timezone
407
- zone = ActiveRecord::Base.default_timezone
408
- ActiveRecord::Base.default_timezone = @force_timezone
408
+ if on_rails_7
409
+ zone = ActiveRecord.default_timezone
410
+ ActiveRecord.default_timezone = @force_timezone
411
+ else
412
+ zone = ActiveRecord::Base.default_timezone
413
+ ActiveRecord::Base.default_timezone = @force_timezone
414
+ end
409
415
  end
410
416
 
411
417
  yield if block_given?
412
418
  ensure
413
- ActiveRecord::Base.default_timezone = zone if @force_timezone
419
+ if on_rails_7
420
+ ActiveRecord.default_timezone = zone if @force_timezone
421
+ else
422
+ ActiveRecord::Base.default_timezone = zone if @force_timezone
423
+ end
414
424
  end
415
425
  end
416
426
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github-ds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-04-07 00:00:00.000000000 Z
12
+ date: 2023-07-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -160,8 +160,8 @@ executables: []
160
160
  extensions: []
161
161
  extra_rdoc_files: []
162
162
  files:
163
+ - ".github/workflows/ci.yml"
163
164
  - ".gitignore"
164
- - ".travis.yml"
165
165
  - CHANGELOG.md
166
166
  - CODE_OF_CONDUCT.md
167
167
  - CONTRIBUTING.md
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  - !ruby/object:Gem::Version
215
215
  version: '0'
216
216
  requirements: []
217
- rubygems_version: 3.1.4
217
+ rubygems_version: 3.4.10
218
218
  signing_key:
219
219
  specification_version: 4
220
220
  summary: A collection of libraries for working with SQL on top of ActiveRecord's connection.
data/.travis.yml DELETED
@@ -1,14 +0,0 @@
1
- language: ruby
2
- before_install:
3
- - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
4
- - gem install bundler -v '<2'
5
- rvm:
6
- - 2.5
7
- - 2.6
8
- - 2.7
9
- script: bundle exec rake
10
- env:
11
- - RAILS_VERSION=6.0.3.5
12
- - RAILS_VERSION=5.2.0
13
- services:
14
- - mysql