class Jinda::Doc
Public Class Methods
search(q, page, per_page=PER_PAGE)
click to toggle source
# File lib/generators/jinda_engine/templates/app/models/jinda/doc.rb, line 24 def self.search(q, page, per_page=PER_PAGE) paginate :per_page=>per_page, :page => page, :conditions => ["content_type=? AND data_text LIKE ? AND (ma_secured=? OR ma_user_id=?)", "output", "%#{q}%", false, session[:user_id] ], :order=>'ma_xmain_id DESC', :select=>'DISTINCT ma_xmain_id' end
search_ma_secured(q, page, per_page=PER_PAGE)
click to toggle source
# File lib/generators/jinda_engine/templates/app/models/jinda/doc.rb, line 30 def self.search_ma_secured(q, page, per_page=PER_PAGE) paginate :per_page=>per_page, :page => page, :conditions => ["content_type=? AND data_text LIKE ?", "output", "%#{q}%" ], :order=>'ma_xmain_id DESC', :select=>'DISTINCT ma_xmain_id' end