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

"Nothing to annotate" in rails 4.2 #173

Closed
ekampp opened this issue Mar 17, 2014 · 12 comments · Fixed by #193
Closed

"Nothing to annotate" in rails 4.2 #173

ekampp opened this issue Mar 17, 2014 · 12 comments · Fixed by #193
Assignees
Labels
Milestone

Comments

@ekampp
Copy link
Contributor

ekampp commented Mar 17, 2014

Disclaimer: I'm aware that 4.2 is in alpha at the moment.

After upgrading to rails 4.2.0.alpha, annotation always yields Nothing annotated.

Running it with the bundle exec annotate --trace parameter yields the following:

State :complete for :levelup_state is already defined in :state
/Users/emil/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/closure_tree-4.4.0/lib/closure_tree/support.rb:29: warning: already initialized constant FeatHierarchy
/Users/emil/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/closure_tree-4.4.0/lib/closure_tree/support.rb:29: warning: previous definition of FeatHierarchy was here
Nothing annotated.

As you can see, the warnings are unrelated to Annotate, and yields nothing of interest indicating why the annotation didn't find any models to annotate, even though there's several models in the project.

@ctran
Copy link
Owner

ctran commented Mar 17, 2014

The latest version is actually 2.6.2. You may wan to try that.

@ekampp
Copy link
Contributor Author

ekampp commented Mar 17, 2014

I have both tried the latest gem >= 2.6.2 and directly from github. Neither solves the problem. And it seems to work when using rails 4.0 and 4.2 4.1.

@seuros
Copy link

seuros commented Apr 2, 2014

@ekampp
And it seems to work when using rails 4.0 and 4.2. you mean 4.1

@ekampp
Copy link
Contributor Author

ekampp commented Apr 2, 2014

Indeed I do, @seuros, thanks.

@rahuljayaraman
Copy link

Facing the same issues with v2.6.3 & edge rails (4.2.0.alpha)

@ctran
Copy link
Owner

ctran commented Apr 5, 2014

Sorry, 2.6.3 just has a small fix.

@ctran ctran added this to the v2.6.4 milestone Apr 5, 2014
@ctran ctran added the bug label Apr 5, 2014
@ctran ctran self-assigned this Apr 5, 2014
@bigardone
Copy link

Same issue here using 2.6.3 and Rails 4.1.1

@ekampp
Copy link
Contributor Author

ekampp commented Jun 11, 2014

I found the offending line: lib/annotate/annotate_models.rb:386, which tries (e.g.) 'User' == 'user', which is never true.
So it seems the problem is in the ActiveSupport::Inflector.underscore method, which may once have underscores a class, but doesn't any more. Now it seems it can only handle strings.

ekampp added a commit to ekampp/annotate_models that referenced this issue Jun 11, 2014
Fixes ctran#173, by ensuring that the model is coerced to a string before it's run through `ActiveSupport::Inflector.underscore`, which then correctly compares to the filename (which is a string already).
@dlynam
Copy link

dlynam commented Mar 11, 2015

I'm seeing this issue in Rails 4.2.0 (Ruby 2.2.0) still. I've tried multiple versions (v2.6.6 and v2.6.7). Could this still be an issue?

@ekampp
Copy link
Contributor Author

ekampp commented Mar 11, 2015

@dlynam are you sure it's the exact same issue? I haven't used this gem for a while, so I don't know if this is still an issue. Can you track down, where your exact problem arises from?

@dlynam
Copy link

dlynam commented Mar 11, 2015

@ekampp looks like this issue has already been fixed, just not pushed to -v2.6.7 #235

@bcackerman
Copy link

Running gem 'annotate', '2.6.5' and it works. I rolled back from 2.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants