OSDN Git Service

change: cache system
[pettanr/pettanr.git] / app / assets / javascripts / models / sheet.js.coffee
index 6b1c72b..959a870 100644 (file)
@@ -14,7 +14,12 @@ class Pettanr.Sheet extends Peta.Root
   } \r
   \r
   author: () ->\r
-    new Pettanr.Author({id: @get('author_id')})\r
+    new Pettanr.Cache.Retriever(Pettanr.Author, @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
   is_visible: (operators) ->\r
     switch super(operators)\r
@@ -29,6 +34,3 @@ class Pettanr.Sheet extends Peta.Root
     if @id\r
       @url = @url + @id\r
   \r
-class Pettanr.Sheet.Collection extends Backbone.Collection\r
-  model: Pettanr.Sheet\r
-  url: '/sheets'\r