Sha256: 08045c7d32c3d50f46316e95930a1386edb942ce4acbcf0fcf31e409ef28f181
Contents?: true
Size: 1.18 KB
Versions: 26
Compression:
Stored size: 1.18 KB
Contents
# -*- encoding : utf-8 -*- class Jinda::Doc include Mongoid::Document include Mongoid::Timestamps field :name, :type => String field :filename, :type => String field :content_type, :type => String field :data_text, :type => String field :url, :type => String field :basename, :type => String field :cloudinary, :type => Boolean belongs_to :xmain, :class_name => "Jinda::Xmain" belongs_to :runseq, :class_name => "Jinda::Runseq" belongs_to :user belongs_to :service, :class_name => "Jinda::Service" field :ip, :type => String field :ma_display, :type => Boolean field :ma_secured, :type => Boolean 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 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 end
Version data entries
26 entries across 26 versions & 1 rubygems