diff --git a/app/assets/stylesheets/bootstrap.min.css b/app/assets/stylesheets/bootstrap.min.css
index 555d7ba0..fadefcf5 100644
--- a/app/assets/stylesheets/bootstrap.min.css
+++ b/app/assets/stylesheets/bootstrap.min.css
@@ -258,7 +258,6 @@ button,
select,
optgroup,
textarea {
- margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
diff --git a/app/controllers/children_controller.rb b/app/controllers/children_controller.rb
index 85eafbe2..3bd51b5f 100644
--- a/app/controllers/children_controller.rb
+++ b/app/controllers/children_controller.rb
@@ -70,7 +70,6 @@ def child_params
params.require(:child).permit(
:active,
:agency_child_id,
- :child_lives_with,
:comments,
:date_of_birth,
:first_name,
@@ -78,7 +77,9 @@ def child_params
:health_insurance,
:item_needed_diaperid,
:last_name,
- :race
+ :race,
+ :archived,
+ child_lives_with: []
)
end
end
diff --git a/app/controllers/families_controller.rb b/app/controllers/families_controller.rb
index 803fb4a3..65b7cc21 100644
--- a/app/controllers/families_controller.rb
+++ b/app/controllers/families_controller.rb
@@ -72,8 +72,8 @@ def family_params
:home_adult_count,
:home_child_count,
:home_young_child_count,
- :sources_of_income,
- :military
+ :military,
+ sources_of_income: []
)
end
end
diff --git a/app/models/child.rb b/app/models/child.rb
index eb5bb1ce..cd9daf22 100644
--- a/app/models/child.rb
+++ b/app/models/child.rb
@@ -20,6 +20,8 @@
#
class Child < ApplicationRecord
+ CAN_LIVE_WITH = %w[Mother Father Grandparent Foster\ Parent Other\ Parent/Relative].freeze
+ serialize :child_lives_with, Array
belongs_to :family
has_many :family_request_child, dependent: :destroy
has_many :family_requests, through: :family_request_child
diff --git a/app/models/family.rb b/app/models/family.rb
index b636b92e..7a733fa9 100644
--- a/app/models/family.rb
+++ b/app/models/family.rb
@@ -28,6 +28,9 @@ class Family < ApplicationRecord
belongs_to :partner
has_many :children, dependent: :destroy
has_many :authorized_family_members, dependent: :destroy
+ serialize :sources_of_income, Array
+
+ INCOME_TYPES = %w[SSI SNAP/FOOD\ Stamps TANF WIC Housing/subsidized Housing/unsubsidized N/A].freeze
def guardian_display_name
"#{guardian_first_name} #{guardian_last_name}"
diff --git a/app/models/partner.rb b/app/models/partner.rb
index cd680126..04b8f5b8 100644
--- a/app/models/partner.rb
+++ b/app/models/partner.rb
@@ -105,7 +105,7 @@
class Partner < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
- ACTIVE_FAMILY_REQUESTS = [3, 27].freeze
+ ACTIVE_FAMILY_REQUESTS = [1, 3, 27].freeze
devise :invitable, :database_authenticatable,
:recoverable, :rememberable, :trackable, :validatable
diff --git a/app/views/children/_form.html.erb b/app/views/children/_form.html.erb
index c67aa1c8..c8faa74a 100644
--- a/app/views/children/_form.html.erb
+++ b/app/views/children/_form.html.erb
@@ -49,14 +49,17 @@
@@ -70,7 +73,12 @@
@@ -105,6 +113,13 @@
+
+
<%= form.submit(class: 'btn btn-primary') %>
diff --git a/app/views/children/show.html.erb b/app/views/children/show.html.erb
index 5ff25ff1..44cbee81 100644
--- a/app/views/children/show.html.erb
+++ b/app/views/children/show.html.erb
@@ -36,7 +36,7 @@
<%= child.gender %>
Child lives with:
- <%= child.child_lives_with %>
+ <%= child.child_lives_with.join(', ') %>
Race:
<%= child.race %>
diff --git a/app/views/families/_form.html.erb b/app/views/families/_form.html.erb
index 0650f3d1..8a10a577 100644
--- a/app/views/families/_form.html.erb
+++ b/app/views/families/_form.html.erb
@@ -39,7 +39,7 @@
@@ -60,43 +60,54 @@
@@ -109,19 +120,22 @@
diff --git a/app/views/families/show.html.erb b/app/views/families/show.html.erb
index d27ffb75..615da022 100644
--- a/app/views/families/show.html.erb
+++ b/app/views/families/show.html.erb
@@ -34,7 +34,7 @@
Guardian zip code:
<%= family.guardian_zip_code %>
- Guardian country:
+ Guardian county:
<%= family.guardian_country %>
Guardian phone:
@@ -53,7 +53,7 @@
<%= family.home_young_child_count %>
Sources of income:
- <%= family.sources_of_income %>
+ <%= family.sources_of_income.join(', ') %>
Guardian employed:
<%= family.guardian_employed %>
diff --git a/db/migrate/20190721044143_add_archived_to_child.rb b/db/migrate/20190721044143_add_archived_to_child.rb
new file mode 100644
index 00000000..7691243d
--- /dev/null
+++ b/db/migrate/20190721044143_add_archived_to_child.rb
@@ -0,0 +1,5 @@
+class AddArchivedToChild < ActiveRecord::Migration[5.2]
+ def change
+ add_column :children, :archived, :boolean
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 9e0eec6c..b4b93acb 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2019_07_08_185154) do
+ActiveRecord::Schema.define(version: 2019_07_21_044143) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -63,6 +63,7 @@
t.bigint "family_id"
t.integer "item_needed_diaperid"
t.boolean "active", default: true
+ t.boolean "archived"
t.index ["family_id"], name: "index_children_on_family_id"
end
diff --git a/spec/factories/children.rb b/spec/factories/children.rb
index 0ff44293..0972fcf1 100644
--- a/spec/factories/children.rb
+++ b/spec/factories/children.rb
@@ -27,7 +27,7 @@
date_of_birth { Faker::Date.backward(14).iso8601 }
active { true }
gender { Faker::Gender.type }
- child_lives_with { "Parent" }
+ child_lives_with { ["Mother"] }
race { "Unknown" }
item_needed_diaperid { 1 }
agency_child_id { "Agency" }
diff --git a/spec/factories/families.rb b/spec/factories/families.rb
index c732186b..17cb59ac 100644
--- a/spec/factories/families.rb
+++ b/spec/factories/families.rb
@@ -35,11 +35,11 @@
home_adult_count { 1 }
home_child_count { 1 }
home_young_child_count { 1 }
- sources_of_income { "" }
+ sources_of_income { ["WIC"] }
guardian_employed { false }
guardian_employment_type { "" }
guardian_monthly_pay { "9.99" }
- guardian_health_insurance { "" }
+ guardian_health_insurance { "Uninsured" }
military { false }
comments { "MyText" }
partner