Sha256: 8f5f85d03301cf96ffb2702f6a40b5fe8d407fd099c42504c3b453a5c354e0c6
Contents?: true
Size: 723 Bytes
Versions: 5
Compression:
Stored size: 723 Bytes
Contents
# frozen_string_literal: true module SocialNetworking # A statement by a Participant to be shared with the Group. class OnTheMindStatement < ActiveRecord::Base belongs_to :participant has_many :comments, as: "item", dependent: :destroy has_many :likes, as: "item", dependent: :destroy validates :participant, :description, presence: true scope :for_today, lambda { where( "created_at <= ? AND created_at >= ?", Time.zone.today.end_of_day, Time.zone.today.beginning_of_day ) } scope :for_week, lambda { where("created_at >= ?", Time.current.advance(days: -7).beginning_of_day) } def shared_description description end end end
Version data entries
5 entries across 5 versions & 1 rubygems