Hourly backup, only if something has changed

You could check whether a post/topic/user was created/updated in the last hour. Something like this

def has_something_changed_since?(date=1.hour.ago)
  [User, Post, Topic].any? { |klass| klass.exists?("created_at >= :date OR updated_at >= :date", date: date) }
end
1 Like