Given address ids 1,2,3, we would want a single query to returns rows for every combination of directions, ie:
1,2
1,3
2,1
2,3
3,1
3,2
RSpec::Matchers.define :encrypt do |attribute| | |
encrypted_attribute = ('encrypted_' + attribute.to_s) | |
match do |model| | |
model.respond_to?(attribute) && model.respond_to?(encrypted_attribute.intern) && model.class.column_names.include?(encrypted_attribute) | |
end | |
failure_message_for_should do |model| | |
unless model.class.column_names.include?(encrypted_attribute) |
Rails => Geddy | |
**Models** | |
User.new(params) => User.create(params); | |
----- | |
User.create(params) => var u = User.create(params); | |
// saves the user then calls the callback function | |
u.save(function (err, data) { // do things }); | |
----- |
var Mocha = require('mocha'), | |
fs = require('fs'), | |
_ = require('underscore'); | |
var mocha = new Mocha({reporter: 'spec', ui: 'bdd'}); | |
mocha.addPath = function(dir){ | |
fs.readdirSync(dir).filter(function(file){ | |
var fileArray = file.split('.'); | |
Given address ids 1,2,3, we would want a single query to returns rows for every combination of directions, ie:
1,2
1,3
2,1
2,3
3,1
3,2