#62 open
rbpandey

Field.to_param should check to see if Merb is defined before parsing query parameters

Reported by rbpandey | November 17th, 2008 @ 03:50 PM

I changed the else block to an elsif for Merb query param parsing. I also added a dumb else block to just return the key_and_value local variable.

def to_param
return nil if disabled?

  key_and_value = "#{name}=#{escaped_value}"

  if defined?(CGIMethods)
    CGIMethods.parse_query_parameters(key_and_value)
  elsif defined?(ActionController::AbstractRequest)
    ActionController::AbstractRequest.parse_query_parameters(key_and_value)
  elsif defined?(::Merb)
    ::Merb::Parse.query(key_and_value)
  else
    key_and_value
  end
end

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Ruby Acceptance Testing for Web applications.

Shared Ticket Bins

People watching this ticket

Attachments

Referenced by

Pages