Skip to content

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?

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? 😄

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