bibendi / activerecord-postgres_enum

Integrate PostgreSQL's enum data type into ActiveRecord's schema and migrations.
MIT License
361 stars 24 forks source link

Error running with Rails 7.0 alpha #50

Closed noelrappin closed 3 years ago

noelrappin commented 3 years ago

Describe the bug activerecord-postgres_enum is not compatible with Rails 7.0 alpha

To Reproduce Upgrade to Rails 7.0 alpha Run db:migrate

Error:

ArgumentError: wrong number of arguments (given 1, expected 0)

/Users/noel/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/rails-061bf3156fb9/activemodel/lib/active_model/type/value.rb:8:in `initialize'
/Users/noel/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/gems/activerecord-postgres_enum-0.6.0/lib/active_record/postgres_enum/extensions.rb:12:in `initialize'
/Users/noel/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/gems/activerecord-postgres_enum-0.6.0/lib/active_record/postgres_enum/extensions.rb:19:in `new'
/Users/noel/.asdf/installs/ruby/3.0.2/lib/ruby/gems/3.0.0/gems/activerecord-postgres_enum-0.6.0/lib/active_record/postgres_enum/extensions.rb:19:in `register_enum_type'

Expected behavior No error

Context (please complete the following information):

bouk commented 3 years ago

You're using version 0.6.0, it works on 1.6.1

noelrappin commented 3 years ago

I tried that today, it appears that 1.6.1 needs to change its dependencies to allow for Rails 7.

activerecord-postgres_enum (= 1.6.1) was resolved to 1.6.1, which depends on
      activerecord (>= 5, < 6.2)

Thanks!

noelrappin commented 3 years ago

https://github.com/noelrappin/activerecord-postgres_enum I can submit it as a PR if you'd like

dpaluy commented 3 years ago

@bibendi Can you please release the fix for Rails 7?

bibendi commented 3 years ago

Sure. Will do it this week.