Browse Source

Merge branch 'develop' into standalone_develop

pull/313/head
yystopf 4 years ago
parent
commit
1d7c7eba24
6 changed files with 39 additions and 31 deletions
  1. +1
    -0
      app/controllers/users_controller.rb
  2. +1
    -1
      app/models/user.rb
  3. +28
    -29
      app/models/user_extension.rb
  4. +2
    -1
      app/views/users/get_user_info.json.jbuilder
  5. +1
    -0
      app/views/users/show.json.jbuilder
  6. +6
    -0
      db/migrate/20220428015313_add_super_description_to_user_extensions.rb

+ 1
- 0
app/controllers/users_controller.rb View File

@@ -313,6 +313,7 @@ class UsersController < ApplicationController
:occupation, :technical_title, :occupation, :technical_title,
:school_id, :department_id, :province, :city, :school_id, :department_id, :province, :city,
:custom_department, :identity, :student_id, :description, :custom_department, :identity, :student_id, :description,
:show_super_description, :super_description,
:show_email, :show_location, :show_department] :show_email, :show_location, :show_department]
) )
end end


+ 1
- 1
app/models/user.rb View File

@@ -188,7 +188,7 @@ class User < Owner
attr_accessor :password, :password_confirmation attr_accessor :password, :password_confirmation


delegate :description, :gender, :department_id, :school_id, :location, :location_city, delegate :description, :gender, :department_id, :school_id, :location, :location_city,
:show_email, :show_location, :show_department,
:show_email, :show_location, :show_department, :super_description, :show_super_description,
:technical_title, :province, :city, :custom_department, to: :user_extension, allow_nil: true :technical_title, :province, :city, :custom_department, to: :user_extension, allow_nil: true


before_save :update_hashed_password, :set_lastname before_save :update_hashed_password, :set_lastname


+ 28
- 29
app/models/user_extension.rb View File

@@ -2,35 +2,34 @@
# #
# Table name: user_extensions # Table name: user_extensions
# #
# id :integer not null, primary key
# user_id :integer not null
# birthday :date
# brief_introduction :string(255)
# gender :integer
# location :string(255)
# occupation :string(255)
# work_experience :integer
# zip_code :integer
# created_at :datetime not null
# updated_at :datetime not null
# technical_title :string(255)
# identity :integer
# student_id :string(255)
# teacher_realname :string(255)
# student_realname :string(255)
# location_city :string(255)
# school_id :integer
# description :string(255) default("")
# department_id :integer
# honor :text(65535)
# edu_background :integer
# edu_entry_year :integer
# province :string(255)
# city :string(255)
# custom_department :string(255)
# show_email :boolean default("0")
# show_location :boolean default("0")
# show_department :boolean default("0")
# id :integer not null, primary key
# user_id :integer not null
# birthday :date
# brief_introduction :string(255)
# gender :integer
# location :string(255)
# occupation :string(255)
# work_experience :integer
# zip_code :integer
# created_at :datetime not null
# updated_at :datetime not null
# technical_title :string(255)
# identity :integer
# student_id :string(255)
# teacher_realname :string(255)
# student_realname :string(255)
# location_city :string(255)
# school_id :integer
# description :string(255) default("")
# department_id :integer
# province :string(255)
# city :string(255)
# custom_department :string(255)
# show_email :boolean default("0")
# show_location :boolean default("0")
# show_department :boolean default("0")
# super_description :text(4294967295)
# show_super_description :boolean
# #
# Indexes # Indexes
# #


+ 2
- 1
app/views/users/get_user_info.json.jbuilder View File

@@ -22,5 +22,6 @@ json.province @user.province
json.city @user.city json.city @user.city
json.custom_department @user.custom_department json.custom_department @user.custom_department
json.description @user.description json.description @user.description
json.(@user, :show_email, :show_department, :show_location)
json.super_description @user.super_description
json.(@user, :show_email, :show_department, :show_location, :show_super_description)
json.message_unread_total @message_unread_total json.message_unread_total @message_unread_total

+ 1
- 0
app/views/users/show.json.jbuilder View File

@@ -13,4 +13,5 @@ json.email @user.show_email ? @user.mail : nil
json.province @user.show_location ? @user.province : nil json.province @user.show_location ? @user.province : nil
json.city @user.show_location ? @user.city : nil json.city @user.show_location ? @user.city : nil
json.custom_department @user.show_department ? @user.custom_department : nil json.custom_department @user.show_department ? @user.custom_department : nil
json.super_description @user.show_super_description ? @user.super_description : nil
json.description @user.description json.description @user.description

+ 6
- 0
db/migrate/20220428015313_add_super_description_to_user_extensions.rb View File

@@ -0,0 +1,6 @@
class AddSuperDescriptionToUserExtensions < ActiveRecord::Migration[5.2]
def change
add_column :user_extensions, :super_description, :text, :limit => 4294967295
add_column :user_extensions, :show_super_description, :boolean
end
end

Loading…
Cancel
Save