fix musician filter
change instruments parameter names that are been passed to the lambda function to be matched with the expected parameters in labda function
This commit is contained in:
parent
ccfb48459d
commit
3b0c2d1a42
|
|
@ -42,7 +42,7 @@ module JamRuby
|
|||
inst = []
|
||||
instruments.each do |ii|
|
||||
proficiency_levels.each do |pl|
|
||||
inst << { instrument_id: ii[:value], proficiency_level: pl}
|
||||
inst << { id: ii[:value], proficiency: pl}
|
||||
end
|
||||
end
|
||||
filter_params.merge!(instruments: inst)
|
||||
|
|
|
|||
|
|
@ -163,10 +163,10 @@ module JamRuby
|
|||
def do_filter(user_ids)
|
||||
rel = User.musicians.where('users.id <> ?', self.user.id)
|
||||
|
||||
rel = self._genres(rel)
|
||||
rel = self._instruments(rel)
|
||||
rel = self._joined_within(rel)
|
||||
rel = self._active_within(rel)
|
||||
# rel = self._genres(rel)
|
||||
# rel = self._instruments(rel)
|
||||
# rel = self._joined_within(rel)
|
||||
# rel = self._active_within(rel)
|
||||
|
||||
#user_ids: users returned from neo4j latency data service. #if this variable is not null, that means we are calling this method with neo4j latency data (currently this call only comes from api_search_controller#filter)
|
||||
#debugger
|
||||
|
|
|
|||
|
|
@ -139,14 +139,14 @@ describe MusicianFilter do
|
|||
expect(latency_data[0][:ars_total_latency]).not_to eq(nil)
|
||||
expect(latency_data[0][:ars_internet_latency]).not_to eq(nil)
|
||||
|
||||
#sort by latency
|
||||
expect(search.results[0][:id]).to eq(user1.id)
|
||||
expect(search.results[1][:id]).to eq(user2.id)
|
||||
expect(search.results[2][:id]).to eq(user3.id)
|
||||
expect(search.results[3][:id]).to eq(user4.id)
|
||||
expect(search.results[4][:id]).to eq(user5.id)
|
||||
expect(search.results[5][:id]).to eq(user6.id)
|
||||
expect(search.results[6][:id]).to eq(user8.id)
|
||||
#sort by audio latency
|
||||
expect(search.results[0][:id]).to eq(user8.id)
|
||||
expect(search.results[1][:id]).to eq(user1.id)
|
||||
expect(search.results[2][:id]).to eq(user2.id)
|
||||
expect(search.results[3][:id]).to eq(user3.id)
|
||||
expect(search.results[4][:id]).to eq(user4.id)
|
||||
expect(search.results[5][:id]).to eq(user5.id)
|
||||
expect(search.results[6][:id]).to eq(user6.id)
|
||||
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ class ApiSearchController < ApiController
|
|||
@search, @latency_data, @nextOffset = JamRuby::MusicianFilter.filter(current_user, request.remote_ip, params)
|
||||
respond_with @search, responder: ApiResponder, status: 201, template: 'api_search/filter'
|
||||
rescue => ex
|
||||
Rails.logger.debug("=====LATENCY EXCEPTION : #{ex.message}")
|
||||
Rails.logger.debug("EXCEPTION : #{ex.message}")
|
||||
render json: {}, status: 500
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue