Sha256: 54da7563a0c255764ffb332af566659d97255c6f0896e97ef7c3f5976aa91c74

Contents?: true

Size: 393 Bytes

Versions: 1

Compression:

Stored size: 393 Bytes

Contents

require 'mongoid-sortable'

class ParentDocument
	include Mongoid::Document

	has_many :documents
end

class Document
	include Mongoid::Document
	include Mongoid::Sortable

	belongs_to :parent_document
	embeds_many :embedded_documents
	sortable scope: [:parent_document_id]
end

class EmbeddedDocument
	include Mongoid::Document
	include Mongoid::Sortable

	embedded_in :document
	sortable
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongoid-sortable-0.0.1 spec/support/models.rb