Skip to content
This repository has been archived by the owner on Jul 30, 2020. It is now read-only.

isSingleResource, model.get is not a function #2

Closed
alexanderjeurissen opened this issue May 20, 2015 · 2 comments
Closed

isSingleResource, model.get is not a function #2

alexanderjeurissen opened this issue May 20, 2015 · 2 comments

Comments

@alexanderjeurissen
Copy link
Owner

currently the following regex is used to determine if a route is a single resource:

  isSingleResource: Ember.computed.match('currentPath', /(?:^(?!.*s\b))(?:^(?!index)).*$/),

this regex checks if one of the following conditions is true:

  • currentRouteName is not equal to index
  • currentRouteName isn't plural (only checks if it doesn't end with an 'S')

however this regex breaks on routes such as: not-found because it
a. isn't equal to index
b. isn't plural

a simple check in the activeRoute computed property on the presence of the id property is a possible workaround that I'll implement soon.

@gordonbisnor
Copy link
Contributor

I created a pull request related to this: #3 –– not sure if my solution is the best solution, but it worked for me in my project.

@alexanderjeurissen
Copy link
Owner Author

closed by #3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants