| @@ -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 | ||||
| @@ -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 | ||||
| @@ -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 | ||||
| # | # | ||||
| @@ -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 | ||||
| @@ -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 | ||||
| @@ -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 | |||||