lib/troo/models/board.rb in troo-0.0.8 vs lib/troo/models/board.rb in troo-0.0.9

- old
+ new

@@ -5,37 +5,45 @@ attribute :name attribute :description attribute :default, Type::Boolean attribute :closed, Type::Boolean - attribute :external_board_id + attribute :external_id + attribute :short_id index :default - index :external_board_id + index :external_id + index :short_id - alias_method :default?, :default + alias_method :default?, :default - def self.remote(id, options = {}) - External::Board.fetch(id, options).first + class << self + def remote + Remote::Board + end + + def type + :board + end end def lists - Troo::List.find(external_board_id: external_board_id) + Troo::List.find(external_board_id: external_id) end def cards - Troo::Card.find(external_board_id: external_board_id) + Troo::Card.find(external_board_id: external_id) end def decorator(options = {}) - Decorators::Board.new(self, options) + Decorators::Resource.new(self, options) end def presenter(options = {}) - Presenters::Board.new(self, options) + Presenters::Board.new(decorator, options) end - def set_default! - Behaviours::SetDefault.for(self) + def type + self.class.type end end end