o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1364984304.696471: @value" {I" class:EFI"ProcessedAsset;FI"logical_path;FI"'locomotive/models/content_entry.js;TI" pathname;FI"n/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/models/content_entry.js.coffee;TI"content_type;FI"application/javascript;FI" mtime;FI"2013-04-03T11:01:13+02:00;FI" length;Fi”I" digest;F"%c5b1105d9ea5d633f4f252b7596a06aaI" source;FI"”(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;F"%451e4f4abcc6e4eb84d1aa30717bd835I"required_paths;F[I"n/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/models/content_entry.js.coffee;TI"dependency_paths;F[{I" path;FI"n/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/locomotive/models/content_entry.js.coffee;TI" mtime;FI"2013-04-03T11:01:13+02:00;FI" digest;F"%04050a41089aee7ed9b9187a1c49e190I" _version;F"%6776f581a4329e299531e1d52aa59832