Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Merge branch master into stable #268

Merged
merged 3 commits into from
Jan 10, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Capfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rails'
require 'capistrano/bundler'
require 'whenever/capistrano'

# Use Git
require 'capistrano/scm/git'
Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ group :deploy do
gem 'capistrano-bundler', require: false
gem 'capistrano-rails'
gem 'capistrano-rvm', require: false
gem 'whenever'
gem 'httparty'
end

Expand Down
65 changes: 31 additions & 34 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ GIT
GEM
remote: http://rubygems.org/
specs:
RedCloth (4.3.2)
RedCloth (4.3.3)
actioncable (6.1.7.6)
actionpack (= 6.1.7.6)
activesupport (= 6.1.7.6)
Expand Down Expand Up @@ -81,12 +81,12 @@ GEM
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.5)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
airbrussh (1.5.0)
sshkit (>= 1.6.1, != 1.7.0)
awesome_print (1.9.2)
bcrypt (3.1.19)
bcrypt (3.1.20)
bcrypt_pbkdf (1.1.0)
better_errors (2.10.1)
erubi (>= 1.0.0)
Expand All @@ -96,11 +96,11 @@ GEM
debug_inspector (>= 0.0.1)
bluecloth (2.2.0)
builder (3.2.4)
bullet (7.1.2)
bullet (7.1.4)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
capistrano (3.17.3)
capistrano (3.18.0)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
Expand Down Expand Up @@ -144,7 +144,7 @@ GEM
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
date (3.3.3)
date (3.3.4)
debug_inspector (1.1.0)
devise (4.9.3)
bcrypt (~> 3.0)
Expand All @@ -165,7 +165,7 @@ GEM
actionmailer (>= 5.2, < 8)
activesupport (>= 5.2, < 8)
execjs (2.7.0)
factory_bot (6.3.0)
factory_bot (6.4.2)
activesupport (>= 5.0.0)
ffaker (2.23.0)
ffi (1.16.3)
Expand All @@ -188,7 +188,7 @@ GEM
rspec (>= 2.99.0, < 4.0)
gutentag (2.6.2)
activerecord (>= 3.2.0)
haml (6.2.3)
haml (6.3.0)
temple (>= 0.8.2)
thor
tilt
Expand Down Expand Up @@ -230,10 +230,10 @@ GEM
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.21.4)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
lumberjack (1.2.9)
lumberjack (1.2.10)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
Expand All @@ -243,31 +243,31 @@ GEM
matrix (0.4.2)
method_source (1.0.0)
mini_mime (1.1.5)
mini_portile2 (2.8.4)
mini_portile2 (2.8.5)
mini_racer (0.8.0)
libv8-node (~> 18.16.0.0)
minitest (5.20.0)
multi_xml (0.6.0)
nenv (0.3.0)
net-imap (0.4.1)
net-imap (0.4.7)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
net-protocol (0.2.2)
timeout
net-scp (4.0.0)
net-ssh (>= 2.6.5, < 8.0.0)
net-smtp (0.4.0)
net-protocol
net-ssh (7.2.0)
nio4r (2.5.9)
nokogiri (1.15.4)
nio4r (2.7.0)
nokogiri (1.15.5)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.15.4-x86_64-darwin)
nokogiri (1.15.5-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.15.4-x86_64-linux)
nokogiri (1.15.5-x86_64-linux)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
Expand All @@ -281,10 +281,10 @@ GEM
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
psych (3.3.4)
public_suffix (5.0.3)
puma (6.4.0)
public_suffix (5.0.4)
puma (6.4.2)
nio4r (~> 2.0)
racc (1.7.1)
racc (1.7.3)
rack (2.2.8)
rack-cors (2.0.1)
rack (>= 2.0.0)
Expand Down Expand Up @@ -324,20 +324,20 @@ GEM
method_source
rake (>= 12.2)
thor (~> 1.0)
rake (13.0.6)
rake (13.1.0)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (2.8.2)
regexp_parser (2.8.3)
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rouge (4.1.3)
rouge (4.2.0)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-activemodel-mocks (1.1.0)
rspec-activemodel-mocks (1.2.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
rspec-mocks (>= 2.99, < 4.0)
Expand All @@ -349,7 +349,7 @@ GEM
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-rails (6.0.3)
rspec-rails (6.1.0)
actionpack (>= 6.1)
activesupport (>= 6.1)
railties (>= 6.1)
Expand All @@ -368,10 +368,10 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
sentry-rails (5.12.0)
sentry-rails (5.15.0)
railties (>= 5.0)
sentry-ruby (~> 5.12.0)
sentry-ruby (5.12.0)
sentry-ruby (~> 5.15.0)
sentry-ruby (5.15.0)
concurrent-ruby (~> 1.0, >= 1.0.2)
shellany (0.0.1)
shoulda-matchers (5.3.0)
Expand All @@ -389,18 +389,18 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sshkit (1.21.5)
sshkit (1.21.6)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
temple (0.10.3)
thin (1.8.2)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thor (1.2.2)
thor (1.3.0)
tilt (2.3.0)
timecop (0.9.8)
timeout (0.4.0)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
Expand All @@ -412,8 +412,6 @@ GEM
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
whenever (1.0.0)
chronic (>= 0.6.3)
wirble (0.1.3)
xpath (3.2.0)
nokogiri (~> 1.8)
Expand Down Expand Up @@ -485,7 +483,6 @@ DEPENDENCIES
timecop
uglifier
uuidtools
whenever
wirble
zeitwerk (< 2.6.4)

Expand Down
7 changes: 0 additions & 7 deletions app/assets/javascripts/credence.js

This file was deleted.

1 change: 0 additions & 1 deletion app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*= require predictions
*= require footer
*= require facebox
*= require credence
*/

/* General Page Structure
Expand Down
20 changes: 0 additions & 20 deletions app/assets/stylesheets/credence.css

This file was deleted.

12 changes: 0 additions & 12 deletions app/controllers/api/prediction_group_by_description_controller.rb

This file was deleted.

36 changes: 1 addition & 35 deletions app/controllers/api/prediction_groups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,8 @@ class PredictionGroupsController < AuthorisedController
MAXIMUM_PREDICTION_GROUPS_LIMIT = 1000
DEFAULT_PREDICTION_GROUPS_LIMIT = 100

before_action :find_prediction_group, only: %i[show update]
before_action :find_prediction_group, only: %i[show]
before_action :authorize_to_see_prediction_group, only: [:show]
before_action :authorize_to_update_prediction_group, only: [:update]

def create
prediction_group = UpdatedPredictionGroup.new(PredictionGroup.new,
@user,
prediction_group_params).prediction_group
if prediction_group.save
render json: prediction_group
else
render json: prediction_group.errors, status: :unprocessable_entity
end
end

def index
render json: build_prediction_groups
Expand All @@ -28,17 +16,6 @@ def show
render json: find_prediction_group
end

def update
prediction_group = UpdatedPredictionGroup.new(find_prediction_group,
@user,
prediction_group_params).prediction_group
if prediction_group.save
render json: prediction_group
else
render json: prediction_group.errors, status: :unprocessable_entity
end
end

protected

def find_prediction_group
Expand All @@ -55,13 +32,6 @@ def authorize_to_see_prediction_group
@user.authorized_for?(prediction))
end

def authorize_to_update_prediction_group
prediction_group = find_prediction_group
prediction = prediction_group.try(:predictions).try(:first)
return if prediction.nil?
raise UnauthorizedRequest unless @user.authorized_for?(prediction)
end

def build_prediction_groups
limit = params[:limit].to_i
out_of_range = (1..MAXIMUM_PREDICTION_GROUPS_LIMIT).cover?(limit)
Expand All @@ -74,9 +44,5 @@ def build_prediction_groups
.order(id: :desc)
.limit(limit)
end

def prediction_group_params
params.require(:prediction_group).permit!
end
end
end
13 changes: 0 additions & 13 deletions app/controllers/api/prediction_judgements_controller.rb

This file was deleted.

Loading