o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1396022039.922175: @value"ï{I" class:ETI"ProcessedAsset;FI"logical_path;TI"'locomotive/models/content_entry.js;FI" pathname;TI"r/Users/didier/Documents/LocomotiveCMS/engine/app/assets/javascripts/locomotive/models/content_entry.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;TI"2013-11-30T11:53:02+01:00;TI" length;TiYI" digest;TI"%4a1da42ef94340d3c21504ac55edc673;FI" source;TI"Y(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.ContentEntry = (function(_super) { __extends(ContentEntry, _super); function ContentEntry() { return ContentEntry.__super__.constructor.apply(this, arguments); } ContentEntry.prototype.paramRoot = 'content_entry'; ContentEntry.prototype.urlRoot = "" + Locomotive.mounted_on + "/content_types/:slug/entries"; ContentEntry.prototype.initialize = function() { this.urlRoot = this.urlRoot.replace(':slug', this.get('content_type_slug')); _.each(this.get('has_many_custom_fields'), (function(_this) { return function(field) { var collection, name; name = field[0]; collection = new Locomotive.Models.ContentEntriesCollection(_this.get(name)); return _this.set_attribute(name, collection); }; })(this)); return _.each(this.get('many_to_many_custom_fields'), (function(_this) { return 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); }; })(this)); }; ContentEntry.prototype.set_attribute = function(attribute, value) { var data; data = {}; data[attribute] = value; return this.set(data); }; ContentEntry.prototype.update_attributes = function(attributes) { return _.each(this.get('file_custom_fields'), (function(_this) { return function(field) { var attribute; attribute = "" + field + "_url"; _this.set_attribute(attribute, attributes[attribute]); return _this.set_attribute("remove_" + field, false); }; })(this)); }; ContentEntry.prototype.reset_attributes = function() { return _.each(_.keys(this.attributes), (function(_this) { return function(name) { return _this.set_attribute(name, null); }; })(this)); }; ContentEntry.prototype.toMinJSON = function() { return _.tap({}, (function(_this) { return function(hash) { return _.each(_this.attributes, function(val, key) { if (key === 'id' || key === '_destroy' || key.indexOf('position_in_') === 0) { return hash[key] = val; } }); }; })(this)); }; ContentEntry.prototype.toJSON = function() { return _.tap(ContentEntry.__super__.toJSON.apply(this, arguments), (function(_this) { return 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; }); }); }; })(this)); }; return ContentEntry; })(Backbone.Model); Locomotive.Models.ContentEntriesCollection = (function(_super) { __extends(ContentEntriesCollection, _super); function ContentEntriesCollection() { return ContentEntriesCollection.__super__.constructor.apply(this, arguments); } ContentEntriesCollection.prototype.model = Locomotive.Models.ContentEntry; ContentEntriesCollection.prototype.url = "" + Locomotive.mounted_on + "/content_types/:slug/entries"; ContentEntriesCollection.prototype.toMinJSON = function() { return this.map((function(_this) { return function(entry) { return entry.toMinJSON(); }; })(this)); }; return ContentEntriesCollection; })(Backbone.Collection); }).call(this); ;TI"dependency_digest;TI"%c52425aa538182d0d4ca89ac6b37cc1e;FI"required_paths;T[I"r/Users/didier/Documents/LocomotiveCMS/engine/app/assets/javascripts/locomotive/models/content_entry.js.coffee;FI"dependency_paths;T[{I" path;TI"r/Users/didier/Documents/LocomotiveCMS/engine/app/assets/javascripts/locomotive/models/content_entry.js.coffee;FI" mtime;TI"2013-11-30T11:53:02+01:00;TI" digest;TI"%365b15fde4d77fdf9669abe1b9784ac9;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F