Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Creates addresses table and associations#511

Merged
mohinid merged 8 commits intodevelopfrom
create-addresses-table
Jun 24, 2022
Merged

Creates addresses table and associations#511
mohinid merged 8 commits intodevelopfrom
create-addresses-table

Conversation

@mohinid
Copy link
Contributor

@mohinid mohinid commented Jun 22, 2022

Notion card

https://www.notion.so/saeloun/Add-tables-for-personal-employment-Allocated-devices-Address-71ef49d0c38e4242bd2998120141372d

Summary

  1. Created addresses table with columns(address_line_1, address_line_2, city, country, pin, address_type and addressable).
  2. Addressable can be referenced by user_id and company_id
  3. Created Address model and updated associations to User and Company.
  4. Created RSpecs.
  5. Tested manually on rails console.

Preview

Emp-details updated 22June

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

With RSpecs and on the console.

Checklist:

  • I have manually tested all workflows
  • I have performed a self-review of my own code
  • I have added automated tests for my code

@mohinid
Copy link
Contributor Author

mohinid commented Jun 22, 2022

@keshavbiswa please help with the failing test.

@github-actions
Copy link

github-actions bot commented Jun 22, 2022

Current Code Coverage Percent of this PR:

88.69 %

Files having coverage below 100%

Impacted Files Coverage
/lib/custom_failure.rb 80.0 %
/app/services/weekly_reminder_for_missed_entries_service.rb 31.82 %
/app/controllers/users/invitations_controller.rb 86.36 %
/app/controllers/users/sessions_controller.rb 85.71 %
/app/services/invoice_payment/pdf_generation.rb 70.97 %
/app/services/invoice_payment/checkout.rb 44.0 %
/app/controllers/internal_api/v1/payment_settings_controller.rb 93.33 %
/app/controllers/internal_api/v1/profile_controller.rb 96.88 %
/app/controllers/internal_api/v1/companies_controller.rb 95.45 %
/app/controllers/internal_api/v1/payments/providers_controller.rb 94.74 %
/app/controllers/internal_api/v1/wise/recipients_controller.rb 90.0 %
/lib/benchmarking/benchmarker.rb 0.0 %

Copy link
Contributor

@rohitjoshixyz rohitjoshixyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of address_line_2? We are anyways storing the address_type right?Codel LGTM otherwise

t.bigint "addressable_id"
t.string "address_type"
t.string "address_line_1", null: false
t.string "address_line_2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are we storing in address line 2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, we did not have any field for house no. or flat no. so made a generic field called address_line_1 . On UI we can show a message to populate house no etc.
address_line_2 is optional, if user wants to give more details like street etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like this. On UI we can change the label name.

Screenshot 2022-06-22 at 1 33 06 PM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay got it 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added missing state column as well :)

Copy link
Contributor

@rohitjoshixyz rohitjoshixyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@keshavbiswa keshavbiswa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@apoorv-mishra apoorv-mishra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Tidy work @mohinid 👍

@mohinid mohinid removed the request for review from akhilgkrishnan June 24, 2022 07:01
@mohinid mohinid merged commit 50a0d8a into develop Jun 24, 2022
@mohinid mohinid deleted the create-addresses-table branch June 24, 2022 07:02
vipulnsward pushed a commit that referenced this pull request Feb 15, 2026
* Creates addresses table and associations

* Fixed tests

* test fix

* Adds state column to addresses table

* Updates state field to be not_null

Co-authored-by: Keshav Biswa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants