This adds a method value_for_database to the Tod::TimeOfDay class. When ActiveRecord is preparing to 'quote' an object for use in a SQL query, it asks the object if it responds to this method. If so, it calls quote() with the return value rather than with the object itself.
This will allow usage of instances of Tod::TimeOfDay when building queries:
This adds a method
value_for_database
to the Tod::TimeOfDay class. When ActiveRecord is preparing to 'quote' an object for use in a SQL query, it asks the object if it responds to this method. If so, it callsquote()
with the return value rather than with the object itself.This will allow usage of instances of Tod::TimeOfDay when building queries: