Sha256: 78f0c8626e9f952fa699be877a7e83be66daf4ca62db6595c116a1761c13c28a

Contents?: true

Size: 624 Bytes

Versions: 53

Compression:

Stored size: 624 Bytes

Contents

# @deprecated, remove
class Ish::AppModel2
  include ::Mongoid::Document
  include ::Mongoid::Timestamps

  field :is_public,    :type => Boolean, :default => false
  field :is_trash,     :type => Boolean, :default => false

  default_scope ->{ where({ :is_public => true, :is_trash => false }).order_by({ :created_at => :desc }) }

  field :x, :type => Float
  field :y, :type => Float

  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


end

Version data entries

53 entries across 51 versions & 1 rubygems

Version Path
ish_models-0.0.33.176 lib/trash/app_model2.rb
ish_models-0.0.33.175 lib/ish/app_model2.rb
ish_models-0.0.33.174 lib/ish/app_model2.rb
ish_models-0.0.33.173 lib/ish/app_model2.rb
ish_models-0.0.33.172 lib/ish/app_model2.rb
ish_models-0.0.33.170 lib/ish/app_model2.rb
ish_models-0.0.33.169 lib/ish/app_model2.rb
ish_models-0.0.33.168 lib/ish/app_model2.rb
ish_models-0.0.33.167 lib/ish/app_model2.rb
ish_models-0.0.33.166 lib/ish/app_model2.rb
ish_models-0.0.33.164 lib/ish/app_model2.rb
ish_models-0.0.33.163 lib/ish/app_model2.rb
ish_models-0.0.33.162 lib/ish/app_model2.rb
ish_models-0.0.33.161 lib/ish/app_model2.rb
ish_models-0.0.33.160 lib/ish/app_model2.rb
ish_models-0.0.33.159 lib/ish/app_model2.rb
ish_models-0.0.33.158 lib/ish/app_model2.rb
ish_models-0.0.33.157 lib/ish/app_model2.rb
ish_models-0.0.33.156 lib/ish/app_model2.rb
ish_models-0.0.33.154 lib/ish/app_model2.rb