Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Compatibility with Ruby 2.0 (including smart redirects fix) #263

Merged
merged 2 commits into from

4 participants

@mehanoid

Original pull request: #262

Fixed same problem with "respond_to?" for smart redirects correct work.

corny and others added some commits
@corny corny Compatibility with ruby 2.0
Passing true as second argument to respond_to? to check for protected methods in Ruby 2.0.
e3f54db
@mehanoid mehanoid Fix smart redirects for compatibility with ruby 2.0 0f252c0
@corny

Oh thanks, I failed to notice the second call.

@joelmoss joelmoss merged commit 820e4f6 into josevalim:master
@wyaeld

+1, ran into this yesterday. Is there a reason for not publishing a new version of the gem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 27, 2013
  1. @corny

    Compatibility with ruby 2.0

    corny authored
    Passing true as second argument to respond_to? to check for protected methods in Ruby 2.0.
  2. @mehanoid
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/inherited_resources/base_helpers.rb
View
4 lib/inherited_resources/base_helpers.rb
@@ -267,7 +267,7 @@ def respond_with_dual_blocks(object, options, &block) #:nodoc:
# It's extend by HasScopeHelpers.
#
def apply_scopes_if_available(target_object) #:nodoc:
- respond_to?(:apply_scopes) ? apply_scopes(target_object) : target_object
+ respond_to?(:apply_scopes, true) ? apply_scopes(target_object) : target_object
end
# Symbols chain in base helpers return nothing. This is later overwriten
@@ -292,7 +292,7 @@ def smart_collection_url
if respond_to? :index
url ||= collection_url rescue nil
end
- if respond_to? :parent
+ if respond_to? :parent, true
url ||= parent_url rescue nil
end
url ||= root_url rescue nil
Something went wrong with that request. Please try again.