-
Notifications
You must be signed in to change notification settings - Fork 142
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
Fix conflict with Devise generator #23
Conversation
ActionView::TestCase.class_eval do | ||
include ActionView::Helpers::PrototypeHelper | ||
include ActionView::Helpers::ScriptaculousHelper | ||
if ActionView::TestCase.present? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if defined? ActionView::TestCase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this post, sorry for the delay.
Jeremy, any chance of motion forward on this? Anything further I need to do to make it more merge-able? Thanks, Walter |
@grosser could you check if this solution works for you? If so I'll release with it. |
Afaik there is no way of doing this test, for example the following setup:
so not sure how exactly devise generator is failing, can it require test_case ? |
I didn't get. Seems something is requiring test_case in development already. So why do you need #28? |
Ok. Now I got, the constant is defined but the file was not required. So, seems you fix is the only one that will work. I'll put it back and release with it. Thanks for looking it ❤️ |
maybe there is some magic ruby foo that would also work, I just ran out of ideas :) |
Yes. It was because of the |
@walterdavis do you remember what the problem with testing Rails.env.test was ? |
It was the first thing I wrote, and it worked, but Jeremy suggested that I use TestCase.present?, maybe because it was actually the error that was being thrown. This was my first pull request to a big project, so maybe I caved too soon. |
Hmmm do you know how to reproduce the error you got ? |
The issue was that when I used the official prototype_rails gem, the Devise generators would die horribly whenever I tried to run them. I have been using this fork: https://github.com/anamba/prototype-rails which cooperates reliably. My patch also worked, but this was back in Rails 3, and I haven't kept up with it since I found the anamba version and standardized on it. |
ok, so On Thu, Dec 11, 2014 at 7:03 PM, Walter Lee Davis notifications@github.com
|
I would try it, my recollection is that it did. Walter On Dec 11, 2014, at 10:39 PM, Michael Grosser notifications@github.com wrote:
|
(This is a revised version of the original pull request, cleaning up the commit history to only the needed change.)
This patch allows Prototype-Rails to work with the latest Devise generators. As requested, this no longer uses Rails.env to check whether TestCase is loaded.