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

Kaminari::Hooks init call is no longer needed #660

Closed
wants to merge 1 commit into from

Conversation

twe4ked
Copy link

@twe4ked twe4ked commented Jan 21, 2017

See: kaminari/kaminari@653143b

For people Googling:

/Users/odin/Dev/twe4ked/remember/config/initializers/elasticsearch.rb:1:in `<top (required)>': uninitialized constant Kaminari::Hooks (NameError)
        from /Users/odin/.gem/ruby/2.3.1/gems/railties-5.0.1/lib/rails/engine.rb:648:in `block in load_config_initializer'
        from /Users/odin/.gem/ruby/2.3.1/gems/activesupport-5.0.1/lib/active_support/notifications.rb:166:in `instrument'
        from /Users/odin/.gem/ruby/2.3.1/gems/railties-5.0.1/lib/rails/engine.rb:647:in `load_config_initializer'
        from /Users/odin/.gem/ruby/2.3.1/gems/railties-5.0.1/lib/rails/engine.rb:612:in `block (2 levels) in <class:Engine>'
        from /Users/odin/.gem/ruby/2.3.1/gems/railties-5.0.1/lib/rails/engine.rb:611:in `each'
        from /Users/odin/.gem/ruby/2.3.1/gems/railties-5.0.1/lib/rails/engine.rb:611:in `block in <class:Engine>'
        from /Users/odin/.gem/ruby/2.3.1/gems/railties-5.0.1/lib/rails/initializable.rb:30:in `instance_exec'
        from /Users/odin/.gem/ruby/2.3.1/gems/railties-5.0.1/lib/rails/initializable.rb:30:in `run'
        from /Users/odin/.gem/ruby/2.3.1/gems/railties-5.0.1/lib/rails/initializable.rb:55:in `block in run_initializers'
        from /Users/odin/.rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
        from /Users/odin/.rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /Users/odin/.rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
        from /Users/odin/.rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /Users/odin/.rubies/ruby-2.3.1/lib/ruby/2.3.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
        from /Users/odin/.gem/ruby/2.3.1/gems/railties-5.0.1/lib/rails/initializable.rb:44:in `each'
        from /Users/odin/.gem/ruby/2.3.1/gems/railties-5.0.1/lib/rails/initializable.rb:44:in `tsort_each_child'

# ... snip

@karmi
Copy link
Contributor

karmi commented Jan 21, 2017

Nice, thanks! Can you also please check the example, verify that it works, and remove the line also there? I'm wondering how to do this so we don't break old Kaminari versions, maybe call the method if the Hooks constant is defined?

@twe4ked
Copy link
Author

twe4ked commented Jan 21, 2017

I guess this is going to be more of a documentation thing. Perhaps the wording should just change to mention that after version x.x.x you don't need the init line. We could also add a comment above the init call in the example.

Not sure the of the fastest way to get that example going. I can confirm it's not needed in my app. As you can see in the current version of Kaminari it's a no op.

karmi added a commit that referenced this pull request Jan 28, 2017
@twe4ked
Copy link
Author

twe4ked commented Jan 28, 2017

Thanks @karmi!

@karmi
Copy link
Contributor

karmi commented Jan 28, 2017

Hi @twe4ked, sorry, meant to leave a note here, and forgot! Thank you for reporting the issue -- I think it's safer to go with the if defined? ... approach in code and documentation as well, over time we can safely remove it altogether. Thanks again!

@karmi karmi closed this in be5b44d Jan 28, 2017
@twe4ked twe4ked deleted the kaminari-readme branch January 28, 2017 21:21
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