Skip to content

Commit

Permalink
add list position to registered attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
rossta committed Jan 12, 2013
1 parent 5c8bf2c commit 0e2b62c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/trello/list.rb
@@ -1,7 +1,7 @@
module Trello
# A List is a container which holds cards. Lists are items on a board.
class List < BasicData
register_attributes :id, :name, :closed, :board_id, :readonly => [ :id, :board_id ]
register_attributes :id, :name, :closed, :board_id, :pos, :readonly => [ :id, :board_id ]
validates_presence_of :id, :name, :board_id
validates_length_of :name, :in => 1..16384

Expand All @@ -28,6 +28,7 @@ def update_fields(fields)
attributes[:name] = fields['name']
attributes[:closed] = fields['closed']
attributes[:board_id] = fields['idBoard']
attributes[:pos] = fields['pos']
self
end

Expand Down
4 changes: 4 additions & 0 deletions spec/list_spec.rb
Expand Up @@ -42,6 +42,10 @@ module Trello
it "has a board" do
@list.board.should == Board.new(boards_details.first)
end

it "gets its position" do
@list.pos.should == lists_details.first['pos']
end
end

context "actions" do
Expand Down

0 comments on commit 0e2b62c

Please sign in to comment.