Class: AppModel2

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/app_model2.rb

Class Method Summary collapse

Class Method Details

.list(conditions = { :is_trash => false }) ⇒ Object


14
15
16
17
# File 'lib/app_model2.rb', line 14

def self.list conditions = { :is_trash => false }
  out = self.where( conditions ).order_by( :created_at => :desc )
  [['', nil]] + out.map { |item| [ "#{item.created_at.strftime('%Y%m%d')} #{item.name}", item.id ] }
end