-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
848 - Merge OrganizationProfile with Organization (#870)
* Migration to merge profile into organization and related seed file changes * Updated Details in footer and sidebar from Organization Profile to Organization * Updated model, controller, policy from OrganizationProfile to Organization * Fix test cases after merging organization_profile with organization * Migration to remove OrganizationProfile * Modularize code * Remove unwanted comments * Migration changes for location assocation * Seed file, association changes for location * Remove not null contraint for organization_id as if conflicts with existing data * Test cases changes for updated location association * Fixes for location nested form as per association changes * Migration to drop organization_profiles table * Fix attahment deletion issue * Lint fix * Fixed organization attachment issue * Lint fix
- Loading branch information
1 parent
da451fc
commit 3047dc9
Showing
35 changed files
with
537 additions
and
511 deletions.
There are no files selected for viewing
36 changes: 0 additions & 36 deletions
36
app/controllers/organizations/staff/organization_profiles_controller.rb
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
app/controllers/organizations/staff/organizations_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
module Organizations | ||
module Staff | ||
class OrganizationsController < Organizations::BaseController | ||
layout "dashboard" | ||
|
||
before_action :set_organization, only: %i[edit update] | ||
|
||
def edit | ||
end | ||
|
||
def update | ||
if @organization.update(organization_params) | ||
redirect_to edit_staff_organization_path, notice: t(".success") | ||
else | ||
render :edit, status: :unprocessable_entity | ||
end | ||
end | ||
|
||
private | ||
|
||
def organization_params | ||
params.require(:organization).permit( | ||
:phone_number, | ||
:email, | ||
:avatar, | ||
:facebook_url, | ||
:instagram_url, | ||
:donation_url, | ||
locations_attributes: %i[city_town country province_state] | ||
) | ||
end | ||
|
||
def set_organization | ||
@organization = Organization.first | ||
|
||
authorize! @organization | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Organizations | ||
class OrganizationPolicy < ApplicationPolicy | ||
pre_check :verify_active_staff! | ||
|
||
def manage? | ||
permission?(:manage_organization) | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.