OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[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.Author({id: @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
27 class Pettanr.Scroll.Collection extends Backbone.Collection\r
28   model: Pettanr.Scroll\r
29   url: '/scrolls'\r