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

classified sort has problems if no id is present #348

Closed
lnxbil opened this issue Feb 19, 2016 · 3 comments
Closed

classified sort has problems if no id is present #348

lnxbil opened this issue Feb 19, 2016 · 3 comments
Labels
Milestone

Comments

@lnxbil
Copy link

lnxbil commented Feb 19, 2016

Hi,

I want to switch from annotate to annotate --classified-sort and I encounter the following problem:

Unable to annotate app/models/schema_migration.rb: undefined method `type' for nil:NilClass

It also happens to other models without an ID too and the file gets not annotated at all. Without --classified-sort it works as expected, but the columns are obviously not sorted.

@ctran ctran added the bug label Feb 20, 2016
@kfarst
Copy link
Contributor

kfarst commented Feb 25, 2016

@lnxbil from the description of the --classified-sort flag, it will Sort columns alphabetically, but first goes id, then the rest columns, then the timestamp columns and then the association columns so sorting by the id is part of the feature. @ctran should the annotation still work with missing columns?

@lnxbil
Copy link
Author

lnxbil commented Feb 25, 2016

The thing is that I do not want to select my tables with id and without upfront to run different annotation parameters to each of them. I think a fallback to not sorting is still better than skipping entirely, isn't it?

@ctran
Copy link
Owner

ctran commented Feb 25, 2016

I would think so; It should skip the id column if it doesn't exist.

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

No branches or pull requests

3 participants