I am trying to iterate over the properties of an ActiveRecord object. I searched on the Internet, but I’m coming up all the time. I thought I was warm with object.to_enum, but despite the fact that this returns an Enumerator object, I still get the error message "every" undefined for my object.
Calling object.methods gives me a bunch of inherited things that I don't want. Calling object.instance_variables does not give me anything close to what I'm looking for. I guess this is not difficult, but I have not figured it out yet. Can anyone help? Thank!
source
share