New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Collections and fixtures #13
Comments
This is a really good idea! I prefer to have an API like var Posts = new server.Collection('posts'); What you think? I think for the fixtures we can add it our actions API (not documented yet) If we added it to actions we can simply use it like this. server.evalSync(laika.actions.fixtures('coll-name', [{}, {}])); What you think about it? |
great idea! About the fixtures I thought we could attach a copy of the fixtures in a key of the respective collection, been able to use this way: var Posts = server.Collection('posts');
someUpdateFn();
var before = Posts.fixtures.findOne({title: "Laika is cool"});
var after = Posts.findOne({title: "Laika is cool"}); I think I haven't got the idea of actions, but it is important to keep the simplicity of the "extendind Laika" example when defining the fixtures data. I like the idea of having files .js or .json with fixture data, and then just a command to insert all of them at the same time. If your idea of action require to pass the fixtures through |
okay. forget about actions. Let's think about some API for fixtures.
for running we can simply use your functions, with var fixtures = laika.runAllFixtures()
var singleFixture = laika.runFixture('Posts'); for the querying it. I think following makes sense too var Posts = server.Collection('posts');
//fixtures variable is defined in the above code section
var before = fixtures['Posts'].findOne({title: "Laika is cool"});
var after = Posts.findOne({title: "Laika is cool"}); |
I agree with almost everything, but I prefer Note: I reviewed my implementation of Collections and replaced the |
Okay. That's nice. PS. I didn't knew about |
Are you working on this, or shall I start? |
I cannot work on this now, so would be nice if you could. this if (!options._driver) {
if (name && self._connection === Meteor.default_server &&
Meteor._RemoteCollectionDriver)
options._driver = Meteor._RemoteCollectionDriver;
else
options._driver = Meteor._LocalCollectionDriver;
}
self._collection = options._driver.open(name); It seems to me that |
Awesome. I'll work on this. On Fri, Jun 14, 2013 at 12:27 AM, zVictor notifications@github.com wrote:
Arunoda Susiripala @arunoda http://twitter.com/arunoda |
As seen on extendind Laika example, we can extend Laika to use Collections in the same way we would use Meteor API, but extendind we have to declare
Collection
inside of eachtest
.Can we make
Collection
natively available insidetest
?Can we also support fixtures?
The text was updated successfully, but these errors were encountered: