diff --git a/app/controllers/work_info_controller.rb b/app/controllers/work_info_controller.rb index a64311a..6fe09c3 100644 --- a/app/controllers/work_info_controller.rb +++ b/app/controllers/work_info_controller.rb @@ -1,5 +1,6 @@ class WorkInfoController < ApplicationController def index + @user = current_user end end diff --git a/app/models/work_info.rb b/app/models/work_info.rb index 4eaddcc..4a564e0 100644 --- a/app/models/work_info.rb +++ b/app/models/work_info.rb @@ -1,4 +1,10 @@ class WorkInfo < ActiveRecord::Base - attr_accessible :DoB, :SSN, :bonuses, :income, :user_id, :years_worked + attr_accessible :DoB, :SSN, :bonuses, :income, :years_worked belongs_to :user + + # We should probably use this + def last_four + "***-**-" << self.SSN[-4,4] + end + end diff --git a/app/views/work_info/index.html.erb b/app/views/work_info/index.html.erb index e69de29..349f23e 100644 --- a/app/views/work_info/index.html.erb +++ b/app/views/work_info/index.html.erb @@ -0,0 +1,41 @@ +
+
+
+
+
+
+
+ Employee Information +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Full NameIncomeBonusesYears w/ MetaCorpSSNDoB
<%= "#{@user.first_name} #{@user.last_name}" %><%= @user.work_info.income %><%= @user.work_info.bonuses %><%= @user.work_info.years_worked %><%= @user.work_info.SSN %><%= @user.work_info.DoB %>
+
+
+
+
+
+
\ No newline at end of file diff --git a/db/seeds.rb b/db/seeds.rb index c568203..e39c69c 100755 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -143,6 +143,42 @@ paid_time_off = [ } ] + + work_info = [ + + { + :user_id => 2, + :income => "$50,000", + :bonuses => "$10,000", + :years_worked => 2, + :SSN => "555-55-5555", + :DoB => "01-01-1980" + }, + { + :user_id => 3, + :income => "$40,000", + :bonuses => "$10,000", + :years_worked => 1, + :SSN => "333-33-3333", + :DoB => "01-01-1979" + }, + { + :user_id => 4, + :income => "$60,000", + :bonuses => "$12,000", + :years_worked => 3, + :SSN => "444-44-4444", + :DoB => "01-01-1981" + }, + { + :user_id => 5, + :income => "$30,000", + :bonuses => "7,000", + :years_worked => 1, + :SSN => "222-22-2222", + :DoB => "01-01-1982" + } + ] users.each do |user_info| @@ -168,4 +204,10 @@ schedule.each do |event| sched = Schedule.new(event.reject {|k| k == :user_id}) sched.user_id = event[:user_id] sched.save +end + +work_info.each do |wi| + info = WorkInfo.new(wi.reject {|k| k == :user_id}) + info.user_id = wi[:user_id] + info.save end \ No newline at end of file