Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4627

How can I fix "Unknown enum attribute" after Rails 7.1 upgrade?

$
0
0

Hi I have this Company model with the following enum that works fine for rails < 7.1

class Company < ApplicationRecord  enum auth_type: {    password: 'password',    magic_link: 'magic_link',    google: 'google',    microsoft: 'microsoft',    saml: 'saml',    workos: 'workos',    developer: 'developer'  }, _prefix: :auth_byend

Once I try to upgrade to rails 7.1 it stops working because it breaks on the migrations already on CI, with the following error:

Unknown enum attribute 'auth_type' for Company/home/runner/work/clearyapp/clearyapp/vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.0/lib/active_record/enum.rb:174:in `block in load_schema!'

I saw this error raising was added in 7.1 here https://my.diffend.io/gems/activerecord/7.0.8/7.1.0/page/26#d2h-285143-749

The thing I don't understand is how I should fix it if the error doesn't tell me anything useful. It is a known enum attribute =/

Does anyone have an idea of how to fix it?


Viewing all articles
Browse latest Browse all 4627

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>