179
You could definitely use the attributes to return all attributes but you could add an instance method to Post, call it "to_hash" and have it return the data you would like in a hash. Something like
def to_hash
{ name: self.name, active: true }
end