Sha256: 1e3453350d992acc81b5e02f9746cdabe7e7ff3da92e5e5f78f132ecda15c039

Contents?: true

Size: 387 Bytes

Versions: 10

Compression:

Stored size: 387 Bytes

Contents

# -*- encoding : utf-8 -*-
class Jinda::Notice
  include Mongoid::Document
  include Mongoid::Timestamps
  field :message, :type => String
  field :unread, :type => Boolean
  field :ip, :type => String
  belongs_to :user, :class_name => "Jinda::User"

  def self.recent(user_id, ip)
    where(unread: true, ip: ip).last
    # where(unread: true, user_id: user_id, ip: ip).last
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
jinda-0.4.3 lib/generators/jinda/templates/app/models/jinda/notice.rb
jinda-0.4.2 lib/generators/jinda/templates/app/models/jinda/notice.rb
jinda-0.4.1 lib/generators/jinda/templates/app/models/jinda/notice.rb
jinda-0.4.0 lib/generators/jinda/templates/app/models/jinda/notice.rb
jinda-0.3.9 lib/generators/jinda/templates/app/models/jinda/notice.rb
jinda-0.3.8 lib/generators/jinda/templates/app/models/jinda/notice.rb
jinda-0.3.7 lib/generators/jinda/templates/app/models/jinda/notice.rb
jinda-0.3.6 lib/generators/jinda/templates/app/models/jinda/notice.rb
jinda-0.3.5 lib/generators/jinda/templates/app/models/jinda/notice.rb
jinda-0.3.4 lib/generators/jinda/templates/app/models/jinda/notice.rb