This file contains hidden or 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
| # Crear un arreglo de hashes, cada hash contiene los datos de la persona: | |
| # - Nombre Completo | |
| # - País | |
| # - Continente | |
| # - Género | |
| # | |
| # Poblar con muchos datos | |
| # 2.- Contar la cantidad de personas de la lista | |
| # 3.- Generar un array con cada continente, eliminar repeticiones, considerar | |
| # que pueden haber nombres escritos con mayúscula y minúscula |
This file contains hidden or 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
| before do | |
| @user = user_with(first_name: "Maria") | |
| @project_one = project_with( | |
| fixed_annual_rate: 11, | |
| execution_date: Date.new(2015, 10, 8), | |
| investments: [investment_with(amount: 100_000, user: user)]) | |
| end | |
| def project_with(attrs) | |
| FakeProject.new({ fixed_annual_rate: 11 }.merge(attrs)) |
This file contains hidden or 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
| it "(when project is refunded)" do | |
| portfolio = portfolio_on(Date.new(2018, 2, 4)) | |
| date = next_payment_date_for_project( | |
| portfolio, | |
| refunded_project, | |
| formatter: ->(date) { "My date: #{date}" }, | |
| not_executed_message: "No se ha ejecutado", | |
| no_payments_left_message: "No hay más pagos", | |
| project_refunded_message: "No aplica" | |
| ) |
This file contains hidden or 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
| class Admin::ProjectFundingTerminationsController < Admin::BaseController | |
| def destroy | |
| Projects.revert_funding_termination( | |
| find_project, | |
| projects_store: Project, | |
| receipts_cancelator: ReceiptsCancelator | |
| ) | |
| redirect_to admin_projects_path | |
| end | |
This file contains hidden or 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
| class Admin::ProjectFundingTerminationsController < Admin::BaseController | |
| def new | |
| project = find_project | |
| form = Projects.terminate_funding_form(project) | |
| render locals: { project: project, form: form }, layout: false | |
| end | |
| def create | |
| termination = Projects.terminate_funding( | |
| find_project.id, |
This file contains hidden or 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
| module Projects | |
| def self.publish_project | |
| end | |
| def self.add_termination_date_form | |
| end | |
| def self.add_termination_date | |
| end | |
| def self.details_page_for_project | |
| end | |
| def self.terminate_funding_form |
This file contains hidden or 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
| class User < ActiveRecord::Base | |
| def self.last_registered(number) | |
| order(id: :desc).limit(number) | |
| end | |
| end | |
| class Admin::UsersExportsController < Admin::BaseController | |
| def create | |
| export = Users.export_users(User, params[:users_export], Date.current) | |
| # other stuff... |