Skip to content

Commit 23bf69c

Browse files
committed
[#62] Separate positional and keyword arguments for Ruby 3.0
1 parent 443b4d9 commit 23bf69c

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

lib/parse/model/associations/has_many.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def has_many(key, scope = nil, **opts)
406406
opts[:through] ||= :query
407407

408408
if opts[:through] == :query
409-
return has_many_queried(key, scope, opts)
409+
return has_many_queried(key, scope, **opts)
410410
end
411411

412412
# below this is the same

lib/parse/model/classes/user.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ def self.session(token, opts = {})
417417
def self.session!(token, opts = {})
418418
# support Parse::Session objects
419419
token = token.session_token if token.respond_to?(:session_token)
420-
response = client.current_user(token, opts)
420+
response = client.current_user(token, **opts)
421421
response.success? ? Parse::User.build(response.result) : nil
422422
end
423423

lib/parse/model/core/fetching.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module Fetching
1515
# @param opts [Hash] a set of options to pass to the client request.
1616
# @return [self] the current object, useful for chaining.
1717
def fetch!(opts = {})
18-
response = client.fetch_object(parse_class, id, opts)
18+
response = client.fetch_object(parse_class, id, **opts)
1919
if response.error?
2020
puts "[Fetch Error] #{response.code}: #{response.error}"
2121
end

lib/parse/query.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ def distinct(field)
635635
compile_query[:distinct] = Query.format_field(field).to_sym
636636
@count = old_count_value
637637
# perform aggregation
638-
return client.aggregate_objects(@table, compile_query.as_json, _opts).result
638+
return client.aggregate_objects(@table, compile_query.as_json, **_opts).result
639639
else
640640
raise ArgumentError, "Invalid field name passed to `distinct`."
641641
end
@@ -654,7 +654,7 @@ def distinct(field)
654654
def count
655655
old_value = @count
656656
@count = 1
657-
res = client.find_objects(@table, compile.as_json, _opts).count
657+
res = client.find_objects(@table, compile.as_json, **_opts).count
658658
@count = old_value
659659
res
660660
end
@@ -766,7 +766,7 @@ def _opts
766766
# @param compiled_query [Hash] the compiled query
767767
# @return [Parse::Response] a response for a query request.
768768
def fetch!(compiled_query)
769-
response = client.find_objects(@table, compiled_query.as_json, _opts)
769+
response = client.find_objects(@table, compiled_query.as_json, **_opts)
770770
if response.error?
771771
puts "[ParseQuery] #{response.error}"
772772
end

0 commit comments

Comments
 (0)