Sha256: f3712e58b8ff87d181a9a2fccfcfd310826d23869bbd79e2f058f278c773569a

Contents?: true

Size: 630 Bytes

Versions: 22

Compression:

Stored size: 630 Bytes

Contents

# frozen_string_literal: true

module Thredded
  # The state of a user with regards to a messageboard, such as the last time the user was active (visited)
  # the messageboard.
  class MessageboardUser < ActiveRecord::Base
    belongs_to :messageboard,
               class_name:  'Thredded::Messageboard',
               foreign_key: :thredded_messageboard_id,
               inverse_of:  :messageboard_users
    belongs_to :user_detail, class_name: 'Thredded::UserDetail', foreign_key: :thredded_user_detail_id
    scope :recently_active, -> { where(arel_table[:last_seen_at].gt(Thredded.active_user_threshold.ago)) }
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
thredded-0.12.3 app/models/thredded/messageboard_user.rb
thredded-0.12.2 app/models/thredded/messageboard_user.rb