Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    maco144
    @maco144
    methods: {
        makeWinner() {
            this.winner = true;
        },
    sets winner to try but then doesnt save it... it is Player.winner, which is its own field class array inside of my main collection
    peterchoo
    @peterchoo

    @maco144 I believe you would be better off using this.set('winner', true); and you would also have to call this.save() in your method. that said, I would personally make sure that this is run inside a server-side Meteor method:

    ```
    Meteor.methods({
    setPlayerWinner: function(playerId) {
    // Perform checks on this.userId ? Security for who can set winner etc.
    var player = Player.findOne(

    Whoops.... Here you go.
    Meteor.methods({
      setPlayerWinner: function(playerId) {
      // Perform checks on this.userId ? Security for who can set winner etc.
      var player = Player.findOne(playerId);
      player.set('winner', true);
      player.save();
      return player;
    });
    maco144
    @maco144
    @peterchoo yeah that makes a lot more sense doing everything through a server method. i was so eager to give it a try through the template i didnt really consider how insecure that would be lol. thanks for the advice
    Andrew Hartwig
    @Andrew1431
    Hey anybody around using v2 astronomy?
    peterchoo
    @peterchoo
    @maco144 No worries, I'm very conscious of it haha. I know Meteor has a lot of latency compensation stuff, which can be handy, but I find the whole allow deny stuff to be a bit complex, and difficult to manage, so I tend to go with the option deny all, and use methods.
    Sergio Tapia
    @sergiotapia
    @jagi Can we use a RC version of astronomy 2.0 today? I'm about to start a large open source Meteor app and would love to use 2.0 in it.
    Gaelan
    @Gaelan
    Is Astronomy 2 documented yet?
    Sam Hulick
    @ffxsam
    is there a way to validate something that has the shape of an Astro class but is not actually an Astro object? for instance: valid = Color.Validate({R: -3, G: 0, B: 255})
    instead of having to do: const c = new Color({R: -3, G: 0, B: 255}); valid = c.validate();
    jagi
    @jagi
    @Gaelan no it's not documented yet
    @ffxsam it's not possible right now but I can allow that. It may be handy
    @sergiotapia yes you can but there can be a few little changes in API of behaviors.
    Sam Hulick
    @ffxsam
    @jagi awesome, that would be helpful. I think it makes sense for validators to be static like that. thanks so much for the awesome work. Astronomy is amazing!
    Deadly0
    @Deadly0
    @jagi can you explain how events work? If i define, for example, before Insert event will it trigger on client and on server together? If yes, how to define server side event only?
    Jørgen Foss Eri
    @jorgeer
    Haha, @Deadly0 , came to ask the exact same question
    Though, with the afterInsert event. I want to trigger a function on the server when a document is inserted on the client side.
    Jørgen Foss Eri
    @jorgeer
    For now I've been using matb33:collection-hooks, but it isn't as elegant as having it in the model.
    MyCollection.getCollection().after.insert(function (userId, doc) {....});
    Anton S
    @SPAHI4
    Does astronomy supports validating of nested classes?
    Mike Cardwell
    @mikecentiq
    When using inheritance with a typeField, I thought that by calling Parent.find(), it would also pull out Child items. It doesn't though. Shouldn't it? This is certainly the expected behaviour to me... Could an option be added to allow this?
    Adam Heller
    @HellerCommaA
    Anyone implement easy search with astronomy yet?
    Adam Heller
    @HellerCommaA
    update: works with no issues
    Adam Heller
    @HellerCommaA
    will boolean false values always show?
    my true values are showing ... just not my false values. trying to make sure it's not a framework thing before i go tearing into my code.
    funny. default: true will display 'true' default: false will display ''
    Adam Heller
    @HellerCommaA
    @jagi intentional?
    ah crap. nvm, it's probably on me. i have to modify my template. nvm.
    maco144
    @maco144
    if I require validator unique on field _id that then means that it will apply to any nested class with _id as well. for example I am inserting Player class with field _id into Record. Record requires unique _ID but Player does not (as player can be part of many records). This is intended since it is a hard rule on the validation of field _id (correct?)
    I hope that is clear. Validator is blocking additional Records from being created if I attempt to insert a Player with _id whose _id is already in a different record. I want the validator to be only on the _id of Record Collection, not on the Player Class _id
    maco144
    @maco144
    @HellerCommaA Did you figure out the true/false showing issue? I think this is a spacebars issue see https://github.com/meteor/meteor/blob/master/packages/spacebars/README.md#in-attribute-values
    Aharon Rossano
    @aharonrossano
    Hi, I can't work out how to get relations to work. My relations object comes back as 'relations: null'.
    I installed the meteor package jagi:astronomy-relations, so I assume it should work.
    got it. it shouldn't be in fields! :) yay
    mm it still didn't work :S
    Aharon Rossano
    @aharonrossano
    is it possible it doesn't work with meteor 0.13?
    Aharon Rossano
    @aharonrossano
    i see. maybe it's not supposed to work just yet: jagi/meteor-astronomy-relations#6
    Charles Baker
    @czbaker
    Random question: If I'm wanting to validate input for something like a user registration form, can Astronomy be used for that, or...should I just do stuff like that manually (validating a valid email format, username length, password length, etc.)
    Arihant Verma
    @gdad-s-river
    Hey @jagi or anyone who knows, may I know the name of the reading progress bar meteor package that you used in the meteor-astronomy documentation page?
    Arihant Verma
    @gdad-s-river
    Also, since I'm starting with Meteor, I'd like to know some resources through which I can start building a blog looking website similar to the astronomy and bulletproofmeteor websites, using Meteor, could anybody help ?
    Sam Hulick
    @ffxsam
    This message was deleted
    This message was deleted
    Antoine Cordelois
    @Billybobbonnet
    Gello all
    Hello*
    Is there testimonies or examples of large app using astronomy out there?
    I am about to migrate a quite large app to a package based architecture
    I consider the whole code refactoring in the process
    and maybe including astronomy