Skip to content

Instantly share code, notes, and snippets.

@jinihl
Forked from acidsound/alltables.js
Created December 6, 2013 05:06
Show Gist options
  • Save jinihl/7818862 to your computer and use it in GitHub Desktop.
Save jinihl/7818862 to your computer and use it in GitHub Desktop.
Alltables = new Meteor.Collection('alltables');
if (Meteor.isClient) {
Meteor.subscribe('Alltables');
Template.tables.tables=function() {
return Session.get("wd") && Alltables.find({
$or:[
{TABLE_PHYSICAL:RegExp(Session.get('wd'))},
{TABLE_LOGICAL:RegExp(Session.get('wd'))},
{COLUMN_PHYSICAL:RegExp(Session.get('wd'))},
{COLUMN_LOGICAL:RegExp(Session.get('wd'))}
]
}, {
$sort:{TABLE_PHYSICAL:1, COLUMN_ID:1}
});
}
Template.tables.events({
'submit' : function () {
Session.set('wd', $('.wd').val());
return false;
}
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
// code to run on server at startup
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment