OSDN Git Service

v07
[pettanr/pettanr.git] / app / assets / javascripts / models / comic.js.coffee
1 class Pettanr.Comic extends Peta.Binder\r
2   \r
3   @singular: () ->\r
4     'Comic'\r
5   \r
6   @plural: () ->\r
7     'Comics'\r
8   \r
9   defaults: {\r
10     id: null,\r
11     visible: 0,\r
12     author_id: null\r
13   } \r
14   \r
15   is_visible: (operators = Pettanr.cache.operators) ->\r
16     switch super(operators)\r
17       when null\r
18         return true\r
19       when false\r
20         return false\r
21       else\r
22         @get('visible') > 0\r
23   \r
24   overwrite: (options) ->\r
25     operators = Pettanr.cache.operators\r
26     return false if not operators.author\r
27     @set('author_id', operators.author.id)\r
28   \r
29   symbol_filename: () ->\r
30   \r
31   initialize: (attr = {}, options = {}) ->\r
32     super(attr, options)\r
33   \r