Skip to content

Commit

Permalink
Fix storing name to db
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Gehani committed Sep 18, 2013
1 parent 9618747 commit 45523c3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class ApplicationController < ActionController::Base
protected

def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:first_name, :last_name, :email, :password, :password_confirmation) }
devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:first_name, :last_name, :email, :current_password, :password, :password_confirmation) }
devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:name, :email, :password, :password_confirmation) }
devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:name, :email, :current_password, :password, :password_confirmation) }
end

end
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class User < ActiveRecord::Base
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable, #:recoverable,
:rememberable, :trackable, :validatable
attr_accessible :email, :password, :password_confirmation, :remember_me, :name, :first_name, :last_name, :provider, :uid, :as => [:default, :admin]
attr_accessible :email, :password, :password_confirmation, :remember_me, :name, :provider, :uid, :as => [:default, :admin]

has_many :pins, :dependent => :destroy

Expand Down
6 changes: 6 additions & 0 deletions db/migrate/20130918214208_remove_name_from_user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class RemoveNameFromUser < ActiveRecord::Migration
def change
remove_column :users, :first_name, :string
remove_column :users, :last_name, :string
end
end
4 changes: 1 addition & 3 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20130918001115) do
ActiveRecord::Schema.define(version: 20130918214208) do

create_table "pins", force: true do |t|
t.string "description"
Expand All @@ -35,8 +35,6 @@
t.string "last_sign_in_ip"
t.datetime "created_at"
t.datetime "updated_at"
t.string "first_name"
t.string "last_name"
t.string "name"
end

Expand Down

0 comments on commit 45523c3

Please sign in to comment.