tab/app/controllers/pages_controller.rb
2017-01-14 16:22:44 +01:00

14 lines
488 B
Ruby

class PagesController < ApplicationController
require 'statistics'
def landing
query = TransactionsQuery.new(current_user)
@transactions = ActiveRecord::Base.connection.exec_query(query.query.order(query.arel_table[:time].desc).take(10).project(Arel.star).to_sql)
@requests = current_user.incoming_requests.open.includes(:creditor).take(10)
@notifications = current_user.notifications.unread
end
def sign_in_page
@statistics = Statistics.new
end
end