Skip to content

Commit

Permalink
Merge pull request #168 from Shopify/support-rails-head
Browse files Browse the repository at this point in the history
Support next rails version
  • Loading branch information
driv3r authored Aug 5, 2024
2 parents 239639f + d390731 commit ee9050b
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 47 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@ jobs:

strategy:
fail-fast: false
max-parallel: 8
matrix:
activerecord: ["6.1", "7.0", "7.1"]
ruby: ["3.0", "3.1", "3.2", "3.3", "head"]
activerecord: ["6.1", "7.0", "7.1", "head"]
ruby: ["3.1", "3.2", "3.3", "head"]
mysql: ["5.7", "8.0"]
adapter: ["mysql2", "trilogy"]
exclude:
- activerecord: 6.1
ruby: head
- activerecord: 7.0
ruby: head
- activerecord: head
ruby: 3.0

env:
BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/activerecord_${{ matrix.activerecord }}.gemfile"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Unreleased

# 4.3.0 (Aug, 2024)
* Drop support for Ruby 3.0, as it reached its EOL
* Add support for next Rails version

# 4.2.3 (Jul, 2024)
* Fix check for warnings against PKs with line breaks

Expand Down
43 changes: 21 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
PATH
remote: .
specs:
lhm-shopify (4.2.3)
lhm-shopify (4.3.0)
retriable (>= 3.0.0)

GEM
remote: https://rubygems.org/
specs:
activemodel (7.1.1)
activesupport (= 7.1.1)
activerecord (7.1.1)
activemodel (= 7.1.1)
activesupport (= 7.1.1)
activemodel (7.1.3.4)
activesupport (= 7.1.3.4)
activerecord (7.1.3.4)
activemodel (= 7.1.3.4)
activesupport (= 7.1.3.4)
timeout (>= 0.4.0)
activesupport (7.1.1)
activesupport (7.1.3.4)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
Expand All @@ -28,22 +28,21 @@ GEM
bundler
rake
thor (>= 0.14.0)
base64 (0.1.1)
bigdecimal (3.1.4)
base64 (0.2.0)
bigdecimal (3.1.8)
byebug (11.1.3)
concurrent-ruby (1.2.2)
concurrent-ruby (1.3.3)
connection_pool (2.4.1)
docile (1.4.0)
drb (2.1.1)
ruby2_keywords
i18n (1.14.1)
docile (1.4.1)
drb (2.2.1)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
minitest (5.22.2)
mocha (2.1.0)
minitest (5.24.1)
mocha (2.4.5)
ruby2_keywords (>= 0.0.5)
mutex_m (0.1.2)
mysql2 (0.5.5)
rake (13.0.6)
mutex_m (0.2.0)
mysql2 (0.5.6)
rake (13.2.1)
retriable (3.1.2)
ruby2_keywords (0.0.5)
simplecov (0.22.0)
Expand All @@ -52,10 +51,10 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
thor (1.2.2)
timeout (0.4.0)
thor (1.3.1)
timeout (0.4.1)
toxiproxy (2.0.2)
trilogy (2.6.0)
trilogy (2.8.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)

Expand Down
6 changes: 2 additions & 4 deletions dev.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: lhm
up:
- homebrew:
- mysql-client@5.7:
or: [mysql@5.7]
conflicts: [shopify/shopify/mysql-client, mysql-connector-c, mysql, mysql-client]
- packages:
- mysql-client@5.7
- wget
- ruby
- bundler
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/activerecord_6.1.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
lhm-shopify (4.2.3)
lhm-shopify (4.3.0)
retriable (>= 3.0.0)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/activerecord_7.0.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
lhm-shopify (4.2.3)
lhm-shopify (4.3.0)
retriable (>= 3.0.0)

GEM
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/activerecord_7.1.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
lhm-shopify (4.2.3)
lhm-shopify (4.3.0)
retriable (>= 3.0.0)

GEM
Expand Down
7 changes: 7 additions & 0 deletions gemfiles/activerecord_head.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord", git: "https://github.com/rails/rails.git", branch: "main"

gemspec path: "../"
2 changes: 1 addition & 1 deletion lib/lhm/sql_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def supports_atomic_switch?
end

def struct_key(struct, key)
keys = if struct.is_a? Hash
keys = if struct.respond_to?(:keys)
struct.keys
else
struct.members
Expand Down
2 changes: 1 addition & 1 deletion lib/lhm/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# Schmidt

module Lhm
VERSION = '4.2.3'
VERSION = '4.3.0'
end
21 changes: 7 additions & 14 deletions spec/integration/lhm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,7 @@
:collate => collation,
})

result = select_one('SELECT login from users')
result = result['login'] if result.respond_to?(:has_key?)
result = select_value('SELECT login from users')
value(result).must_equal('a user')
end
end
Expand All @@ -353,8 +352,7 @@
:collate => collation,
})

result = select_one('SELECT `fnord` from users')
result = result['fnord'] if result.respond_to?(:has_key?)
result = select_value('SELECT `fnord` from users')
value(result).must_equal('Superfriends')
end
end
Expand All @@ -380,8 +378,7 @@
:collate => 'utf8mb4_unicode_ci',
})

result = select_one('SELECT `user_name` from users')
result = result['user_name'] if result.respond_to?(:has_key?)
result = select_value('SELECT `user_name` from users')
value(result).must_equal('a user')
end
end
Expand Down Expand Up @@ -410,8 +407,7 @@
:collate => nil,
})

result = select_one('SELECT `ref` from users')
result = result['ref'] if result.respond_to?(:has_key?)
result = select_value('SELECT `ref` from users')
value(result).must_equal(10)
end
end
Expand All @@ -437,8 +433,7 @@
:collate => collation,
})

result = select_one('SELECT `fnord` from users')
result = result['fnord'] if result.respond_to?(:has_key?)
result = select_value('SELECT `fnord` from users')
assert_nil(result)
end
end
Expand All @@ -462,8 +457,7 @@
:collate => collation,
})

result = select_one('SELECT `user_name` from users')
result = result['user_name'] if result.respond_to?(:has_key?)
result = select_value('SELECT `user_name` from users')
value(result).must_equal('a user')
end
end
Expand All @@ -489,8 +483,7 @@
:collate => collation,
})

result = select_one('SELECT `user_name` from users')
result = result['user_name'] if result.respond_to?(:has_key?)
result = select_value('SELECT `user_name` from users')
value(result).must_equal('a user')
end
end
Expand Down

0 comments on commit ee9050b

Please sign in to comment.