All threads / How do I extend enum method?
Ask A Question


You’re not receiving notifications from this thread.

How do I extend enum method?

Amie Walton asked in Rails

Is there a simple way to either extend the enum methods OR to override the current bang method? I have a lot of enum statuses that I update with bang. However, the rails enum bang method is written to update all rather than update_attribute. I don't want my use of this method to trigger a ton of validations on the class just to change one status. Has anyone else run into this?

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 66,029+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.