OSDN Git Service

fix:asoc system
[pettanr/pettanr.git] / app / assets / javascripts / models / speech_balloon_template.js.coffee
index f86a167..d7dde80 100644 (file)
@@ -1,14 +1,4 @@
 class Pettanr.SpeechBalloonTemplate extends Peta.Template\r
-  relations: [{\r
-    type: Backbone.HasMany,\r
-    key: 'speech_balloons',\r
-    relatedModel: 'SpeechBalloon',\r
-    collectionType: 'SpeechBalloonCollection',\r
-    reverseRelation: {\r
-      key: 'livesIn',\r
-      includeInJSON: 'id'\r
-    }\r
-  }]\r
   \r
   @singular: () ->\r
     'SpeechBalloonTemplate'\r
@@ -20,21 +10,14 @@ class Pettanr.SpeechBalloonTemplate extends Peta.Template
     id: null\r
   } \r
   \r
-  get_system_picture: () ->\r
-    new Pettanr.SystemPicture({id: @get('system_picture_id')})\r
+  @trace_routes: () ->\r
+    {\r
+      symbol: ['system_picture']\r
+    }\r
   \r
-  symbol_option: () ->\r
-    _this = this\r
-    r = @get_system_picture()\r
-    r.fetch({}).done () ->\r
-      _this.system_picture = r\r
-      _this.system_picture.tmb_opt_img_tag()\r
+  parsed_settings: () ->\r
+    JSON.parse(@get('settings'))\r
   \r
-  initialize: () ->\r
-    if @id\r
-      @url = @url + @id\r
-    @system_picture = null\r
+  initialize: (attr = {}, options = {}) ->\r
+    super(attr, options)\r
   \r
-class Pettanr.SpeechBalloonTemplate.Collection extends Backbone.Collection\r
-  model: Pettanr.SpeechBalloonTemplate\r
-  url: '/speech_balloon_templates'\r