mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 17:55:55 +02:00
rubocoped contacts helper
This commit is contained in:
parent
d759a232cb
commit
2b1736cd9b
2 changed files with 116 additions and 105 deletions
|
@ -13,7 +13,7 @@ class Address < ActiveRecord::Base
|
|||
#validates_inclusion_of :type, in: TYPES
|
||||
|
||||
class << self
|
||||
def extract_attributes(ah, _type = :create)
|
||||
def extract_attributes(ah)
|
||||
address_hash = {}
|
||||
[ah].flatten.each do |pi|
|
||||
address_hash[local?(pi)] = addr_hash_from_params(pi)
|
||||
|
@ -27,7 +27,7 @@ class Address < ActiveRecord::Base
|
|||
def local?(postal_info)
|
||||
return :local_address_attributes if postal_info[:type] == LOCAL_TYPE_SHORT
|
||||
:international_address_attributes
|
||||
end
|
||||
end
|
||||
|
||||
def addr_hash_from_params(addr)
|
||||
return {} unless addr[:addr].is_a?(Hash)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue