Sha256: 724ed4ceb12c04bfec85f7ccb637ff753020894ecbcd0207e7911f2b71102962

Contents?: true

Size: 590 Bytes

Versions: 1

Compression:

Stored size: 590 Bytes

Contents

module Dropmark
  class Collection
    include Her::Model
    uses_api Dropmark.api
    
    has_many :users
    has_many :items
    custom_get :count
    
    after_find do |i|
      begin
        i.created_at = Time.parse(i.created_at)
        i.updated_at = Time.parse(i.updated_at)
        i.last_accessed_at = Time.parse(i.last_accessed_at)
      rescue
      end
    end
    
    def self.sort(order)
      items = put("collections", :order => order)
    end
    
    def sort_items(order)
      items = Dropmark::Item.put("collections/#{id}/items", :order => order)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dropmark-0.1.5 lib/dropmark/collection.rb