From 1b445b94ded33b2b59e351cbf6730b08a884cb7d Mon Sep 17 00:00:00 2001 From: souzabruna Date: Mon, 31 Oct 2016 10:21:24 -0200 Subject: [PATCH] =?UTF-8?q?#5=20<@callegas,=20@lucasgaspari>=20-=20Apagar?= =?UTF-8?q?=20coment=C3=A1rios=20e=20controller=20n=C3=A3o=20utilizada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user_blood_banks_controller.rb | 74 ------------------- .../confirmations_controller.rb | 27 +------ .../passwords_controller.rb | 30 -------- .../registrations_controller.rb | 38 +--------- .../sessions_controller.rb | 12 +-- .../user_blood_donators/unlocks_controller.rb | 25 ------- .../user_blood_donators_controller.rb | 74 +------------------ 7 files changed, 4 insertions(+), 276 deletions(-) delete mode 100644 app/controllers/user_blood_banks_controller.rb diff --git a/app/controllers/user_blood_banks_controller.rb b/app/controllers/user_blood_banks_controller.rb deleted file mode 100644 index 5402ad3..0000000 --- a/app/controllers/user_blood_banks_controller.rb +++ /dev/null @@ -1,74 +0,0 @@ -class UserBloodBanksController < ApplicationController - before_action :set_user_blood_bank, only: [:show, :edit, :update, :destroy] - - # GET /user_blood_banks - # GET /user_blood_banks.json - def index - @user_blood_banks = UserBloodBank.all - end - - # GET /user_blood_banks/1 - # GET /user_blood_banks/1.json - def show - end - - # GET /user_blood_banks/new - def new - @user_blood_bank = UserBloodBank.new - end - - # GET /user_blood_banks/1/edit - def edit - end - - # POST /user_blood_banks - # POST /user_blood_banks.json - # def create - # @user_blood_bank = UserBloodBank.new(user_blood_bank_params) - # - # respond_to do |format| - # if @user_blood_bank.save - # format.html { redirect_to @user_blood_bank, notice: 'UserBloodBank was successfully created.' } - # format.json { render :show, status: :created, location: @user_blood_bank } - # else - # format.html { render :new } - # format.json { render json: @user_blood_bank.errors, status: :unprocessable_entity } - # end - # end - # end - - # PATCH/PUT /user_blood_banks/1 - # PATCH/PUT /user_blood_banks/1.json - def update - respond_to do |format| - if @user_blood_bank.update(user_blood_bank_params) - format.html { redirect_to @user_blood_bank, notice: 'UserBloodBank was successfully updated.' } - format.json { render :show, status: :ok, location: @user_blood_bank } - else - format.html { render :edit } - format.json { render json: @user_blood_bank.errors, status: :unprocessable_entity } - end - end - end - - # DELETE /user_blood_banks/1 - # DELETE /user_blood_banks/1.json - def destroy - @user_blood_bank.destroy - respond_to do |format| - format.html { redirect_to user_blood_banks_url, notice: 'UserBloodBank 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_bank - @user_blood_bank = UserBloodBank.find(params[:id]) - end - - # Never trust parameters from the scary internet, only allow the white list through. - def user_blood_bank_params - params.require(:user_blood_bank).permit(:name, :email, :cnpj, :password, :phone, :lat, :long, :address, :extension ) - end -end diff --git a/app/controllers/user_blood_donators/confirmations_controller.rb b/app/controllers/user_blood_donators/confirmations_controller.rb index 28f9b42..0a5a42a 100644 --- a/app/controllers/user_blood_donators/confirmations_controller.rb +++ b/app/controllers/user_blood_donators/confirmations_controller.rb @@ -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 diff --git a/app/controllers/user_blood_donators/passwords_controller.rb b/app/controllers/user_blood_donators/passwords_controller.rb index 14cd487..1429caa 100644 --- a/app/controllers/user_blood_donators/passwords_controller.rb +++ b/app/controllers/user_blood_donators/passwords_controller.rb @@ -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 diff --git a/app/controllers/user_blood_donators/registrations_controller.rb b/app/controllers/user_blood_donators/registrations_controller.rb index b8bb56d..78b30be 100644 --- a/app/controllers/user_blood_donators/registrations_controller.rb +++ b/app/controllers/user_blood_donators/registrations_controller.rb @@ -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. @@ -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 @@ -102,8 +70,4 @@ def send_notification NotificationMailer.send_email.deliver_now end - def teste_chamada - NotificationMailer.get_donators - end - end diff --git a/app/controllers/user_blood_donators/sessions_controller.rb b/app/controllers/user_blood_donators/sessions_controller.rb index 3a9a75b..06ff79a 100644 --- a/app/controllers/user_blood_donators/sessions_controller.rb +++ b/app/controllers/user_blood_donators/sessions_controller.rb @@ -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]) diff --git a/app/controllers/user_blood_donators/unlocks_controller.rb b/app/controllers/user_blood_donators/unlocks_controller.rb index fa0ca6a..b6481d0 100644 --- a/app/controllers/user_blood_donators/unlocks_controller.rb +++ b/app/controllers/user_blood_donators/unlocks_controller.rb @@ -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 diff --git a/app/controllers/user_blood_donators_controller.rb b/app/controllers/user_blood_donators_controller.rb index f5b7c4e..fe05ede 100644 --- a/app/controllers/user_blood_donators_controller.rb +++ b/app/controllers/user_blood_donators_controller.rb @@ -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