Sha256: 4a12514b561b748a81ef2667c93a7dd2c029934cfe9d63addf0303bb4e3a14f4

Contents?: true

Size: 692 Bytes

Versions: 6

Compression:

Stored size: 692 Bytes

Contents

# == Schema Information
#
# Table name: tally_records
#
#  id              :integer          not null, primary key
#  day             :date
#  recordable_id   :integer
#  recordable_type :string
#  key             :string
#  value           :integer          default(0)
#  created_at      :datetime         not null
#  updated_at      :datetime         not null
#

module Tally
  class Record < ApplicationRecord

    validates :day, presence: true
    validates :key, presence: true

    belongs_to :recordable, polymorphic: true, optional: true

    scope :today, -> { where(day: Time.current.utc.to_date) }

    def self.search(*args)
      RecordSearcher.search(*args)
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tally-2.1.0 app/models/tally/record.rb
tally-2.0.0 app/models/tally/record.rb
tally-1.0.2 app/models/tally/record.rb
tally-1.0.1 app/models/tally/record.rb
tally-1.0.0 app/models/tally/record.rb
tally-1.0.0.beta1 app/models/tally/record.rb