def authorize_web
if session[:user]
- @user = User.where(:status => ["active", "confirmed", "suspended"]).find(session[:user])
+ @user = User.where(:id => session[:user]).where("status IN ('active', 'confirmed', 'suspended')").first
if @user.status == "suspended"
session.delete(:user)
@entries = DiaryEntry.includes(:user).order("created_at DESC").limit(20)
if params[:display_name]
- user = User.where(:status => ["active", "confirmed"]).find_by_display_name(params[:display_name])
+ user = User.where("status IN ('active', 'confirmed')").find_by_display_name(params[:display_name])
if user
@entries = @entries.where(:user_id => user.id, :visible => true )
end
def view
- user = User.where(:status => ["active", "confirmed"]).find_by_display_name(params[:display_name])
+ user = User.where("status IN ('active', 'confirmed')").find_by_display_name(params[:display_name])
if user
@entry = DiaryEntry.where(:id => params[:id],
# from display name, pick up user id if one user's traces only
display_name = params[:display_name]
if !display_name.blank?
- target_user = User.where(:status => ["active", "confirmed"], :display_name => display_name).first
+ target_user = User.where("status IN ('active', 'confirmed')").where(:display_name => display_name).first
if target_user.nil?
@title = t'trace.no_such_user.title'
@not_found_user = display_name
end
def georss
- traces = Trace.where(:visibility => [:public, :identifiable])
+ traces = Trace.where("visibility IN ('public', 'identifiable')")
if params[:display_name]
traces = traces.where(:users => {:display_name => params[:display_name]})