OSDN Git Service

fix sign in,out
[pettanr/pettanr.git] / app / assets / javascripts / models / scroll.js.coffee
index f26e2d8..c312605 100644 (file)
@@ -1,2 +1,26 @@
 class Pettanr.Scroll extends Peta.Binder\r
-\r
+  url: '/scrolls/'\r
+  \r
+  @singular: () ->\r
+    'Scroll'\r
+  \r
+  @plural: () ->\r
+    'Scrolls'\r
+  \r
+  defaults: {\r
+    id: null,\r
+    visible: 0\r
+  } \r
+  \r
+  author: () ->\r
+    new Pettanr.Author({id: @get('author_id')})\r
+  \r
+  overwrite: (options) ->\r
+    operators = options.operators\r
+    return false if not operators.author\r
+    @set('author_id', operators.author.id)\r
+  \r
+  initialize: () ->\r
+    if @id\r
+      @url = @url + @id\r
+  \r