OSDN Git Service

v07
[pettanr/pettanr.git] / app / assets / javascripts / models / comic.js.coffee
index 3699848..de9689b 100644 (file)
@@ -1,5 +1,4 @@
 class Pettanr.Comic extends Peta.Binder\r
-  url: '/comics/'\r
   \r
   @singular: () ->\r
     'Comic'\r
@@ -13,10 +12,7 @@ class Pettanr.Comic extends Peta.Binder
     author_id: null\r
   } \r
   \r
-  author: () ->\r
-    new Pettanr.Author({id: @get('author_id')})\r
-  \r
-  is_visible: (operators) ->\r
+  is_visible: (operators = Pettanr.cache.operators) ->\r
     switch super(operators)\r
       when null\r
         return true\r
@@ -25,9 +21,13 @@ class Pettanr.Comic extends Peta.Binder
       else\r
         @get('visible') > 0\r
   \r
+  overwrite: (options) ->\r
+    operators = Pettanr.cache.operators\r
+    return false if not operators.author\r
+    @set('author_id', operators.author.id)\r
+  \r
   symbol_filename: () ->\r
   \r
-  initialize: () ->\r
-    if @id\r
-      @url = @url + @id\r
+  initialize: (attr = {}, options = {}) ->\r
+    super(attr, options)\r
   \r