From 6a9c7e493a309670e2dba433331ed75a374aaf39 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Fri, 10 Mar 2023 19:07:23 -0600 Subject: Añade gema de paginación MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 ++ Gemfile.lock | 13 +++++++++++++ app/models/company.rb | 2 ++ 3 files changed, 17 insertions(+) diff --git a/Gemfile b/Gemfile index da61184..c0ca794 100644 --- a/Gemfile +++ b/Gemfile @@ -50,6 +50,8 @@ gem 'bcrypt', '~> 3.1.7' # Json web tokens. gem 'jwt' +gem 'kaminari' + group :development, :test do # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem gem 'debug', platforms: %i[mri mingw x64_mingw] diff --git a/Gemfile.lock b/Gemfile.lock index 51ebfcd..b91ee17 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -92,6 +92,18 @@ GEM jsonapi-serializer (2.2.0) activesupport (>= 4.2) jwt (2.7.0) + kaminari (1.2.2) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.2.2) + kaminari-activerecord (= 1.2.2) + kaminari-core (= 1.2.2) + kaminari-actionview (1.2.2) + actionview + kaminari-core (= 1.2.2) + kaminari-activerecord (1.2.2) + activerecord + kaminari-core (= 1.2.2) + kaminari-core (1.2.2) loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) @@ -199,6 +211,7 @@ DEPENDENCIES faker jsonapi-serializer jwt + kaminari mysql2 puma (~> 5.0) rack-cors diff --git a/app/models/company.rb b/app/models/company.rb index 134d8e9..0fb5cd8 100644 --- a/app/models/company.rb +++ b/app/models/company.rb @@ -12,6 +12,8 @@ class Company < ApplicationRecord has_one_attached :logo + paginates_per 10 + def to_param short_name end -- cgit v1.2.3