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

Commit

Permalink
Browse files Browse the repository at this point in the history
Updated :position property to be required and set the minimum value
  • Loading branch information
dkubb committed May 26, 2010
1 parent 92a2dfc commit c9a8089
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/dm-is-list/is/list.rb
Expand Up @@ -252,8 +252,8 @@ def is_list(options={})
extend DataMapper::Is::List::ClassMethods
include DataMapper::Is::List::InstanceMethods

unless properties.any? { |p| p.name == :position && p.primitive == Integer }
property :position, Integer
unless properties.any? { |p| p.kind_of?(Property::Integer) && p.name == :position }
property :position, Integer, :min => options[:first], :required => true
end

@list_options = options
Expand Down

0 comments on commit c9a8089

Please sign in to comment.