Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

will_paginate rails4 deprecation warnings when used with groupdate gem #318

maxwell opened this Issue Jul 4, 2013 · 2 comments


None yet
2 participants

maxwell commented Jul 4, 2013

(this is a bug only when using BOTH gems, so I am placing the bug in both places)

Tracking down warnings on Rails 4

When trying to update my existing Rails 4 app, I was coming up with some weird warnings littered all over my tests, and with some Googling, some other people seemed to have it too.


/Users/maxwell/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.0/lib/active_record/core.rb:103: warning: already initialized constant #<Module:0x007fbb60919038>::AttrNames
/Users/maxwell/.rvm/gems/ruby-2.0.0-p247/gems/activerecord-4.0.0/lib/active_record/core.rb:103: warning: previous definition of AttrNames was here

After doing some real yak shaving, I realized that it was having the combo of both the will_paginate and groupdate gems in my Gemfile.

Here is the repo showing the problem: https://github.com/maxwell/rails4_will_paginate_groupdate_warnings

To see the errors for yourself.

rake db:migrate

bundle && rails r "Post.first"

Then, you will see the warning

if you comment out either of the gems and re-run

bundle && rails r "Post.first"

no warnings!

Not sure of exactly WHY, but at least now I know WHO :)

maxwell commented Jul 4, 2013

ankane/groupdate#19 <= issue @groupdate


mislav commented Jul 4, 2013

First of all, these aren't Rails deprecation warnings. They're simply generic Ruby warnings about redefined constant.

Since will_paginate doesn't touch or mention a constant named AttrNames, I think it's safe to say that will_paginate is not the cause of this. It might help trigger it, but it's definitely not the cause.

@mislav mislav closed this Jul 4, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment