Skip to content

Commit

Permalink
added a tickets method for tags by abusing String
Browse files Browse the repository at this point in the history
  • Loading branch information
granth committed Nov 26, 2008
1 parent b947c66 commit c7d6b14
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/lighthouse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ def cleanup_tags(tags)
t.gsub! /(^')|('$)/, ''
t.gsub! /[^a-z0-9 \-_@\!']/, ''
t.strip!
t.prefix_options = prefix_options
t
end
end
Expand Down Expand Up @@ -290,6 +291,17 @@ class Changeset < Base
class Change < Array; end
end

class String
attr_writer :prefix_options
def prefix_options
@prefix_options || {}
end

def tickets(options = {})
Ticket.find(:all, :params => options.merge(prefix_options).update(:q => "tagged:'#{self}'"))
end
end

module ActiveResource
class Connection
private
Expand Down

0 comments on commit c7d6b14

Please sign in to comment.