This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rspec/autorun' | |
ValidUKPostcode = /\A( | |
[A-PR-UWYZ]\d{1,2} \s? \d[ABD-HJLNP-UWXYZ]{2}| # A9 9AA or A99 9AA | |
[A-PR-UWYZ][A-HK-Y]\d{1,2} \s? \d[ABD-HJLNP-UWXYZ]{2}| # AA9 9AA or AA99 9AA | |
[A-PR-UWYZ]\d[A-HJKSTUW] \s? \d[ABD-HJLNP-UWXYZ]{2}| # A9A 9AA | |
[A-PR-UWYZ][A-HK-Y]\d[ABEHMNPRVWXY] \s? \d[ABD-HJLNP-UWXYZ]{2}| # AA9A 9AA | |
GIR \s? 0AA | |
)\z/ix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Activity = Model("activity", function() { | |
this.persistence(Model.REST, "/activity"); | |
this.unique_key = '_id'; | |
}); | |
$(function() { | |
Activity.load(function() { | |
console.log(Activity.all()) | |
var one_activity = Activity.find('fa7043e52b644cd3a7a2217edc0e8928'); | |
console.log(one_activity) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Post('post', { | |
validations: { | |
presence: ['title', 'body'], | |
length: { | |
title: { min: 20 }, | |
body: { max: 2000 } | |
} | |
} | |
}) |