o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1314578812.0570712: @value{I" class:EFI"BundledAsset; FI"id; F"%7bb05e0817bd376d091016a3e5cb3973I"logical_path; F"!test/alpha_simprini/model.jsI" pathname; FI"e/Users/collin/Code/alpha-simprini-engine/app/assets/javascripts/test/alpha_simprini/model.coffee; TI"content_type; FI"application/javascript; FI" mtime; FI"2011-08-28T19:46:46-05:00; FI" body; FI"(function() { var __hasProp = Object.prototype.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; }; module("AS.Model"); test("All", function() { var model; model = new AS.Model; return equal(AS.All.getByCid(model.cid), model, "All models are automatically addded to the All collection"); }); test("has_many", function() { var model, model2; AS.HasManyModel = (function() { __extends(HasManyModel, AS.Model); function HasManyModel() { HasManyModel.__super__.constructor.apply(this, arguments); } HasManyModel.has_many('things', { model_name: "AS.HadModel" }); return HasManyModel; })(); AS.HadModel = (function() { __extends(HadModel, AS.Model); function HadModel() { HadModel.__super__.constructor.apply(this, arguments); } return HadModel; })(); deepEqual(AS.HasManyModel.associations, ["things"], "stores the association in the association list"); ok(AS.HasManyModel.has_manys.things, "stores a configuration for the association"); equal(AS.HasManyModel.has_manys.things.model, void 0, "association collection configuration is lazy to allow associated class to load"); model = new AS.HasManyModel; equal(AS.HasManyModel.has_manys.things.model, AS.HadModel, "configures the collection class properly when needed"); equal(model.get("things").model, AS.HadModel, "association collection is auto-created"); model.get("things").add({}); equal(model.get("things").at(0).constructor, AS.HadModel, "items added to the association are properly instantiated"); model2 = new AS.HasManyModel({ things: [{}] }); return equal(model2.get("things").at(0).constructor, AS.HadModel, "items passed to constructor for the association are properly instantiated"); }); test("belongs to", function() { var model, new_owner, owner, proof; AS.Belonging = (function() { __extends(Belonging, AS.Model); function Belonging() { Belonging.__super__.constructor.apply(this, arguments); } Belonging.belongs_to("parent"); return Belonging; })(); AS.Owner = (function() { __extends(Owner, AS.Model); function Owner() { Owner.__super__.constructor.apply(this, arguments); } return Owner; })(); deepEqual(AS.Belonging.associations, ["parent"], "stores the association on the class"); ok(AS.Belonging.belongs_to.parent, "stores a configuration object for the association on the class"); owner = new AS.Owner({ id: "OWNERID" }); model = new AS.Belonging; model.set({ parent: owner }); equal(model.get("parent"), owner, "correctly sets the owner"); model = new AS.Belonging; model.set({ parent: owner.get("id") }); equal(model.get("parent"), owner, "correctly sets the from a string id"); proof = false; model.bind("change:parent", function() { return proof = true; }); owner.set({ some: "value" }); ok(proof, "association changes trigger on the child"); proof = false; new_owner = new AS.Owner; model.set({ parent: new_owner }); new_owner.set({ some: "other value" }); return ok(proof, "changes trigger when associated model is changed"); }); }).call(this); ; TI"asset_paths; F[I"e/Users/collin/Code/alpha-simprini-engine/app/assets/javascripts/test/alpha_simprini/model.coffee; TI"dependency_paths; F[{I" path; FI"e/Users/collin/Code/alpha-simprini-engine/app/assets/javascripts/test/alpha_simprini/model.coffee; TI" mtime; FIu: Time  ß€àº: @_zoneI"CDT; T: offsetiþ°¹I"hexdigest; F"%b0500bcc2ca6b0e8a2395d317ec7b3faI" _version; F"%a697d8e69dd5bf8f3a29159773d6c5f5