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

[WIP] Models and more #82

Merged
merged 5 commits into from Jul 18, 2015

Conversation

Projects
None yet
6 participants
@samselikoff
Owner

samselikoff commented Apr 7, 2015

  • basic schema, model, relation
  • belongs to
  • has many
  • update route handler api - probably inject schema instead of db (db accessible via schema.db)

@samselikoff samselikoff referenced this pull request Apr 11, 2015

Closed

Models #69

@samselikoff samselikoff force-pushed the models-and-more branch 2 times, most recently from aa93253 to ad0b286 Apr 12, 2015

@samselikoff samselikoff force-pushed the models-and-more branch 2 times, most recently from 0a7d893 to a71f73b Apr 25, 2015

@samselikoff samselikoff force-pushed the models-and-more branch 2 times, most recently from 5a21ee0 to bf6f96c May 16, 2015

@seawatts

This comment has been minimized.

Contributor

seawatts commented Jun 3, 2015

Hey do you think it might make sense to break this into smaller PRs? This one is getting huge.

@samselikoff

This comment has been minimized.

Owner

samselikoff commented Jun 3, 2015

Yah, this is the first time I've really worked on such a big feature in a separate branch like this. What would be the way to split it up? All the new objects are related to each other..

@seawatts

This comment has been minimized.

Contributor

seawatts commented Jun 3, 2015

Yeah thats always hard. What I do sometimes just to make it easier is pull some of the code onto separate branches and then merge back into this branch just to make it a little easier to review. But again it's kinda hard when everything becomes very coupled up.

@@ -1,5 +1,12 @@
# Ember CLI Mirage Changelog
## next
Changes:

This comment has been minimized.

@seawatts

seawatts Jun 3, 2015

Contributor

We may want to add a deprecation warning for this in v0.0.30?
And then actually do the release in v0.1.x

@seawatts

This comment has been minimized.

Contributor

seawatts commented Jun 3, 2015

Maybe you could separate it by your checkpoints above?
belongsTo,
hasMany,
etc

@samselikoff samselikoff force-pushed the models-and-more branch from 3e47b26 to 4fa5005 Jun 8, 2015

@samselikoff

This comment has been minimized.

Owner

samselikoff commented Jun 8, 2015

i would be dead without tests.

also, es6 works under /addon now!!111 time to clean up these classes

@samselikoff samselikoff force-pushed the models-and-more branch from 391380e to 442903d Jun 10, 2015

@samselikoff

This comment has been minimized.

Owner

samselikoff commented Jun 25, 2015

@seawatts I'm happy to rebase this, how should I organize? Put belongsTo + tests in one commit, hasMany + tests in another?

@seawatts

This comment has been minimized.

Contributor

seawatts commented Jun 25, 2015

@samselikoff Yeah that sounds pretty good to me. It will just make it easier to read the PR and find potential bugs.

@samselikoff samselikoff force-pushed the models-and-more branch from 78fc24c to f5c7baa Jul 5, 2015

@samselikoff samselikoff force-pushed the models-and-more branch 2 times, most recently from 82e29be to fe5c976 Jul 17, 2015

@samselikoff

This comment has been minimized.

Owner

samselikoff commented Jul 17, 2015

I'm going to merge this soon, bc I should be able to undo the two breaking changes, now that I'm dropping ie8 support and can use getter/setters:

  • I changed db.collection to db.collection.all(). Will revert
  • I changed db.collection.update(target, attrs) to db.collection.update(attrs, target). Will revert

I want to do this so I can go ahead and merge all this in, as it's completely backwards compatible. This way we can work on serializers in a new PR.

@seawatts

This comment has been minimized.

Contributor

seawatts commented Jul 17, 2015

That sounds great @samselikoff! 👍 Thanks for continuing to work on this! I can't wait for this to land!

@samselikoff samselikoff force-pushed the models-and-more branch from fe5c976 to da74423 Jul 18, 2015

samselikoff added a commit that referenced this pull request Jul 18, 2015

@samselikoff samselikoff merged commit 03ebb66 into master Jul 18, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@samselikoff

This comment has been minimized.

Owner

samselikoff commented Jul 18, 2015

😓 whew!

ok so these are usable now, but not really useful. next step will be to add base serializers - essentially, if a route handler returns a model, just call model.attrs.

I already have this mostly implemented, hopefully will get to it later today.

@seawatts

This comment has been minimized.

Contributor

seawatts commented Jul 20, 2015

👍

@cibernox

This comment has been minimized.

Collaborator

cibernox commented Jul 20, 2015

🎊

@binhums

This comment has been minimized.

Contributor

binhums commented Jul 20, 2015

🎉

@jamesdixon

This comment has been minimized.

Contributor

jamesdixon commented Aug 13, 2015

@samselikoff is there any documentation on the associations you implemented in this PR?

@samselikoff

This comment has been minimized.

Owner

samselikoff commented Aug 13, 2015

no, bc they really need serializers to be effective. well kind of. but yah I want to implement those first (getting very close!)

@jamesdixon

This comment has been minimized.

Contributor

jamesdixon commented Aug 13, 2015

Gotcha, thanks!

From: Sam Selikoff notifications@github.com
Reply: samselikoff/ember-cli-mirage reply@reply.github.com>
Date: August 12, 2015 at 9:51:14 PM
To: samselikoff/ember-cli-mirage ember-cli-mirage@noreply.github.com>
Cc: jamesdixon jim.w.dixon@gmail.com>
Subject:  Re: [ember-cli-mirage] [WIP] Models and more (#82)

no, bc they really need serializers to be effective. well kind of. but yah I want to implement those first (getting very close!)


Reply to this email directly or view it on GitHub.

@samselikoff samselikoff deleted the models-and-more branch Sep 23, 2015

@dslh

This comment has been minimized.

dslh commented Jan 28, 2016

Hi, just a quick bump for docs on this feature, are there any available? The official docs at ember-cli-mirage.com are still waiting for this PR to land.

I'd be happy to contribute a nicely-written patch to the docs myself if that's possible, if I could just get a quick usage example to get me started.

@samselikoff

This comment has been minimized.

Owner

samselikoff commented Jan 28, 2016

@dslh I've kept the default docs pointed to the latest release version, but in the bottom-left you can select the {beta version of the docs](http://www.ember-cli-mirage.com/docs/v0.2.0-beta.3/). You'll see the docs have been restructured. Have a look at the Defining routes guide for an overview on models, and also the Models, Schema and Serializer reference docs for more info.

@dslh

This comment has been minimized.

dslh commented Jan 28, 2016

Awesome! Thanks so much for the fast reply 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment