Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tallty_import_export
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
tallty_import_export
Commits
663a6c2c
Commit
663a6c2c
authored
Nov 21, 2020
by
Ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix excel pagination
parent
6266c3a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
excel.rb
lib/tallty_import_export/excel.rb
+2
-2
excel_spec.rb
spec/excel_spec.rb
+1
-1
No files found.
lib/tallty_import_export/excel.rb
View file @
663a6c2c
...
...
@@ -69,9 +69,9 @@ module TalltyImportExport
def
initialize
ary
,
page:
,
per_page:
@raw_ary
=
ary
@current_page
=
page
@current_page
=
page
.
to_i
@total_pages
=
(
@raw_ary
.
count
/
per_page
.
to_f
).
ceil
parsed_ary
=
@raw_ary
[(
page
-
1
)
*
per_page
...
(
page
)
*
per_page
]
parsed_ary
=
@raw_ary
[(
page
.
to_i
-
1
)
*
per_page
.
to_i
...
(
page
.
to_i
)
*
per_page
.
to_i
]
super
(
parsed_ary
)
end
...
...
spec/excel_spec.rb
View file @
663a6c2c
...
...
@@ -8,7 +8,7 @@ RSpec.describe TalltyImportExport::Excel do
end
it
'Excel::Pagination'
do
pagination
=
TalltyImportExport
::
Excel
::
Pagination
.
new
([
1
,
2
,
3
,
4
,
5
,
6
],
page:
2
,
per_page:
2
)
pagination
=
TalltyImportExport
::
Excel
::
Pagination
.
new
([
1
,
2
,
3
,
4
,
5
,
6
],
page:
'2'
,
per_page:
'2'
)
expect
(
pagination
.
count
).
to
eq
(
6
)
expect
(
pagination
.
current_page
).
to
eq
(
2
)
expect
(
pagination
.
total_pages
).
to
eq
(
3
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment