o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1396088392.3595562: @value"|{I" class:ETI"ProcessedAsset;FI"logical_path;TI"&locomotive/models/custom_field.js;FI" pathname;TI"/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/engine-c0bddd719ddf/app/assets/javascripts/locomotive/models/custom_field.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;TI"2014-03-29T11:18:01+01:00;TI" length;TiT I" digest;TI"%d2184d326c20f8bbd68493f149c06d7a;FI" source;TI"T (function() { var __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; Locomotive.Models.CustomField = (function(_super) { __extends(CustomField, _super); function CustomField() { return CustomField.__super__.constructor.apply(this, arguments); } CustomField.prototype.initialize = function() { this._normalize(); if (this.get('name') == null) { return this.set({ name: this.get('label').slugify() }); } }; CustomField.prototype._normalize = function() { return this.set({ select_options: new Locomotive.Models.CustomFieldSelectOptionsCollection(this.get('select_options')) }); }; CustomField.prototype._undesired_fields = ['select_options', 'type_text', 'text_formatting_text', 'inverse_of_text', 'class_name_text', 'undefined_text', 'undefined', 'created_at', 'updated_at']; CustomField.prototype._relationship_fields = ['class_name', 'inverse_of', 'ui_enabled']; CustomField.prototype.is_relationship_type = function() { return _.include(['belongs_to', 'has_many', 'many_to_many'], this.get('type')); }; CustomField.prototype.toJSONForSave = function() { return _.tap({}, (function(_this) { return function(hash) { var key, value, _ref; _ref = _this.toJSON(); for (key in _ref) { value = _ref[key]; if (!_.include(_this._undesired_fields, key)) { if (_.include(_this._relationship_fields, key)) { if (_this.is_relationship_type()) { hash[key] = value; } } else { hash[key] = value; } } } if ((_this.get('select_options') != null) && _this.get('select_options').length > 0) { return hash.select_options_attributes = _this.get('select_options').toJSONForSave(); } }; })(this)); }; return CustomField; })(Backbone.Model); Locomotive.Models.CustomFieldsCollection = (function(_super) { __extends(CustomFieldsCollection, _super); function CustomFieldsCollection() { return CustomFieldsCollection.__super__.constructor.apply(this, arguments); } CustomFieldsCollection.prototype.model = Locomotive.Models.CustomField; CustomFieldsCollection.prototype.toJSONForSave = function() { return this.map((function(_this) { return function(model) { return model.toJSONForSave(); }; })(this)); }; return CustomFieldsCollection; })(Backbone.Collection); }).call(this); ;TI"dependency_digest;TI"%e6b54f123ca062cf5762a774b3bb390e;FI"required_paths;T[I"/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/engine-c0bddd719ddf/app/assets/javascripts/locomotive/models/custom_field.js.coffee;FI"dependency_paths;T[{I" path;TI"/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/engine-c0bddd719ddf/app/assets/javascripts/locomotive/models/custom_field.js.coffee;FI" mtime;TI"2014-03-29T11:18:01+01:00;TI" digest;TI"%6c45a13e03f1176f835f6c65eda4360b;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F