o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1384182735.698655: @value" {I" class:ETI"ProcessedAsset;FI"logical_path;TI"'locomotive/models/content_entry.js;FI" pathname;TI"—/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.1/app/assets/javascripts/locomotive/models/content_entry.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;TI"2013-11-11T00:40:29+01:00;TI" length;Ti‰I" digest;TI"%8d40bb5a93ea89dcd8d573c57a5cf80d;FI" source;TI"‰(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.ContentEntry = (function(_super) { __extends(ContentEntry, _super); function ContentEntry() { _ref = ContentEntry.__super__.constructor.apply(this, arguments); return _ref; } ContentEntry.prototype.paramRoot = 'content_entry'; ContentEntry.prototype.urlRoot = "" + Locomotive.mounted_on + "/content_types/:slug/entries"; ContentEntry.prototype.initialize = function() { var _this = this; this.urlRoot = this.urlRoot.replace(':slug', this.get('content_type_slug')); _.each(this.get('has_many_custom_fields'), function(field) { var collection, name; name = field[0]; collection = new Locomotive.Models.ContentEntriesCollection(_this.get(name)); return _this.set_attribute(name, collection); }); return _.each(this.get('many_to_many_custom_fields'), function(field) { var collection, name; name = field[0]; collection = new Locomotive.Models.ContentEntriesCollection(_this.get(name)); collection.comparator = function(entry) { return entry.get('__position') || 0; }; return _this.set_attribute(name, collection); }); }; ContentEntry.prototype.set_attribute = function(attribute, value) { var data; data = {}; data[attribute] = value; return this.set(data); }; ContentEntry.prototype.update_attributes = function(attributes) { var _this = this; return _.each(this.get('file_custom_fields'), function(field) { var attribute; attribute = "" + field + "_url"; _this.set_attribute(attribute, attributes[attribute]); return _this.set_attribute("remove_" + field, false); }); }; ContentEntry.prototype.toMinJSON = function() { var _this = this; return _.tap({}, function(hash) { return _.each(_this.attributes, function(val, key) { if (key === 'id' || key === '_destroy' || key.indexOf('position_in_') === 0) { return hash[key] = val; } }); }); }; ContentEntry.prototype.toJSON = function() { var _this = this; return _.tap(ContentEntry.__super__.toJSON.apply(this, arguments), function(hash) { if (hash['_slug'] === null) { hash['_slug'] = ''; } _.each(_.keys(hash), function(key) { if (!_.include(_this.get('safe_attributes'), key)) { return delete hash[key]; } }); _.each(_this.get('has_many_custom_fields'), function(field) { var name; name = field[0]; if (_this.get(name).length > 0) { return hash["" + name + "_attributes"] = _this.get(name).toMinJSON(); } }); return _.each(_this.get('many_to_many_custom_fields'), function(field) { var name, setter_name; name = field[0]; setter_name = field[1]; return hash[setter_name] = _this.get(name).sort().map(function(entry) { return entry.id; }); }); }); }; return ContentEntry; })(Backbone.Model); Locomotive.Models.ContentEntriesCollection = (function(_super) { __extends(ContentEntriesCollection, _super); function ContentEntriesCollection() { _ref1 = ContentEntriesCollection.__super__.constructor.apply(this, arguments); return _ref1; } ContentEntriesCollection.prototype.model = Locomotive.Models.ContentEntry; ContentEntriesCollection.prototype.url = "" + Locomotive.mounted_on + "/content_types/:slug/entries"; ContentEntriesCollection.prototype.toMinJSON = function() { var _this = this; return this.map(function(entry) { return entry.toMinJSON(); }); }; return ContentEntriesCollection; })(Backbone.Collection); }).call(this); ;TI"dependency_digest;TI"%9cab5c71b2f9a4dc1a3e5cf3a972aedf;FI"required_paths;T[I"—/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.1/app/assets/javascripts/locomotive/models/content_entry.js.coffee;FI"dependency_paths;T[{I" path;TI"—/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.1/app/assets/javascripts/locomotive/models/content_entry.js.coffee;FI" mtime;TI"2013-11-11T00:40:29+01:00;TI" digest;TI"%ab085c3a859f45635637efa58231aa40;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F