Marie-Therese Fischer
fischer.codes
Marie-Therese Fischer
@fischer.codes
Developer, Social Scientist and Wilderness Mentor from Vienna

Or you could just call me:
Nerd, Solarpunk and Herb Witch 😁✌️
24 HOURS!!!!!!!!
April 1, 2025 at 11:13 PM
And throws: `You tried to define an enum named "status" on the model "Task", but this will generate a instance method "working_on_this?", which is already defined by another enum. (ArgumentError)`

Which is obviously bullsh*t and you're like WHAAAAAT?? 😅

(see report github.com/rails/rails/...)
ArgumentError (You tried to define an enum named "availabilty_type" on the model "Product", but this will generate a instance method "regular?", which is already defined by another enum. · Issue #4053...
Saw many issues relating to this problem but all seem to come down to the use of the same value for different enums within the same model, which can be resolved with the use of _suffix or _prefix. ...
github.com
March 16, 2025 at 4:41 PM
So you got

```
class Task < ApplicationRecord
enum :status, {
working_on_this: 0,
closed: 1
}

validates :owner_id, on: :update
end
```

The `validates` is obviously missing something like `presence: true`. But Rails thinks your `enum` above is the problem.
March 16, 2025 at 4:41 PM
When I need to stay focused for a longer period of time: open.spotify.com/playlist/37i...
Your Favorite Coffeehouse
Playlist · Spotify · 140 items · 4.1M saves
open.spotify.com
December 7, 2024 at 8:28 AM
Thank you @hansschnedlitz.com and @hola-soy-milk.online for reviving this meetup 😊
December 6, 2024 at 10:01 AM