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

A little constantize update #4784

Merged
merged 2 commits into from Feb 1, 2012
Merged

Conversation

semaperepelitsa
Copy link
Contributor

I was also able to reduce safe_constantize to the following without breaking any tests and I don't really understand what is the point in the deleted lines. Maybe someone could provide some tests explaining and covering them?

def safe_constantize(camel_cased_word)
  begin
    constantize(camel_cased_word)
  rescue NameError => e
  end
end

@tenderlove
Copy link
Member

These changes seem fine to me. Were you able to run even the railties tests with these changes?

@semaperepelitsa
Copy link
Contributor Author

Yes, railties tests all pass.

tenderlove added a commit that referenced this pull request Feb 1, 2012
@tenderlove tenderlove merged commit 7bfdbea into rails:master Feb 1, 2012
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

2 participants