Skip to content
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

Extract helper proxy #310

Merged
merged 1 commit into from Oct 15, 2012
Merged

Extract helper proxy #310

merged 1 commit into from Oct 15, 2012

Conversation

haines
Copy link
Contributor

@haines haines commented Oct 14, 2012

Pulling more stuff out of Decorator...

class << self
def helpers
Draper::ViewContext.current
@helpers ||= HelperProxy.new
Copy link
Member

Choose a reason for hiding this comment

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

not sure that helpers method should be memoized. @steveklabnik, there was an issue with it, wasn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, as of e2a757d we are memoizing the view context. This, on the other hand, only memoizes the HelperProxy object, and HelperProxy#view_context delegates to Draper::ViewContext.current, so I think this is safer.

Copy link
Member

Choose a reason for hiding this comment

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

Right. I'm really just not sure what all this effects. We really need some real-world integration tests :/

steveklabnik added a commit that referenced this pull request Oct 15, 2012
@steveklabnik steveklabnik merged commit 7b645ea into drapergem:master Oct 15, 2012
@steveklabnik
Copy link
Member

That said, this seems fine for now. I just have overall concerns.

@haines
Copy link
Contributor Author

haines commented Oct 15, 2012

@steveklabnik Understood! As I mentioned, I think what I did here is the "most safe" memoization.

I'll take a look at integration testing too.

@steveklabnik
Copy link
Member

I pushed a branch, but it's not quite working yet. Check it out.

On Monday, October 15, 2012, Andrew Haines wrote:

@steveklabnik https://github.com/steveklabnik Understood! As I
mentioned, I think what I did here is the "most safe" memoization.

I'll take a look at integration testing too.


Reply to this email directly or view it on GitHubhttps://github.com//pull/310#issuecomment-9461226.

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.

None yet

3 participants