o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1381142251.335886: @value"{I" class:EFI"ProcessedAsset;FI"logical_path;FI"&locomotive/models/custom_field.js;TI" pathname;FI"/Users/papipo/.rvm/gems/ruby-1.9.3-p448/gems/locomotive_cms-2.1.0/app/assets/javascripts/locomotive/models/custom_field.js.coffee;TI"content_type;FI"application/javascript;FI" mtime;FI"2013-10-07T10:55:40+02:00;FI" length;Fi8 I" digest;F"%caaa8844a6ebe8b11127f689ae5d55e0I" source;FI"8 (function() { var _ref, _ref1, __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() { _ref = CustomField.__super__.constructor.apply(this, arguments); return _ref; } 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() { var _this = this; return _.tap({}, function(hash) { var key, value, _ref1; _ref1 = _this.toJSON(); for (key in _ref1) { value = _ref1[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(); } }); }; return CustomField; })(Backbone.Model); Locomotive.Models.CustomFieldsCollection = (function(_super) { __extends(CustomFieldsCollection, _super); function CustomFieldsCollection() { _ref1 = CustomFieldsCollection.__super__.constructor.apply(this, arguments); return _ref1; } CustomFieldsCollection.prototype.model = Locomotive.Models.CustomField; CustomFieldsCollection.prototype.toJSONForSave = function() { var _this = this; return this.map(function(model) { return model.toJSONForSave(); }); }; return CustomFieldsCollection; })(Backbone.Collection); }).call(this); ;TI"dependency_digest;F"%6eb0091fdb6a68f58c7198b2108b16f4I"required_paths;F[I"/Users/papipo/.rvm/gems/ruby-1.9.3-p448/gems/locomotive_cms-2.1.0/app/assets/javascripts/locomotive/models/custom_field.js.coffee;TI"dependency_paths;F[{I" path;FI"/Users/papipo/.rvm/gems/ruby-1.9.3-p448/gems/locomotive_cms-2.1.0/app/assets/javascripts/locomotive/models/custom_field.js.coffee;TI" mtime;FI"2013-10-07T10:55:40+02:00;FI" digest;F"%6c45a13e03f1176f835f6c65eda4360bI" _version;F"%ffd318ca8b794f42f5029101c2cf5d91