Skip to content

Commit

Permalink
disable showing deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
kjgarza committed Nov 14, 2018
1 parent d95c8f1 commit abe3090
Show file tree
Hide file tree
Showing 3 changed files with 277 additions and 277 deletions.
4 changes: 2 additions & 2 deletions app/controllers/clients_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def destroy
status = 400
logger.warn message
render json: { errors: [{ status: status.to_s, title: message }] }.to_json, status: status
elsif @client.update_attributes(is_active: "\x00", deleted_at: Time.zone.now)
elsif @client.update_attributes(is_active: nil, deleted_at: Time.zone.now)
@client.remove_users(id: "client_id", jwt: current_user.jwt) unless Rails.env.test?
head :no_content
else
Expand All @@ -137,7 +137,7 @@ def set_include

def set_client
# params[:id] = params[:id][/.+?(?=\/)/]
@client = Client.where(symbol: params[:id]).first
@client = Client.where(symbol: params[:id]).where(is_active: "\x01").first
fail ActiveRecord::RecordNotFound unless @client.present?
end

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/providers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def destroy
status = 400
logger.warn message
render json: { errors: [{ status: status.to_s, title: message }] }.to_json, status: status
elsif @provider.update_attributes(is_active: "\x00", deleted_at: Time.zone.now)
elsif @provider.update_attributes(is_active: nil, deleted_at: Time.zone.now)
@provider.remove_users(id: "provider_id", jwt: current_user.jwt) unless Rails.env.test?
head :no_content
else
Expand All @@ -142,7 +142,7 @@ def destroy

# Use callbacks to share common setup or constraints between actions.
def set_provider
@provider = Provider.unscoped.where("allocator.role_name IN ('ROLE_ALLOCATOR', 'ROLE_ADMIN')").where(deleted_at: nil).where(symbol: params[:id]).first
@provider = Provider.unscoped.where("allocator.role_name IN ('ROLE_ALLOCATOR', 'ROLE_ADMIN')").where(is_active: "\x01").where(deleted_at: nil).where(symbol: params[:id]).first
fail ActiveRecord::RecordNotFound unless @provider.present?
end

Expand Down
Loading

0 comments on commit abe3090

Please sign in to comment.