Giter VIP home page Giter VIP logo

annotate_models's People

Contributors

alexch avatar amekss avatar bitaxis avatar ctran avatar cuong-now avatar cyborgmaster avatar dependabot[bot] avatar djsegal avatar drwl avatar dustin avatar fistfvck avatar henrik avatar ijcd avatar jackdanger avatar jeremyolliver avatar kamilbielawski avatar masa-iwasaki avatar miyucy avatar mrjoy avatar nard-tech avatar nofxx avatar olleolleolle avatar robertwahler avatar ryanfox1985 avatar ryanwjackson avatar sashabelozerov avatar smtlaissezfaire avatar thermistor avatar turadg avatar yhirano55 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

annotate_models's Issues

no such file to load -- annotate/annotate_models (MissingSourceFile)

When I run annotate I get this error:

$ annotate
DEPRECATION WARNING: require "activesupport" is deprecated and will be removed in Rails 3. Use require "active_support" instead. (called from /Users/pupeno/.rvm/gems/ruby-1.8.7-p174@lemonfrog/gems/activesupport-2.3.8/lib/activesupport.rb:2)
default config
** Erubis 2.6.5
/Users/pupeno/.rvm/gems/ruby-1.8.7-p174@lemonfrog/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require': no such file to load -- annotate/annotate_models (MissingSourceFile)
        from /Users/pupeno/.rvm/gems/ruby-1.8.7-p174@lemonfrog/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
        from /Users/pupeno/.rvm/gems/ruby-1.8.7-p174@lemonfrog/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
        from /Users/pupeno/.rvm/gems/ruby-1.8.7-p174@lemonfrog/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
        from /Users/pupeno/.rvm/gems/ruby-1.8.7-p174@lemonfrog/gems/annotate-2.4.0/lib/tasks/annotate_models.rake:3
        from /Users/pupeno/.rvm/gems/ruby-1.8.7-p174@global/gems/rake-0.8.7/lib/rake.rb:636:in `call'
        from /Users/pupeno/.rvm/gems/ruby-1.8.7-p174@global/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
        from /Users/pupeno/.rvm/gems/ruby-1.8.7-p174@global/gems/rake-0.8.7/lib/rake.rb:631:in `each'
        from /Users/pupeno/.rvm/gems/ruby-1.8.7-p174@global/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
        from /Users/pupeno/.rvm/gems/ruby-1.8.7-p174@global/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
        from /Users/pupeno/.rvm/rubies/ruby-1.8.7-p174/lib/ruby/1.8/monitor.rb:242:in `synchronize'
        from /Users/pupeno/.rvm/gems/ruby-1.8.7-p174@global/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
        from /Users/pupeno/.rvm/gems/ruby-1.8.7-p174@global/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
        from /Users/pupeno/.rvm/gems/ruby-1.8.7-p174@lemonfrog/gems/annotate-2.4.0/bin/annotate:67
        from /Users/pupeno/.rvm/gems/ruby-1.8.7-p174@lemonfrog/bin/annotate:19:in `load'
        from /Users/pupeno/.rvm/gems/ruby-1.8.7-p174@lemonfrog/bin/annotate:19

FactoryGirl is not supported

It would be awesome if this annotated my FactoryGirl factories as well as all the other stuff. I am only opening this issue to let everyone know that I am working on implementing that.

-d doesn't remove from unit tests

% svn st; annotate; annotate -d; svn st
Curb not found. Using Net::HTTP.
Annotated (9): Account, Answer, Business, Favorite, Friendship, Invitation, Question, Service, User
Curb not found. Using Net::HTTP.
Removed annotation from: Account, Answer, Business, Favorite, Friendship, Invitation, Question, Service, User
M      test/unit/user_test.rb
M      test/unit/favorite_test.rb
M      test/unit/answer_test.rb
M      test/unit/service_test.rb
M      test/unit/invitation_test.rb
M      test/unit/question_test.rb
M      test/unit/business_test.rb
M      test/unit/friendship_test.rb
M      test/unit/account_test.rb

Losing a column after running annotate

I just created a new migration to add a column called "blurb" to a PostgreSQL database. After it ran, I called annotate. It not only could not locate the column, but also when I checked on the database console I saw that it wasn't in the database schema anymore. So I don't know what "annotate" did, but I'm leaning toward not using it anymore until I figure this out.

uninitialized constant Rake (NameError)

Im working with Rails 2.3.8. I put the gem in the Gemfile (I work with Bundler) and I have installed too.

$ annotate
./Rakefile:5: uninitialized constant Rake (NameError)
from /usr/lib/ruby/gems/1.8/gems/annotate-2.4.0/lib/annotate.rb:17:in load' from /usr/lib/ruby/gems/1.8/gems/annotate-2.4.0/lib/annotate.rb:17:inload_tasks'
from /usr/lib/ruby/gems/1.8/gems/annotate-2.4.0/bin/annotate:66
from /usr/bin/annotate:19:in `load'
from /usr/bin/annotate:19

Best annotation position is different for models and fixtures...

The 'best' IMHO position for annotations in models is after all code, since you regularly have to edit it and only refer to annotations irregularly. But for fixtures it's is before all the yaml data, since you can have huge yaml files and scrolling to the bottom is annoying/hard, and use usually only refer to fixtures once or twice in their lifetime (certainly less than models).

Could this be changed to the default behaviour? (I know it makes the current 'before|after' syntax a little hard since it is a mix of both...

Thanks in advance,

'annotate -p before' and # coding: utf-8 ruby magic comment

I like my annotations to be on top of my model definitions (and fixtures etc.).

However almost all my ruby files have non-ascii characters and need to have '# coding: utf-8' at the beginning of each file.

After I run 'annotate -p before' model definitions get inserted before this magic comment and I get many 'invalid multibyte char (US-ASCII)' errors.

Can this be fixed to insert after the magic utf-8 comment?

fix rcov and rdoc tasks in Rakefile

  • the current specs don't pass
  • rake tasks don't catch them all
  • rcov doesn't work well in Ruby 1.9

Revamp the testing framework with RSpec 2 and SimpleCov.

uninitialized constant Rake::DSL (NameError) - Rails 3.1.1

unusable currently with Rails 3.1.1

rubyrails:atelier (ruby-1.9.2@rails311)$ annotate
/Users/yves/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/rake.rb:2482:in const_missing': uninitialized constant Rake::DSL (NameError) from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/bin/annotate:11:in

'
rubyrails:atelier (ruby-1.9.2@rails311)$ annotate
/Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/rake-0.9.2/lib/rake/tasklib.rb:8:in <class:TaskLib>': uninitialized constant Rake::DSL (NameError) from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/rake-0.9.2/lib/rake/tasklib.rb:6:inmodule:Rake'
from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/rake-0.9.2/lib/rake/tasklib.rb:3:in <top (required)>' from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/rake-0.9.2/lib/rake/testtask.rb:4:in<top (required)>'
from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/railties-3.1.1/lib/rails/test_unit/testing.rake:2:in <top (required)>' from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/railties-3.1.1/lib/rails/test_unit/railtie.rb:12:inblock in class:TestUnitRailtie'
from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/railties-3.1.1/lib/rails/railtie.rb:183:in call' from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/railties-3.1.1/lib/rails/railtie.rb:183:inblock in load_tasks'
from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/railties-3.1.1/lib/rails/railtie.rb:183:in each' from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/railties-3.1.1/lib/rails/railtie.rb:183:inload_tasks'
from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/railties-3.1.1/lib/rails/engine.rb:396:in block in load_tasks' from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/railties-3.1.1/lib/rails/application/railties.rb:8:ineach'
from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/railties-3.1.1/lib/rails/application/railties.rb:8:in all' from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/railties-3.1.1/lib/rails/engine.rb:396:inload_tasks'
from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/railties-3.1.1/lib/rails/application.rb:103:in load_tasks' from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:inmethod_missing'
from Rakefile:7:in <top (required)>' from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/annotate-2.4.1.beta1/lib/annotate.rb:20:inload'
from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/annotate-2.4.1.beta1/lib/annotate.rb:20:in load_tasks' from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/annotate-2.4.1.beta1/bin/annotate:66:in<top (required)>'
from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/bin/annotate:21:in load' from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/bin/annotate:21:in'

How do I change the default behavior?

I only want to annotate my models, so every time I have to type '-e tests,fixtures' which is kinda cumbersome.
I've never looked inside gems before so I'm wondering where can I change the default options? Thanks.

dont include this in your gemfile

accidentally did, and since it overwrites method_missing for active_record was ignoring all the beautiful built in stuff.

Took some debugging to find it, just in case anyone else runs into this problem

Annotate don't work with enumerated_attribute gem

I get the following error

Unable to annotate contract.rb: #<MetaProgramming::AliasMethodChainError: method_missing_without_enumerated_attribute already exists.  Circular references not permitted.>

Travis CI build not working

The Rake task is missing dependencies.

$ rake
Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler
rake aborted!
no such file to load -- spec/rake/spectask

annotate -d doesn't work if applied after

522 % svn st; annotate -p after; annotate -d;  svn st; annotate -d -p after; svn st
Curb not found. Using Net::HTTP.
Annotated (9): Account, Answer, Business, Favorite, Friendship, Invitation, Question, Service, User
Curb not found. Using Net::HTTP.
Removed annotation from: Account, Answer, Business, Favorite, Friendship, Invitation, Question, Service, User
M      test/unit/user_test.rb
M      test/unit/favorite_test.rb
M      test/unit/answer_test.rb
M      test/unit/service_test.rb
M      test/unit/invitation_test.rb
M      test/unit/question_test.rb
M      test/unit/business_test.rb
M      test/unit/friendship_test.rb
M      test/unit/account_test.rb
M      test/fixtures/accounts.yml
M      test/fixtures/users.yml
M      test/fixtures/favorites.yml
M      test/fixtures/answers.yml
M      test/fixtures/businesses.yml
M      test/fixtures/services.yml
M      test/fixtures/invitations.yml
M      test/fixtures/questions.yml
M      test/fixtures/friendships.yml
M      app/models/user.rb
M      app/models/favorite.rb
M      app/models/answer.rb
M      app/models/service.rb
M      app/models/invitation.rb
M      app/models/question.rb
M      app/models/business.rb
M      app/models/friendship.rb
M      app/models/account.rb
Curb not found. Using Net::HTTP.
Removed annotation from: Account, Answer, Business, Favorite, Friendship, Invitation, Question, Service, User
M      test/unit/user_test.rb
M      test/unit/favorite_test.rb
M      test/unit/answer_test.rb
M      test/unit/service_test.rb
M      test/unit/invitation_test.rb
M      test/unit/question_test.rb
M      test/unit/business_test.rb
M      test/unit/friendship_test.rb
M      test/unit/account_test.rb
M      test/fixtures/accounts.yml
M      test/fixtures/users.yml
M      test/fixtures/favorites.yml
M      test/fixtures/answers.yml
M      test/fixtures/businesses.yml
M      test/fixtures/services.yml
M      test/fixtures/invitations.yml
M      test/fixtures/questions.yml
M      test/fixtures/friendships.yml
M      app/models/user.rb
M      app/models/favorite.rb
M      app/models/answer.rb
M      app/models/service.rb
M      app/models/invitation.rb
M      app/models/question.rb
M      app/models/business.rb
M      app/models/friendship.rb
M      app/models/account.rb

annotate should ignore magic comment

given a model file:

# encoding: utf-8

class MyModel < ActiveRecord::Base
  # code contains utf-8 characters
end

after run annotate, it becomes:

# == Schema Information
#
# Table name: my_models
# encoding: utf-8

class MyModel < ActiveRecord::Base
  # code contains utf-8 characters
end

this will cause magic comment dont work.

expect:

# encoding: utf-8
# == Schema Information
#
# Table name: my_models

class MyModel < ActiveRecord::Base
  # code contains utf-8 characters
end

cannot annotate 'acronym classes'

Trying to annotate a class with a string of capital letters such as IRSDocuments in a file named "irs_documents.rb" will fail with the message:

Unable to annotate irs_documents.rb: #<NameError: uninitialized constant IrsDocuments>
  • If there is no mechanism to handle this, it should be added
  • If there is a mechanism to handle this, please excuse me, and it should be better documented.

Add Rails 3 install instructions to the README

It wasn't clear from the README if this worked with Rails 3, it appears to do so, adding install instructions for Rails 3 might clarify, something like

Add to Gemfile

gem 'annotate'

The run 'bundle install'

Does it work with rails 3.1rc?

For the first time I use this gem. I find it work on a project with rails3.0, yet I fail to make it run with rails3.1. The rails version I use include 3.1.0.rc4 and 3.1.0.rc3.

The error I get is like:

ree-1.8.7-2011.03@r310/gems/activerecord-3.1.0.rc4/lib/active_record/railties/databases.rake:3: undefined method `namespace' for main:Object (NoMethodError)
.....

        from ./Rakefile:7
        from /.rvm/gems/ree-1.8.7-2011.03@r310/gems/annotate-2.4.0/lib/annotate.rb:17:in `load'

Release as a gem

Hello,

Can you release this plug in as a gem so it's easier to install and update?

Thanks.

Annotate gives Nomethod error.

Hi,
I have ruby 1.9.2 and rails 3.1. I am trying to get annotate 2.4.0 to work, but I get nomethod errors. I have tried uninstall and reinstall but it did not help. Please see the spool after the jump. Any suggestions on how to proceed will help
Thanks,
Tabrez

~/myapps/testapp/app>sudo gem install annotate
Fetching: annotate-2.4.0.gem (100%)
Successfully installed annotate-2.4.0
1 gem installed

~/myapps/testapp/app>bundle exec annotate -p before -e Tests, Fixtures
/Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/railties/databases.rake:3:in <top (required)>': undefined methodnamespace' for main:Object (NoMethodError)
from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:234:in load' from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:234:inblock in load'
from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in block in load_dependency' from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:innew_constants_in'
from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in load_dependency' from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:234:inload'
from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/railtie.rb:26:in block in <class:Railtie>' from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/railtie.rb:183:incall'
from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/railtie.rb:183:in block in load_tasks' from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/railtie.rb:183:ineach'
from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/railtie.rb:183:in load_tasks' from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/engine.rb:396:inblock in load_tasks'
from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/application/railties.rb:8:in each' from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/application/railties.rb:8:inall'
from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/engine.rb:396:in load_tasks' from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/application.rb:103:inload_tasks'
from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in method_missing' from Rakefile:7:in<top (required)>'
from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/annotate-2.4.0/lib/annotate.rb:17:in load' from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/annotate-2.4.0/lib/annotate.rb:17:inload_tasks'
from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/annotate-2.4.0/bin/annotate:66:in <top (required)>' from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/bin/annotate:19:inload'
from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/bin/annotate:19:in `

'

annotate is getting confused by namespaced models

I have several projects that use namespaced models. Some of those models have the same name as a non-namespaced one (i.e.: a User model and a Legacy::User model).

Annotate 2.4.0 did its job well in those cases. I just upgraded to the Github version today (needed the #56 fix), and it is no longer working on those cases: it applies the non-namespaced model annotations to my namespaced model.

Annotate doesn't work on windows

Hi everyone :)

Annotate has a strange behavior on Windows. I managed to install it, I added it to my gemfile, did the bundle install and so... I can launch the command "annotate" but then... nothing happens.

No matter how long I wait nothing come out.

I'm using Rails 3.0.9, mysql2 version 0.2.7 and the very last version of annotate (2.4.0).
Does anyone one have the same issue and came with a solution ?

Thanks to all the good soul who'll try to help me :)

Kulgar.

rake db:annotate broken

This is at least in Rails 3.1, I don't know elsewhere.

$ rake db:annotate --trace
rake aborted!
Don't know how to build task 'db:annotate'
/usr/local/Cellar/ruby/1.9.2-p180/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task_manager.rb:49:in `[]'
/usr/local/Cellar/ruby/1.9.2-p180/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:111:in `invoke_task'
/usr/local/Cellar/ruby/1.9.2-p180/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/usr/local/Cellar/ruby/1.9.2-p180/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/usr/local/Cellar/ruby/1.9.2-p180/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/usr/local/Cellar/ruby/1.9.2-p180/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/local/Cellar/ruby/1.9.2-p180/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/usr/local/Cellar/ruby/1.9.2-p180/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/usr/local/Cellar/ruby/1.9.2-p180/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/local/Cellar/ruby/1.9.2-p180/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/usr/local/Cellar/ruby/1.9.2-p180/lib/ruby/gems/1.9.1/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19:in `<main>'

[Feature] Sort fields in annotation

I think it's good idea to have fields sorted in annotation no matter then they were created in DB.
I propose the following order:

  • id
  • foreign keys - /_id$/
  • other fields
  • timestamps - /_at$/

Can't annotate models using memoization.

If you're using memoize inside of an AR model, you will receive the following error during annotation.

Unable to annotate [MODEL].rb: #<RuntimeError: Already memoized [METHOD]>

Manual placement should be able to override 'position'

At some point, a departed developer had the schema information in our project models at the base of the section of comments before the class. Later, someone else ran annotate in the normal way, which moved all of these back down to the bottom.

While trying to figure out how to get them back up to the top, I found that annotate's -p before will put them above all of the other comments. This is not what I want.

After manually placing them, I find a small change to annotate_models will preserve the previous position. This seems like an all-around good patch. The other option would be adding a new position parameter value for putting it at the bottom of the comments that come before the class definition, but that would clearly be more difficult, and this solution just seems more wise anyway.

annotate routes strangeness

Hi,

I was searching the annotation for a route, and I could not find it, as it happens, it is the first route, so, I went into the code and had a look, and it's dropping the first lines returned by rake routes, which in my case (rails 3.1) is not a file path but the first route.

Can someone else verify this ?

comment of column seems not annotate

| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment
| city | int(11) | NULL | YES | | NULL | | select,insert,update,references | species and city mainly used in search form |

column city with a comment ,but its annotate is not contain it
maybe the Rails did not extract the comment data

Annotate translated models (using globalize2).

When using globalize2 to translate a model, not all fields of the model are actually stored in the table. Some are stored on a separate table called <model_name>_translations. Would it be possible to scan those tables too and annotate the correct model?

For example, if I have a model called Page I have two tables, pages and page_translations. page_translations have the typical id, created_at, updated_at as well as a _id field, in this case page_id and locale fields, that should also be ignored. All other fields can be accessed on the Page model so having it annotated would be useful.

Rails 3.1 problem, i suppose.

When I try to annotate It doesnt work.
The error says namespace, but I believe it is not related with routes.

/Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/activerecord-3.1.0.rc4/lib/active_record/railties/databases.rake:3:in <top (required)>': undefined methodnamespace' for main:Object (NoMethodError)
from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/activesupport-3.1.0.rc4/lib/active_support/dependencies.rb:233:in load' from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/activesupport-3.1.0.rc4/lib/active_support/dependencies.rb:233:inblock in load'
from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/activesupport-3.1.0.rc4/lib/active_support/dependencies.rb:223:in block in load_dependency' from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/activesupport-3.1.0.rc4/lib/active_support/dependencies.rb:639:innew_constants_in'
from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/activesupport-3.1.0.rc4/lib/active_support/dependencies.rb:223:in load_dependency' from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/activesupport-3.1.0.rc4/lib/active_support/dependencies.rb:233:inload'
from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/activerecord-3.1.0.rc4/lib/active_record/railtie.rb:26:in block in <class:Railtie>' from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/railties-3.1.0.rc4/lib/rails/railtie.rb:182:incall'
from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/railties-3.1.0.rc4/lib/rails/railtie.rb:182:in block in load_tasks' from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/railties-3.1.0.rc4/lib/rails/railtie.rb:182:ineach'
from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/railties-3.1.0.rc4/lib/rails/railtie.rb:182:in load_tasks' from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/railties-3.1.0.rc4/lib/rails/application.rb:103:inblock in load_tasks'
from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/railties-3.1.0.rc4/lib/rails/application/railties.rb:8:in each' from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/railties-3.1.0.rc4/lib/rails/application/railties.rb:8:inall'
from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/railties-3.1.0.rc4/lib/rails/application.rb:103:in load_tasks' from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/railties-3.1.0.rc4/lib/rails/railtie/configurable.rb:30:inmethod_missing'
from Rakefile:7:in <top (required)>' from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/annotate-2.4.0/lib/annotate.rb:17:inload'
from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/annotate-2.4.0/lib/annotate.rb:17:in load_tasks' from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/gems/annotate-2.4.0/bin/annotate:66:in<top (required)>'
from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/bin/annotate:19:in load' from /Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/bin/annotate:19:in

'

can't activate activesupport

When I run the annotate script against my application based on Rails 2.2.2, it halted with following error message:
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:149:in `activate': can't activate activesupport (= 2.2.2, runtime), already activated activesupport-2.3.2 (Gem::Exception)

I have installed both Rails 2.2.2 and Rails 2.3.2.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.