Sha256: f4d2c00ef9a4e812426621cd6c6904e2986d750781cc6d84cab35e3535617be5

Contents?: true

Size: 281 Bytes

Versions: 63

Compression:

Stored size: 281 Bytes

Contents

module MyForum
  class PrivateMessage < ActiveRecord::Base
    scope :unread_count_for, -> (user) { where(recipient_id: user.id, unread: true).count }
    scope :inbox_for, -> (user) { where(recipient_id: user.id).order('created_at DESC') }

    attr_accessor :recipient
  end
end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
my_forum-0.0.2.4 app/models/my_forum/private_message.rb
my_forum-0.0.2.3 app/models/my_forum/private_message.rb
my_forum-0.0.2.2 app/models/my_forum/private_message.rb
my_forum-0.0.2.1 app/models/my_forum/private_message.rb
my_forum-0.0.2 app/models/my_forum/private_message.rb
my_forum-0.0.1.beta60 app/models/my_forum/private_message.rb
my_forum-0.0.1.beta59 app/models/my_forum/private_message.rb
my_forum-0.0.1.beta58 app/models/my_forum/private_message.rb
my_forum-0.0.1.beta57 app/models/my_forum/private_message.rb
my_forum-0.0.1.beta56 app/models/my_forum/private_message.rb
my_forum-0.0.1.beta55 app/models/my_forum/private_message.rb
my_forum-0.0.1.beta54 app/models/my_forum/private_message.rb
my_forum-0.0.1.beta53 app/models/my_forum/private_message.rb
my_forum-0.0.1.beta52 app/models/my_forum/private_message.rb
my_forum-0.0.1.beta51 app/models/my_forum/private_message.rb
my_forum-0.0.1.beta50 app/models/my_forum/private_message.rb
my_forum-0.0.1.beta49 app/models/my_forum/private_message.rb
my_forum-0.0.1.beta48 app/models/my_forum/private_message.rb
my_forum-0.0.1.beta47 app/models/my_forum/private_message.rb
my_forum-0.0.1.beta46 app/models/my_forum/private_message.rb