Fix for Issue #23 (unable to find custom sections) #50

Merged
merged 2 commits into from Jan 6, 2012

Conversation

Projects
None yet
2 participants
@scrozier

scrozier commented Jan 5, 2012

(This is my first pull request, so please be gentle with me!)

It looks like this was just an oversight, neglecting to put the exception_notifier directory at the end of the specification for the custom section path.

I have tested it in my application and it is working.

If you'd like me to write a test for this specifically, let me know.

@smartinez87

This comment has been minimized.

Show comment
Hide comment
@smartinez87

smartinez87 Jan 5, 2012

Owner

Yes, please add a test for this and I'll merge it.

Owner

smartinez87 commented Jan 5, 2012

Yes, please add a test for this and I'll merge it.

@scrozier

This comment has been minimized.

Show comment
Hide comment
@scrozier

scrozier Jan 6, 2012

OK, the root cause of this issue turned out to be a little different than I thought at first.

It looks like when ExceptionNotifier::Notifier is loaded, Rails.root has not yet been defined (maybe a Rails 2 -> Rails 3 change?). Consequently, the app level location for views (where new view partials are to be found) is not correctly appended to view_paths.

I tried a couple of approaches, but wound up appending the app level location to view_paths in ExceptionNotifier::Notifier#exception_notification, essentially just before the view is actually needed.

I added a test (and revised a related one) that fails on the current master branch and succeeds on the code represented by this pull request.

Hope this is satisfactory!

scrozier commented Jan 6, 2012

OK, the root cause of this issue turned out to be a little different than I thought at first.

It looks like when ExceptionNotifier::Notifier is loaded, Rails.root has not yet been defined (maybe a Rails 2 -> Rails 3 change?). Consequently, the app level location for views (where new view partials are to be found) is not correctly appended to view_paths.

I tried a couple of approaches, but wound up appending the app level location to view_paths in ExceptionNotifier::Notifier#exception_notification, essentially just before the view is actually needed.

I added a test (and revised a related one) that fails on the current master branch and succeeds on the code represented by this pull request.

Hope this is satisfactory!

@smartinez87

This comment has been minimized.

Show comment
Hide comment
@smartinez87

smartinez87 Jan 6, 2012

Owner

Yes, I don't quite like appending to view_path in the very method, but as of now I don't see any other better solution to it.
Thanks for the patch!

Owner

smartinez87 commented Jan 6, 2012

Yes, I don't quite like appending to view_path in the very method, but as of now I don't see any other better solution to it.
Thanks for the patch!

smartinez87 added a commit that referenced this pull request Jan 6, 2012

Merge pull request #50 from scrozier/master
Fix for Issue #23 (unable to find custom sections)

@smartinez87 smartinez87 merged commit 20122d2 into smartinez87:master Jan 6, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment