class Locmare.ProfilerModule.Association extends Backbone.View tagName: 'div' initialize: (options) -> @profiler = options.profiler @association_manifest = options.association_manifest @belongs_to = _.map @association_manifest.belongs_to, (belongs_to_manifest) => new Locmare.ProfilerModule.AssociationModule.BelongsTo({association: this, belongs_to_manifest: belongs_to_manifest}) @has_many = _.map @association_manifest.has_many, (list_manifest) => new Locmare.ProfilerModule.AssociationModule.HasMany({association: this, has_many_manifest: list_manifest}) @has_one = _.map @association_manifest.has_one, (list_manifest) => new Locmare.ProfilerModule.AssociationModule.HasOne({association: this, has_one_manifest: list_manifest}) @render() render: () -> this.$el.html('') _this = this caption = new Pettanr.Tag.Div({class_name: 'caption', content: 'associations'}) this.$el.append(caption.render().el) caption = new Pettanr.Tag.Div({class_name: 'caption', content: 'belongs_to'}) this.$el.append(caption.render().el) _.each @belongs_to, (f) -> _this.$el.append(f.render().el) caption = new Pettanr.Tag.Div({class_name: 'caption', content: 'has_many'}) this.$el.append(caption.render().el) _.each @has_many, (f) -> _this.$el.append(f.render().el) caption = new Pettanr.Tag.Div({class_name: 'caption', content: 'has_one'}) this.$el.append(caption.render().el) _.each @has_one, (f) -> _this.$el.append(f.render().el) this item: () -> @profiler.item model_manifest: () -> Manifest.manifest().models[@profiler.item_name] class Locmare.ProfilerModule.AssociationModule