Sha256: 233a93960d077704938107a3e74a31d7793896aa688b8c537fedec79503caa53
Contents?: true
Size: 1.91 KB
Versions: 5
Compression:
Stored size: 1.91 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.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
5 entries across 4 versions & 1 rubygems