<commit_before><div class='current_address raf_section'>

<p>child's current home address</p>
<%#
#
#
#	This will require modification for editting ONLY THE RAF ADDRESSES AND PHONE NUMBERS
#
#	can't use detect as want all not just the first
#
%>
<%# @study_subject.enrollments.build(
	:project_id => Project['ccls'].id ) if @study_subject.enrollments.empty? %>
<%# can't use where as that would require it be in the database
	and a new subject's enrollment won't be.  This seems to work.  %>
<%#= f.fields_for :enrollments, @study_subject.enrollments.detect{|e|
	e.project_id == Project['ccls'].id } do |enrollment_fields| %>

<% @raf_addressings = @study_subject.addressings.select{|a|
	a.data_source_id == DataSource['raf'].id} %>
<% @raf_addressings << @study_subject.addressings.build(
	:data_source_id => DataSource['raf'].id) if @raf_addressings.empty? %>

<%# @study_subject.addressings.build if @study_subject.addressings.empty? %>
<%#= f.fields_for :addressings do |addressing_fields| %>

<%= f.fields_for :addressings, @raf_addressings do |addressing_fields| %>
 <% addressing_fields.object.build_address if addressing_fields.object.address.nil? %>
 <%= addressing_fields.fields_for :address do |address_fields| %>
  <%= address_fields.wrapped_text_field :line_1 %>
<%= address_fields.wrapped_text_field :unit, :label_text => 'Apt.' %>

  <div class='field_wrapper csz'>
   <%= address_fields.label :city, 'City, State Zip' -%><%= address_fields.text_field :city %>
   <%= address_fields.select :state, State.abbreviations, 
		{:include_blank => true}, :class => 'state' %>
   <%= address_fields.text_field :zip, :class => :zip %>
  </div>
  <%= address_fields.wrapped_text_field :county, :class => 'county_field' %>
 <% end %><%#= addressing_fields.fields_for :address do |address_fields| %>
<hr/>
<% end %><%#= f.fields_for :addressings do |addressing_fields| %>

<% @raf_phone_numbers = @study_subject.phone_numbers.select{|a|
	a.data_source_id == DataSource['raf'].id} %>
<% @raf_phone_numbers << @study_subject.phone_numbers.build(
	:data_source_id => DataSource['raf'].id) while @raf_phone_numbers.length < 2 %>

<%# @study_subject.phone_numbers.build while( @study_subject.phone_numbers.length < 2 ) %>
<%#= f.fields_for :phone_numbers, 
	@study_subject.phone_numbers[0] do |phone_number_fields| %>
<%= f.fields_for :phone_numbers, 
	@raf_phone_numbers[0] do |phone_number_fields| %>
 <%= phone_number_fields.wrapped_text_field :phone_number,
   :label_text => 'phone number:' %>
<% end -%>
<%#= f.fields_for :phone_numbers, 
	@study_subject.phone_numbers[1] do |phone_number_fields| %>
<%= f.fields_for :phone_numbers, 
	@raf_phone_numbers[1] do |phone_number_fields| %>
 <%= phone_number_fields.wrapped_text_field :phone_number,
   :label_text => 'alternate phone:' %>
<% end -%>

</div><!-- class='current_address' -->
<commit_msg>All RAF phone numbers on edit form.[#401]<commit_after><div class='current_address raf_section'>

<p>child's current home address</p>
<%#
#
#
#	This will require modification for editting ONLY THE RAF ADDRESSES AND PHONE NUMBERS
#
#	can't use detect as want all not just the first
#
%>
<%# @study_subject.enrollments.build(
	:project_id => Project['ccls'].id ) if @study_subject.enrollments.empty? %>
<%# can't use where as that would require it be in the database
	and a new subject's enrollment won't be.  This seems to work.  %>
<%#= f.fields_for :enrollments, @study_subject.enrollments.detect{|e|
	e.project_id == Project['ccls'].id } do |enrollment_fields| %>

<% @raf_addressings = @study_subject.addressings.select{|a|
	a.data_source_id == DataSource['raf'].id} %>
<% @raf_addressings << @study_subject.addressings.build(
	:data_source_id => DataSource['raf'].id) if @raf_addressings.empty? %>

<%# @study_subject.addressings.build if @study_subject.addressings.empty? %>
<%#= f.fields_for :addressings do |addressing_fields| %>

<%= f.fields_for :addressings, @raf_addressings do |addressing_fields| %>
 <% addressing_fields.object.build_address if addressing_fields.object.address.nil? %>
 <%= addressing_fields.fields_for :address do |address_fields| %>
  <%= address_fields.wrapped_text_field :line_1 %>
<%= address_fields.wrapped_text_field :unit, :label_text => 'Apt.' %>

  <div class='field_wrapper csz'>
   <%= address_fields.label :city, 'City, State Zip' -%><%= address_fields.text_field :city %>
   <%= address_fields.select :state, State.abbreviations, 
		{:include_blank => true}, :class => 'state' %>
   <%= address_fields.text_field :zip, :class => :zip %>
  </div>
  <%= address_fields.wrapped_text_field :county, :class => 'county_field' %>
 <% end %><%#= addressing_fields.fields_for :address do |address_fields| %>
<hr/>
<% end %><%#= f.fields_for :addressings do |addressing_fields| %>

<% @raf_phone_numbers = @study_subject.phone_numbers.select{|a|
	a.data_source_id == DataSource['raf'].id} %>
<% @raf_phone_numbers << @study_subject.phone_numbers.build(
	:data_source_id => DataSource['raf'].id) while @raf_phone_numbers.length < 2 %>

<%# @study_subject.phone_numbers.build while( @study_subject.phone_numbers.length < 2 ) %>
<%#= f.fields_for :phone_numbers, 
	@study_subject.phone_numbers[0] do |phone_number_fields| %>
<%= f.fields_for :phone_numbers, 
	@raf_phone_numbers[0] do |phone_number_fields| %>
 <%= phone_number_fields.wrapped_text_field :phone_number,
   :label_text => 'phone number:' %>
<% end -%>
<%#= f.fields_for :phone_numbers, 
	@study_subject.phone_numbers[1] do |phone_number_fields| %>
<%= f.fields_for :phone_numbers, 
	@raf_phone_numbers[1..-1] do |phone_number_fields| %>
 <%= phone_number_fields.wrapped_text_field :phone_number,
   :label_text => 'alternate phone:' %>
<% end -%>

</div><!-- class='current_address' -->

{'fraction_non_alphanumeric': 0.1651552145099407, 'fraction_numerical': 0.003139169863969306, 'mean_word_length': 5.934703748488513, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 105, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2357118', 'n_tokens_mistral': 2200, 'n_tokens_neox': 1978, 'n_words': 378}