Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 8.0 support #182

Merged
merged 2 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- gemfiles/Gemfile.rails-7.0
- gemfiles/Gemfile.rails-7.1
- gemfiles/Gemfile.rails-7.2
- gemfiles/Gemfile.rails-8.0
orm:
- active_record
- mongoid
Expand All @@ -47,16 +48,18 @@ jobs:
ruby-version: 3.2.4
- gemfile: gemfiles/Gemfile.rails-7.2
ruby-version: 3.3.4
- gemfile: gemfiles/Gemfile.rails-8.0
ruby-version: 3.3.6
- gemfile: Gemfile
ruby-version: 3.3.3
ruby-version: 3.3.6
orm: active_record
test-db: mysql
- gemfile: Gemfile
ruby-version: 3.3.3
ruby-version: 3.3.6
orm: active_record
test-db: postgresql
- gemfile: Gemfile
ruby-version: 3.3.3
ruby-version: 3.3.6
orm: mongoid
test-db: mongodb
- gemfile: Gemfile
Expand All @@ -74,6 +77,8 @@ jobs:
orm: dynamoid
- gemfile: gemfiles/Gemfile.rails-7.2
orm: dynamoid
- gemfile: gemfiles/Gemfile.rails-8.0
orm: dynamoid

env:
RAILS_ENV: test
Expand Down
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ source 'https://rubygems.org'

gemspec

gem 'rails', '~> 7.1.0'
gem 'rails', '~> 8.0.0'

group :production do
gem 'sprockets-rails'
gem 'puma'
gem 'pg'
gem 'devise'
gem 'devise_token_auth'
# https://github.com/lynndylanhurley/devise_token_auth/pull/1639
gem 'devise_token_auth', git: 'https://github.com/lynndylanhurley/devise_token_auth.git'
gem 'sqlite3', ">= 2.1"
end

group :development do
Expand Down
2 changes: 1 addition & 1 deletion activity_notification.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]
s.required_ruby_version = '>= 2.1.0'

s.add_dependency 'railties', '>= 5.0.0', '< 7.3'
s.add_dependency 'railties', '>= 5.0.0', '< 8.1'
s.add_dependency 'i18n', '>= 0.5.0'
s.add_dependency 'jquery-rails', '>= 3.1.1'
s.add_dependency 'swagger-blocks', '>= 3.0.0'
Expand Down
2 changes: 0 additions & 2 deletions gemfiles/Gemfile.rails-7.2
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ gemspec path: '../'

gem 'rails', '~> 7.2.0'
gem 'sprockets-rails'
# https://github.com/lynndylanhurley/devise_token_auth/pull/1632
gem 'devise_token_auth', git: 'https://github.com/lynndylanhurley/devise_token_auth.git'

group :development do
gem 'bullet'
Expand Down
26 changes: 26 additions & 0 deletions gemfiles/Gemfile.rails-8.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
source 'https://rubygems.org'

gemspec path: '../'

gem 'rails', '~> 8.0.0'
gem 'sprockets-rails'
# https://github.com/lynndylanhurley/devise_token_auth/pull/1639
gem 'devise_token_auth', git: 'https://github.com/lynndylanhurley/devise_token_auth.git'

group :development do
gem 'bullet'
gem 'rack-cors'
gem 'sqlite3'
end

group :test do
gem 'rails-controller-testing'
gem 'ammeter'
gem 'timecop'
gem 'committee'
gem 'committee-rails', '< 0.6'
# gem 'coveralls', require: false
gem 'coveralls_reborn', require: false
end

gem 'dotenv-rails', groups: [:development, :test]
4 changes: 2 additions & 2 deletions lib/activity_notification/rails/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def notify_to(*resources)
if options[:with_devise].present? && options[:devise_default_routes].present?
create_notification_routes options, resources_options
else
self.resources target, only: :none do
self.resources target, only: [] do
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because of rails/rails#51464 - all tests now pass, but I'm unsure of your intention @simukappu with this code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @simukappu any feedback?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry for my very late response. I'm not sure with my original intent, but this modification seems fine. I'll merge your PR and update this gem. Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simukappu no problem, this gem is much appreciated.

create_notification_routes options, resources_options
end
end
Expand Down Expand Up @@ -348,7 +348,7 @@ def subscribed_by(*resources)
if options[:with_devise].present? && options[:devise_default_routes].present?
create_subscription_routes options, resources_options
else
self.resources target, only: :none do
self.resources target, only: [] do
create_subscription_routes options, resources_options
end
end
Expand Down
Loading