Added nice front page stuff, fixing sqlite issues, adding user payments to profiles

This commit is contained in:
2013-02-14 00:29:22 -07:00
parent ed75ea0e90
commit cefd4b3878
8 changed files with 44 additions and 6 deletions

View File

@@ -6,7 +6,7 @@ def index
@num_users = User.count
@recent_users = User.where("created_at > ?", DateTime.now - 7.days).count
if can? :read, User then
@recent_user_names = User.where("created_at > ?", DateTime.now - 7.days)
@recent_user_names = User.where("member_level > 10").accessible_by(current_ability).order('created_at desc').limit(5)
end
@num_door_opens = DoorLog.where("key = 'G'").count
@today_door_opens = DoorLog.where("key = 'G' AND created_at > ?", DateTime.now - 1.day).count

View File

@@ -36,6 +36,7 @@ class UsersController < ApplicationController
# GET /users/1
# GET /users/1.json
def show
@payments = Payment.where(:user_id => @user.id).order('date desc').limit(10)
respond_to do |format|
format.html # show.html.erb
format.json { render :json => @user }