|
|
|
@ -146,35 +146,6 @@ unless Rails.env.test? |
|
|
|
child_organisation: managing_agent2, |
|
|
|
child_organisation: managing_agent2, |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
if (Rails.env.development? || Rails.env.review?) && SalesLog.count.zero? |
|
|
|
|
|
|
|
SalesLog.find_or_create_by!( |
|
|
|
|
|
|
|
saledate: Date.new(2023, 1, 1), |
|
|
|
|
|
|
|
purchid: "1", |
|
|
|
|
|
|
|
ownershipsch: 1, |
|
|
|
|
|
|
|
type: 2, |
|
|
|
|
|
|
|
jointpur: 1, |
|
|
|
|
|
|
|
jointmore: 1, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SalesLog.find_or_create_by!( |
|
|
|
|
|
|
|
saledate: Date.new(2023, 1, 1), |
|
|
|
|
|
|
|
purchid: "1", |
|
|
|
|
|
|
|
ownershipsch: 2, |
|
|
|
|
|
|
|
type: 9, |
|
|
|
|
|
|
|
jointpur: 1, |
|
|
|
|
|
|
|
jointmore: 1, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SalesLog.find_or_create_by!( |
|
|
|
|
|
|
|
saledate: Date.new(2023, 1, 1), |
|
|
|
|
|
|
|
purchid: "1", |
|
|
|
|
|
|
|
ownershipsch: 3, |
|
|
|
|
|
|
|
type: 10, |
|
|
|
|
|
|
|
companybuy: 1, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pp "Seeded a sales log of each type" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if Rails.env.development? || Rails.env.review? |
|
|
|
if Rails.env.development? || Rails.env.review? |
|
|
|
User.find_or_create_by!( |
|
|
|
User.find_or_create_by!( |
|
|
|
@ -197,7 +168,7 @@ unless Rails.env.test? |
|
|
|
user.confirmed_at = Time.zone.now |
|
|
|
user.confirmed_at = Time.zone.now |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
User.find_or_create_by!( |
|
|
|
support_user = User.find_or_create_by!( |
|
|
|
name: "Support", |
|
|
|
name: "Support", |
|
|
|
email: "support@example.com", |
|
|
|
email: "support@example.com", |
|
|
|
organisation: org, |
|
|
|
organisation: org, |
|
|
|
@ -210,6 +181,42 @@ unless Rails.env.test? |
|
|
|
pp "Seeded 3 dummy users" |
|
|
|
pp "Seeded 3 dummy users" |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Rails.env.development? || Rails.env.review?) && SalesLog.count.zero? |
|
|
|
|
|
|
|
SalesLog.find_or_create_by!( |
|
|
|
|
|
|
|
created_by: support_user, |
|
|
|
|
|
|
|
owning_organisation: org, |
|
|
|
|
|
|
|
saledate: Date.new(2023, 1, 1), |
|
|
|
|
|
|
|
purchid: "1", |
|
|
|
|
|
|
|
ownershipsch: 1, |
|
|
|
|
|
|
|
type: 2, |
|
|
|
|
|
|
|
jointpur: 1, |
|
|
|
|
|
|
|
jointmore: 1, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SalesLog.find_or_create_by!( |
|
|
|
|
|
|
|
created_by: support_user, |
|
|
|
|
|
|
|
owning_organisation: org, |
|
|
|
|
|
|
|
saledate: Date.new(2023, 1, 1), |
|
|
|
|
|
|
|
purchid: "1", |
|
|
|
|
|
|
|
ownershipsch: 2, |
|
|
|
|
|
|
|
type: 9, |
|
|
|
|
|
|
|
jointpur: 1, |
|
|
|
|
|
|
|
jointmore: 1, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SalesLog.find_or_create_by!( |
|
|
|
|
|
|
|
created_by: support_user, |
|
|
|
|
|
|
|
owning_organisation: org, |
|
|
|
|
|
|
|
saledate: Date.new(2023, 1, 1), |
|
|
|
|
|
|
|
purchid: "1", |
|
|
|
|
|
|
|
ownershipsch: 3, |
|
|
|
|
|
|
|
type: 10, |
|
|
|
|
|
|
|
companybuy: 1, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pp "Seeded a sales log of each type" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
if Rails.env.development? || Rails.env.review? |
|
|
|
if Rails.env.development? || Rails.env.review? |
|
|
|
dummy_org = Organisation.find_or_create_by!( |
|
|
|
dummy_org = Organisation.find_or_create_by!( |
|
|
|
name: "FooBar LTD", |
|
|
|
name: "FooBar LTD", |
|
|
|
|