mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 05:25:24 +02:00
Add Property Details View (#1116)
* Add backend for property account details
* Rubocop updates
* Add property form with details
* Revert "Rubocop updates"
This reverts commit 05b0b8f3a4
.
* Bump brakeman to latest version
* Add overview section to property view
* Lint fixes
This commit is contained in:
parent
4433488562
commit
e856691c86
30 changed files with 547 additions and 81 deletions
24
app/models/address.rb
Normal file
24
app/models/address.rb
Normal file
|
@ -0,0 +1,24 @@
|
|||
class Address < ApplicationRecord
|
||||
belongs_to :addressable, polymorphic: true
|
||||
|
||||
validates :line1, :locality, presence: true
|
||||
validates :postal_code, presence: true, if: :postal_code_required?
|
||||
|
||||
def to_s
|
||||
I18n.t("address.format",
|
||||
line1: line1,
|
||||
line2: line2,
|
||||
county: county,
|
||||
locality: locality,
|
||||
region: region,
|
||||
country: country,
|
||||
postal_code: postal_code
|
||||
)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def postal_code_required?
|
||||
country.in?(%w[US CA GB])
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue