OSDN Git Service

change: cache system
[pettanr/pettanr.git] / app / assets / javascripts / models / scroll.js.coffee
1 class Pettanr.Scroll extends Peta.Binder\r
2   url: '/scrolls/'\r
3   \r
4   @singular: () ->\r
5     'Scroll'\r
6   \r
7   @plural: () ->\r
8     'Scrolls'\r
9   \r
10   defaults: {\r
11     id: null,\r
12     visible: 0\r
13   } \r
14   \r
15   author: () ->\r
16     new Pettanr.Cache.Retriever(Pettanr.Author, @get('author_id'))\r
17   \r
18   overwrite: (options) ->\r
19     operators = options.operators\r
20     return false if not operators.author\r
21     @set('author_id', operators.author.id)\r
22   \r
23   initialize: () ->\r
24     if @id\r
25       @url = @url + @id\r
26   \r