diff options
author | re4k <re4k@re4k.info> | 2013-04-30 23:09:54 +0900 |
---|---|---|
committer | re4k <re4k@re4k.info> | 2013-04-30 23:09:54 +0900 |
commit | 10c7c723c16d757b5a5692542911a08715966b6f (patch) | |
tree | 995d9b184bc5f9dc9d3d5819c723d62478e29784 /app/controllers/application_controller.rb | |
parent | 617c786764e4c10d85c87945a6c281061e65dcc8 (diff) | |
download | aclog-10c7c723c16d757b5a5692542911a08715966b6f.tar.gz |
refactor (not tested, no compatibility)
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 249b4ea..2c73623 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -4,27 +4,12 @@ class ApplicationController < ActionController::Base before_filter :set_format after_filter :xhtml - def render_tweets(options = {}, &blk) - if params[:count] - count = params[:count].to_i - else - count = 10 + def _get_user(id, screen_name) + if id + User.find_by(id: id.to_i) + elsif screen_name + User.find_by(screen_name: screen_name) end - p options - if options[:force_page] - params[:page] ||= "1" - end - - @items = blk.call.limit(count) - - if params[:page] - @items = @items.page(params[:page].to_i, count) - else - @items = @items.max_id(params[:max_id].to_i) if params[:max_id] - @items = @items.since_id(params[:since_id].to_i) if params[:since_id] - end - - render "shared/tweets" end private |