Skip to content

Commit

Permalink
add part_time checkbox to employment tab. create supporting migration…
Browse files Browse the repository at this point in the history
… and edit in employments_params.
  • Loading branch information
charleshuang80 committed Nov 10, 2015
1 parent 37cb603 commit a1c3d7e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.1.2
1 change: 1 addition & 0 deletions app/controllers/employments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def model_params
:start_date,
:end_date,
:current,
:part_time,
:employer_name,
:supervisor_name,
:position,
Expand Down
1 change: 1 addition & 0 deletions app/views/employments/_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<%= f.date_field :end_date %>
</div>
<%= f.check_box :current, label: "Currently employed here", disable: true %>
<%= f.check_box :part_time, label: "Part time?", disable: true %>
<div class="field">
<%= f.text_field :employer_name %>
</div>
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20151110013159_add_part_time_to_employments.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddPartTimeToEmployments < ActiveRecord::Migration
def change
add_column :employments, :part_time, :boolean
end
end
3 changes: 2 additions & 1 deletion 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: 20150825093953) do
ActiveRecord::Schema.define(version: 20151110013159) do

create_table "addresses", force: true do |t|
t.string "street"
Expand Down Expand Up @@ -75,6 +75,7 @@
t.integer "person_id"
t.integer "address_id"
t.integer "applicant_id"
t.boolean "part_time"
end

add_index "employments", ["address_id"], name: "index_employments_on_address_id"
Expand Down

0 comments on commit a1c3d7e

Please sign in to comment.