Sha256: 30b0e10c171f021c6297a56701763d36335871a51ef20449228722471cb99999

Contents?: true

Size: 768 Bytes

Versions: 150

Compression:

Stored size: 768 Bytes

Contents

require_dependency "educode_sales/application_controller"

module EducodeSales
  class UserBehaviorsController < ApplicationController
    def index
      respond_to do |format|
        format.html do
        end
        format.json do
          if params[:sort].present? && params[:sort][:field]
            if params[:sort][:field] == 'name'
              @data = LoginHistory.joins(staff: :user).order("users.lastname #{params[:sort][:order]}")
            else
              @data = LoginHistory.order("#{params[:sort][:field]} #{params[:sort][:order]}")
            end
          else
            @data = LoginHistory.order(created_at: :desc)
          end
          @data = @data.page(params[:page]).per(params[:limit])
        end
      end
    end


  end
end

Version data entries

150 entries across 150 versions & 1 rubygems

Version Path
educode_sales-1.10.74 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.73 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.72 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.71 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.70 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.59 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.58 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.49 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.48 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.46 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.41 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.37 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.36 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.35 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.34 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.33 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.31 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.30 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.29 app/controllers/educode_sales/user_behaviors_controller.rb
educode_sales-1.10.28 app/controllers/educode_sales/user_behaviors_controller.rb