added the PTO section
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
class CreatePaidTimeOffs < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :paid_time_offs do |t|
|
||||
t.integer :user_id
|
||||
t.integer :sick_days_taken
|
||||
t.integer :sick_days_earned
|
||||
t.integer :pto_taken
|
||||
t.integer :pto_earned
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
+13
-3
@@ -11,13 +11,23 @@
|
||||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20130524222129) do
|
||||
ActiveRecord::Schema.define(:version => 20130525001150) do
|
||||
|
||||
create_table "paid_time_offs", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "sick_days_taken"
|
||||
t.integer "sick_days_earned"
|
||||
t.integer "pto_taken"
|
||||
t.integer "pto_earned"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "retirements", :force => true do |t|
|
||||
t.string "total"
|
||||
t.string "employee_contrib"
|
||||
t.string "employer_contrib"
|
||||
t.integer "user_id"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
@@ -28,7 +38,7 @@ ActiveRecord::Schema.define(:version => 20130524222129) do
|
||||
t.boolean "admin"
|
||||
t.string "first_name"
|
||||
t.string "last_name"
|
||||
t.integer "user_id"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
+42
-6
@@ -47,32 +47,64 @@ users = [
|
||||
|
||||
retirements = [
|
||||
{
|
||||
:user_id => "2",
|
||||
:user_id => 2,
|
||||
:employee_contrib => "1000",
|
||||
:employer_contrib => "2000",
|
||||
:total => "4500"
|
||||
},
|
||||
{
|
||||
:user_id => "3",
|
||||
:user_id => 3,
|
||||
:employee_contrib => "8000",
|
||||
:employer_contrib => "16000",
|
||||
:total => "30000"
|
||||
},
|
||||
{
|
||||
:user_id => "4",
|
||||
:user_id => 4,
|
||||
:employee_contrib => "10000",
|
||||
:employer_contrib => "20000",
|
||||
:total => "40000"
|
||||
},
|
||||
{
|
||||
:user_id => "5",
|
||||
:user_id => 5,
|
||||
:employee_contrib => "3000",
|
||||
:employer_contrib => "6000",
|
||||
:total => "12500"
|
||||
},
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
paid_time_off = [
|
||||
{
|
||||
:user_id => 2,
|
||||
:sick_days_taken => 2,
|
||||
:sick_days_earned => 5,
|
||||
:pto_taken => 5,
|
||||
:pto_earned => 30
|
||||
},
|
||||
{
|
||||
:user_id => 3,
|
||||
:sick_days_taken => 3,
|
||||
:sick_days_earned => 6,
|
||||
:pto_taken => 3,
|
||||
:pto_earned => 20
|
||||
},
|
||||
{
|
||||
:user_id => 4,
|
||||
:sick_days_taken => 2,
|
||||
:sick_days_earned => 5,
|
||||
:pto_taken => 5,
|
||||
:pto_earned => 30
|
||||
},
|
||||
{
|
||||
:user_id => 5,
|
||||
:sick_days_taken => 1,
|
||||
:sick_days_earned => 5,
|
||||
:pto_taken => 10,
|
||||
:pto_earned => 30
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
|
||||
users.each do |user_info|
|
||||
User.create!(user_info)
|
||||
@@ -80,4 +112,8 @@ end
|
||||
|
||||
retirements.each do |r|
|
||||
Retirement.create!(r)
|
||||
end
|
||||
end
|
||||
|
||||
paid_time_off.each do |pto|
|
||||
PaidTimeOff.create!(pto)
|
||||
end
|
||||
Reference in New Issue
Block a user