Created
November 3, 2012 19:10
-
-
Save bernsno/4008317 to your computer and use it in GitHub Desktop.
This file contains 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
# Subscriptions | |
Meteor.autosubscribe -> | |
Meteor.subscribe('app_types') | |
Meteor.subscribe('apps', Session.get('sort_attribute'), Session.get('sort_order'), Session.get('filter_type')) | |
Meteor.subscribe('servers') | |
# No sorting | |
Meteor.publish 'apps', (sort_attribute, sort_order, filter_type)-> | |
sort = [[sort_attribute, sort_order]] | |
filters = {} | |
filters = { type: filter_type } if filter_type | |
Apps.find(filters, {sort: sort}) | |
# Sends back apps correctly sorted | |
Meteor.publish 'apps', (sort_attribute, sort_order, filter_type)-> | |
filters = {} | |
filters = { type: filter_type } if filter_type | |
Apps.find(filters, {sort: [["name", -1]]}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment