Ticket #43 (closed task: fixed)

Opened 1 year ago

Last modified 1 year ago

Use %% when calling Connection.quote?

Reported by: anonymous Assigned to: jgehtland
Priority: major Milestone: v0.9
Component: models Version: 2.0
Keywords: Cc:

Description

I'm not using Streamlined for my app, but I "borrowed" the method conditions_by_like. Under some conditions (sorry, not sure exactly what those are), an expression like Post.find(:all, :conditions => Post.conditions_by_like('search_term") will cause ActiveRecord to raise ArgumentError malformed format string - %'. I found a post about this on the Rails mailing list which says that two percent signs should be used when quoting: i.e, "%%#{value}%%" instead of "%#{value}%" This immediately solved my problem.

Change History

07/08/07 04:15:12 changed by anonymous

  • cc set to painting.
  • component changed from plugin to ui.
  • summary changed from conditions_by_like causes ActiveRecord to raise ArgumentError: malformed format string - %' to wine.
  • priority changed from major to minor.
  • version set to 2.0.
  • milestone set to v0.0.10.
  • keywords changed from conditions_by_like Relevance to wine.
  • type changed from defect to task.

07/19/07 22:03:48 changed by stuart.halloway

  • status changed from new to closed.
  • cc deleted.
  • component changed from ui to models.
  • summary changed from wine to Use %% when calling Connection.quote?.
  • priority changed from minor to major.
  • milestone changed from Post 1.0 to v0.9.
  • keywords deleted.
  • resolution set to fixed.