diff --git a/app/models/contact.rb b/app/models/contact.rb index 091b5b7cd..05eb07764 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -2,7 +2,8 @@ class Contact include ActiveModel::Model attr_accessor :name, :email, :message - validates :name, :email, :message, presence: true + validates :name, :email, presence: true + validates :message, presence: true, length: {maximum: 500} # credit: https://medium.com/@limichelle21/building-and-debugging-a-contact-form-with-rails-mailgun-heroku-c0185b8bf419 end diff --git a/app/models/organization_account_request.rb b/app/models/organization_account_request.rb index 1d1eb659c..85b64b116 100644 --- a/app/models/organization_account_request.rb +++ b/app/models/organization_account_request.rb @@ -5,7 +5,7 @@ class OrganizationAccountRequest before_validation :normalize_phone - validates :name, :email, :city_town, :country, :province_state, presence: true + validates :name, :email, :requester_name, :city_town, :country, :province_state, presence: true validates_format_of :email, with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i validates :phone_number, presence: true, phone: {possible: true, allow_blank: true} diff --git a/app/services/organizations/create_service.rb b/app/services/organizations/create_service.rb index 8a4f2ebfe..599bba598 100644 --- a/app/services/organizations/create_service.rb +++ b/app/services/organizations/create_service.rb @@ -1,11 +1,12 @@ -# class to create a new location, organization, user, and staff account with role admin -# email is sent to admin user if all steps are successful +# Class to create a new location, organization, user, and staff account with role admin. +# An email is sent to admin user if all steps are successful. +# Be sure to use the Country and State codes from countries_states.yml # call with Organizations::CreateService.new.signal(args) # sample args: # { # location: { -# country: 'Mexico', -# city_town: 'La Ventana', +# country: 'MX', +# city_town: 'JAL', # province_state: 'Baja' # }, # organization: { diff --git a/app/views/layouts/adopter_foster_dashboard.html.erb b/app/views/layouts/adopter_foster_dashboard.html.erb index bb4858c06..e6eaca4b3 100644 --- a/app/views/layouts/adopter_foster_dashboard.html.erb +++ b/app/views/layouts/adopter_foster_dashboard.html.erb @@ -121,11 +121,6 @@ Log Out <% end %> -