OSDN Git Service

merge:
[pettanr/pettanr.git] / app / assets / javascripts / models / comic.js.coffee
index 8cb686a..98973a0 100644 (file)
@@ -14,7 +14,7 @@ class Pettanr.Comic extends Peta.Binder
   } \r
   \r
   author: () ->\r
-    new Pettanr.Author({id: @get('author_id')})\r
+    new Pettanr.Cache.Retriever(Pettanr.Author, @get('author_id'))\r
   \r
   is_visible: (operators) ->\r
     switch super(operators)\r
@@ -25,12 +25,15 @@ class Pettanr.Comic extends Peta.Binder
       else\r
         @get('visible') > 0\r
   \r
+  overwrite: (options) ->\r
+    operators = options.operators\r
+    return false if not operators.author\r
+    @set('author_id', operators.author.id)\r
+  \r
   symbol_filename: () ->\r
   \r
-  initialize: () ->\r
+  initialize: (attr = {}, options = {}) ->\r
+    super(attr, options)\r
     if @id\r
       @url = @url + @id\r
   \r
-class Pettanr.Comic.Collection extends Backbone.Collection\r
-  model: Pettanr.Comic\r
-  url: '/comics'\r