Skip to content

Commit

Permalink
Removes adopter foster profile (#906)
Browse files Browse the repository at this point in the history
* Remove adopter foster profile

* lint

* comment for later

* fix test
  • Loading branch information
kasugaijin authored Aug 3, 2024
1 parent 661f0a3 commit 10f77cf
Show file tree
Hide file tree
Showing 55 changed files with 53 additions and 2,778 deletions.

This file was deleted.

This file was deleted.

34 changes: 0 additions & 34 deletions app/javascript/controllers/display_controller.js

This file was deleted.

1 change: 0 additions & 1 deletion app/models/adopter_foster_account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
class AdopterFosterAccount < ApplicationRecord
acts_as_tenant(:organization)
belongs_to :user
has_one :adopter_foster_profile, dependent: :destroy
has_many :adopter_applications, dependent: :destroy
has_many :matches, dependent: :destroy
has_many :likes, dependent: :destroy
Expand Down
141 changes: 0 additions & 141 deletions app/models/adopter_foster_profile.rb

This file was deleted.

7 changes: 0 additions & 7 deletions app/models/concerns/authorizable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@ def permission?(name)
create_adopter_applications
view_adopter_applications
withdraw_adopter_applications
create_adopter_foster_profiles
manage_adopter_foster_profiles
purge_avatar
manage_likes
].freeze

FOSTERER_PERMISSIONS = %i[
view_adopter_foster_dashboard
create_adopter_foster_profiles
manage_adopter_foster_profiles
purge_avatar
].freeze

Expand All @@ -32,14 +28,11 @@ def permission?(name)
%i[
view_adopter_foster_dashboard
create_adopter_applications
create_adopter_foster_profiles
manage_adopter_foster_profiles
manage_likes
]
) + %i[
review_adopter_applications
view_adopter_foster_accounts
view_adopter_foster_profiles
invite_fosterers
purge_attachments
manage_default_pet_tasks
Expand Down
1 change: 0 additions & 1 deletion app/models/location.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#
class Location < ApplicationRecord
acts_as_tenant(:organization)
has_one :adopter_foster_profile

validates :country, presence: true, length: {maximum: 50, message: "50 characters maximum"}
validates :city_town, presence: true, length: {maximum: 50, message: "50 characters maximum"}
Expand Down
1 change: 0 additions & 1 deletion app/models/match.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class Match < ApplicationRecord
belongs_to :adopter_foster_account

has_one :user, through: :adopter_foster_account
has_one :adopter_foster_profile, through: :adopter_foster_account

validates :start_date,
presence: {if: -> { match_type == "foster" }}
Expand Down
3 changes: 1 addition & 2 deletions app/policies/adopter_application_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ def already_applied?
end

def verify_profile!
deny! unless user.adopter_foster_account.present?
deny! unless user.adopter_foster_account.adopter_foster_profile.present?
deny! unless user.adopter_foster_account.present? # UPDATE THIS TO CHECK FOR FORMSUBMISSION INSTEAD OF PROFILE
end

def verify_pet_appliable!
Expand Down
19 changes: 0 additions & 19 deletions app/policies/organizations/adopter_foster_profile_policy.rb

This file was deleted.

14 changes: 0 additions & 14 deletions app/policies/organizations/profile_review_policy.rb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<% c.with_header_title { t("dashboard.index.header_title") } %>
<% c.with_body do %>
<div class="row">
<% unless current_user.adopter_foster_account.adopter_foster_profile.present? %>
<% unless current_user.adopter_foster_account.present? %>
<div class="alert alert-warning ">
<%= link_to t('organizations.adoptable_pets.show.complete_my_profile'), new_adopter_fosterer_profile_path,
class: 'custom-btn-pink' %>
Expand Down
Loading

0 comments on commit 10f77cf

Please sign in to comment.