Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Jimmy Knoot
    @jimmy1993k

    nice documented, some small things I saw while reading over it were
    var child = new Child();
    child.type; // "Child"

    var parent = new Parent();
    child.type; // "Parent"

    it should be parent.type I guess.

    birthDate: {
    type: Date,
    validators: [{
    type: 'lte',
    resolveParam: function() {
    let date = new Date();
    return date.setFullYear(date.getFullYear() - 18);
    }
    }]
    },

    I know it's just an example but you might put people on the wrong path with this one, because you're not taking into account the month and days of the year

    Joe
    @joetidee
    hi
    Anton S
    @SPAHI4
    Is this good idea to use transient field as relation? Or what is the best way?
        events: {
            afterInit: function() {
               this.user = User.findOne(this.userId);
            }
        }
    Anton S
    @SPAHI4
    and how to use DDPRateLimiter package with Astronomy methods?
    Namir
    @namirsab
    Hello!
    I have a question. Is possible to use the Schema system from astronomy independently?
    PolGuixe
    @PolGuixe
    Does anybody know how to simulate a high latency enviroment with Astronomy?
    I want to test how latency compensation works with Astronomy
    Without using Astronomy I used to put a Meteor._sleepForMs(10000); in the Meteor method, before doing the insert or the update
    peterchoo
    @peterchoo
    Hi all, I'm wondering if it's possible to have nested arrays defined and validated in Astronomy, either v1 or v2. My use case is we have a set of rules which need evaluating. These rules may have multiple conditions. We are using two arrays as an "or" array, which contains "and" arrays:
    
    
    Whoops:
    {
      rule: [
        [
        ]
      ]
    }
    so any objects in the inner array will be considered with an and condition, and if there are more than one inner array they will be considered as or conditions

    the conditions will be a separate astronomy class with some specific validation, for now lets assume a class name of RuleCondition. I can define with:

    {
      rule: {
        type: 'array',
        nested: 'RuleCondition'
      }
    }

    But this is only with one surrounding array. I'd like to be able to have two nested arrays. Any ideas?

    peterchoo
    @peterchoo
    @jagi Is this possible in Astronomy v1 or v2? Could this be possible with a custom type?
    jongidal
    @jongidal
    Is there any way to use es2015 Class with astronomy?
    PolGuixe
    @PolGuixe
    This message was deleted

    @jagi in case I do:

    doc._id = docId; //Generated using Random.id()
    doc.save();

    But that docId already exists in the DB...Will Astronomy try to generate a new _id and insert the document?

    Lucas Peres
    @mysyfy
    How can I use ENUM type at Blaze Templates ?
    For ex: export const Depts = Enum.create({
    name : 'Depts',
    identifiers : ['DeptHR','DeptAccouting', 'DeptFinances']
    });
    How can I use Depts.DeptHR a blaze template
    ?
    Brian Duffey
    @bduff9
    I'm trying to set up a basic example with this, but the server doesn't start as it complains that "Can not add index to class without assigned collection". The class in question is my User class which has Meteor.users as the collection. The docs seem to indicate this should work but it does not for me. Any thoughts?
    import { Meteor } from 'meteor/meteor';
    import { Class } from 'meteor/jagi:astronomy';
    
    export const User = Class.create({
      name: 'User',
      collection: Meteor.users,
      fields: {
          email: {
              type: String,
              validators: [{ type: 'email' }]
          }
      },
      indexes: {
        email: {
          fields: {
            email: 1
          },
          options: {
            unique: true
          }
        }
      }
    });
    Jake Lacey
    @jakelacey2012
    Hi has anyone had this error before? http://puu.sh/pPI63/6399f169a2.png
    Jake Lacey
    @jakelacey2012
    I'm using astronomy it in an atmosphere package but I'm getting this error...
    Jake Lacey
    @jakelacey2012
    never mind... if I bothered to read the repo then I would have noticed that Astro is what I need to import and not class :P
    ioseb
    @realioseb
    how can i make a field not-required? :/
    ioseb
    @realioseb
    ok i found it - optional: true :stuck_out_tongue_closed_eyes:
    kullt
    @kullt
    Hi. Would a behaviour be a good place to check whether a user has been disabled and stop any further action?
    ioseb
    @realioseb
    @kullt, I don't think so. i prefer server-side data insertions and i'm putting all kind of checkers in methods
    kullt
    @kullt
    @realioseb Yeah, that's what I do and did in the end. Thanks for the reply.
    janek
    @jbbr
    Hi, is there a recommended way of changing default validation errors - globally or at least per Astro-Class?
    It's not very convenient to add an error message to every collection's field especially for multi-language environments :)
    Zaiban
    @Zaiban
    @sveinburne Type.types.Number is working
    Jules Sam. Randolph
    @jsamr
    @Zaiban Interresting ... I guess the issue comes from lodash find method, we'll mimick the Type.find method to see what is not working in IE11
    static find(Class) {
        return _.find(this.types, (type) => {
          return type.class === Class;
        });
    }
    Is the Type.find method definition. I'm writing a mimick, back in 2 min
    Jules Sam. Randolph
    @jsamr
    var Type = require('meteor/jagi:astronomy/lib/modules/fields/type').default
    var lfind = require('lodash/find')
    function findtype(Class) {
      return lfind(Type.types, function(type) {
        console.info(Class, type)
        return type.class === Class;
      })
    }
    findtype(Number)
    We could also print type.class === Class after the first console.info
    Jules Sam. Randolph
    @jsamr
    lodash/lodash#2423 with the following Type.has definition :
    static has(name) {
        return _.has(this.types, name);
    }
    Jules Sam. Randolph
    @jsamr
    @Zaiban Have you noticed anything?
    Rand Nix
    @therenix
    Anyone using a good Forms package compatible with Astronomy2?
    Zaiban
    @Zaiban
    @sveinburne Sorry it took so long, here are the results: https://gist.github.com/Zaiban/9751730dba4d4cedb0a8a479a8024179
    Zaiban
    @Zaiban
    So it gives false with Number.. trying it with anything other than Number works
    Zaiban
    @Zaiban
    tried downgrading to lodash 3 and that fixes the problem, so its definitely related to lodash 4
    Zaiban
    @Zaiban
    I'll take that back, lodash 3 gives also false with number, forgot String as the argument when switching to lodash 3
    Zaiban
    @Zaiban
    it seems that the definition of Number is different in IE11 than other browsers.. and thats causing the issue
    Zaiban
    @Zaiban
    or I dont know, I'm still a beginner with JavaScript.. but thanks for help @sveinburne , now we at least have a clue about the bug. Its a shame IE11 is still default browser for so many, Microsoft could have updated them all to Edge regardless of OS while they were at it
    Jules Sam. Randolph
    @jsamr
    @Zaiban You're welcome! It's really a shame IE11 doesn't provide consistency for the equality operation ! Such a shame ... Try with ==instead of === as I've just suggested in the issue tracker
    Jules Sam. Randolph
    @jsamr
    @Zaiban I managed to ask a friend for a Windows 10 laptop, and I made the following checks in IE11 :
    This message was deleted
    Number === Number // true
    Number == Number // true
    Does those checks work for you? What is your IE exact version ? Mine is 11.0.10240.17022? It might be a bug that has been corrected.