Skip to content

Instantly share code, notes, and snippets.

@joshrendek
Created December 29, 2010 02:13
Show Gist options
  • Save joshrendek/758064 to your computer and use it in GitHub Desktop.
Save joshrendek/758064 to your computer and use it in GitHub Desktop.
def list
#render :text =>"test"
current_user = User.find_by_login(params[:login])
status = 1
if !params[:status].nil?
status = params[:status].to_i
end
@tickets = Ticket.find(:all, :conditions => ["parent_id = 0 AND user_id = ? AND status = ?", current_user.id, status], :order => "id DESC")
@t = []
for t in @tickets
@t << ( t.attributes.merge!(:assigned_to_user => t.assigned_to_who?, :waiting_on => t.waiting_on?) )
end
render :xml => @t
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment