–still learning rails here.. I want to write a conditional statement such as:
if variable.created_at.method_for_checking_if_older_than(10 minutes)
#code
end
What statement or method can i use on a created_at value to fulfil the purpose of checking if it is older than a certain number of minutes/hours etc..?
You’re looking for this:
Rails adds several such methods to the standard Ruby Numeric class, a full list is available from the Rails API documentation: