Skip to content

Commit f19a779

Browse files
committed
Merge branch 'main' of github.com:cs169/snapcon
2 parents bf76578 + 1a7adf8 commit f19a779

File tree

7 files changed

+2
-18
lines changed

7 files changed

+2
-18
lines changed

app/controllers/users_controller.rb

+1-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
class UsersController < ApplicationController
44
before_action :authenticate_user!, only: :search
5-
before_action :set_currency_options, only: [:edit, :new, :create, :update]
65
load_and_authorize_resource
76

87
# GET /users/1
@@ -41,7 +40,7 @@ def search
4140

4241
def user_params
4342
params[:user][:timezone] = params[:user][:timezone].presence || nil
44-
params.require(:user).permit(:name, :biography, :nickname, :affiliation, :default_currency,
43+
params.require(:user).permit(:name, :biography, :nickname, :affiliation,
4544
:picture, :picture_cache, :timezone)
4645
end
4746

@@ -50,9 +49,5 @@ def user_params
5049
def load_user
5150
@user ||= (params[:id] && params[:id] != 'current' && User.find(params[:id])) || current_user
5251
end
53-
5452
# rubocop:enable Naming/MemoizedInstanceVariableName
55-
def set_currency_options
56-
@currency_options = CurrencyConversion::VALID_CURRENCIES.map { |currency| [currency, currency] }
57-
end
5853
end

app/models/currency_conversion.rb

-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,5 @@ class CurrencyConversion < ApplicationRecord
2424
VALID_CURRENCIES = %w[AUD CAD CHF CNY EUR GBP JPY USD].freeze
2525
belongs_to :conference
2626
validates :rate, numericality: { greater_than: 0 }
27-
# Ensure from_currency and to_currency are among the VALID_CURRENCIES
28-
validates :from_currency, :to_currency, inclusion: { in: VALID_CURRENCIES }
2927
validates :from_currency, uniqueness: { scope: :to_currency }, on: :create
3028
end

app/models/user.rb

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# confirmed_at :datetime
1717
# current_sign_in_at :datetime
1818
# current_sign_in_ip :string
19-
# default_currency :string
2019
# email :string default(""), not null
2120
# email_public :boolean default(FALSE)
2221
# encrypted_password :string default(""), not null

app/views/users/edit.html.haml

-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
The timezone setting will update the event schedules to show using the time you selected.
2424
Your browser is current set to
2525
%span.js-localTimezone
26-
.form-group
27-
= f.label :default_currency, 'Default Currency'
28-
= f.select :default_currency, options_for_select(@currency_options, selected: @user.default_currency), {}, { class: 'form-control' }
2926
.form-group
3027
= f.label :avatar
3128
%br

db/schema.rb

+1-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
14-
ActiveRecord::Schema[7.0].define(version: 2024_03_06_000725) do
15-
13+
ActiveRecord::Schema[7.0].define(version: 2024_02_26_175634) do
1614
# These are extensions that must be enabled in order to support this database
1715
enable_extension "pg_stat_statements"
1816
enable_extension "plpgsql"
@@ -626,7 +624,6 @@
626624
t.boolean "is_disabled", default: false
627625
t.string "picture"
628626
t.string "timezone"
629-
t.string "default_currency"
630627
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
631628
t.index ["email"], name: "index_users_on_email", unique: true
632629
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true

spec/factories/users.rb

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# confirmed_at :datetime
1717
# current_sign_in_at :datetime
1818
# current_sign_in_ip :string
19-
# default_currency :string
2019
# email :string default(""), not null
2120
# email_public :boolean default(FALSE)
2221
# encrypted_password :string default(""), not null

spec/models/user_spec.rb

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# confirmed_at :datetime
1717
# current_sign_in_at :datetime
1818
# current_sign_in_ip :string
19-
# default_currency :string
2019
# email :string default(""), not null
2120
# email_public :boolean default(FALSE)
2221
# encrypted_password :string default(""), not null

0 commit comments

Comments
 (0)