OSDN Git Service

fix filer
[pettanr/pettanr.git] / app / assets / javascripts / manifest / manifest.js.coffee
index d0826de..77c1aba 100644 (file)
@@ -9,6 +9,11 @@ class Manifest
     @items = ManifestBase.load_type_name_args(this, @global_json, 'items', Manifest.ItemFactory)\r
     @controllers = Manifest.Controller.load(this, @global_json, 'controllers', Manifest.Controller)\r
     @models = Manifest.Model.load(this, @global_json, 'models', Manifest.Model)\r
+    @inflectors = {}\r
+    _this = this\r
+    _.each @models, (model_manifest, item_name) ->\r
+      if model_manifest.table_name\r
+        _this.inflectors[model_manifest.table_name] = item_name\r
     true\r
   \r
   @item_name_to_model: (item_name) ->\r