{"action":"created","issue":{"url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/368","repository_url":"https://api.github.com/repos/jagi/meteor-astronomy","labels_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/368/labels{/name}","comments_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/368/comments","events_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/368/events","html_url":"https://github.com/jagi/meteor-astronomy/issues/368","id":152941085,"number":368,"title":"[v2] Class Inheritance","user":{"login":"talha-asad","id":2978646,"avatar_url":"https://avatars.githubusercontent.com/u/2978646?v=3","gravatar_id":"","url":"https://api.github.com/users/talha-asad","html_url":"https://github.com/talha-asad","followers_url":"https://api.github.com/users/talha-asad/followers","following_url":"https://api.github.com/users/talha-asad/following{/other_user}","gists_url":"https://api.github.com/users/talha-asad/gists{/gist_id}","starred_url":"https://api.github.com/users/talha-asad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talha-asad/subscriptions","organizations_url":"https://api.github.com/users/talha-asad/orgs","repos_url":"https://api.github.com/users/talha-asad/repos","events_url":"https://api.github.com/users/talha-asad/events{/privacy}","received_events_url":"https://api.github.com/users/talha-asad/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jagi/meteor-astronomy/labels/feature","name":"feature","color":"008000"},{"url":"https://api.github.com/repos/jagi/meteor-astronomy/labels/v2","name":"v2","color":"d93f0b"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-05-04T06:48:31Z","updated_at":"2016-05-07T03:46:50Z","closed_at":null,"body":"Consider the following:\r\n\r\n```js\r\nAnimals = new Mongo.Collection('animals');\r\n\r\nAnimal = Astro.Class.create({\r\n  name: 'Animal',\r\n  collection: Animals,\r\n  typeField: 'type',\r\n  fields: {\r\n    _id: {type: String, index: 1},\r\n    name: {type: String},\r\n    options: {type: Object, default() { return {}; }}\r\n  },\r\n  methods: {\r\n    speak() { return 'Animal does not know how to speak'; }\r\n  }\r\n});\r\n\r\nDog = Animal.inherit({\r\n  name: 'Dog',\r\n  fields: {\r\n    color: {type: String},\r\n    breed: {type: String}\r\n  },\r\n  methods: {\r\n    speak() { return 'Woof'; }\r\n  }\r\n});\r\n\r\nCat = Animal.inherit({\r\n  name: 'Cat',\r\n  fields: {\r\n    owner: {type: String}\r\n  },\r\n  methods: {\r\n    speak() { return 'Meow'; }\r\n  }\r\n});\r\n```\r\n\r\nIf a `Cat` and a `Dog` are inserted, doing a `Animal.find({}).fetch()` should return them both, however currently this not the case, is this by design or a bug?"},"comment":{"url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/comments/217603836","html_url":"https://github.com/jagi/meteor-astronomy/issues/368#issuecomment-217603836","issue_url":"https://api.github.com/repos/jagi/meteor-astronomy/issues/368","id":217603836,"user":{"login":"katrotz","id":1922321,"avatar_url":"https://avatars.githubusercontent.com/u/1922321?v=3","gravatar_id":"","url":"https://api.github.com/users/katrotz","html_url":"https://github.com/katrotz","followers_url":"https://api.github.com/users/katrotz/followers","following_url":"https://api.github.com/users/katrotz/following{/other_user}","gists_url":"https://api.github.com/users/katrotz/gists{/gist_id}","starred_url":"https://api.github.com/users/katrotz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katrotz/subscriptions","organizations_url":"https://api.github.com/users/katrotz/orgs","repos_url":"https://api.github.com/users/katrotz/repos","events_url":"https://api.github.com/users/katrotz/events{/privacy}","received_events_url":"https://api.github.com/users/katrotz/received_events","type":"User","site_admin":false},"created_at":"2016-05-07T03:46:50Z","updated_at":"2016-05-07T03:46:50Z","body":"@jagi Actually getting `[Cat, Cat, Dog, Dog]` makes perfect case as long as these behave like animals inheriting its methods and properties, IMHO"}}