Sha256: 34b4683f4f78424659edaf10ee111deebef79e6c0b8427b0efc18d2e3daab43a
Contents?: true
Size: 1.95 KB
Versions: 11
Compression:
Stored size: 1.95 KB
Contents
I"¼(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 } } }; Article.attributes = { title: { validations: { presence: true, length: { minimum: 3, maximum: 255 } } }, content: { validations: { presence: true, length: { min: 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" } }; Article.receivedSignal = function(signal, data) {}; Article.validate = ["vulgarityLevel"]; function Article(data) { Article.__super__.constructor.call(this, data); } 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' }); } }; return Article; })(App.Models.Base); }).call(this); :ET
Version data entries
11 entries across 4 versions & 1 rubygems