foalfetch/app/models/visit_count.rb

15 lines
344 B
Ruby
Raw Normal View History

2024-07-30 15:56:47 +02:00
# frozen_string_literal: true
2024-04-14 00:19:59 +02:00
# == Schema Information
#
# Table name: visit_counts
#
# id :bigint not null, primary key
# count :integer default(0), not null
# date :date not null
#
class VisitCount < ApplicationRecord
def self.for_today
VisitCount.find_or_create_by(date: Time.zone.today)
end
end