Skip to content
This repository was archived by the owner on Aug 6, 2021. It is now read-only.

Commit 04a48e7

Browse files
committed
Merge pull request #16 from mphasize/lodash-linux-fixes
Fixes the last missing require statements.
2 parents 2ef8bf0 + 14b5c67 commit 04a48e7

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

templates/api/blueprints/populate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
var util = require('util');
55
var actionUtil = require('./_util/actionUtil');
6-
var find = require('lodash/Collection/find');
6+
var find = require('lodash/collection/find');
77

88
/**
99
* Populate (or "expand") an association

templates/api/blueprints/update.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
var actionUtil = require( './_util/actionUtil' );
66
var util = require( 'util' );
7-
var cloneDeep = require('lodash/Lang/cloneDeep');
7+
var cloneDeep = require('lodash/lang/cloneDeep');
88

99
/**
1010
* Enable sideloading. Edit config/blueprints.js and add:

templates/api/services/Ember.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,24 @@
44
* @module Ember
55
*/
66

7-
var _ = require( 'lodash' ),
8-
pluralize = require( 'pluralize' );
7+
var forEach = require('lodash/collection/forEach');
8+
var map = require('lodash/collection/map');
9+
var size = require('lodash/collection/size');
10+
var pluralize = require( 'pluralize' );
911

1012
module.exports = {
1113
linkAssociations: function ( model, records ) {
1214
if ( !Array.isArray( records ) ) records = [ records ];
1315
var modelPlural = pluralize( model.identity );
1416

15-
return _.map( records, function ( record ) {
17+
return map( records, function ( record ) {
1618
var links = {};
17-
_.each( model.associations, function ( assoc ) {
19+
forEach( model.associations, function ( assoc ) {
1820
if ( assoc.type == "collection" ) {
1921
links[ assoc.alias ] = sails.config.blueprints.prefix + "/" + modelPlural + "/" + record.id + "/" + assoc.alias;
2022
}
2123
} );
22-
if ( _.size( links ) > 0 ) {
24+
if ( size( links ) > 0 ) {
2325
record.links = links;
2426
}
2527
return record;

0 commit comments

Comments
 (0)