I am looking to set an attribute_accessor with a datatype associated with it like how we have fields in the model that have database that have datatypes like string , integer etc associated with them.
How do i tell rails that my attr_accessor should respond to a specific datatype. I am looking to set a datetime to one the accessor i am trying to create,
Please suggest.
You can make a custom setter like
just off of the top of my head
Also, duplicate question: attr_accessor strongly typed Ruby on Rails