Let's say I have a custom class with column names and email:
Class User < ActiveRecord::Base
attr_accessor :gender
end
user = User.new(:gender => 'male', :name => 'joe', :email => 'user@example.com')
If I need attributes that I can usually execute user.attributes, or user.inspect, or user.to_yaml. However, this does not give gender. Is there any way I can easily output everything?
source
share