Comments (13)
I think this is because the model hook is only called if the route is entered from the url, if not the model should be known (because it's passed to the linkTo). I think something like this is better done in activate
.
from epf.
Thanks for the activate
idea. Clarification on the model
hook:
- if it is a non-dynamic route (i.e. no
:foo_id
segments), then it is always called - if it is a dynamic route, then it is only called on url entry; otherwise a model instance would be expected (from
transitionTo
,replaceWith
, or thelinkTo
helper)
In this case though, the route in question is a non-dynamic route, so using the model
hook should not be the cause.
from epf.
@heartsentwined I think you are correct about the behavior of the model
hook. Is the model hook actually hit here?
Eventually I would like to document a solid set of example CRUD routes.
from epf.
I dropped console.log()
statements in there, and have already checked that they are hit / not hit as described above.
from epf.
What exactly are the symptoms of flush not being called? I assume that the line of code is being hit but nothing is sent to the server? What happens if you create the model and manually set inside setupController
? Also, if you have time to set up a fiddle for this I will debug this deeper.
from epf.
You're right, nothing is sent to the server. The flush is being called, and got resolved immediately. The above is a minimal illustration, a slightly longer example will be
# inside save event
@context.session.flush -> console.log 'done'
# make server sleep, say, 2 secs, on any request
Now flush()
does get called, and on the "successful" case described above, I see the server request in the console, and that done
went back after 2 secs. On the "failure" case, no server request in the console, and done
went back immediately. Quick and dirty testing, I admit.
The fiddle - sorry, I have no experience in making ember fiddles, and I have no idea how to illustrate this with one.
from epf.
Hmm sounds like for whatever reason the session is not seeing the newly created model as being dirty, or if it is, it could be being blocked by another operation on a different related model. Can you share more code (e.g. model definition)? Are there any other models being updated/created before you transition to this route?
from epf.
I'm fairly sure that's all useful code, nevertheless,
class App.Foo extends Ep.Model
desc: Ep.attr 'string' # or whatever, just a dummy field
This has been isolated, there is no other model.
from epf.
Sorry, this one fell off the radar for me. Still stuck in the same place?
from epf.
I will let you know shortly – thanks!
From: Gordon L. Hempton [mailto:[email protected]]
Sent: Wednesday, July 17, 2013 3:43 PM
To: GroupTalent/epf
Subject: Re: [epf] session.create() issue / example (#10)
Sorry, this one fell off the radar for me. Still stuck in the same place?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-21150783.
from epf.
You can close this bug. I don’t know what we did wrong before but it is no longer an issue.
Thanks
Ray
From: Gordon L. Hempton [mailto:[email protected]]
Sent: Wednesday, July 17, 2013 3:43 PM
To: GroupTalent/epf
Subject: Re: [epf] session.create() issue / example (#10)
Sorry, this one fell off the radar for me. Still stuck in the same place?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-21150783.
from epf.
I've been working on other code since this was reported; I'll get back on this when I'm back to epf code.
from epf.
No idea what happened, but as @rayb said, I can no longer reproduce this bug. Perhaps a blanket gem update somewhere during these days did it. Closing issue.
from epf.
Related Issues (20)
- Ep.IdSerializer can break with mongodb HOT 3
- typeKey seems incompatible with non-global Ember HOT 1
- Epf conflict with Ember.SimpleAuth HOT 6
- stricter jqXHR check
- Add `session.persist` HOT 1
- Testing EPF on ember-cli? HOT 6
- how to handle server error 500 on Model.find?
- Slow performance with 100 children HOT 5
- Using with ember-cli? HOT 6
- Still Alive? HOT 2
- Question: Embedded Documents HOT 24
- Embedded Update Error HOT 20
- Must be attached to a session. HOT 3
- Can't build distributable HOT 2
- Sideloading? HOT 6
- api documentation HOT 1
- Can't have belongsTo relation to work... HOT 2
- Delete parent model instance update children HOT 3
- Offline / network issues?
- Is the project dead? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from epf.