diff --git a/app/views/employers/_form.html.erb b/app/views/employers/_form.html.erb index ca171a0..d867f39 100644 --- a/app/views/employers/_form.html.erb +++ b/app/views/employers/_form.html.erb @@ -11,19 +11,38 @@ <% end %>
Address: - <%= @employer.address %> + <%= [employer.address_line_1, employer.address_line_2, employer.city, employer.state, employer.zip].compact.join(', ') %>
diff --git a/app/views/participants/_form.html.erb b/app/views/participants/_form.html.erb index c559321..9e84ea6 100644 --- a/app/views/participants/_form.html.erb +++ b/app/views/participants/_form.html.erb @@ -21,9 +21,34 @@ + <%# Address Line 1 Field %>
Address: - <%= @participant.address %> + <%= [@participant.address_line_1, @participant.address_line_2, @participant.city, @participant.state, @participant.zip].reject(&:blank?).join(', ') %>
diff --git a/app/views/vendors/_form.html.erb b/app/views/vendors/_form.html.erb index eefcc98..bb962e5 100644 --- a/app/views/vendors/_form.html.erb +++ b/app/views/vendors/_form.html.erb @@ -16,8 +16,28 @@
Address: - <%= @vendor.address %> + <%= [vendor.address_line_1, vendor.address_line_2, vendor.city, vendor.state, vendor.zip].compact.join(', ') %>
Phone: diff --git a/app/views/workers/_form.html.erb b/app/views/workers/_form.html.erb index 429336e..e5e06af 100644 --- a/app/views/workers/_form.html.erb +++ b/app/views/workers/_form.html.erb @@ -11,18 +11,38 @@ <% end %>
Address: - <%= @worker.address %> + <%= [worker.address_line_1, worker.address_line_2, worker.city, worker.state, worker.zip].compact.join(', ') %>
Phone: diff --git a/db/migrate/20240130041504_update_address_in_participants.rb b/db/migrate/20240130041504_update_address_in_participants.rb new file mode 100644 index 0000000..871e566 --- /dev/null +++ b/db/migrate/20240130041504_update_address_in_participants.rb @@ -0,0 +1,10 @@ +class UpdateAddressInParticipants < ActiveRecord::Migration[7.1] + def change + add_column :participants, :address_line_1, :string + add_column :participants, :address_line_2, :string + add_column :participants, :city, :string + add_column :participants, :state, :string + add_column :participants, :zip, :string + remove_column :participants, :address, :string + end +end diff --git a/db/migrate/20240130042522_update_address_in_employers.rb b/db/migrate/20240130042522_update_address_in_employers.rb new file mode 100644 index 0000000..b5c044b --- /dev/null +++ b/db/migrate/20240130042522_update_address_in_employers.rb @@ -0,0 +1,10 @@ +class UpdateAddressInEmployers < ActiveRecord::Migration[7.1] + def change + add_column :employers, :address_line_1, :string + add_column :employers, :address_line_2, :string + add_column :employers, :city, :string + add_column :employers, :state, :string + add_column :employers, :zip, :string + remove_column :employers, :address, :string + end +end diff --git a/db/migrate/20240130043224_update_address_in_workers.rb b/db/migrate/20240130043224_update_address_in_workers.rb new file mode 100644 index 0000000..b7ca179 --- /dev/null +++ b/db/migrate/20240130043224_update_address_in_workers.rb @@ -0,0 +1,11 @@ +class UpdateAddressInWorkers < ActiveRecord::Migration[7.1] + def change + add_column :workers, :address_line_1, :string + add_column :workers, :address_line_2, :string + add_column :workers, :city, :string + add_column :workers, :state, :string + add_column :workers, :zip, :string + remove_column :workers, :address, :string + end +end + diff --git a/db/migrate/20240130051346_update_address_in_vendors.rb b/db/migrate/20240130051346_update_address_in_vendors.rb new file mode 100644 index 0000000..c10cf83 --- /dev/null +++ b/db/migrate/20240130051346_update_address_in_vendors.rb @@ -0,0 +1,10 @@ +class UpdateAddressInVendors < ActiveRecord::Migration[7.1] + def change + add_column :vendors, :address_line_1, :string + add_column :vendors, :address_line_2, :string + add_column :vendors, :city, :string + add_column :vendors, :state, :string + add_column :vendors, :zip, :string + remove_column :vendors, :address, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 7ae1686..b27529d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,10 +10,9 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_01_30_033832) do +ActiveRecord::Schema[7.1].define(version: 2024_01_30_051346) do create_table "employers", force: :cascade do |t| t.string "first_name" - t.string "address" t.string "phone" t.string "email" t.string "tin" @@ -23,6 +22,11 @@ ActiveRecord::Schema[7.1].define(version: 2024_01_30_033832) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "last_name" + t.string "address_line_1" + t.string "address_line_2" + t.string "city" + t.string "state" + t.string "zip" end create_table "employers_vendors", id: false, force: :cascade do |t| @@ -43,7 +47,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_01_30_033832) do create_table "participants", force: :cascade do |t| t.string "first_name" - t.string "address" t.string "phone" t.string "email" t.string "mci" @@ -55,6 +58,11 @@ ActiveRecord::Schema[7.1].define(version: 2024_01_30_033832) do t.datetime "updated_at", null: false t.integer "worker_id" t.string "last_name" + t.string "address_line_1" + t.string "address_line_2" + t.string "city" + t.string "state" + t.string "zip" t.index ["employer_id"], name: "index_participants_on_employer_id" t.index ["last_name"], name: "index_participants_on_last_name" t.index ["mci"], name: "index_participants_on_mci" @@ -92,7 +100,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_01_30_033832) do create_table "vendors", force: :cascade do |t| t.string "name" - t.string "address" t.string "phone" t.string "email" t.string "dba" @@ -101,11 +108,15 @@ ActiveRecord::Schema[7.1].define(version: 2024_01_30_033832) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "contact" + t.string "address_line_1" + t.string "address_line_2" + t.string "city" + t.string "state" + t.string "zip" end create_table "workers", force: :cascade do |t| t.string "name" - t.string "address" t.string "phone" t.string "email" t.date "dob" @@ -115,6 +126,11 @@ ActiveRecord::Schema[7.1].define(version: 2024_01_30_033832) do t.datetime "updated_at", null: false t.string "first_name" t.string "last_name" + t.string "address_line_1" + t.string "address_line_2" + t.string "city" + t.string "state" + t.string "zip" end add_foreign_key "employments", "participants"