lib/synchronisable/input_parser.rb in synchronisable-1.1.1 vs lib/synchronisable/input_parser.rb in synchronisable-1.1.2
- old
+ new
@@ -23,11 +23,11 @@
result = case
when input.empty?
@synchronizer.fetch
when input.params?
- find_or_fetch_by_data(input.data)
+ find_or_fetch_by_params(input.data)
when input.remote_id?
@synchronizer.find(data)
when input.local_id?
find_by_local_id(data)
when input.array_of_ids?
@@ -39,12 +39,12 @@
[result].flatten.compact
end
private
- def find_or_fetch_by_data(data)
- sync_method = data.key?(:id) ? :find : :fetch
- @synchronizer.send(sync_method, data)
+ def find_or_fetch_by_params(params)
+ sync_method = params.key?(:id) ? :find : :fetch
+ @synchronizer.send(sync_method, params)
end
def find_by_array_of_ids(input)
records = find_imports(input.element_class.name, input.data)
records.map { |r| @synchronizer.find(r.remote_id) }