Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Eden Corbin
@edencorbin
Agreed, I'll shoot the sailsit facebook page a message, maybe they could make some updates, or consider joining up with other sails users to overhaul it. Theirs a post from yesterday, it looks actively maintained.
Eden Corbin
@edencorbin
Is there no official forum? That could be nice/simple to add too.
martskins
@martskins
I don't think there is.. or at least no other than stackoverflow (as with most things in life)
Eden Corbin
@edencorbin
Good point, maybe stackoverflow supersedes forums for a framework like sails.
Problem is stackoverflow requires a question/answer format to my knowledge, imagine the downvotes for posting a sails tutorial, vs a forum could have a section for it...
martskins
@martskins
too bad stackoverflow documentation was shut down, that would have been a nice place to do this
martskins
@martskins
speaking of documentation... do you guys use documentation generators? as in JSDoc or docco or anything? any preference for any of them?
I have yet to find a good doc generator that has good documentation :disappointed:
martskins
@martskins
damn.. why didn't I find about docco earlier..
Corey Birnbaum
@vonWolfehaus
@mikermcneil I totally support the v1 changes, my code looks and works better with them :thumbsup: I created a new project that started with v1 so I got used to it that way, but tonight I'm going back and upgrading an older, very large project... gonna take a while, but I know it'll be worth it :) Keep it up, and thanks a ton for staying with this thing!
Corey Birnbaum
@vonWolfehaus
Speaking of which, my old project uses services, and while they're supported in v1, will they eventually be deprecated in favor of helpers?
Tom Murphy
@bluemalkin
Hi - I cannot get sails postgres to honour the SSL environment setting for connecting to the DB. Anyone else have issues with it ?
here's the issue: pantsel/konga#139
Raj Soni
@soniraj
@edencorbin @martskins Hi guys we have just started sailsit and we are trying to expand. Regarding the website layout, we will be launching our new website layout by today so stay tuned. We have a fb group and twitter page, do follow us.
ChrisWorks
@ChrisWorks
@soniraj This sounds great. Cant wait to have a look.
ChrisWorks
@ChrisWorks
@soniraj Would you be able to structure the content by theme on the site? E.g. "Getting started with Sails", "How to structure your app", "Working with policies". As I mentioned yesterday we need a place to document best-practices and how to work with the various sails features. This would include allowing people discuss how to do a certain thing and then graduate the approach into documented pattern.
Raj Soni
@soniraj
@ChrisWorks do you mean to say, organize content category wise for better readability ?
Alexander Ostapenko
@NachtRitter
about changes to framework I like scheme in Ember where changes are discussed via public RFC https://github.com/emberjs/rfcs
ChrisWorks
@ChrisWorks
@soniraj Yes, one thing we were discussing here yesterday was to create a lexicon for sails "how-to's". Instead of a long list of blog-posts, we would need categorize the content so users can easily find what they are looking for. (not just search for it).
"Getting started guides" -> ... "Sails and email ->" ... "Sails and databases" ... "App architecture ->" .. "Integrations with.... " ... so a topic based navigation. :)
Alexander Ostapenko
@NachtRitter
@mikermcneil does sails-mysql datastore configuration accept parameters for node-mysql driver? I'd like to know how datastore works with pool of connections to MySQL.
Tom Murphy
@bluemalkin
any luck with my query ? :)
Albert Peiró
@albertpeiro

@mikermcneil the query:

{"where":{"or":[{"name":{"contains":"su"}}]}}

used to be case insensitive in 0.12 by default at least with disk and mongo adapters. I'm upgrading to 1.0 and need to keep it that way. How? Any reference? anyone?
In 1.0 it seems to be case sensitive now..
https://github.com/adminxhq/sails-hook-adminx/blob/sails-1.0/api/controllers/AdminXController.js#L49

Raj Soni
@soniraj
@ChrisWorks nice idea ! once our new layout is up, we can start work on the categorization
Eden Corbin
@edencorbin
@soniraj, another categorization request would be in the forums section. "new to sails", "errors and troubleshooting", "user tutorials", "extending sails", "sails db adapters", "looking for help", just random off the top of head ideas, it's nice that new users have a place they don't feel intimidated posting "new to sails", and that advanced users can better specify their forum topic, and lastly that some categories are clearly not intended for q & a (although the q & a format is fine to leave as it can be used as a comment system at that point) "user tutorials".
Eden Corbin
@edencorbin
If you have async controller routes, any way to have sails auto try catch them all, so you don't have to write a try catch inside each one?
martskins
@martskins
@edencorbin maybe create a function wrapper that returns a controller method and wraps the actual method in a try/catch?
function basicHandler(fn) {
    return function (req, res, next) {
      try {
            fn(req, res, next);
        } catch (err) {
            console.log(err);
            res.serverError(err);
        }
     }
}

// SomeController.js
module.exports = {
    someControllerMethod: basicHandler(function (req, res, next) {
       // Do un-"try/catched" stuff
     })
}
actually.. i didn't even think of async there.. but it should be analogous
Alexander Ostapenko
@NachtRitter
@martskins It could be better to do with ES6-classes. To write abstract Controller class and extend your custom controllers from this class... but Sails doesn't support controllers as class instance
I've done theese scheme with sails 0.12

and my custom controllers look like:

class MembersController extends Controller {
    constructor() {
        super('Members');
    } 
}

all CRUD-actions are realized in this abstract Controller class

Eden Corbin
@edencorbin
@martskins thanks that's a great idea, I think I'll do that, should work perfectly for my use case, and trim a bunch of repeated code.
@NachtRitter that also looks like a good approach, are you saying it worked in .12 but not in 1.0.
Alexander Ostapenko
@NachtRitter

@edencorbin it works in sails 0.12 but via different "hacks" like:

class Controller {

    constructor(modelName) {
        this.model = modelName;

        this._assignPublicMethods(this.__proto__.__proto___);
        this._assignPublicMethods(this.__proto__);
    }

    _assignPublicMethods(sourse) {
        var controller = this;
        _.forEach(Object.getOwnPropertyNames(sourse), function (localName) {
            if (!controller.hasOwnProperty(localName)  && _.isFunction(sourse[localName])  && localName != 'constructor') {
                var publicName = localName.substring(1); // cut off '_' in the beginning of private method, e.g. '_create'
                controller[publicName] = sourse[localName];
            }
        });
    }
}

I haven't tried to do this in Sails 1.0 yet

but I think I should works in Sails 1.0 also.
Eden Corbin
@edencorbin
Okay, I'll keep digging into this, I imagine this is something that could benefit everyone working in 1.0+ async and not wanting to try catch every controller route.
Alexander Ostapenko
@NachtRitter
@edencorbin yeah, similar approaches also helps to do less mistakes or different behavior for same actions in different controllers
Rachael McNeil
@rachaelshaw
@edencorbin @NachtRitter Sails/Express automatically catches errors that are thrown as long as you're using await. For handling specific errors, you might check out .intercept() and .tolerate()
Eden Corbin
@edencorbin
@rachaelshaw wow it does, I/we were overthinking that problem, I see I can link into the function in responses/serverError, and my async errors go there automatically, perfect, thanks.
cacoch
@cacoch
any suggestion how to test sails with avajs?
I cant get it
Lzxe92
@Lzxe92
hmm

i'm getting this

error: Sending 500 ("Server Error") response:
UsageError: Sorry, .exec() doesn't know how to handle {...} callbacks.
Please provide a callback function when calling .exec().
| If you passed in {...} on purpose as a "switchback" (dictionary of callbacks),
| then try calling .switch() intead of .exec().
[?] See https://sailsjs.com/support for more help.

only on my remote server
anyreason why
was using windows previously, trying to deploy onto ubuntu 16.04
Alexander Ostapenko
@NachtRitter
how can I return Promise from helper?
Sachin Pachari
@SachinPachari

Hi Guys, I am trying to connect to mongo using sails adapter, and i am using trying to set auth-source as "etc/*.pem" file. but not sure how to set this up using the config/connections.js file.

Thanks in advance.

ChrisWorks
@ChrisWorks
I am getting an error in v1. User.findOne( {id: user.id } ) throws an error: Cannot findOne() without specifying a more specific where clause. I thought specifying the exact ID should be specific enough, right? Anyone seen this before?