Skip to content

Commit

Permalink
Stop passing keyword arguments to AR's enum
Browse files Browse the repository at this point in the history
This isn't supported in Rails 8.0 anymore.
  • Loading branch information
janko committed Oct 26, 2024
1 parent 7716775 commit b727fdd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gemfiles/Gemfile.rails-8.0
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ gemspec path: ".."
gem "rake", "~> 12.0"
gem "warning"

gem "rails", "~> 8.0.0.beta1"
gem "rails", "~> 8.0.0.rc1"
gem "sqlite3", "~> 2.0", platforms: :mri
gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby

Expand Down
2 changes: 1 addition & 1 deletion lib/generators/rodauth/templates/app/models/account.rb.tt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
class <%= table_prefix.camelize %> < ApplicationRecord
include Rodauth::Rails.model
<% if ActiveRecord.version >= Gem::Version.new("7.0") -%>
enum :status, unverified: 1, verified: 2, closed: 3
enum :status, { unverified: 1, verified: 2, closed: 3 }
<% else -%>
enum status: { unverified: 1, verified: 2, closed: 3 }
<% end -%>
Expand Down
2 changes: 1 addition & 1 deletion test/rails_app/app/models/account.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Account < ApplicationRecord
include Rodauth::Rails.model
if ActiveRecord.version >= Gem::Version.new("7.0")
enum :status, unverified: 1, verified: 2, closed: 3
enum :status, { unverified: 1, verified: 2, closed: 3 }
else
enum status: { unverified: 1, verified: 2, closed: 3 }
end
Expand Down

0 comments on commit b727fdd

Please sign in to comment.