-
-
Notifications
You must be signed in to change notification settings - Fork 572
Expand file tree
/
Copy pathorganizations.rb
More file actions
59 lines (56 loc) · 2.84 KB
/
organizations.rb
File metadata and controls
59 lines (56 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# == Schema Information
#
# Table name: organizations
#
# id :integer not null, primary key
# bank_is_set_up :boolean default(FALSE), not null
# city :string
# deadline_day :integer
# default_storage_location :integer
# distribute_monthly :boolean default(FALSE), not null
# email :string
# enable_child_based_requests :boolean default(TRUE), not null
# enable_individual_requests :boolean default(TRUE), not null
# enable_quantity_based_requests :boolean default(TRUE), not null
# hide_package_column_on_receipt :boolean default(FALSE)
# hide_value_columns_on_receipt :boolean default(FALSE)
# include_in_kind_values_in_exported_files :boolean default(FALSE), not null
# intake_location :integer
# invitation_text :text
# latitude :float
# longitude :float
# name :string
# one_step_partner_invite :boolean default(FALSE), not null
# partner_form_fields :text default([]), is an Array
# receive_email_on_requests :boolean default(FALSE), not null
# reminder_day :integer
# reminder_schedule_definition :string
# repackage_essentials :boolean default(FALSE), not null
# signature_for_distribution_pdf :boolean default(FALSE)
# state :string
# street :string
# url :string
# ytd_on_distribution_printout :boolean default(TRUE), not null
# zipcode :string
# created_at :datetime not null
# updated_at :datetime not null
# account_request_id :integer
# ndbn_member_id :bigint
#
require 'seeds'
FactoryBot.define do
factory :organization do
sequence(:name) { |n| "Dont test this name #{n}" } # 037000863427
trait :with_items do
after(:create) do |instance, evaluator|
Seeds.seed_base_items if BaseItem.count.zero? # seeds 45 base items if none exist
Organization.seed_items(instance) # creates 1 item for each base item
end
end
trait :created_at_2006 do
after(:create) do |instance|
instance.update(created_at: Time.zone.local(2006, 1, 1))
end
end
end
end