mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Fix group factory in rails 4
params[:address] was breaking the creation of the EnterpriseGroup
This commit is contained in:
@@ -10,19 +10,21 @@ class GroupFactory
|
||||
return if EnterpriseGroup.where(name: "Producer group").exists?
|
||||
|
||||
create_group(
|
||||
name: "Producer group",
|
||||
owner: enterprises.first.owner,
|
||||
on_front_page: true,
|
||||
description: "The seed producers",
|
||||
address: "6 Rollings Road, Upper Ferntree Gully, 3156"
|
||||
{
|
||||
name: "Producer group",
|
||||
owner: enterprises.first.owner,
|
||||
on_front_page: true,
|
||||
description: "The seed producers"
|
||||
},
|
||||
"6 Rollings Road, Upper Ferntree Gully, 3156"
|
||||
)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def create_group(params)
|
||||
def create_group(params, group_address)
|
||||
group = EnterpriseGroup.new(params)
|
||||
group.address = address(params[:address])
|
||||
group.address = address(group_address)
|
||||
group.enterprises = enterprises
|
||||
group.save!
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user