Skip to content

Commit

Permalink
Updates oct 2024 (#1071)
Browse files Browse the repository at this point in the history
  • Loading branch information
epugh authored Oct 16, 2024
1 parent 74f1302 commit f5a2f73
Show file tree
Hide file tree
Showing 8 changed files with 596 additions and 602 deletions.
273 changes: 142 additions & 131 deletions Gemfile.lock

Large diffs are not rendered by default.

16 changes: 4 additions & 12 deletions app/controllers/admin/users/pulses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,22 @@ def set_data
case params[:data]
when 'metadata'
@data = CaseMetadatum.where(user_id: @user.id)
.where('last_viewed_at >= :start AND last_viewed_at <= :end',
start: params[:start],
end: params[:end])
.where(last_viewed_at: (params[:start])..(params[:end]))
.group(:last_viewed_at)
.count
when 'scores'
@data = Score.where(user_id: @user.id)
.where('created_at >= :start AND created_at <= :end',
start: params[:start],
end: params[:end])
.where(created_at: (params[:start])..(params[:end]))
.group(:created_at)
.count
when 'cases-created'
@data = Case.where(owner_id: @user.id)
.where('created_at >= :start AND created_at <= :end',
start: params[:start],
end: params[:end])
.where(created_at: (params[:start])..(params[:end]))
.group(:created_at)
.count
when 'teams-created'
@data = Team.where(owner_id: @user.id)
.where('created_at >= :start AND created_at <= :end',
start: params[:start],
end: params[:end])
.where(created_at: (params[:start])..(params[:end]))
.group(:created_at)
.count
when 'queries-created'
Expand Down
8 changes: 4 additions & 4 deletions app/models/judgement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ def mark_judge_later!
end

# Based on a judgement, find the previous one made by the
# same user, but prior to that judgement, or the most recent judgement!
# same user, but prior to that judgement, or return the most recent judgement!
# rubocop:disable Layout/LineLength
def previous_judgement_made
query_doc_pair.book.judgements.where(judgements: { user: user }).where(
'judgements.updated_at < ?', updated_at.nil? ? DateTime.current : updated_at
).reorder('judgements.updated_at DESC').first
query_doc_pair.book.judgements.where(judgements: { user: user }).where(judgements: { updated_at: ...(updated_at.nil? ? DateTime.current : updated_at) }).reorder('judgements.updated_at DESC').first
end
# rubocop:enable Layout/LineLength
end
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"license": "Apache-2.0",
"dependencies": {
"@popperjs/core": "^2.11.6",
"@rails/actioncable": "7.2.0",
"@rails/activestorage": "7.2.0",
"@rails/actioncable": "7.2.101",
"@rails/activestorage": "7.2.101",
"ace-builds": "^1.32.2",
"angular": "~1.8.3",
"angular-animate": "^1.8.3",
Expand Down Expand Up @@ -50,7 +50,7 @@
"karma": "^6.4.1",
"karma-chrome-launcher": "3.2.0",
"karma-jasmine": "5.1.0",
"puppeteer": "^22.0.0"
"puppeteer": "^23.0.0"
},
"resolutions": {}
}
6 changes: 0 additions & 6 deletions test/controllers/books_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,4 @@ def test_combining_single_rater_strategy_into_multiple_rater_strategy_book_works
assert_equal book_with_multiple_raters.query_doc_pairs.count, 2
assert_equal book_with_multiple_raters.judgements.count, 2
end

def test_combinining_multiple_rater_strategy_into_single_works
end

def test_combining_same_user_same_query_doc_merges
end
end
2 changes: 2 additions & 0 deletions test/controllers/proxy_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

# rubocop:disable Layout/LineLength
class ProxyControllerTest < ActionDispatch::IntegrationTest
# See webmock.rb for the corresponding mocks.
#
test 'should require a url query parameter' do
get proxy_fetch_path
assert_response :bad_request
Expand Down
6 changes: 3 additions & 3 deletions test/support/webmock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def setup
'Content-Type' => 'application/json',
'Cookie' => '',
'Https' => 'off',
'User-Agent' => /Faraday.*/,
'User-Agent' => /Faraday/,
}
)
.to_return(status: 200, body: mock_statedecoded_body)
Expand All @@ -179,7 +179,7 @@ def setup
'Content-Type' => 'application/json',
'Cookie' => '',
'Https' => 'off',
'User-Agent' => /Faraday.*/,
'User-Agent' => /Faraday/,
}
)
.to_return(status: 200, body: mock_statedecoded_body)
Expand All @@ -204,7 +204,7 @@ def setup
'Content-Type' => 'application/json',
'Cookie' => '',
'Https' => 'off',
'User-Agent' => 'Faraday v2.9.0',
'User-Agent' => /Faraday/,
}
)
.to_return(status: 200, body: '', headers: {})
Expand Down
Loading

0 comments on commit f5a2f73

Please sign in to comment.