Skip to content

Commit e6813e3

Browse files
authored
[*] Has Many Relationships - Fix records count, i.e consider filters when counting (#348)
1 parent f80f1d1 commit e6813e3

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Change Log
22

33
## [Unreleased]
4+
### Fixed
5+
- Has Many Relationships - Fix records count, i.e consider filters when counting.
46

57
## RELEASE 4.2.0 - 2020-01-22
68
### Added

app/services/forest_liana/has_many_getter.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def initialize(resource, association, params)
1919
end
2020

2121
def perform
22-
@records = @search_query_builder.perform(@records)
22+
@records
2323
end
2424

2525
def count
@@ -64,10 +64,12 @@ def model_association
6464
end
6565

6666
def prepare_query
67-
@records = get_resource()
68-
.find(@params[:id])
69-
.send(@params[:association_name])
70-
.eager_load(@includes)
67+
@records = @search_query_builder.perform(
68+
get_resource()
69+
.find(@params[:id])
70+
.send(@params[:association_name])
71+
.eager_load(@includes)
72+
)
7173
end
7274

7375
def offset

0 commit comments

Comments
 (0)