Sha256: 3671817fed6eb1abb37d73e4c0bd4692549e20993ed15e4c5d9d3dbfeee26a33
Contents?: true
Size: 776 Bytes
Versions: 9
Compression:
Stored size: 776 Bytes
Contents
require "uri" require "not_relational/domain_model.rb" class Comment < NotRelational::DomainModel property :id,:string,:is_primary_key=>true property :title , :string property :content , :string property :posted_time , :date property :mediaitem_id , :string property :parent_id , :string property :user_name , :string property :namespace , :string belongs_to :Mediaitem def Comment.recent Comment.find(:all, :limit => 16 ,:order_by =>:posted_time ,:order => :descending) end def Comment.recent_by_user(user_name) Comment.find(:all, :limit => 16 ,:order_by =>:posted_time ,:order => :descending,:params => {:user_name=>user_name}) end def user_url return "/users/#{CGI.escape self.user_name}" end end
Version data entries
9 entries across 9 versions & 1 rubygems