OSDN Git Service

fix: show's destroy button
[pettanr/pettanr.git] / app / assets / javascripts / models / story.js.coffee
index ba4f06c..606df47 100644 (file)
@@ -1,5 +1,4 @@
 class Pettanr.Story extends Peta.Binder\r
-  url: '/stories/'\r
   \r
   @singular: () ->\r
     'Story'\r
@@ -17,11 +16,11 @@ class Pettanr.Story extends Peta.Binder
     new Pettanr.Cache.Retriever(Pettanr.Author, @get('author_id'))\r
   \r
   overwrite: (options) ->\r
-    operators = options.operators\r
+    operators = Pettanr.cache.operators\r
     return false if not operators.author\r
     @set('author_id', operators.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
@@ -32,6 +31,4 @@ class Pettanr.Story extends Peta.Binder
   \r
   initialize: (attr = {}, options = {}) ->\r
     super(attr, options)\r
-    if @id\r
-      @url = @url + @id\r
   \r