meteor-astronomy

Model layer for Meteor

MIT License

Stars
606
Committers
22

Bot releases are visible (Hide)

meteor-astronomy -

Published by lukejagodzinski over 7 years ago

  • Decrease bundle size by limiting usage of lodash and rewriting imports to not include entire lodash but only functions that are used #622
meteor-astronomy -

Published by lukejagodzinski over 7 years ago

  • Speed up multiple updates
  • Add index for the type property
meteor-astronomy -

Published by lukejagodzinski over 7 years ago

  • Allow overriding the "type" property in selector for inherited classes #602
meteor-astronomy -

Published by lukejagodzinski over 7 years ago

  • Pass meteor methods down the inheritance tree #596
  • Allow casting array elements for embedded field names
const user = new User();
// Now casting works also for array elements
user.set('phones.0', '123456789', {
  cast: true
});
meteor-astronomy -

Published by lukejagodzinski over 7 years ago

  • Fix bug with lack of the Enum.js file
meteor-astronomy -

Published by lukejagodzinski over 7 years ago

  • Union type
import { Class, Union } from 'meteor/jagi:astronomy';

const StringOrNumber = Union.create({
  name: 'StringOrNumber',
  types: [String, Number],
  cast(value) {
    if (typeof value !== 'string') {
      return String(value);
    }
    return value;
  }
});

const Item = Class.create({
  name: 'Item',
  fields: {
    strOrNum: StringOrNumber
  }
});
meteor-astronomy -

Published by lukejagodzinski over 7 years ago

  • Fix email validation so that it accepts all allowed characters
  • Option to validate only modified fields
user.firstName = 'John';
user.validate({
  modified: true
});
  • Do not set default values on fetch if the Astro.config.defaults flag is set to false
Astro.config.defaults = false;
User.findOne(); // Default values won't be set
meteor-astronomy -

Published by lukejagodzinski almost 8 years ago

  • Fix console.warn error in MS Edge
  • Add missing lodash import
meteor-astronomy -

Published by lukejagodzinski almost 8 years ago

  • Fix #570 by not adding the _isNew property to classes without collection attached
meteor-astronomy -

Published by lukejagodzinski almost 8 years ago

  • Fix #564 a bug with not catching meteor method errors thrown on the client
  • Fix #551 by adding modules' aliases
  • Fix #560 and undeprecate _isNew also fixing the _isNew property in the beforeInit event
meteor-astronomy -

Published by lukejagodzinski almost 8 years ago

  • Temporary fix #556 for detecting $inc and $push modifiers on document update
meteor-astronomy -

Published by lukejagodzinski almost 8 years ago

  • Fix #557 not retrieving multiple raw values of nested fields
meteor-astronomy -

Published by lukejagodzinski almost 8 years ago

  • Fix #546 wrong merging of Date fields
meteor-astronomy -

Published by lukejagodzinski almost 8 years ago

  • Fix #538 - cast default values
meteor-astronomy -

Published by lukejagodzinski almost 8 years ago

  • Fix #541 deprecation warning during inheritance
meteor-astronomy -

Published by lukejagodzinski almost 8 years ago

  • #537 Improve casting empty string for required and optional fields
// Required fields:
item.set('number', '', {cast: true}); // Casts to 0
item.set('boolean', '', {cast: true}); // Casts to false
item.set('date', '', {cast: true}); // Does not cast
item.set('object', '', {cast: true}); // Does not cast
item.set('list', '', {cast: true}); // Does not cast
// Optional fields:
item.set('number', '', {cast: true}); // Casts to null
item.set('boolean', '', {cast: true}); // Casts to null
item.set('date', '', {cast: true}); // Casts to null
item.set('object', '', {cast: true}); // Casts to null
item.set('list', '', {cast: true}); // Casts to null
  • #482 Deprecate using doc._isNew and introduce a new Class.isNew method and fix a bug with wrong value of the doc._isNew property in the afterInit event
const Item = Class.create({
  name: 'Item',
  collection: new Mongo.Collection('items'),
  events: {
    afterInsert(e) {
      const doc = e.target;
      Item.isNew(doc);
    }
  }
});
  • #478 Allow options (transient, immutable, undefined) as the last argument of the raw() method.
  • Allow options (transient, immutable, undefined) as the last argument of the get() method.
  • #536 Extend child classes when extending parent class
  • #475 Pass full path name in validation error object for double nested documents
  • Small bug fixes and code cleaning
meteor-astronomy -

Published by lukejagodzinski almost 8 years ago

  • Fix #534 a bug when non object values were unnecessary resolved
meteor-astronomy -

Published by lukejagodzinski almost 8 years ago

  • Fix resolving values bug when using the "fields" options
meteor-astronomy -

Published by lukejagodzinski almost 8 years ago

  • Fix a bug causing the softremove behavior not to work with version >=2.2.4
meteor-astronomy -

Published by lukejagodzinski almost 8 years ago

user.set({
  firstName: 123 // Will be casted to the "123" string
}, {
  cast: true
});
const user = new User(userFormData);
user.save({
  cast: true
});
const user = new User(userFormData);
user.validate({
  cast: true
});
const addressData = {
  state: 'CA'
};
// Will not override the "city" property in address.
user.set('address', addressData, {
  merge: true
});
  • Allow turning off default values in the find() method
const users = User.find(selector, {
  defaults: false
}).fetch();
  • Allow turning off the resolve feature for performance improvements
Astro.config.resolving = false;