blob: 7a678d54479ea2e58dccc2a5db95580d3d75f49a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# frozen_string_literal: true
require 'rails_helper'
# Module to form relationships between addresses and users.
module AddressHelper
def relate_user_and_addresses(user, addresses)
addresses.each do |address|
address.user_accounts << user
address.save
end
end
def relate_user_and_address(user, address)
address.user_accounts << user
address.save
end
end
|