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