2011-07-27 20:34:30 +02:00
|
|
|
class Message < ActiveRecord::Base
|
2011-08-02 23:12:17 +02:00
|
|
|
belongs_to :user
|
|
|
|
|
|
|
|
#cattr_reader :per_page
|
|
|
|
#@@per_page = $defaults["msgs_per_page"]
|
|
|
|
|
|
|
|
def self.getPageForUser(user,page,order = "date desc")
|
|
|
|
#Message.paginate :page => page , :per_page => user.prefs.msgs_per_page.to_i, :conditions=> ['user_id = ?', user.id],:order => order
|
|
|
|
|
|
|
|
Message.paginate :page => page , :per_page => 50, :conditions=> ['user_id = ?', user.id],:order => order
|
|
|
|
end
|
|
|
|
|
2011-07-27 20:34:30 +02:00
|
|
|
end
|