From ab57edba4078ed8e1ebc981080af0e9b83553ae6 Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Tue, 21 Jun 2011 12:21:13 +1200 Subject: Fix failure on Ruby 1.8.7 where lines can't begin with a . (it has to be on the previous line) --- app/controllers/admin/blog/posts_controller.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'app/controllers/admin/blog/posts_controller.rb') diff --git a/app/controllers/admin/blog/posts_controller.rb b/app/controllers/admin/blog/posts_controller.rb index 7569aa6..9fdc638 100644 --- a/app/controllers/admin/blog/posts_controller.rb +++ b/app/controllers/admin/blog/posts_controller.rb @@ -12,10 +12,9 @@ class Admin::Blog::PostsController < Admin::BaseController end def tags - @tags = BlogPost.tag_counts_on(:tags).where(["tags.name LIKE ?", "%#{params[:term].to_s.downcase}%"]) - .collect { |tag| - {:id => tag.id, :value => tag.name} - } + @tags = BlogPost.tag_counts_on(:tags).where( + ["tags.name LIKE ?", "%#{params[:term].to_s.downcase}%"] + ).map { |tag| {:id => tag.id, :value => tag.name}} render :json => @tags.flatten end -- cgit v1.2.3