Skip to content

Commit

Permalink
[#62] Separate positional and keyword arguments for Ruby 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
apersaud committed May 4, 2021
1 parent 443b4d9 commit 23bf69c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/parse/model/associations/has_many.rb
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def has_many(key, scope = nil, **opts)
opts[:through] ||= :query

if opts[:through] == :query
return has_many_queried(key, scope, opts)
return has_many_queried(key, scope, **opts)
end

# below this is the same
Expand Down
2 changes: 1 addition & 1 deletion lib/parse/model/classes/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def self.session(token, opts = {})
def self.session!(token, opts = {})
# support Parse::Session objects
token = token.session_token if token.respond_to?(:session_token)
response = client.current_user(token, opts)
response = client.current_user(token, **opts)
response.success? ? Parse::User.build(response.result) : nil
end

Expand Down
2 changes: 1 addition & 1 deletion lib/parse/model/core/fetching.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module Fetching
# @param opts [Hash] a set of options to pass to the client request.
# @return [self] the current object, useful for chaining.
def fetch!(opts = {})
response = client.fetch_object(parse_class, id, opts)
response = client.fetch_object(parse_class, id, **opts)
if response.error?
puts "[Fetch Error] #{response.code}: #{response.error}"
end
Expand Down
6 changes: 3 additions & 3 deletions lib/parse/query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ def distinct(field)
compile_query[:distinct] = Query.format_field(field).to_sym
@count = old_count_value
# perform aggregation
return client.aggregate_objects(@table, compile_query.as_json, _opts).result
return client.aggregate_objects(@table, compile_query.as_json, **_opts).result
else
raise ArgumentError, "Invalid field name passed to `distinct`."
end
Expand All @@ -654,7 +654,7 @@ def distinct(field)
def count
old_value = @count
@count = 1
res = client.find_objects(@table, compile.as_json, _opts).count
res = client.find_objects(@table, compile.as_json, **_opts).count
@count = old_value
res
end
Expand Down Expand Up @@ -766,7 +766,7 @@ def _opts
# @param compiled_query [Hash] the compiled query
# @return [Parse::Response] a response for a query request.
def fetch!(compiled_query)
response = client.find_objects(@table, compiled_query.as_json, _opts)
response = client.find_objects(@table, compiled_query.as_json, **_opts)
if response.error?
puts "[ParseQuery] #{response.error}"
end
Expand Down

0 comments on commit 23bf69c

Please sign in to comment.