Skip to content
This repository has been archived by the owner on Apr 5, 2020. It is now read-only.

Commit

Permalink
#5 <@callegas, @lucasgaspari> - Apagar comentários e controller não u…
Browse files Browse the repository at this point in the history
…tilizada
  • Loading branch information
lucasgaspari committed Oct 31, 2016
1 parent a9b3bc6 commit 1b445b9
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 276 deletions.
74 changes: 0 additions & 74 deletions app/controllers/user_blood_banks_controller.rb

This file was deleted.

27 changes: 1 addition & 26 deletions app/controllers/user_blood_donators/confirmations_controller.rb
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
class UserBloodDonators::ConfirmationsController < Devise::ConfirmationsController
# GET /resource/confirmation/new
# def new
# super
# end

# POST /resource/confirmation
# def create
# super
# end

# GET /resource/confirmation?confirmation_token=abcdef
# def show
# super
# end

# protected

# The path used after resending confirmation instructions.
# def after_resending_confirmation_instructions_path_for(resource_name)
# super(resource_name)
# end

# The path used after confirmation.
# def after_confirmation_path_for(resource_name, resource)
# super(resource_name, resource)
# end

end
30 changes: 0 additions & 30 deletions app/controllers/user_blood_donators/passwords_controller.rb
Original file line number Diff line number Diff line change
@@ -1,32 +1,2 @@
class UserBloodDonators::PasswordsController < Devise::PasswordsController
# GET /resource/password/new
# def new
# super
# end

# POST /resource/password
# def create
# super
# end

# GET /resource/password/edit?reset_password_token=abcdef
# def edit
# super
# end

# PUT /resource/password
# def update
# super
# end

# protected

# def after_resetting_password_path_for(resource)
# super(resource)
# end

# The path used after sending reset password instructions
# def after_sending_reset_password_instructions_path_for(resource_name)
# super(resource_name)
# end
end
38 changes: 1 addition & 37 deletions app/controllers/user_blood_donators/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,6 @@ def cancel_notification

end

# GET /resource/edit
# def edit
# super
# end

# PUT /resource
# def update
# super
# end

# DELETE /resource
# def destroy
# super
# end

# GET /resource/cancel
# Forces the session data which is usually expired after sign
# in to be expired now. This is useful if the user wants to
# cancel oauth signing in/up in the middle of the process,
# removing all OAuth session data.
# def cancel
# super
# end

# protected

# If you have extra params to permit, append them to the sanitizer.
Expand All @@ -79,19 +55,11 @@ def configure_sign_up_params
:last_donation_token, :notification_token])
end

# If you have extra params to permit, append them to the sanitizer.
# def configure_account_update_params
# devise_parameter_sanitizer.permit(:account_update, keys: [:attribute])
# end
# The path used after sign up.

def after_sign_up_path_for(resource)
dashboard_path
end

# The path used after sign up for inactive accounts.
# def after_inactive_sign_up_path_for(resource)
# super(resource)
# end

protected
def get_donators
Expand All @@ -102,8 +70,4 @@ def send_notification
NotificationMailer.send_email.deliver_now
end

def teste_chamada
NotificationMailer.get_donators
end

end
12 changes: 1 addition & 11 deletions app/controllers/user_blood_donators/sessions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
class UserBloodDonators::SessionsController < Devise::SessionsController
before_action :configure_sign_in_params, only: [:create]

# GET /resource/sign_in
# def new
# super
# end

# POST /resource/sign_in
def create
puts params.inspect
super
end

# DELETE /resource/sign_out
# def destroy
# super
# end

protected

# If you have extra params to permit, append them to the sanitizer.
def configure_sign_in_params
devise_parameter_sanitizer.permit(:sign_in, keys: [:cpf])
Expand Down
25 changes: 0 additions & 25 deletions app/controllers/user_blood_donators/unlocks_controller.rb
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
class UserBloodDonators::UnlocksController < Devise::UnlocksController
# GET /resource/unlock/new
# def new
# super
# end

# POST /resource/unlock
# def create
# super
# end

# GET /resource/unlock?unlock_token=abcdef
# def show
# super
# end

# protected

# The path used after sending unlock password instructions
# def after_sending_unlock_instructions_path_for(resource)
# super(resource)
# end

# The path used after unlocking the resource
# def after_unlock_path_for(resource)
# super(resource)
# end
end
74 changes: 1 addition & 73 deletions app/controllers/user_blood_donators_controller.rb
Original file line number Diff line number Diff line change
@@ -1,83 +1,11 @@
class UserBloodDonatorsController < ApplicationController
before_action :set_user_blood_donator, only: [:show, :edit, :update, :destroy]

# GET /user_blood_donators
# GET /user_blood_donators.json
def index
@user_blood_donators = UserBloodDonator.all
end

# GET /user_blood_donators/1
# GET /user_blood_donators/1.json
def show
end

# GET /user_blood_donators/new
def new
@user_blood_donator = UserBloodDonator.new
end


# =newPrototipo
# GET /user_blood_donators/new
def newPrototipo
@resourceT = "blood_prototype"
@user_blood_donator = UserBloodDonator.new
render 'user_blood_donators/registrations/newPrototipo'
end

# GET /user_blood_donators/1/edit
def edit
end

# POST /user_blood_donators
# POST /user_blood_donators.json

# def create
# @user_blood_donator = UserBloodDonator.new(user_blood_donator_params)
# respond_to do |format|
# if @user_blood_donator.save
# format.html { redirect_to @user_blood_donator, notice: 'user_blood_donator was successfully created.' }
# format.json { render :show, status: :created, location: @user_blood_donator }
# else
# format.html { render :new }
# format.json { render json: @user_blood_donator.errors, status: :unprocessable_entity }
# end
# end
# end

# PATCH/PUT /user_blood_donators/1
# PATCH/PUT /user_blood_donators/1.json
def update
respond_to do |format|
if @user_blood_donator.update(user_blood_donator_params)
format.html { redirect_to @user_blood_donator, notice: 'user_blood_donator was successfully updated.' }
format.json { render :show, status: :ok, location: @user_blood_donator }
else
format.html { render :edit }
format.json { render json: @user_blood_donator.errors, status: :unprocessable_entity }
end
end
end

# DELETE /user_blood_donators/1
# DELETE /user_blood_donators/1.json
def destroy
@user_blood_donator.destroy
respond_to do |format|
format.html { redirect_to user_blood_donators_url, notice: 'user_blood_donator was successfully destroyed.' }
format.json { head :no_content }
end
end

private
# Use callbacks to share common setup or constraints between actions.
def set_user_blood_donator
@user_blood_donator = UserBloodDonator.find(params[:id])
end

# Never trust parameters from the scary internet, only allow the white list through.
def user_blood_donator_params
params.require(:user_blood_donator).permit(:name, :date_birth, :cpf, :email, :phone, :password, :blood_type, :admin, :notification, :last_donation, :cep, :lat, :long, :genre)
end

end

0 comments on commit 1b445b9

Please sign in to comment.