Sfoglia il codice sorgente

Migrate user names to basecamp/name_of_person

Chris Oliver 6 anni fa
parent
commit
1ebcda7065
2 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 2 0
      app/models/user.rb
  2. 3 1
      template.rb

+ 2 - 0
app/models/user.rb

@@ -3,6 +3,8 @@ class User < ApplicationRecord
   # :confirmable, :lockable, :timeoutable and :omniauthable
   devise :masqueradable, :database_authenticatable, :registerable, :recoverable, :rememberable, :validatable, :omniauthable
 
+  has_person_name
+
   has_many :notifications, foreign_key: :recipient_id
   has_many :services
 end

+ 3 - 1
template.rb

@@ -39,6 +39,7 @@ def add_gems
   gem 'jquery-rails', '~> 4.3.1'
   gem 'local_time', '~> 2.0', '>= 2.0.1'
   gem 'mini_magick', '~> 4.8'
+  gem 'name_of_person', '~> 1.0'
   gem 'omniauth-facebook', '~> 5.0'
   gem 'omniauth-github', '~> 1.3'
   gem 'omniauth-twitter', '~> 1.4'
@@ -70,7 +71,8 @@ def add_users
 
   # Create Devise User
   generate :devise, "User",
-           "name",
+           "first_name",
+           "last_name",
            "announcements_last_read_at:datetime",
            "admin:boolean"