Skip to content
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

Fix for ruby 2.7 warning: The last argument is used as the keyword parameter #92

Merged
merged 1 commit into from
Dec 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/ar_sync/class_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def _sync_child_info(name)
end

def _each_sync_parent(&block)
_sync_parents_info.each(&block)
_sync_parents_info.each { |parent, options| block.call(parent, **options) }
superclass._each_sync_parent(&block) if superclass < ActiveRecord::Base
end

Expand All @@ -46,18 +46,18 @@ def sync_has_data(*names, **option, &data_block)
@_sync_self = true
names.each do |name|
_sync_children_info[name] = nil
_sync_define name, option, &data_block
_sync_define name, **option, &data_block
end
end

def sync_has_many(name, **option, &data_block)
_sync_children_info[name] = [:many, option, data_block]
_sync_has_many name, option, &data_block
_sync_has_many name, **option, &data_block
end

def sync_has_one(name, **option, &data_block)
_sync_children_info[name] = [:one, option, data_block]
_sync_define name, option, &data_block
_sync_define name, **option, &data_block
end

def _sync_has_many(name, order: :asc, limit: nil, preload: nil, association: nil, **option, &data_block)
Expand Down
2 changes: 1 addition & 1 deletion test/helper/test_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def handle_requests(requests)
info = @schema.class._serializer_field_info api_name
api_params = (request['params'] || {}).transform_keys(&:to_sym)
user = @current_user.reload
model = instance_exec(user, api_params, &info.data_block)
model = instance_exec(user, **api_params, &info.data_block)
{ data: ArSync.sync_serialize(model, user, request['query']) }
end
end
Expand Down