Skip to content
This repository has been archived by the owner on Jul 8, 2018. It is now read-only.

Commit

Permalink
Merge pull request mongoid#1 from semaperepelitsa/master
Browse files Browse the repository at this point in the history
Customized field
  • Loading branch information
pyromaniac committed Feb 3, 2012
2 parents 95235e6 + 2e31a85 commit 58f4de0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/mongoid/orderable_spec.rb
Expand Up @@ -36,6 +36,12 @@ class EmbeddedOrderable
embedded_in :embeds_orderable embedded_in :embeds_orderable
end end


class CustomizedOrderable
include Mongoid::Document
include Mongoid::Orderable

orderable :column => :pos
end


describe SimpleOrderable do describe SimpleOrderable do
before :each do before :each do
Expand Down Expand Up @@ -251,4 +257,14 @@ def positions


end end


describe CustomizedOrderable do
it 'does not have default position field' do
CustomizedOrderable.fields.should_not have_key('position')
end

it 'should have custom pos field' do
CustomizedOrderable.fields.should have_key('pos')
end
end

end end

0 comments on commit 58f4de0

Please sign in to comment.