Updated door logs to work with new schema
This commit is contained in:
parent
4fc18013d9
commit
cc3857604b
|
@ -5,7 +5,7 @@ class DoorLogsController < ApplicationController
|
|||
# GET /door_logs
|
||||
# GET /door_logs.json
|
||||
def index
|
||||
@door_logs = DoorLog.find(:all, :order => "created_at DESC")
|
||||
@door_logs = DoorLog.find(:all, :order => "created_at DESC", :limit => 500)
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
|
|
|
@ -72,8 +72,8 @@ Guide to log keys and data:
|
|||
end %>
|
||||
<% @cardnum = (door_log.data.to_i+(@divided_tmp*32767)).to_s(16) %>
|
||||
<%= "Card: "+@cardnum %>
|
||||
<% @card_user = User.find(:first,:conditions=>['card_number LIKE ?', @cardnum]) %>
|
||||
<%= "("+@card_user.name+")" unless @card_user.nil? %>
|
||||
<% @card = Card.find(:first,:conditions=>['card_number LIKE ?', @cardnum]) %>
|
||||
<%= "("+@card.user.name+")" unless @card.nil? %>
|
||||
</td>
|
||||
<% else
|
||||
@divided_tmp = nil
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
# encoding: UTF-8
|
||||
# This file is auto-generated from the current state of the database. Instead
|
||||
# of editing this file, please use the migrations feature of Active Record to
|
||||
# incrementally modify your database, and then regenerate this schema definition.
|
||||
|
|
Loading…
Reference in New Issue
Block a user