Commit 3038a43

mo <mo@mokhan.ca>
2018-09-22 21:18:44
add locale and timezone to users.
1 parent 357d189
app/views/scim/v2/users/show.scim.jbuilder
@@ -16,8 +16,8 @@ json.name do
   json.givenName @user.email
 end
 json.displayName @user.email
-json.locale @user.try(:locale)
-json.timezone @user.try(:timezone)
+json.locale @user.locale
+json.timezone @user.timezone
 json.active true
 json.emails [{ value: @user.email, primary: true }]
 json.groups []
db/migrate/20180922211216_add_timezone_locale_to_users.rb
@@ -0,0 +1,8 @@
+class AddTimezoneLocaleToUsers < ActiveRecord::Migration[5.2]
+  def change
+    change_table :users do |t|
+      t.column :locale, :string, default: 'en', null: false
+      t.column :timezone, :string, default: 'Etc/UTC', null: false
+    end
+  end
+end
db/schema.rb
@@ -10,7 +10,15 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema.define(version: 2018_09_22_174543) do
+ActiveRecord::Schema.define(version: 2018_09_22_211216) do
+
+  create_table "authentications", force: :cascade do |t|
+    t.integer "user_id"
+    t.string "type", null: false
+    t.datetime "created_at", null: false
+    t.datetime "updated_at", null: false
+    t.index ["user_id"], name: "index_authentications_on_user_id"
+  end
 
   create_table "authorizations", force: :cascade do |t|
     t.integer "user_id"
@@ -84,6 +92,8 @@ ActiveRecord::Schema.define(version: 2018_09_22_174543) do
     t.datetime "updated_at", null: false
     t.integer "lock_version", default: 0, null: false
     t.string "mfa_secret", limit: 16
+    t.string "locale", default: "en", null: false
+    t.string "timezone", default: "Etc/UTC", null: false
     t.index ["uuid"], name: "index_users_on_uuid"
   end