summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2023-03-10 19:07:23 -0600
committerHombreLaser <sebastian-440@live.com>2023-03-10 19:07:23 -0600
commit6a9c7e493a309670e2dba433331ed75a374aaf39 (patch)
treea533cd139040dd9fdf18b81d279464e29a7ac016
parente7c54136f8bba9951fe8e538c91463e7eee09d83 (diff)
Añade gema de paginación
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock13
-rw-r--r--app/models/company.rb2
3 files changed, 17 insertions, 0 deletions
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