{:uriI"file://app/assets/javascripts/models/article.coffee?type=application/javascript&pipeline=self&id=e2e5cebb2d62b238954df6daddf4fcd61a0459afa289b8f6f8c668ad01e25ba2:ET:load_pathI"app/assets/javascripts;T: filenameI"1app/assets/javascripts/models/article.coffee;T: nameI"models/article;T:logical_pathI"models/article.self.js;T:content_typeI"application/javascript;T: sourceI" (function() { var extend = 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; }, hasProp = {}.hasOwnProperty; App.Models.Article = (function(superClass) { extend(Article, superClass); Article.identity = "Article"; Article.resources = { url: '/user/articles', paginate: { per: 5 }, main: { url: '/articles', paginate: { per: 3 } }, admin: { url: '/admin/articles', paginate: { per: 4 } } }; Article.attributes = { title: { validations: { presence: true, length: { within: [3, 255] } } }, content: { validations: { presence: true, length: { minimum: 100 } }, remoteName: "text" }, createdAt: { type: "Date", remoteName: "created_at" }, updatedAt: { type: "Date", remoteName: "updated_at" }, commentsCount: { type: "Int", remoteName: "comments_count" }, publishedAt: { type: "Date", remoteName: "published_at" }, published: {}, adminReview: { remoteName: "admin_review" }, adminRate: { type: "Int", remoteName: "admin_rate" }, categoryId: { type: "Int", remoteName: "category_id" }, adminReviewStartedAt: { remoteName: "admin_review_started_at" } }; Article.receivedSignal = function(signal, data) {}; Article.validate = ["vulgarityLevel"]; function Article(data) { Article.__super__.constructor.call(this, data); this.published = this.publishedAt != null ? true : false; } Article.prototype.receivedSignal = function(signal, data) {}; Article.prototype.vulgarityLevel = function() { if (((this.title != null) && /fuck/i.exec(this.title)) || ((this.content != null) && /fuck/i.exec(this.content))) { return this.addErrorMessage("Article contains strong language.", { "for": 'base' }); } }; Article.prototype.setDefaultValuesForAdminReview = function() { if (this.adminRate == null) { this.adminRate = 3; } if (this.categoryId == null) { this.categoryId = 6; } return this.adminReviewStartedAt = Date.now(); }; return Article; })(App.Models.Base); }).call(this); ;T: metadata{ :dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"jprocessors:type=application/javascript&file_type=application/javascript&engines=.coffee&pipeline=self;TTI"?file-digest://app/assets/javascripts/models/article.coffee;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"%`eW7A`=j>y̺biI: lengthi :dependencies_digest"%q'^fu{7i2IcCS콣m:idI"Ee2e5cebb2d62b238954df6daddf4fcd61a0459afa289b8f6f8c668ad01e25ba2;F: mtimel+ sW