I'm attempting to reformat a date being returned by from the database (Date format) as a formatted string (format: %m%d%y) in order for it to be output by a separate client application.
Formatting it on the client side is not an option as only the web app is under our control.
def as_json(options={})
super(
:except => [:id, :created_at, :updated_at],
:include => {
:children => {
:except => [:created_at, :updated_at]
}
}
).merge(:tasks_total => self.tasks_total)
end
I've attempted to use a after_initialize callback, however that simply result in a nill value being passed to the client.
Any help much appreciated.