Skip to content
Snippets Groups Projects
Commit 2ed1ab18 authored by bfs15's avatar bfs15
Browse files

added education field to users

parent f27faf60
No related branches found
No related tags found
No related merge requests found
......@@ -94,6 +94,16 @@ class V1::UsersController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def user_params
params.require(:user).permit(:name, :email, :description, :password, :password_confirmation, :terms_of_service, :avatar, role_ids: [])
params.require(:user).permit(
:name,
:email,
:description,
:education,
:password,
:password_confirmation,
:terms_of_service,
:avatar,
role_ids: []
)
end
end
......@@ -9,5 +9,23 @@ class UserSerializer < ActiveModel::Serializer
object.followed? current_user
end
attributes :id, :email, :provider, :name, :description, :score, :role_ids, :institution_ids, :avatar, :likes_count, :followed, :complained, :follows_count, :learning_objects_count, :collections_count, :created_at, :updated_at
attributes \
:id,
:email,
:provider,
:name,
:description,
:education,
:score,
:role_ids,
:institution_ids,
:avatar,
:likes_count,
:followed,
:complained,
:follows_count,
:learning_objects_count,
:collections_count,
:created_at,
:updated_at
end
class AddEducationToUsers < ActiveRecord::Migration[5.0]
def change
add_column :users, :education, :string
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment