advanced patterns when using custom enumerations in ActiveRecord with Rails 7.1
I'm experiencing an scenario with custom enumerations in my ActiveRecord model in Rails 7.1. I have a model called `Order` with a custom enumeration for the order status, defined as follows: ```ruby class Order < ApplicationRecord enum status: { pending: 0, completed: 1, canceled: 2 } end ``` However, when I try to create a new order with the status set to `:completed`, it seems to store the value correctly, but when I retrieve it, I get an unexpected result. For example: ```ruby order = Order.create(status: :completed) puts order.status # should print 'completed' ``` Instead, it prints `"1"` which is the integer value associated with `:completed`. This is not what I expected because I thought ActiveRecord would automatically convert it to the symbol when accessed. I have confirmed that there are no custom getter methods that might interfere with this. I tried adding the `default` option to the enum declaration: ```ruby enum status: { pending: 0, completed: 1, canceled: 2 }, _default: :pending ``` But it did not resolve the scenario. I also checked the database and confirmed that the `status` column in the `orders` table is of type `integer`. Is there some additional configuration I need to consider, or is there a specific way to retrieve the enum value as a symbol? Any insights would be greatly appreciated!