seyhunak / twitter-bootstrap-rails

Twitter Bootstrap for Rails 6.0, Rails 5 - Rails 4.x Asset Pipeline
https://github.com/seyhunak/twitter-bootstrap-rails
4.49k stars 997 forks source link

DEPRECATION WARNING: Calling #in? #613

Closed breakliu closed 10 years ago

breakliu commented 11 years ago

DEPRECATION WARNING: Calling #in? with multiple arguments is deprecated, please pass in an object that responds to #include? instead. (called from is_active? at /Users/mac/.rvm/gems/ruby-2.0.0-p247/bundler/gems/twitter-bootstrap-rails-9a0a31096ece/app/helpers/navbar_helper.rb:162)

ruralocity commented 11 years ago

I noticed this in some feature specs, using Ruby 2.0.0-p247 and Rails 4.0.0. Haven't tested it extensively beyond my own application, but changing the is_active? method in app/helpers/navbar_helper.rb removed the warnings for me. You need to pass an array to in?:

  def is_active?(path)
    # "active" if uri_state(path).in?(:active, :chosen)
    "active" if uri_state(path).in?([:active, :chosen])
  end
egyptiankarim commented 11 years ago

@ruralocity That does seem to do the trick.

ruralocity commented 11 years ago

@egyptiankarim cool. Looks like @angrauel has submitted a patch to address this.

mrgrauel commented 11 years ago

That's true, in Pull Request #614