Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    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.
    Mateusz Qunabu
    @qunabu
    Hello. I'm having issue with saving field to connection. I get Exception while invoking method '/Astronomy/insert' TypeError: undefined is not a function has anyone experience something similar ?
    Rand Nix
    @therenix
    Is there a trick to get V2 to install? I've done "Meteor add jagi:astronomy" but it looks in my .meteor dir like it installed 1.2.11 -- also the first time I try to use the imported Class, I get an undefined error....
    Thomas ن
    @duvrai_twitter
    Where should I report a bug for the 2.x documentation?
    Thomas ن
    @duvrai_twitter
    Essentially in http://jagi.github.io/meteor-astronomy/v2#transient-fields this should be replaced with e.currentTarget.
    Rand Nix
    @therenix

    Why is this:

      update({Meteor, LocalState}, data) {
        Meteor.call('companies.find', data._id, (err, res) => {
          if (err) {
            return LocalState.set('COMPANY_FIND_ERROR', err.message);
          } else {
            let comp = res;
            comp.modifiedBy = Meteor.user().username;
            comp.name = data.name;
            comp.compNum = data.compNum;
            comp.addressOne = data.addressOne;
            comp.addressTwo = data.addressTwo;
            comp.addressThree = data.addressThree;
            comp.addressFour = data.addressFour;
            comp.addressDisplay = data.addressDisplay;
            comp.country = data.country;
            comp.phone = data.phone;
            comp.email = data.email;
            comp.fax = data.fax;
            Meteor.call('companies.add', comp, (err1, res1) => {
              if (err) {
                console.log('Error Detected:  ', err1.message);
                return LocalState.set('COMPANY_ADD_ERROR', err1.message);
              } else {
                console.log('Successfully saved!', res1);
              }
            });
          }
        });

    giving me:

    E11000 duplicate key error collection: meteor.companies index: _id_ dup key: { : \\"GyiJ4bcv7jT98mBba\\" }"

    Rand Nix
    @therenix
    Is there a better way to do an update from a React Form?
    ioseb
    @realioseb
    @therenix i m not sure but i think your method 'companies.find' returns object containing '_id' which must be unique in collection. then you are sending that object back to server to create new record with existing '_id'
    @therenix and if you want your app more secure: 'comp.modifiedBy = Meteor.user().username;' such things must be done on server, considering that I can call 'companies.add' from browser console and send all kind of data i wish
    burggraben
    @burggraben
    Only since my last update attributes of instances of subclasses are set to undefined when they were queried by their parent class. For example like let child = Parent.findOne({_id: childId}) leads to child.childAttribute === undefined, when childAttribute is set and defined in the fields of the Child = Parent.inherit(… class. Is this intended?
    M. Aufa Husen R.
    @aufahr
    Hi im having a problem with astronomy in which im calling a save function on a server with meteor methods and it throws an exception that says save() is not a function, any clues why? help..
    Adalberto Soares
    @soaresa
    Maybe you are getting the object with Cars.find() (Collection) and not like Car.find() (Astronomy Class)
    M. Aufa Husen R.
    @aufahr
    im trying to create/insert a new one to db
    and yes i've refer to the astronomy class correctly
    Ścibor Rudnicki
    @sciborrudnicki
    Hi, i am trying to use astronomy, but i have got an error: 404, reason: "Method '/Astronomy/insert' not found". Actually i use simpleSchema and Collection2 with success.