-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
collection method load_records
should pass parameters
#83
Comments
Depends on how you structure the implementation of your collection. If you had class Foo::Things < Foo::Collection
attribute :page
attribute :per_page
def all
load get_things(page: page, per_page: per_page).data
end
end
Foo.new.things(page: 1, per_page: 3).each {|thing| thing.call } # works The following works when you consider class Foo::Things < Foo::Collection
def all(page:, per_page:)
load get_things(page: page, per_page: per_page).data
end
end
Foo.new.things(page: 1, per_page: 3).each {|thing| thing.call } # does not work
Foo.new.things.all(page: 1, per_page: 3).each {|thing| thing.call } # works |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When loading a collection if you do
the parameters won't get passed through to the
all
call that theload_records
method calls.It works if you call
The text was updated successfully, but these errors were encountered: