Skip to content

Commit a04145b

Browse files
authored
Support newer rails and test against it (#164)
* Support newer rails and test against it * Address feedback * Address more feedback
1 parent 3cbfc65 commit a04145b

File tree

7 files changed

+13
-10
lines changed

7 files changed

+13
-10
lines changed

.github/workflows/test-postgresql.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
strategy:
88
matrix:
99
entry:
10-
- { ruby: 2.6.2, postgresql: 11 }
11-
- { ruby: 3.1.1, postgresql: 11 }
12-
- { ruby: 3.1.1, postgresql: 14 }
13-
name: test (ruby=${{ matrix.entry.ruby }}, postgresql=${{ matrix.entry.postgresql }})
10+
- { ruby: 2.6.2, postgresql: 11, active_record: '~> 6.0.0' }
11+
- { ruby: 3.1.1, postgresql: 11, active_record: '~> 6.1.0' }
12+
- { ruby: 3.1.1, postgresql: 14, active_record: '~> 7.0.0' }
13+
name: test (ruby=${{ matrix.entry.ruby }}, postgresql=${{ matrix.entry.postgresql }}, active_record=${{ matrix.entry.active_record }})
1414
steps:
1515
- uses: actions/checkout@v2
1616
- uses: ruby/setup-ruby@v1
@@ -30,6 +30,7 @@ jobs:
3030
uses: GabrielBB/xvfb-action@v1
3131
env:
3232
DATABASE_ADAPTER: activerecord
33+
ACTIVERECORD_VERSION: ${{ matrix.entry.active_record }}
3334
DATABASE_URL: postgres://test:password@localhost/slack_ruby_bot_server_test
3435
with:
3536
run: |

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
### Changelog
22

3-
### 2.0.2 (Next)
3+
### 2.1.0 (Next)
44

55
* [#163](https://github.com/slack-ruby/slack-ruby-bot-server/pull/163): Updated releasing documentation - [@crazyoptimist](https://github.com/crazyoptimist).
6+
* [#164](https://github.com/slack-ruby/slack-ruby-bot-server/pull/164): Support rails 6.1 and 7.0 and test against it - [@maths22](https://github.com/maths22).
67
* Your contribution here.
78

89
#### 2.0.1 (2023/02/20)

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ when 'mongoid' then
77
gem 'mongoid-scroll'
88
gem 'mongoid-shell'
99
when 'activerecord' then
10-
gem 'activerecord', '~> 6.0.0'
10+
gem 'activerecord', ENV['ACTIVERECORD_VERSION'] || '~> 6.0.0'
1111
gem 'otr-activerecord'
1212
gem 'pagy_cursor'
1313
gem 'pg'

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ gem 'slack-ruby-bot-server'
6666
#### ActiveRecord
6767

6868
Use ActiveRecord with, for example, PostgreSQL via [pg](https://github.com/ged/ruby-pg). Add the `activerecord`, `pg`, `otr-activerecord` and `pagy_cursor` gems to your Gemfile.
69+
Currently supports ActiveRecord/Rails major versions 6.0, 6.1 and 7.0.
6970

7071
```
7172
gem 'pg'

lib/slack-ruby-bot-server/api/endpoints/teams_endpoint.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class TeamsEndpoint < Grape::API
8484
if team
8585
team.ping_if_active!
8686

87-
team.update_attributes!(
87+
team.update!(
8888
oauth_version: oauth_version,
8989
oauth_scope: oauth_scope,
9090
activated_user_id: user_id,

lib/slack-ruby-bot-server/models/team/methods.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ module Methods
1313
validates_presence_of :team_id
1414

1515
def deactivate!
16-
update_attributes!(active: false)
16+
update!(active: false)
1717
end
1818

1919
def activate!(token)
20-
update_attributes!(active: true, token: token)
20+
update!(active: true, token: token)
2121
end
2222

2323
def to_s
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module SlackRubyBotServer
2-
VERSION = '2.0.2'.freeze
2+
VERSION = '2.1.0'.freeze
33
end

0 commit comments

Comments
 (0)