OSDN Git Service

v07
[pettanr/pettanr.git] / app / assets / javascripts / models / scroll.js.coffee
1 class Pettanr.Scroll extends Peta.Binder\r
2   \r
3   @singular: () ->\r
4     'Scroll'\r
5   \r
6   @plural: () ->\r
7     'Scrolls'\r
8   \r
9   defaults: {\r
10     id: null,\r
11     visible: 0\r
12   } \r
13   \r
14   overwrite: (options) ->\r
15     operators = Pettanr.cache.operators\r
16     return false if not operators.author\r
17     @set('author_id', operators.author.id)\r
18   \r
19   short: (column_name, length = 12) ->\r
20     _.escape(Pettanr.truncate(@get(column_name), length))\r
21   \r
22   initialize: (attr = {}, options = {}) ->\r
23     super(attr, options)\r
24   \r