Sha256: 8f4aa5a003e60f3cdf06b1799e9254d2464c7a25ce15a5b59dd839c62c95267c

Contents?: true

Size: 1.15 KB

Versions: 10

Compression:

Stored size: 1.15 KB

Contents

class Event # for safe_update, and Timestamp
  include MongoMapper::Document

  key :start_date, Timestamp
  key :end_date, Timestamp

  key :password, String
end

class Recipe # for Set
  include MongoMapper::Document
  include MongoMapperExt::Filter

  language Proc.new { |d| d.language }
  filterable_keys :language

  key :ingredients, Set
  key :description, String
  key :language, String, :default => 'en'
end

class Avatar # for Storage and File
  include MongoMapper::Document
  include MongoMapperExt::Storage

  file_key :data

  file_list :alternatives
  file_key :first_alternative, :in => :alternatives
end

class UserConfig #for OpenStruct
  include MongoMapper::Document
  key :entries, OpenStruct
end

class BlogPost # for Slug and Filter
  include MongoMapper::Document
  include MongoMapperExt::Filter
  include MongoMapperExt::Slugizer
  include MongoMapperExt::Tags

  filterable_keys :title, :body, :tags, :date
  slug_key :title, :max_length => 18, :min_length => 3, :callback_type => :before_validation
  language :find_language

  key :title, String
  key :body, String
  key :tags, Array
  key :date, Time

  def find_language
    'en'
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mongomapper_ext-0.5.2 test/models.rb
mongomapper_ext-0.5.1 test/models.rb
mongomapper_ext-0.5.0 test/models.rb
mongomapper_ext-0.4.0 test/models.rb
mongomapper_ext-0.3.0 test/models.rb
mongomapper_ext-0.2.4 test/models.rb
mongomapper_ext-0.2.3 test/models.rb
mongomapper_ext-0.2.2 test/models.rb
mongomapper_ext-0.2.1 test/models.rb
mongomapper_ext-0.2.0 test/models.rb