Skip to content

fix cannot use this inside model #320

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

Closed
wants to merge 1 commit into from
Closed

Conversation

thakerng
Copy link

Cannot use this inside model because in Promise.try haven't passed context of model yet.

@maxtruxa
Copy link
Member

maxtruxa commented Jul 15, 2016

I think it wasn't the intention to allow this (no pun intended) as model was supposed to be just a plain object, but I like the change. The ability to use this would be really useful to implement a stateful model.

Could you add tests to verify the added functionality?

@@ -36,7 +36,7 @@ function AbstractGrantType(options) {

AbstractGrantType.prototype.generateAccessToken = function() {
if (this.model.generateAccessToken) {
return Promise.try(this.model.generateAccessToken);
return Promise.try(this.model.generateAccessToken,[], this.model);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a space before [] please? 😄

@@ -48,7 +48,7 @@ AbstractGrantType.prototype.generateAccessToken = function() {

AbstractGrantType.prototype.generateRefreshToken = function() {
if (this.model.generateRefreshToken) {
return Promise.try(this.model.generateRefreshToken);
return Promise.try(this.model.generateRefreshToken,[], this.model);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a space before [] please? 😄

@ruimarinho ruimarinho modified the milestones: 3.0.0, 3.0.0-b3 Oct 14, 2016
@mjsalinger mjsalinger modified the milestones: 3.0.0-b4, 3.0.0-b3 Oct 25, 2016
@mjsalinger
Copy link
Contributor

Closing due to inactivity.

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

Successfully merging this pull request may close these issues.

5 participants