Skip to content

Commit

Permalink
removed collection2, more sensible sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
ndxbxrme committed Jul 8, 2015
1 parent e29759c commit e935990
Show file tree
Hide file tree
Showing 19 changed files with 132 additions and 323 deletions.
1 change: 0 additions & 1 deletion app/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ module.exports = yeoman.generators.Base.extend(
meteorToAdd.push 'mquandalle:bower'
if @filters.pagination
meteorToAdd.push 'tmeasday:publish-counts'
meteorToAdd.push 'aldeed:collection2'
meteorToAdd.push 'angularutils:pagination'
angularModules.push 'angularUtils.directives.dirPagination'
if @filters.auth
Expand Down
1 change: 0 additions & 1 deletion app/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 5 additions & 15 deletions app/templates/bootstrap/model/things(coffee).coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,12 @@

Things.allow
insert: (userId, thing) ->
thing.createdAt = new Date()
thing.name_sort = thing.name.toLowerCase()
true
update: (userId, thing, fields, modifier) ->
thing.updatedAt = new Date()
thing.name_sort = thing.name.toLowerCase()
true
remove: (userId, thing) ->
true
<% if(pagination) { %>
Things.attachSchema new SimpleSchema
name:
type: String
label: 'name'
name_sort:
type: String
optional: true
autoValue: () ->
name = this.field('name')
if name.isSet
name.value.toLowerCase()
else
@unset()<% } %>
true
26 changes: 5 additions & 21 deletions app/templates/bootstrap/model/things(js).js
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,16 @@ Things = new Mongo.Collection('things');

Things.allow({
insert: function(userId, thing) {
thing.createdAt = new Date();
thing.name_sort = thing.name.toLowerCase();
return true;
},
update: function(userId, thing, fields, modifier) {
thing.createdAt = new Date();
thing.name_sort = thing.name.toLowerCase();
return true;
},
remove: function(userId, thing) {
return true;
}
});
<% if(pagination) { %>
Things.attachSchema(new SimpleSchema({
name: {
type: String,
label: 'name'
},
name_sort: {
type: String,
optional: true,
autoValue: function() {
var name = this.field('name');
if(name.isSet) {
return name.value.toLowerCase();
}
else {
return this.unset();
}
}
}
}));<% } %>
});
33 changes: 11 additions & 22 deletions app/templates/bootstrap/server/startup/things.load(coffee).coffee
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
Meteor.startup ->
if Things.find().count() == 0
things = [
{
name: 'Data on the Wire'
}
{
name: 'One Language'
}
{
name: 'Database Everywhere'
}
{
name: 'Latency Compensation'
}
{
name: 'Full Stack Reactivity'
}
{
name: 'Embrace the Ecosystem'
}
{
name: 'Simplicity Equals Productivity'
}
'Data on the Wire'
'One Language'
'Database Everywhere'
'Latency Compensation'
'Full Stack Reactivity'
'Embrace the Ecosystem'
'Simplicity Equals Productivity'
]
things.forEach (thing) ->
Things.insert thing
Things.insert
name: thing
name_sort: thing.toLowerCase()
createdAt: new Date()
34 changes: 12 additions & 22 deletions app/templates/bootstrap/server/startup/things.load(js).js
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
Meteor.startup(function() {
if(Things.find().count() === 0) {
var things = [
{
name: 'Data on the Wire'
},
{
name: 'One Language'
},
{
name: 'Database Everywhere'
},
{
name: 'Latency Compensation'
},
{
name: 'Full Stack Reactivity'
},
{
name: 'Embrace the Ecosystem'
},
{
name: 'Simplicity Equals Productivity'
}
'Data on the Wire',
'One Language',
'Database Everywhere',
'Latency Compensation',
'Full Stack Reactivity',
'Embrace the Ecosystem',
'Simplicity Equals Productivity'
];
things.forEach(function(thing) {
Things.insert(thing);
Things.insert({
name: thing,
name_sort: thing.toLowerCase(),
createdAt: new Date()
});
});
}
});
20 changes: 5 additions & 15 deletions app/templates/material/model/things(coffee).coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,12 @@

Things.allow
insert: (userId, thing) ->
thing.createdAt = new Date()
thing.name_sort = thing.name.toLowerCase()
true
update: (userId, thing, fields, modifier) ->
thing.updatedAt = new Date()
thing.name_sort = thing.name.toLowerCase()
true
remove: (userId, thing) ->
true
<% if(pagination) { %>
Things.attachSchema new SimpleSchema
name:
type: String
label: 'name'
name_sort:
type: String
optional: true
autoValue: () ->
name = this.field('name')
if name.isSet
name.value.toLowerCase()
else
@unset()<% } %>
true
26 changes: 5 additions & 21 deletions app/templates/material/model/things(js).js
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,16 @@ Things = new Mongo.Collection('things');

Things.allow({
insert: function(userId, thing) {
thing.createdAt = new Date();
thing.name_sort = thing.name.toLowerCase();
return true;
},
update: function(userId, thing, fields, modifier) {
thing.createdAt = new Date();
thing.name_sort = thing.name.toLowerCase();
return true;
},
remove: function(userId, thing) {
return true;
}
});
<% if(pagination) { %>
Things.attachSchema(new SimpleSchema({
name: {
type: String,
label: 'name'
},
name_sort: {
type: String,
optional: true,
autoValue: function() {
var name = this.field('name');
if(name.isSet) {
return name.value.toLowerCase();
}
else {
return this.unset();
}
}
}
}));<% } %>
});
33 changes: 11 additions & 22 deletions app/templates/material/server/startup/things.load(coffee).coffee
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
Meteor.startup ->
if Things.find().count() == 0
things = [
{
name: 'Data on the Wire'
}
{
name: 'One Language'
}
{
name: 'Database Everywhere'
}
{
name: 'Latency Compensation'
}
{
name: 'Full Stack Reactivity'
}
{
name: 'Embrace the Ecosystem'
}
{
name: 'Simplicity Equals Productivity'
}
'Data on the Wire'
'One Language'
'Database Everywhere'
'Latency Compensation'
'Full Stack Reactivity'
'Embrace the Ecosystem'
'Simplicity Equals Productivity'
]
things.forEach (thing) ->
Things.insert thing
Things.insert
name: thing
name_sort: thing.toLowerCase()
createdAt: new Date()
34 changes: 12 additions & 22 deletions app/templates/material/server/startup/things.load(js).js
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
Meteor.startup(function() {
if(Things.find().count() === 0) {
var things = [
{
name: 'Data on the Wire'
},
{
name: 'One Language'
},
{
name: 'Database Everywhere'
},
{
name: 'Latency Compensation'
},
{
name: 'Full Stack Reactivity'
},
{
name: 'Embrace the Ecosystem'
},
{
name: 'Simplicity Equals Productivity'
}
'Data on the Wire',
'One Language',
'Database Everywhere',
'Latency Compensation',
'Full Stack Reactivity',
'Embrace the Ecosystem',
'Simplicity Equals Productivity'
];
things.forEach(function(thing) {
Things.insert(thing);
Things.insert({
name: thing,
name_sort: thing.toLowerCase(),
createdAt: new Date()
});
});
}
});
20 changes: 5 additions & 15 deletions app/templates/none/model/things(coffee).coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,12 @@

Things.allow
insert: (userId, thing) ->
thing.createdAt = new Date()
thing.name_sort = thing.name.toLowerCase()
true
update: (userId, thing, fields, modifier) ->
thing.updatedAt = new Date()
thing.name_sort = thing.name.toLowerCase()
true
remove: (userId, thing) ->
true
<% if(pagination) { %>
Things.attachSchema new SimpleSchema
name:
type: String
label: 'name'
name_sort:
type: String
optional: true
autoValue: () ->
name = this.field('name')
if name.isSet
name.value.toLowerCase()
else
@unset()<% } %>
true
26 changes: 5 additions & 21 deletions app/templates/none/model/things(js).js
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,16 @@ Things = new Mongo.Collection('things');

Things.allow({
insert: function(userId, thing) {
thing.createdAt = new Date();
thing.name_sort = thing.name.toLowerCase();
return true;
},
update: function(userId, thing, fields, modifier) {
thing.createdAt = new Date();
thing.name_sort = thing.name.toLowerCase();
return true;
},
remove: function(userId, thing) {
return true;
}
});
<% if(pagination) { %>
Things.attachSchema(new SimpleSchema({
name: {
type: String,
label: 'name'
},
name_sort: {
type: String,
optional: true,
autoValue: function() {
var name = this.field('name');
if(name.isSet) {
return name.value.toLowerCase();
}
else {
return this.unset();
}
}
}
}));<% } %>
});
Loading

0 comments on commit e935990

Please sign in to comment.