├── log
└── .keep
├── storage
└── .keep
├── tmp
├── .keep
├── pids
│ └── .keep
└── storage
│ └── .keep
├── vendor
└── .keep
├── lib
├── assets
│ └── .keep
└── tasks
│ └── .keep
├── public
├── favicon.ico
├── apple-touch-icon.png
├── apple-touch-icon-precomposed.png
├── robots.txt
├── 500.html
├── 422.html
└── 404.html
├── test
├── helpers
│ └── .keep
├── mailers
│ └── .keep
├── models
│ ├── .keep
│ ├── user_test.rb
│ ├── article_test.rb
│ ├── minute_test.rb
│ ├── project_test.rb
│ ├── agreement_test.rb
│ ├── investigator_test.rb
│ ├── transaction_test.rb
│ └── project_investigator_test.rb
├── system
│ ├── .keep
│ ├── minutes_test.rb
│ ├── projects_test.rb
│ ├── agreements_test.rb
│ ├── transactions_test.rb
│ └── investigators_test.rb
├── controllers
│ ├── .keep
│ ├── pages_controller_test.rb
│ ├── minutes_controller_test.rb
│ ├── projects_controller_test.rb
│ ├── agreements_controller_test.rb
│ ├── transactions_controller_test.rb
│ └── investigators_controller_test.rb
├── integration
│ └── .keep
├── fixtures
│ ├── files
│ │ └── .keep
│ ├── minutes.yml
│ ├── projects.yml
│ ├── agreements.yml
│ ├── transactions.yml
│ ├── articles.yml
│ ├── project_investigators.yml
│ ├── investigators.yml
│ └── users.yml
├── application_system_test_case.rb
├── channels
│ └── application_cable
│ │ └── connection_test.rb
└── test_helper.rb
├── .ruby-version
├── app
├── assets
│ ├── builds
│ │ └── .keep
│ ├── images
│ │ └── .keep
│ ├── config
│ │ └── manifest.js
│ └── stylesheets
│ │ └── application.bootstrap.scss
├── models
│ ├── concerns
│ │ └── .keep
│ ├── application_record.rb
│ ├── article.rb
│ ├── project_investigator.rb
│ ├── agreement.rb
│ ├── minute.rb
│ ├── transaction.rb
│ ├── project.rb
│ ├── investigator.rb
│ └── user.rb
├── controllers
│ ├── concerns
│ │ └── .keep
│ ├── application_controller.rb
│ ├── pages_controller.rb
│ ├── Users
│ │ ├── sessions_controller.rb
│ │ ├── unlocks_controller.rb
│ │ ├── confirmations_controller.rb
│ │ ├── passwords_controller.rb
│ │ ├── omniauth_callbacks_controller.rb
│ │ └── registrations_controller.rb
│ ├── agreements_controller.rb
│ ├── transactions_controller.rb
│ ├── investigators_controller.rb
│ ├── minutes_controller.rb
│ └── projects_controller.rb
├── views
│ ├── layouts
│ │ ├── mailer.text.erb
│ │ ├── mailer.html.erb
│ │ └── application.html.erb
│ ├── minutes
│ │ ├── show.json.jbuilder
│ │ ├── index.json.jbuilder
│ │ ├── _minute.json.jbuilder
│ │ ├── index.html.erb
│ │ ├── new.html.erb
│ │ ├── edit.html.erb
│ │ ├── _minute.html.erb
│ │ ├── show.html.erb
│ │ ├── _form.html.erb
│ │ └── articles
│ │ │ ├── _articles_fields.html.erb
│ │ │ └── _articles_form.html.erb
│ ├── projects
│ │ ├── show.json.jbuilder
│ │ ├── index.json.jbuilder
│ │ ├── project_form
│ │ │ ├── _add_investigator_actions.html.erb
│ │ │ ├── _project_data_form.html.erb
│ │ │ ├── _add_investigator_form.html.erb
│ │ │ └── _form.html.erb
│ │ ├── _project.json.jbuilder
│ │ ├── edit.html.erb
│ │ ├── show.html.erb
│ │ ├── index.html.erb
│ │ ├── new.html.erb
│ │ ├── _project.html.erb
│ │ └── _project_table.html.erb
│ ├── agreements
│ │ ├── show.json.jbuilder
│ │ ├── index.json.jbuilder
│ │ ├── _agreement.json.jbuilder
│ │ ├── new.html.erb
│ │ ├── edit.html.erb
│ │ ├── _agreement.html.erb
│ │ ├── show.html.erb
│ │ ├── index.html.erb
│ │ └── _form.html.erb
│ ├── transactions
│ │ ├── show.json.jbuilder
│ │ ├── index.json.jbuilder
│ │ ├── _transaction.json.jbuilder
│ │ ├── new.html.erb
│ │ ├── edit.html.erb
│ │ ├── _transaction.html.erb
│ │ ├── show.html.erb
│ │ ├── index.html.erb
│ │ └── _form.html.erb
│ ├── investigators
│ │ ├── show.json.jbuilder
│ │ ├── index.json.jbuilder
│ │ ├── _investigator.json.jbuilder
│ │ ├── _investigator_table_actions.html.erb
│ │ ├── new.html.erb
│ │ ├── edit.html.erb
│ │ ├── _investigator.html.erb
│ │ ├── index.html.erb
│ │ ├── show.html.erb
│ │ ├── _investigator_filter.html.erb
│ │ └── _form.html.erb
│ ├── users
│ │ ├── mailer
│ │ │ ├── password_change.html.erb
│ │ │ ├── confirmation_instructions.html.erb
│ │ │ ├── unlock_instructions.html.erb
│ │ │ ├── email_changed.html.erb
│ │ │ └── reset_password_instructions.html.erb
│ │ ├── shared
│ │ │ ├── _error_messages.html.erb
│ │ │ └── _links.html.erb
│ │ ├── unlocks
│ │ │ └── new.html.erb
│ │ ├── passwords
│ │ │ ├── new.html.erb
│ │ │ └── edit.html.erb
│ │ ├── confirmations
│ │ │ └── new.html.erb
│ │ ├── registrations
│ │ │ ├── new.html.erb
│ │ │ └── edit.html.erb
│ │ └── sessions
│ │ │ └── new.html.erb
│ ├── shared
│ │ ├── _devise_notifications.html.erb
│ │ ├── _investigator_table.html.erb
│ │ └── _navigation.html.erb
│ └── pages
│ │ └── home.html.erb
├── helpers
│ ├── pages_helper.rb
│ ├── minutes_helper.rb
│ ├── agreements_helper.rb
│ ├── projects_helper.rb
│ ├── application_helper.rb
│ ├── transactions_helper.rb
│ └── investigators_helper.rb
├── channels
│ └── application_cable
│ │ ├── channel.rb
│ │ └── connection.rb
├── mailers
│ └── application_mailer.rb
├── javascript
│ ├── application.js
│ └── controllers
│ │ ├── hello_controller.js
│ │ ├── application.js
│ │ ├── index.js
│ │ ├── nested_form_controller.js
│ │ └── select_controller.js
└── jobs
│ └── application_job.rb
├── Procfile.dev
├── bin
├── rake
├── rails
├── dev
├── setup
└── bundle
├── config
├── environment.rb
├── boot.rb
├── cable.yml
├── initializers
│ ├── filter_parameter_logging.rb
│ ├── permissions_policy.rb
│ ├── assets.rb
│ ├── inflections.rb
│ ├── content_security_policy.rb
│ └── devise.rb
├── credentials.yml.enc
├── routes.rb
├── database.yml
├── application.rb
├── locales
│ ├── en.yml
│ └── devise.en.yml
├── storage.yml
├── puma.rb
└── environments
│ ├── test.rb
│ ├── development.rb
│ └── production.rb
├── config.ru
├── Rakefile
├── db
├── migrate
│ ├── 20220621045935_create_minutes.rb
│ ├── 20220808195327_add_column_article_to_agreement.rb
│ ├── 20220619054820_create_projects.rb
│ ├── 20220806045927_create_articles.rb
│ ├── 20220807025137_add_column_agreement_to_transactions.rb
│ ├── 20220806231734_create_agreements.rb
│ ├── 20220806233143_create_transactions.rb
│ ├── 20220619013813_create_investigators.rb
│ ├── 20220620044002_create_project_investigators.rb
│ ├── 20220618171429_devise_create_users.rb
│ └── 20220621045601_create_active_storage_tables.active_storage.rb
├── seeds.rb
└── schema.rb
├── .gitattributes
├── README.md
├── package.json
├── .gitignore
├── .byebug_history
├── Gemfile
├── Gemfile.lock
└── yarn.lock
/log/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/storage/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tmp/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/assets/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/tasks/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/helpers/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/mailers/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/models/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/system/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tmp/pids/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tmp/storage/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.ruby-version:
--------------------------------------------------------------------------------
1 | 3.1.2
2 |
--------------------------------------------------------------------------------
/app/assets/builds/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/images/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/controllers/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/integration/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/models/concerns/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/fixtures/files/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/controllers/concerns/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/apple-touch-icon-precomposed.png:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/views/layouts/mailer.text.erb:
--------------------------------------------------------------------------------
1 | <%= yield %>
2 |
--------------------------------------------------------------------------------
/app/helpers/pages_helper.rb:
--------------------------------------------------------------------------------
1 | module PagesHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/minutes_helper.rb:
--------------------------------------------------------------------------------
1 | module MinutesHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/agreements_helper.rb:
--------------------------------------------------------------------------------
1 | module AgreementsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/projects_helper.rb:
--------------------------------------------------------------------------------
1 | module ProjectsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/transactions_helper.rb:
--------------------------------------------------------------------------------
1 | module TransactionsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/investigators_helper.rb:
--------------------------------------------------------------------------------
1 | module InvestigatorsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/assets/config/manifest.js:
--------------------------------------------------------------------------------
1 | //= link_tree ../images
2 | //= link_tree ../builds
3 |
--------------------------------------------------------------------------------
/app/views/minutes/show.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.partial! "minutes/minute", minute: @minute
2 |
--------------------------------------------------------------------------------
/app/views/projects/show.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.partial! "projects/project", project: @project
2 |
--------------------------------------------------------------------------------
/app/views/agreements/show.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.partial! "agreements/agreement", agreement: @agreement
2 |
--------------------------------------------------------------------------------
/app/views/minutes/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array! @minutes, partial: "minutes/minute", as: :minute
2 |
--------------------------------------------------------------------------------
/Procfile.dev:
--------------------------------------------------------------------------------
1 | web: bin/rails server -p 3000
2 | js: yarn build --watch
3 | css: yarn build:css --watch
4 |
--------------------------------------------------------------------------------
/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 | end
3 |
--------------------------------------------------------------------------------
/app/views/projects/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array! @projects, partial: "projects/project", as: :project
2 |
--------------------------------------------------------------------------------
/app/views/transactions/show.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.partial! "transactions/transaction", transaction: @transaction
2 |
--------------------------------------------------------------------------------
/app/models/application_record.rb:
--------------------------------------------------------------------------------
1 | class ApplicationRecord < ActiveRecord::Base
2 | primary_abstract_class
3 | end
4 |
--------------------------------------------------------------------------------
/app/views/agreements/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array! @agreements, partial: "agreements/agreement", as: :agreement
2 |
--------------------------------------------------------------------------------
/app/views/investigators/show.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.partial! "investigators/investigator", investigator: @investigator
2 |
--------------------------------------------------------------------------------
/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative "../config/boot"
3 | require "rake"
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/app/models/article.rb:
--------------------------------------------------------------------------------
1 | class Article < ApplicationRecord
2 | belongs_to :minute
3 | belongs_to :project
4 | end
5 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2 |
--------------------------------------------------------------------------------
/app/views/transactions/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array! @transactions, partial: "transactions/transaction", as: :transaction
2 |
--------------------------------------------------------------------------------
/app/views/investigators/index.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.array! @investigators, partial: "investigators/investigator", as: :investigator
2 |
--------------------------------------------------------------------------------
/app/channels/application_cable/channel.rb:
--------------------------------------------------------------------------------
1 | module ApplicationCable
2 | class Channel < ActionCable::Channel::Base
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/application.bootstrap.scss:
--------------------------------------------------------------------------------
1 | @import 'bootstrap/scss/bootstrap';
2 | @import 'bootstrap-icons/font/bootstrap-icons';
3 |
--------------------------------------------------------------------------------
/app/channels/application_cable/connection.rb:
--------------------------------------------------------------------------------
1 | module ApplicationCable
2 | class Connection < ActionCable::Connection::Base
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/app/mailers/application_mailer.rb:
--------------------------------------------------------------------------------
1 | class ApplicationMailer < ActionMailer::Base
2 | default from: "from@example.com"
3 | layout "mailer"
4 | end
5 |
--------------------------------------------------------------------------------
/app/models/project_investigator.rb:
--------------------------------------------------------------------------------
1 | class ProjectInvestigator < ApplicationRecord
2 | belongs_to :project
3 | belongs_to :investigator
4 | end
5 |
--------------------------------------------------------------------------------
/app/views/projects/project_form/_add_investigator_actions.html.erb:
--------------------------------------------------------------------------------
1 | <%= investigator_subform.check_box investigador.id, class: "project_investigators"%>
--------------------------------------------------------------------------------
/app/views/minutes/_minute.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.extract! minute, :id, :number, :date, :created_at, :updated_at
2 | json.url minute_url(minute, format: :json)
3 |
--------------------------------------------------------------------------------
/app/views/projects/_project.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.extract! project, :id, :code, :name, :created_at, :updated_at
2 | json.url project_url(project, format: :json)
3 |
--------------------------------------------------------------------------------
/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_PATH = File.expand_path("../config/application", __dir__)
3 | require_relative "../config/boot"
4 | require "rails/commands"
5 |
--------------------------------------------------------------------------------
/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require_relative "application"
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/test/models/user_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class UserTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/app/views/users/mailer/password_change.html.erb:
--------------------------------------------------------------------------------
1 |
Hello <%= @resource.email %>!
2 |
3 | We're contacting you to notify you that your password has been changed.
4 |
--------------------------------------------------------------------------------
/test/models/article_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class ArticleTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/minute_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class MinuteTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/project_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class ProjectTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/agreement_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class AgreementTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/investigator_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class InvestigatorTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/transaction_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class TransactionTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/app/views/agreements/_agreement.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.extract! agreement, :id, :agreementNumber, :articleNumber, :created_at, :updated_at
2 | json.url agreement_url(agreement, format: :json)
3 |
--------------------------------------------------------------------------------
/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require_relative "config/environment"
4 |
5 | run Rails.application
6 | Rails.application.load_server
7 |
--------------------------------------------------------------------------------
/app/javascript/application.js:
--------------------------------------------------------------------------------
1 | // Entry point for the build script in your package.json
2 | import "@hotwired/turbo-rails"
3 | import "./controllers"
4 | import * as bootstrap from "bootstrap"
5 |
--------------------------------------------------------------------------------
/app/views/transactions/_transaction.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.extract! transaction, :id, :agreementNumber, :status, :created_at, :updated_at
2 | json.url transaction_url(transaction, format: :json)
3 |
--------------------------------------------------------------------------------
/test/models/project_investigator_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class ProjectInvestigatorTest < ActiveSupport::TestCase
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/bin/dev:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | if ! foreman version &> /dev/null
4 | then
5 | echo "Installing foreman..."
6 | gem install foreman
7 | fi
8 |
9 | foreman start -f Procfile.dev "$@"
10 |
--------------------------------------------------------------------------------
/test/controllers/pages_controller_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class PagesControllerTest < ActionDispatch::IntegrationTest
4 | # test "the truth" do
5 | # assert true
6 | # end
7 | end
8 |
--------------------------------------------------------------------------------
/test/application_system_test_case.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
4 | driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
5 | end
6 |
--------------------------------------------------------------------------------
/app/views/investigators/_investigator.json.jbuilder:
--------------------------------------------------------------------------------
1 | json.extract! investigator, :id, :first_name, :last_name, :id_card, :email, :created_at, :updated_at
2 | json.url investigator_url(investigator, format: :json)
3 |
--------------------------------------------------------------------------------
/app/views/shared/_devise_notifications.html.erb:
--------------------------------------------------------------------------------
1 | <% if notice %>
2 | <%= notice %>
3 | <% end %>
4 | <% if alert %>
5 | <%= alert %>
6 | <% end %>
--------------------------------------------------------------------------------
/app/views/agreements/new.html.erb:
--------------------------------------------------------------------------------
1 | New agreement
2 |
3 | <%= render "form", agreement: @agreement %>
4 |
5 |
6 |
7 |
8 | <%= link_to "Back to agreements", agreements_path %>
9 |
10 |
--------------------------------------------------------------------------------
/app/javascript/controllers/hello_controller.js:
--------------------------------------------------------------------------------
1 | import { Controller } from "@hotwired/stimulus"
2 |
3 | export default class extends Controller {
4 | connect() {
5 | this.element.textContent = "Hello World!"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/app/views/transactions/new.html.erb:
--------------------------------------------------------------------------------
1 | New transaction
2 |
3 | <%= render "form", transaction: @transaction %>
4 |
5 |
6 |
7 |
8 | <%= link_to "Back to transactions", transactions_path %>
9 |
10 |
--------------------------------------------------------------------------------
/config/boot.rb:
--------------------------------------------------------------------------------
1 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
2 |
3 | require "bundler/setup" # Set up gems listed in the Gemfile.
4 | require "bootsnap/setup" # Speed up boot time by caching expensive operations.
5 |
--------------------------------------------------------------------------------
/test/fixtures/minutes.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | number: 1
5 | date: 2022-06-20
6 |
7 | two:
8 | number: 1
9 | date: 2022-06-20
10 |
--------------------------------------------------------------------------------
/test/fixtures/projects.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | code: MyString
5 | name: MyString
6 |
7 | two:
8 | code: MyString
9 | name: MyString
10 |
--------------------------------------------------------------------------------
/app/models/agreement.rb:
--------------------------------------------------------------------------------
1 | class Agreement < ApplicationRecord
2 | has_one :articles
3 | has_many :transaction
4 | validates :agreementNumber, presence: true, uniqueness: true
5 | validates :articleNumber, presence: true
6 | end
7 |
--------------------------------------------------------------------------------
/test/fixtures/agreements.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | agreementNumber: 1
5 | articleNumber: 1
6 |
7 | two:
8 | agreementNumber: 1
9 | articleNumber: 1
10 |
--------------------------------------------------------------------------------
/test/fixtures/transactions.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | agreementNumber: 1
5 | status: MyString
6 |
7 | two:
8 | agreementNumber: 1
9 | status: MyString
10 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require_relative "config/application"
5 |
6 | Rails.application.load_tasks
7 |
--------------------------------------------------------------------------------
/app/models/minute.rb:
--------------------------------------------------------------------------------
1 | class Minute < ApplicationRecord
2 | has_one_attached :file
3 | has_many :articles, dependent: :destroy
4 | accepts_nested_attributes_for :articles, allow_destroy: true, reject_if: proc { |attr| attr["number"].blank? }
5 | end
6 |
--------------------------------------------------------------------------------
/config/cable.yml:
--------------------------------------------------------------------------------
1 | development:
2 | adapter: async
3 |
4 | test:
5 | adapter: test
6 |
7 | production:
8 | adapter: redis
9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10 | channel_prefix: CoordinacionDocencia_production
11 |
--------------------------------------------------------------------------------
/db/migrate/20220621045935_create_minutes.rb:
--------------------------------------------------------------------------------
1 | class CreateMinutes < ActiveRecord::Migration[7.0]
2 | def change
3 | create_table :minutes do |t|
4 | t.integer :number
5 | t.date :date
6 |
7 | t.timestamps
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/app/views/users/mailer/confirmation_instructions.html.erb:
--------------------------------------------------------------------------------
1 | Welcome <%= @email %>!
2 |
3 | You can confirm your account email through the link below:
4 |
5 | <%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>
6 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # See https://git-scm.com/docs/gitattributes for more about git attribute files.
2 |
3 | # Mark the database schema as having been generated.
4 | db/schema.rb linguist-generated
5 |
6 | # Mark any vendored files as having been vendored.
7 | vendor/* linguist-vendored
8 |
--------------------------------------------------------------------------------
/app/views/agreements/edit.html.erb:
--------------------------------------------------------------------------------
1 | Editing agreement
2 |
3 | <%= render "form", agreement: @agreement %>
4 |
5 |
6 |
7 |
8 | <%= link_to "Show this agreement", @agreement %> |
9 | <%= link_to "Back to agreements", agreements_path %>
10 |
11 |
--------------------------------------------------------------------------------
/test/fixtures/articles.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | number: MyString
5 | minute_id: 1
6 | project_id: 1
7 |
8 | two:
9 | number: MyString
10 | minute_id: 1
11 | project_id: 1
12 |
--------------------------------------------------------------------------------
/app/views/projects/edit.html.erb:
--------------------------------------------------------------------------------
1 | Editing project
2 |
3 | <%= render "projects/project_form/form", project: @project %>
4 |
5 |
6 |
7 |
8 | <%= link_to "Show this project", @project %> |
9 | <%= link_to "Back to projects", projects_path %>
10 |
11 |
--------------------------------------------------------------------------------
/test/fixtures/project_investigators.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | project_id: 1
5 | investigator_id: 1
6 | role: 1
7 |
8 | two:
9 | project_id: 1
10 | investigator_id: 1
11 | role: 1
12 |
--------------------------------------------------------------------------------
/app/controllers/pages_controller.rb:
--------------------------------------------------------------------------------
1 | class PagesController < ApplicationController
2 | def home
3 | if !current_user
4 | flash[:notice] = "Para acceder a la aplicación, debe iniciar sesión."
5 | redirect_to new_user_session_path
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/app/views/transactions/edit.html.erb:
--------------------------------------------------------------------------------
1 | Editing transaction
2 |
3 | <%= render "form", transaction: @transaction %>
4 |
5 |
6 |
7 |
8 | <%= link_to "Show this transaction", @transaction %> |
9 | <%= link_to "Back to transactions", transactions_path %>
10 |
11 |
--------------------------------------------------------------------------------
/db/migrate/20220808195327_add_column_article_to_agreement.rb:
--------------------------------------------------------------------------------
1 | class AddColumnArticleToAgreement < ActiveRecord::Migration[7.0]
2 | def change
3 | add_column :agreements, :article_id, :integer, null: false
4 | add_foreign_key :agreements, :articles, column: :article_id
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/app/javascript/controllers/application.js:
--------------------------------------------------------------------------------
1 | import { Application } from "@hotwired/stimulus"
2 |
3 | const application = Application.start()
4 |
5 | // Configure Stimulus development experience
6 | application.debug = false
7 | window.Stimulus = application
8 |
9 | export { application }
10 |
--------------------------------------------------------------------------------
/app/views/transactions/_transaction.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | Agreementnumber:
4 | <%= transaction.agreementNumber %>
5 |
6 |
7 |
8 | Status:
9 | <%= transaction.status %>
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/views/agreements/_agreement.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | Agreementnumber:
4 | <%= agreement.agreementNumber %>
5 |
6 |
7 |
8 | Articlenumber:
9 | <%= agreement.articleNumber %>
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/db/migrate/20220619054820_create_projects.rb:
--------------------------------------------------------------------------------
1 | class CreateProjects < ActiveRecord::Migration[7.0]
2 | def change
3 | create_table :projects do |t|
4 | t.string :code, null: false, unique: true
5 | t.string :name, null: false
6 |
7 | t.timestamps
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20220806045927_create_articles.rb:
--------------------------------------------------------------------------------
1 | class CreateArticles < ActiveRecord::Migration[7.0]
2 | def change
3 | create_table :articles do |t|
4 | t.string :number
5 | t.integer :minute_id
6 | t.integer :project_id
7 |
8 | t.timestamps
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/jobs/application_job.rb:
--------------------------------------------------------------------------------
1 | class ApplicationJob < ActiveJob::Base
2 | # Automatically retry jobs that encountered a deadlock
3 | # retry_on ActiveRecord::Deadlocked
4 |
5 | # Most jobs are safe to ignore if the underlying records are no longer available
6 | # discard_on ActiveJob::DeserializationError
7 | end
8 |
--------------------------------------------------------------------------------
/app/views/layouts/mailer.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 | <%= yield %>
12 |
13 |
14 |
--------------------------------------------------------------------------------
/db/migrate/20220807025137_add_column_agreement_to_transactions.rb:
--------------------------------------------------------------------------------
1 | class AddColumnAgreementToTransactions < ActiveRecord::Migration[7.0]
2 | def change
3 | add_column :transactions, :agreement_id, :integer, null: false
4 | add_foreign_key :transactions, :agreements, column: :agreement_id
5 | end
6 |
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20220806231734_create_agreements.rb:
--------------------------------------------------------------------------------
1 | class CreateAgreements < ActiveRecord::Migration[7.0]
2 | def change
3 | create_table :agreements do |t|
4 | t.integer :agreementNumber
5 | t.integer :articleNumber
6 | t.string :description
7 | t.timestamps
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/app/views/projects/show.html.erb:
--------------------------------------------------------------------------------
1 | <%= notice %>
2 |
3 | <%= render @project %>
4 |
5 |
6 | <%= link_to "Edit this project", edit_project_path(@project) %> |
7 | <%= link_to "Back to projects", projects_path %>
8 |
9 | <%= button_to "Destroy this project", @project, method: :delete %>
10 |
11 |
--------------------------------------------------------------------------------
/db/migrate/20220806233143_create_transactions.rb:
--------------------------------------------------------------------------------
1 | class CreateTransactions < ActiveRecord::Migration[7.0]
2 | def change
3 | create_table :transactions do |t|
4 | t.integer :agreementNumber
5 | t.integer :status, default: 0, null: false
6 | t.string :description
7 | t.timestamps
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/app/views/users/mailer/unlock_instructions.html.erb:
--------------------------------------------------------------------------------
1 | Hello <%= @resource.email %>!
2 |
3 | Your account has been locked due to an excessive number of unsuccessful sign in attempts.
4 |
5 | Click the link below to unlock your account:
6 |
7 | <%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>
8 |
--------------------------------------------------------------------------------
/db/migrate/20220619013813_create_investigators.rb:
--------------------------------------------------------------------------------
1 | class CreateInvestigators < ActiveRecord::Migration[7.0]
2 | def change
3 | create_table :investigators do |t|
4 | t.string :first_name
5 | t.string :last_name
6 | t.string :id_card
7 | t.string :email
8 |
9 | t.timestamps
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/test/channels/application_cable/connection_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase
4 | # test "connects with cookies" do
5 | # cookies.signed[:user_id] = 42
6 | #
7 | # connect
8 | #
9 | # assert_equal connection.user_id, "42"
10 | # end
11 | end
12 |
--------------------------------------------------------------------------------
/test/fixtures/investigators.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | one:
4 | first_name: MyString
5 | last_name: MyString
6 | id_card: MyString
7 | email: MyString
8 |
9 | two:
10 | first_name: MyString
11 | last_name: MyString
12 | id_card: MyString
13 | email: MyString
14 |
--------------------------------------------------------------------------------
/app/views/agreements/show.html.erb:
--------------------------------------------------------------------------------
1 | <%= notice %>
2 |
3 | <%= render @agreement %>
4 |
5 |
6 | <%= link_to "Edit this agreement", edit_agreement_path(@agreement) %> |
7 | <%= link_to "Back to agreements", agreements_path %>
8 |
9 | <%= button_to "Destroy this agreement", @agreement, method: :delete %>
10 |
11 |
--------------------------------------------------------------------------------
/app/views/minutes/index.html.erb:
--------------------------------------------------------------------------------
1 | <%= notice %>
2 |
3 | Minutes
4 |
5 |
6 | <% @minutes.each do |minute| %>
7 | <%= render minute %>
8 |
9 | <%= link_to "Show this minute", minute %>
10 |
11 | <% end %>
12 |
13 |
14 | <%= link_to "New minute", new_minute_path %>
15 |
--------------------------------------------------------------------------------
/app/views/minutes/new.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Nueva acta
4 |
5 |
6 | <%= render "form", minute: @minute %>
7 |
8 |
9 |
10 |
11 | <%= link_to "Back to minutes", minutes_path %>
12 |
13 |
--------------------------------------------------------------------------------
/app/views/transactions/show.html.erb:
--------------------------------------------------------------------------------
1 | <%= notice %>
2 |
3 | <%= render @transaction %>
4 |
5 |
6 | <%= link_to "Edit this transaction", edit_transaction_path(@transaction) %> |
7 | <%= link_to "Back to transactions", transactions_path %>
8 |
9 | <%= button_to "Destroy this transaction", @transaction, method: :delete %>
10 |
11 |
--------------------------------------------------------------------------------
/app/views/users/mailer/email_changed.html.erb:
--------------------------------------------------------------------------------
1 | Hello <%= @email %>!
2 |
3 | <% if @resource.try(:unconfirmed_email?) %>
4 | We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.
5 | <% else %>
6 | We're contacting you to notify you that your email has been changed to <%= @resource.email %>.
7 | <% end %>
8 |
--------------------------------------------------------------------------------
/app/views/minutes/edit.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Editar acta
4 |
5 |
6 | <%= render "form", minute: @minute %>
7 |
8 |
9 |
10 |
11 | <%= link_to "Back to minutes", minutes_path %>
12 |
13 |
--------------------------------------------------------------------------------
/app/views/agreements/index.html.erb:
--------------------------------------------------------------------------------
1 | <%= notice %>
2 |
3 | Agreements
4 |
5 |
6 | <% @agreements.each do |agreement| %>
7 | <%= render agreement %>
8 |
9 | <%= link_to "Show this agreement", agreement %>
10 |
11 | <% end %>
12 |
13 |
14 | <%= link_to "New agreement", new_agreement_path %>
15 |
--------------------------------------------------------------------------------
/app/views/investigators/_investigator_table_actions.html.erb:
--------------------------------------------------------------------------------
1 | <%= link_to edit_investigator_path(investigator), class: 'btn btn-primary' do %>
2 |
3 | Editar
4 | <% end %>
5 | <%= link_to investigator, method: :delete, data: { turbo_method: :delete, turbo_confirm: '¿Estás seguro?' }, class: 'btn btn-danger' do %>
6 |
7 | Eliminar
8 | <% end %>
9 |
--------------------------------------------------------------------------------
/db/seeds.rb:
--------------------------------------------------------------------------------
1 | # This file should contain all the record creation needed to seed the database with its default values.
2 | # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
3 | #
4 | # Examples:
5 | #
6 | # movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }])
7 | # Character.create(name: "Luke", movie: movies.first)
8 |
--------------------------------------------------------------------------------
/app/views/transactions/index.html.erb:
--------------------------------------------------------------------------------
1 | <%= notice %>
2 |
3 | Transactions
4 |
5 |
6 | <% @transactions.each do |transaction| %>
7 | <%= render transaction %>
8 |
9 | <%= link_to "Show this transaction", transaction %>
10 |
11 | <% end %>
12 |
13 |
14 | <%= link_to "New transaction", new_transaction_path %>
15 |
--------------------------------------------------------------------------------
/app/views/investigators/new.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Nuevo investigador
4 |
5 |
6 | <%= render "form", investigator: @investigator %>
7 |
8 |
9 |
10 |
11 | <%= link_to "Back to investigators", investigators_path %>
12 |
13 |
--------------------------------------------------------------------------------
/test/fixtures/users.yml:
--------------------------------------------------------------------------------
1 | # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 |
3 | # This model initially had no columns defined. If you add columns to the
4 | # model remove the "{}" from the fixture names and add the columns immediately
5 | # below each fixture, per the syntax in the comments below
6 | #
7 | one: {}
8 | # column: value
9 | #
10 | two: {}
11 | # column: value
12 |
--------------------------------------------------------------------------------
/app/views/projects/index.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Projectos
5 |
6 |
7 |
8 |
9 | <%= render 'project_table', projects: @projects %>
10 |
11 |
12 |
13 |
14 | <%= link_to "New project", new_project_path %>
15 |
--------------------------------------------------------------------------------
/app/views/projects/new.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Nuevo proyecto
4 |
5 |
6 | <%= render "projects/project_form/form", project: @project, investigators: @investigators%>
7 |
8 |
9 |
10 |
11 | <%= link_to "Back to projects", projects_path %>
12 |
13 |
--------------------------------------------------------------------------------
/app/models/transaction.rb:
--------------------------------------------------------------------------------
1 | class Transaction < ApplicationRecord
2 | has_one :arrangements
3 | validates :arrangementNumber, presence: true, uniqueness: true
4 | enum status: [:Pendiente, :Finalizado, :En_Ejecución]
5 | validates :status, presence: true
6 |
7 | after_initialize :set_default_status, if: :new_record?
8 |
9 | def set_default_status
10 | self.status ||= :Pendiente
11 | end
12 |
13 | end
14 |
--------------------------------------------------------------------------------
/app/views/projects/_project.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Nombre: <%= @project.name %>
6 |
7 |
8 |
9 |
10 |
11 |
12 | Código: <%= @project.code %>
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | ENV["RAILS_ENV"] ||= "test"
2 | require_relative "../config/environment"
3 | require "rails/test_help"
4 |
5 | class ActiveSupport::TestCase
6 | # Run tests in parallel with specified workers
7 | parallelize(workers: :number_of_processors)
8 |
9 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
10 | fixtures :all
11 |
12 | # Add more helper methods to be used by all tests here...
13 | end
14 |
--------------------------------------------------------------------------------
/app/models/project.rb:
--------------------------------------------------------------------------------
1 | class Project < ApplicationRecord
2 | validates :name, presence: true
3 | validates :code, presence: true, uniqueness: true
4 |
5 | has_many :project_investigators
6 | has_many :investigators, through: :project_investigators
7 |
8 | has_many :articles, dependent: :destroy
9 |
10 | accepts_nested_attributes_for :project_investigators, reject_if: ->(attributes) { attributes["name"].blank? }, allow_destroy: true
11 | end
12 |
--------------------------------------------------------------------------------
/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure parameters to be filtered from the log file. Use this to limit dissemination of
4 | # sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
5 | # notations and behaviors.
6 | Rails.application.config.filter_parameters += [
7 | :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
8 | ]
9 |
--------------------------------------------------------------------------------
/app/views/minutes/_minute.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Número:
5 | <%= minute.number %>
6 |
7 |
8 | Fecha:
9 | <%= minute.date %>
10 |
11 |
12 | Documento:
13 | <%= link_to minute.file.filename, rails_blob_path(minute.file, disposition: "file") %>
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/config/initializers/permissions_policy.rb:
--------------------------------------------------------------------------------
1 | # Define an application-wide HTTP permissions policy. For further
2 | # information see https://developers.google.com/web/updates/2018/06/feature-policy
3 | #
4 | # Rails.application.config.permissions_policy do |f|
5 | # f.camera :none
6 | # f.gyroscope :none
7 | # f.microphone :none
8 | # f.usb :none
9 | # f.fullscreen :self
10 | # f.payment :self, "https://secure.example.com"
11 | # end
12 |
--------------------------------------------------------------------------------
/app/views/investigators/edit.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Editar investigador
4 |
5 |
6 | <%= render "form", investigator: @investigator %>
7 |
8 |
9 |
10 |
11 | <%= link_to "Show this investigator", @investigator %> |
12 | <%= link_to "Back to investigators", investigators_path %>
13 |
14 |
--------------------------------------------------------------------------------
/app/views/users/mailer/reset_password_instructions.html.erb:
--------------------------------------------------------------------------------
1 | Hello <%= @resource.email %>!
2 |
3 | Someone has requested a link to change your password. You can do this through the link below.
4 |
5 | <%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>
6 |
7 | If you didn't request this, please ignore this email.
8 | Your password won't change until you access the link above and create a new one.
9 |
--------------------------------------------------------------------------------
/config/credentials.yml.enc:
--------------------------------------------------------------------------------
1 | 5bRVFzDG74koBwwwFnbpJBASk3+Eo3INfO123dCHhOR00kQZxX3t9ydlFxZFfnzjgW5dmPgao+FNth5ONaBr3Hj83kRmAe0/uJzcPDVmler5694j3FooNWEQLZXlGunt50J7igPUi9ULruy2aJPYL8mEmHC1+Eg/dE5zdLD2zMmHsPuW2KO8mq15oIc5iKlA3CIhazgxubHIzt0Q9OapGsoLlvYWHGpnU+KPzXSMNnfmxK03vrYoyHfjUmhg6MUxazPZLjXQ0OVF3E0J+QD3yH5T8Ua9r6X8Q7F/1mRCYWABtMsXTfJLzu5kx4RwAOMCxmXbipB/Ir845xhjCNTgF/cuF/f8ArqRao2oyutIBP8/L7i4ULqHw2wocHb816NqKD4XxKkyTsghsOVjyYUjit8UtGv8zmHT36Uq--NsjKSUC3PqQIsSPu--k9FojjIWNKkn9XA8z6Eskg==
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # README
2 |
3 | This README would normally document whatever steps are necessary to get the
4 | application up and running.
5 |
6 | Things you may want to cover:
7 |
8 | * Ruby version
9 |
10 | * System dependencies
11 |
12 | * Configuration
13 |
14 | * Database creation
15 |
16 | * Database initialization
17 |
18 | * How to run the test suite
19 |
20 | * Services (job queues, cache servers, search engines, etc.)
21 |
22 | * Deployment instructions
23 |
24 | * ...
25 |
--------------------------------------------------------------------------------
/app/views/investigators/_investigator.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | Nombre:
4 | <%= investigator.first_name %>
5 |
6 |
7 |
8 | Apellidos:
9 | <%= investigator.last_name %>
10 |
11 |
12 |
13 | Cédula:
14 | <%= investigator.id_card %>
15 |
16 |
17 |
18 | Email:
19 | <%= investigator.email %>
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/views/investigators/index.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Investigadores
5 |
6 |
7 | <%= render 'investigator_filter' %>
8 |
9 |
10 | <%= render 'shared/investigator_table', view: 'investigator' %>
11 |
12 |
13 |
14 | <%= link_to "New investigator", new_investigator_path %>
15 |
--------------------------------------------------------------------------------
/app/views/users/shared/_error_messages.html.erb:
--------------------------------------------------------------------------------
1 | <% if resource.errors.any? %>
2 |
3 |
4 | <%= I18n.t("errors.messages.not_saved",
5 | count: resource.errors.count,
6 | resource: resource.class.model_name.human.downcase)
7 | %>
8 |
9 |
10 | <% resource.errors.full_messages.each do |message| %>
11 | <%= message %>
12 | <% end %>
13 |
14 |
15 | <% end %>
16 |
--------------------------------------------------------------------------------
/app/views/investigators/show.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Investigador
5 |
6 |
7 | <%= render @investigator %>
8 |
9 |
10 |
11 |
12 |
13 | <%= link_to investigators_path, class:"btn btn-primary" do %>
14 |
15 | Ir a la lista de investigatores
16 | <% end %>
17 |
18 |
--------------------------------------------------------------------------------
/app/models/investigator.rb:
--------------------------------------------------------------------------------
1 | class Investigator < ApplicationRecord
2 | validates :first_name, presence: true
3 | validates :last_name, presence: true
4 | validates :id_card, presence: true, uniqueness: true
5 | validates :email, presence: true
6 |
7 | before_create { self.email = email.downcase }
8 | before_create { self.id_card = id_card.strip }
9 |
10 | has_many :project_investigators
11 | has_many :projects, through: :project_investigators
12 |
13 | def to_s
14 | "#{id_card}- #{first_name} #{last_name}"
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/app/views/projects/project_form/_project_data_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= form.label "Código", style: "display: block"%>
4 |
5 |
6 | <%= form.text_field :code, class: "form-control"%>
7 |
8 |
9 |
10 |
11 | <%= form.label "Nombre", style: "display: block"%>
12 |
13 |
14 | <%= form.text_field :name, class: "form-control"%>
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/views/users/unlocks/new.html.erb:
--------------------------------------------------------------------------------
1 | Resend unlock instructions
2 |
3 | <%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
4 | <%= render "devise/shared/error_messages", resource: resource %>
5 |
6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
9 |
10 |
11 |
12 | <%= f.submit "Resend unlock instructions" %>
13 |
14 | <% end %>
15 |
16 | <%= render "devise/shared/links" %>
17 |
--------------------------------------------------------------------------------
/app/views/users/passwords/new.html.erb:
--------------------------------------------------------------------------------
1 | Forgot your password?
2 |
3 | <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
4 | <%= render "devise/shared/error_messages", resource: resource %>
5 |
6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
9 |
10 |
11 |
12 | <%= f.submit "Send me reset password instructions" %>
13 |
14 | <% end %>
15 |
16 | <%= render "devise/shared/links" %>
17 |
--------------------------------------------------------------------------------
/db/migrate/20220620044002_create_project_investigators.rb:
--------------------------------------------------------------------------------
1 | class CreateProjectInvestigators < ActiveRecord::Migration[7.0]
2 | def change
3 | create_table :project_investigators do |t|
4 | t.integer :project_id, null: false
5 | t.integer :investigator_id, null: false
6 | t.integer :role, null: false, default: 0
7 |
8 | t.timestamps
9 | end
10 |
11 | add_foreign_key :project_investigators, :projects, column: :project_id, on_delete: :cascade
12 | add_foreign_key :project_investigators, :investigators, column: :investigator_id
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/app/models/user.rb:
--------------------------------------------------------------------------------
1 | class User < ApplicationRecord
2 | # Include default devise modules. Others available are:
3 | # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
4 | devise :database_authenticatable, :registerable,
5 | :recoverable, :rememberable, :validatable
6 |
7 | enum role: [:student, :assistant, :coordinator]
8 |
9 | validates :name, presence: true
10 | validates :id_card, presence: true, uniqueness: true
11 |
12 | after_initialize :set_default_role, if: :new_record?
13 |
14 | def set_default_role
15 | self.role ||= :student
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CoordinacionDocencia
5 |
6 | <%= csrf_meta_tags %>
7 | <%= csp_meta_tag %>
8 |
9 | <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
10 | <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
11 |
12 |
13 |
14 | <%= render "shared/navigation" %>
15 | <%= render "/shared/devise_notifications" %>
16 | <%= yield %>
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/views/minutes/show.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Acta: <%= @minute.number %>
5 |
6 |
7 |
8 |
9 | <%= render @minute %>
10 |
11 |
12 |
13 |
14 | <%= link_to "Edit this minute", edit_minute_path(@minute) %> |
15 | <%= link_to "Back to minutes", minutes_path %>
16 | <%= button_to "Destroy this minute", @minute, method: :delete %>
17 |
18 |
--------------------------------------------------------------------------------
/app/javascript/controllers/index.js:
--------------------------------------------------------------------------------
1 | // This file is auto-generated by ./bin/rails stimulus:manifest:update
2 | // Run that command whenever you add a new controller or create them with
3 | // ./bin/rails generate stimulus controllerName
4 |
5 | import { application } from "./application"
6 |
7 | import HelloController from "./hello_controller"
8 | application.register("hello", HelloController)
9 |
10 | import NestedFormController from "./nested_form_controller"
11 | application.register("nested-form", NestedFormController)
12 |
13 | import SelectController from "./select_controller"
14 | application.register("select", SelectController)
15 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "app",
3 | "private": "true",
4 | "dependencies": {
5 | "@hotwired/stimulus": "^3.0.1",
6 | "@hotwired/turbo-rails": "^7.1.3",
7 | "@popperjs/core": "^2.11.5",
8 | "bootstrap": "^5.2.0",
9 | "bootstrap-icons": "^1.9.1",
10 | "esbuild": "^0.14.53",
11 | "sass": "^1.54.3"
12 | },
13 | "scripts": {
14 | "build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets",
15 | "build:css": "sass ./app/assets/stylesheets/application.bootstrap.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/config/initializers/assets.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Version of your assets, change this if you want to expire all your assets.
4 | Rails.application.config.assets.version = "1.0"
5 |
6 | # Add additional assets to the asset load path.
7 | # Rails.application.config.assets.paths << Emoji.images_path
8 | Rails.application.config.assets.paths << Rails.root.join("node_modules/bootstrap-icons/font")
9 |
10 | # Precompile additional assets.
11 | # application.js, application.css, and all non-JS/CSS in the app/assets
12 | # folder are already added.
13 | # Rails.application.config.assets.precompile += %w( admin.js admin.css )
14 |
--------------------------------------------------------------------------------
/app/views/projects/project_form/_add_investigator_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Investigador principal
4 |
5 |
6 | <%= form.select :principal_investigator, options_for_select(@investigators.all), {}, data: { select_target: "select", action: "select#select" }, class: "form-select"%>
7 |
8 |
9 |
10 |
11 |
Investigadores secundarios
12 |
13 |
14 | <%= render 'shared/investigator_table', investigators: @investigators, view: 'project', f: form %>
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/views/users/confirmations/new.html.erb:
--------------------------------------------------------------------------------
1 | Resend confirmation instructions
2 |
3 | <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
4 | <%= render "devise/shared/error_messages", resource: resource %>
5 |
6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
9 |
10 |
11 |
12 | <%= f.submit "Resend confirmation instructions" %>
13 |
14 | <% end %>
15 |
16 | <%= render "devise/shared/links" %>
17 |
--------------------------------------------------------------------------------
/app/controllers/Users/sessions_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class Users::SessionsController < Devise::SessionsController
4 | # before_action :configure_sign_in_params, only: [:create]
5 |
6 | # GET /resource/sign_in
7 | def new
8 | super
9 | end
10 |
11 | # POST /resource/sign_in
12 | def create
13 | super
14 | end
15 |
16 | # DELETE /resource/sign_out
17 | # def destroy
18 | # super
19 | # end
20 |
21 | # protected
22 |
23 | # If you have extra params to permit, append them to the sanitizer.
24 | # def configure_sign_in_params
25 | # devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
26 | # end
27 | end
28 |
--------------------------------------------------------------------------------
/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | resources :transactions
3 | resources :agreements
4 | resources :minutes
5 | resources :projects
6 | # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
7 |
8 | # Defines the root path route ("/")
9 | root "pages#home"
10 |
11 | devise_for :users, controllers: {
12 | sessions: "users/sessions",
13 | registrations: "users/registrations",
14 | }
15 |
16 | resources :investigators do
17 | collection do
18 | match 'search' => 'investigators#search', via: [:get, :post], as: :search
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/app/views/pages/home.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Page Name
5 |
6 |
7 |
8 |
9 |
10 | Buscar
11 |
12 |
13 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/config/database.yml:
--------------------------------------------------------------------------------
1 | # SQLite. Versions 3.8.0 and up are supported.
2 | # gem install sqlite3
3 | #
4 | # Ensure the SQLite 3 gem is defined in your Gemfile
5 | # gem "sqlite3"
6 | #
7 | default: &default
8 | adapter: sqlite3
9 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10 | timeout: 5000
11 |
12 | development:
13 | <<: *default
14 | database: db/development.sqlite3
15 |
16 | # Warning: The database defined as "test" will be erased and
17 | # re-generated from your development database when you run "rake".
18 | # Do not set this db to the same as development or production.
19 | test:
20 | <<: *default
21 | database: db/test.sqlite3
22 |
23 | production:
24 | <<: *default
25 | database: db/production.sqlite3
26 |
--------------------------------------------------------------------------------
/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new inflection rules using the following format. Inflections
4 | # are locale specific, and you may define rules for as many different
5 | # locales as you wish. All of these examples are active by default:
6 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
7 | # inflect.plural /^(ox)$/i, "\\1en"
8 | # inflect.singular /^(ox)en/i, "\\1"
9 | # inflect.irregular "person", "people"
10 | # inflect.uncountable %w( fish sheep )
11 | # end
12 |
13 | # These inflection rules are supported but not enabled by default:
14 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
15 | # inflect.acronym "RESTful"
16 | # end
17 |
--------------------------------------------------------------------------------
/app/controllers/Users/unlocks_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class Users::UnlocksController < Devise::UnlocksController
4 | # GET /resource/unlock/new
5 | # def new
6 | # super
7 | # end
8 |
9 | # POST /resource/unlock
10 | # def create
11 | # super
12 | # end
13 |
14 | # GET /resource/unlock?unlock_token=abcdef
15 | # def show
16 | # super
17 | # end
18 |
19 | # protected
20 |
21 | # The path used after sending unlock password instructions
22 | # def after_sending_unlock_instructions_path_for(resource)
23 | # super(resource)
24 | # end
25 |
26 | # The path used after unlocking the resource
27 | # def after_unlock_path_for(resource)
28 | # super(resource)
29 | # end
30 | end
31 |
--------------------------------------------------------------------------------
/app/views/transactions/_form.html.erb:
--------------------------------------------------------------------------------
1 | <%= form_with(model: transaction) do |form| %>
2 | <% if transaction.errors.any? %>
3 |
4 |
<%= pluralize(transaction.errors.count, "error") %> prohibited this transaction from being saved:
5 |
6 |
7 | <% transaction.errors.each do |error| %>
8 | <%= error.full_message %>
9 | <% end %>
10 |
11 |
12 | <% end %>
13 |
14 |
15 | <%= form.label :agreementNumber, style: "display: block" %>
16 | <%= form.number_field :agreementNumber %>
17 |
18 |
19 |
20 | <%= form.label :status, style: "display: block" %>
21 | <%= form.text_field :status %>
22 |
23 |
24 |
25 | <%= form.submit %>
26 |
27 | <% end %>
28 |
--------------------------------------------------------------------------------
/app/views/agreements/_form.html.erb:
--------------------------------------------------------------------------------
1 | <%= form_with(model: agreement) do |form| %>
2 | <% if agreement.errors.any? %>
3 |
4 |
<%= pluralize(agreement.errors.count, "error") %> prohibited this agreement from being saved:
5 |
6 |
7 | <% agreement.errors.each do |error| %>
8 | <%= error.full_message %>
9 | <% end %>
10 |
11 |
12 | <% end %>
13 |
14 |
15 | <%= form.label :agreementNumber, style: "display: block" %>
16 | <%= form.number_field :agreementNumber %>
17 |
18 |
19 |
20 | <%= form.label :articleNumber, style: "display: block" %>
21 | <%= form.number_field :articleNumber %>
22 |
23 |
24 |
25 | <%= form.submit %>
26 |
27 | <% end %>
28 |
--------------------------------------------------------------------------------
/config/application.rb:
--------------------------------------------------------------------------------
1 | require_relative "boot"
2 |
3 | require "rails/all"
4 |
5 | # Require the gems listed in Gemfile, including any gems
6 | # you've limited to :test, :development, or :production.
7 | Bundler.require(*Rails.groups)
8 |
9 | module CoordinacionDocencia
10 | class Application < Rails::Application
11 | # Initialize configuration defaults for originally generated Rails version.
12 | config.load_defaults 7.0
13 |
14 | # Configuration for the application, engines, and railties goes here.
15 | #
16 | # These settings can be overridden in specific environments using the files
17 | # in config/environments, which are processed later.
18 | #
19 | # config.time_zone = "Central Time (US & Canada)"
20 | # config.eager_load_paths << Rails.root.join("extras")
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/app/controllers/Users/confirmations_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class Users::ConfirmationsController < Devise::ConfirmationsController
4 | # GET /resource/confirmation/new
5 | # def new
6 | # super
7 | # end
8 |
9 | # POST /resource/confirmation
10 | # def create
11 | # super
12 | # end
13 |
14 | # GET /resource/confirmation?confirmation_token=abcdef
15 | # def show
16 | # super
17 | # end
18 |
19 | # protected
20 |
21 | # The path used after resending confirmation instructions.
22 | # def after_resending_confirmation_instructions_path_for(resource_name)
23 | # super(resource_name)
24 | # end
25 |
26 | # The path used after confirmation.
27 | # def after_confirmation_path_for(resource_name, resource)
28 | # super(resource_name, resource)
29 | # end
30 | end
31 |
--------------------------------------------------------------------------------
/app/javascript/controllers/nested_form_controller.js:
--------------------------------------------------------------------------------
1 | import {
2 | Controller
3 | } from "@hotwired/stimulus"
4 |
5 | export default class extends Controller {
6 | static targets = ["template", "add_item"];
7 |
8 | add_association(event) {
9 | event.preventDefault();
10 | var content = '';
11 | content += this.templateTarget.innerHTML.replace(/TEMPLATE_RECORD/g, Math.floor(Math.random() * 20));
12 | content += '
';
13 | this.add_itemTarget.insertAdjacentHTML('afterend', content);
14 | }
15 |
16 | remove_association(event) {
17 | event.preventDefault();
18 | let item = event.target.closest(".nested-fields");
19 | item.querySelector("input[name*='_destroy']").value = 1;
20 | item.style.display = 'none';
21 | }
22 |
23 | }
--------------------------------------------------------------------------------
/app/controllers/Users/passwords_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class Users::PasswordsController < Devise::PasswordsController
4 | # GET /resource/password/new
5 | # def new
6 | # super
7 | # end
8 |
9 | # POST /resource/password
10 | # def create
11 | # super
12 | # end
13 |
14 | # GET /resource/password/edit?reset_password_token=abcdef
15 | # def edit
16 | # super
17 | # end
18 |
19 | # PUT /resource/password
20 | # def update
21 | # super
22 | # end
23 |
24 | # protected
25 |
26 | # def after_resetting_password_path_for(resource)
27 | # super(resource)
28 | # end
29 |
30 | # The path used after sending reset password instructions
31 | # def after_sending_reset_password_instructions_path_for(resource_name)
32 | # super(resource_name)
33 | # end
34 | end
35 |
--------------------------------------------------------------------------------
/app/controllers/Users/omniauth_callbacks_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
4 | # You should configure your model like this:
5 | # devise :omniauthable, omniauth_providers: [:twitter]
6 |
7 | # You should also create an action method in this controller like this:
8 | # def twitter
9 | # end
10 |
11 | # More info at:
12 | # https://github.com/heartcombo/devise#omniauth
13 |
14 | # GET|POST /resource/auth/twitter
15 | # def passthru
16 | # super
17 | # end
18 |
19 | # GET|POST /users/auth/twitter/callback
20 | # def failure
21 | # super
22 | # end
23 |
24 | # protected
25 |
26 | # The path used when OmniAuth fails
27 | # def after_omniauth_failure_path_for(scope)
28 | # super(scope)
29 | # end
30 | end
31 |
--------------------------------------------------------------------------------
/app/views/projects/_project_table.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Código
5 | Nombre
6 | Investigador
7 | Rol
8 |
9 |
10 |
11 | <% @projects.each do |project| %>
12 | <% project.investigators.each do |investigator| %>
13 |
14 | <%= project.code %>
15 | <%= project.name %>
16 | <%= investigator %>
17 |
18 | <% if project.project_investigators.find_by(investigator: investigator).role == 0%>
19 | Investigador principal
20 | <% else %>
21 | Investigador secundario
22 | <% end %>
23 |
24 |
25 | <% end %>
26 | <% end %>
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/javascript/controllers/select_controller.js:
--------------------------------------------------------------------------------
1 | import { Controller } from "@hotwired/stimulus"
2 |
3 |
4 | export default class extends Controller {
5 | static targets = ["select", "hidden", "tableRows"];
6 | static classes = ["hidden"];
7 |
8 | connect() {
9 | var option = document.createElement("option");
10 | option.text = "Seleccione una opción";
11 | option.selected = true;
12 | option.disabled = true;
13 | this.selectTarget.add(option);
14 | }
15 |
16 | select() {
17 | let options = this.selectTarget
18 | let rows = this.tableRowsTarget.rows
19 | let selectedOptionIndex = options.selectedIndex
20 | for (let i = 0; i < rows.length; i++) {
21 | rows[i].hidden = false;
22 | }
23 | rows[selectedOptionIndex].hidden = true;
24 | rows[selectedOptionIndex].cells[4].getElementsByClassName("project_investigators")[0].checked = false;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/views/users/passwords/edit.html.erb:
--------------------------------------------------------------------------------
1 | Change your password
2 |
3 | <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
4 | <%= render "devise/shared/error_messages", resource: resource %>
5 | <%= f.hidden_field :reset_password_token %>
6 |
7 |
8 | <%= f.label :password, "New password" %>
9 | <% if @minimum_password_length %>
10 | (<%= @minimum_password_length %> characters minimum)
11 | <% end %>
12 | <%= f.password_field :password, autofocus: true, autocomplete: "new-password" %>
13 |
14 |
15 |
16 | <%= f.label :password_confirmation, "Confirm new password" %>
17 | <%= f.password_field :password_confirmation, autocomplete: "new-password" %>
18 |
19 |
20 |
21 | <%= f.submit "Change my password" %>
22 |
23 | <% end %>
24 |
25 | <%= render "devise/shared/links" %>
26 |
--------------------------------------------------------------------------------
/app/views/users/registrations/new.html.erb:
--------------------------------------------------------------------------------
1 | Sign up
2 |
3 | <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
4 | <%= render "devise/shared/error_messages", resource: resource %>
5 |
6 |
7 | <%= f.label :email %>
8 | <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
9 |
10 |
11 |
12 | <%= f.label :password %>
13 | <% if @minimum_password_length %>
14 | (<%= @minimum_password_length %> characters minimum)
15 | <% end %>
16 | <%= f.password_field :password, autocomplete: "new-password" %>
17 |
18 |
19 |
20 | <%= f.label :password_confirmation %>
21 | <%= f.password_field :password_confirmation, autocomplete: "new-password" %>
22 |
23 |
24 |
25 | <%= f.submit "Sign up" %>
26 |
27 | <% end %>
28 |
29 | <%= render "devise/shared/links" %>
30 |
--------------------------------------------------------------------------------
/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Files in the config/locales directory are used for internationalization
2 | # and are automatically loaded by Rails. If you want to use locales other
3 | # than English, add the necessary files in this directory.
4 | #
5 | # To use the locales, use `I18n.t`:
6 | #
7 | # I18n.t "hello"
8 | #
9 | # In views, this is aliased to just `t`:
10 | #
11 | # <%= t("hello") %>
12 | #
13 | # To use a different locale, set it with `I18n.locale`:
14 | #
15 | # I18n.locale = :es
16 | #
17 | # This would use the information in config/locales/es.yml.
18 | #
19 | # The following keys must be escaped otherwise they will not be retrieved by
20 | # the default I18n backend:
21 | #
22 | # true, false, on, off, yes, no
23 | #
24 | # Instead, surround them with single quotes.
25 | #
26 | # en:
27 | # "true": "foo"
28 | #
29 | # To learn more, please read the Rails Internationalization guide
30 | # available at https://guides.rubyonrails.org/i18n.html.
31 |
32 | en:
33 | hello: "Hello world"
34 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2 | #
3 | # If you find yourself ignoring temporary files generated by your text editor
4 | # or operating system, you probably want to add a global ignore instead:
5 | # git config --global core.excludesfile '~/.gitignore_global'
6 |
7 | # Ignore bundler config.
8 | /.bundle
9 |
10 | # Ignore the default SQLite database.
11 | /db/*.sqlite3
12 | /db/*.sqlite3-*
13 |
14 | # Ignore all logfiles and tempfiles.
15 | /log/*
16 | /tmp/*
17 | !/log/.keep
18 | !/tmp/.keep
19 |
20 | # Ignore pidfiles, but keep the directory.
21 | /tmp/pids/*
22 | !/tmp/pids/
23 | !/tmp/pids/.keep
24 |
25 | # Ignore uploaded files in development.
26 | /storage/*
27 | !/storage/.keep
28 | /tmp/storage/*
29 | !/tmp/storage/
30 | !/tmp/storage/.keep
31 |
32 | /public/assets
33 |
34 | # Ignore master key for decrypting credentials and more.
35 | /config/master.key
36 |
37 | /app/assets/builds/*
38 | !/app/assets/builds/.keep
39 |
40 | /node_modules
41 |
42 | /.byebug_history
--------------------------------------------------------------------------------
/app/views/investigators/_investigator_filter.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Filtros:
4 |
5 |
6 | <%= search_form_for @q, url: search_investigators_path, data: { turbo: false } do |f| %>
7 |
8 | <%= f.label :first_name, 'Nombre' %>
9 | <%= f.text_field :first_name_cont, class:"form-control" %>
10 |
11 |
12 | <%= f.label :last_name, 'Apellidos' %>
13 | <%= f.text_field :last_name_cont, class:"form-control" %>
14 |
15 |
16 | <%= f.label :email, 'Email' %>
17 | <%= f.text_field :email_cont, class:"form-control" %>
18 |
19 |
20 | <%= f.label :id_card, 'Cédula' %>
21 | <%= f.text_field :id_card_start, class:"form-control" %>
22 |
23 |
24 | <%= f.submit 'Buscar', class:"btn btn-primary" %>
25 |
26 | <%end%>
27 |
28 |
29 |
--------------------------------------------------------------------------------
/bin/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require "fileutils"
3 |
4 | # path to your application root.
5 | APP_ROOT = File.expand_path("..", __dir__)
6 |
7 | def system!(*args)
8 | system(*args) || abort("\n== Command #{args} failed ==")
9 | end
10 |
11 | FileUtils.chdir APP_ROOT do
12 | # This script is a way to set up or update your development environment automatically.
13 | # This script is idempotent, so that you can run it at any time and get an expectable outcome.
14 | # Add necessary setup steps to this file.
15 |
16 | puts "== Installing dependencies =="
17 | system! "gem install bundler --conservative"
18 | system("bundle check") || system!("bundle install")
19 |
20 | # puts "\n== Copying sample files =="
21 | # unless File.exist?("config/database.yml")
22 | # FileUtils.cp "config/database.yml.sample", "config/database.yml"
23 | # end
24 |
25 | puts "\n== Preparing database =="
26 | system! "bin/rails db:prepare"
27 |
28 | puts "\n== Removing old logs and tempfiles =="
29 | system! "bin/rails log:clear tmp:clear"
30 |
31 | puts "\n== Restarting application server =="
32 | system! "bin/rails restart"
33 | end
34 |
--------------------------------------------------------------------------------
/config/initializers/content_security_policy.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Define an application-wide content security policy.
4 | # See the Securing Rails Applications Guide for more information:
5 | # https://guides.rubyonrails.org/security.html#content-security-policy-header
6 |
7 | # Rails.application.configure do
8 | # config.content_security_policy do |policy|
9 | # policy.default_src :self, :https
10 | # policy.font_src :self, :https, :data
11 | # policy.img_src :self, :https, :data
12 | # policy.object_src :none
13 | # policy.script_src :self, :https
14 | # policy.style_src :self, :https
15 | # # Specify URI for violation reports
16 | # # policy.report_uri "/csp-violation-report-endpoint"
17 | # end
18 | #
19 | # # Generate session nonces for permitted importmap and inline scripts
20 | # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
21 | # config.content_security_policy_nonce_directives = %w(script-src)
22 | #
23 | # # Report violations without enforcing the policy.
24 | # # config.content_security_policy_report_only = true
25 | # end
26 |
--------------------------------------------------------------------------------
/test/system/minutes_test.rb:
--------------------------------------------------------------------------------
1 | require "application_system_test_case"
2 |
3 | class MinutesTest < ApplicationSystemTestCase
4 | setup do
5 | @minute = minutes(:one)
6 | end
7 |
8 | test "visiting the index" do
9 | visit minutes_url
10 | assert_selector "h1", text: "Minutes"
11 | end
12 |
13 | test "should create minute" do
14 | visit minutes_url
15 | click_on "New minute"
16 |
17 | fill_in "Date", with: @minute.date
18 | fill_in "Number", with: @minute.number
19 | click_on "Create Minute"
20 |
21 | assert_text "Minute was successfully created"
22 | click_on "Back"
23 | end
24 |
25 | test "should update Minute" do
26 | visit minute_url(@minute)
27 | click_on "Edit this minute", match: :first
28 |
29 | fill_in "Date", with: @minute.date
30 | fill_in "Number", with: @minute.number
31 | click_on "Update Minute"
32 |
33 | assert_text "Minute was successfully updated"
34 | click_on "Back"
35 | end
36 |
37 | test "should destroy Minute" do
38 | visit minute_url(@minute)
39 | click_on "Destroy this minute", match: :first
40 |
41 | assert_text "Minute was successfully destroyed"
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/app/views/minutes/_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= form_with(model: minute) do |form| %>
3 | <% if minute.errors.any? %>
4 |
5 |
<%= pluralize(minute.errors.count, "error") %> prohibited this minute from being saved:
6 |
7 | <% minute.errors.each do |error| %>
8 | <%= error.full_message %>
9 | <% end %>
10 |
11 |
12 | <% end %>
13 |
14 | <%= form.label "Número", style: "display: block"%>
15 | <%= form.number_field :number, class: "form-control" %>
16 |
17 |
18 | <%= form.label "Fecha", style: "display: block"%>
19 | <%= form.date_field :date, class: "form-control" %>
20 |
21 |
22 | <%= form.label "Documento de acta", style: "display: block"%>
23 | <%= form.file_field :file, class: "form-control", direct_upload: true %>
24 |
25 |
26 |
27 |
28 | <%= render "minutes/articles/articles_form", minute: minute %>
29 |
30 | <% end %>
31 |
32 |
--------------------------------------------------------------------------------
/test/system/projects_test.rb:
--------------------------------------------------------------------------------
1 | require "application_system_test_case"
2 |
3 | class ProjectsTest < ApplicationSystemTestCase
4 | setup do
5 | @project = projects(:one)
6 | end
7 |
8 | test "visiting the index" do
9 | visit projects_url
10 | assert_selector "h1", text: "Projects"
11 | end
12 |
13 | test "should create project" do
14 | visit projects_url
15 | click_on "New project"
16 |
17 | fill_in "Code", with: @project.code
18 | fill_in "Name", with: @project.name
19 | click_on "Create Project"
20 |
21 | assert_text "Project was successfully created"
22 | click_on "Back"
23 | end
24 |
25 | test "should update Project" do
26 | visit project_url(@project)
27 | click_on "Edit this project", match: :first
28 |
29 | fill_in "Code", with: @project.code
30 | fill_in "Name", with: @project.name
31 | click_on "Update Project"
32 |
33 | assert_text "Project was successfully updated"
34 | click_on "Back"
35 | end
36 |
37 | test "should destroy Project" do
38 | visit project_url(@project)
39 | click_on "Destroy this project", match: :first
40 |
41 | assert_text "Project was successfully destroyed"
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/app/views/minutes/articles/_articles_fields.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= f.hidden_field :_destroy %>
4 | <% f.hidden_field :minute_id, value: minute.id %>
5 |
6 |
7 |
8 | <%= f.label :number, "Número de artículo", style: "display: block" %>
9 |
10 |
11 | <%= f.text_field :number, class: "form-control" %>
12 |
13 |
14 | <%= f.label :project_id, "Proyecto", style: "display: block" %>
15 |
16 |
17 | <%= f.select :project_id, options_for_select(@projects.all.map{|project| [project.code + " - " + project.name , project.id]}), {}, class: "form-select" %>
18 |
19 |
20 |
21 | <%= link_to "#", data: { action: "click->nested-form#remove_association" }, class:"btn btn-sm btn-danger" do %>
22 |
23 | <% end %>
24 | <%= link_to "#", class:"btn btn-sm btn-primary" do %>
25 |
26 | Agregar acuerdo
27 | <% end %>
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/app/views/users/sessions/new.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Iniciar sesión
5 |
6 |
7 |
8 |
9 | <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
10 |
11 | <%= f.label :email %>
12 | <%= f.text_field :email, class: "form-control" %>
13 |
14 |
15 |
16 | <%= f.label :password %>
17 | <%= f.password_field :password, class: "form-control" %>
18 |
19 |
20 | <% if devise_mapping.rememberable? %>
21 |
22 | <%= f.check_box :remember_me %>
23 | <%= f.label :remember_me, "Recordarme" %>
24 |
25 | <% end %>
26 |
27 |
28 | <%= f.submit "Iniciar sesión", class: "btn btn-primary" %>
29 |
30 | <% end %>
31 | <%= render "users/shared/links" %>
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/views/users/shared/_links.html.erb:
--------------------------------------------------------------------------------
1 | <%- if controller_name != 'sessions' %>
2 | <%= link_to "Log in", new_session_path(resource_name) %>
3 | <% end %>
4 |
5 | <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6 | <%= link_to "Sign up", new_registration_path(resource_name) %>
7 | <% end %>
8 |
9 | <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
10 | <%= link_to "Forgot your password?", new_password_path(resource_name) %>
11 | <% end %>
12 |
13 | <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14 | <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
15 | <% end %>
16 |
17 | <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18 | <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
19 | <% end %>
20 |
21 | <%- if devise_mapping.omniauthable? %>
22 | <%- resource_class.omniauth_providers.each do |provider| %>
23 | <%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), method: :post %>
24 | <% end %>
25 | <% end %>
26 |
--------------------------------------------------------------------------------
/config/storage.yml:
--------------------------------------------------------------------------------
1 | test:
2 | service: Disk
3 | root: <%= Rails.root.join("tmp/storage") %>
4 |
5 | local:
6 | service: Disk
7 | root: <%= Rails.root.join("storage") %>
8 |
9 | # Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10 | # amazon:
11 | # service: S3
12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14 | # region: us-east-1
15 | # bucket: your_own_bucket-<%= Rails.env %>
16 |
17 | # Remember not to checkin your GCS keyfile to a repository
18 | # google:
19 | # service: GCS
20 | # project: your_project
21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22 | # bucket: your_own_bucket-<%= Rails.env %>
23 |
24 | # Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25 | # microsoft:
26 | # service: AzureStorage
27 | # storage_account_name: your_account_name
28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29 | # container: your_container_name-<%= Rails.env %>
30 |
31 | # mirror:
32 | # service: Mirror
33 | # primary: local
34 | # mirrors: [ amazon, google, microsoft ]
35 |
--------------------------------------------------------------------------------
/app/views/projects/project_form/_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= form_with(model: project) do |form| %>
3 | <% if project.errors.any? %>
4 |
5 |
<%= pluralize(project.errors.count, "error") %> prohibited this project from being saved:
6 |
7 | <% project.errors.each do |error| %>
8 | <%= error.full_message %>
9 | <% end %>
10 |
11 |
12 | <% end %>
13 |
19 |
20 |
21 |
Agregar investigadores al proyecto
22 | <%= render 'projects/project_form/add_investigator_form', project: @project, investigators: @investigators, form: form %>
23 |
24 |
25 |
26 | <%= button_tag( :class => "btn btn-primary") do %>
27 |
28 | Guardar
29 | <% end %>
30 |
31 |
32 | <% end %>
33 |
34 |
--------------------------------------------------------------------------------
/test/controllers/minutes_controller_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class MinutesControllerTest < ActionDispatch::IntegrationTest
4 | setup do
5 | @minute = minutes(:one)
6 | end
7 |
8 | test "should get index" do
9 | get minutes_url
10 | assert_response :success
11 | end
12 |
13 | test "should get new" do
14 | get new_minute_url
15 | assert_response :success
16 | end
17 |
18 | test "should create minute" do
19 | assert_difference("Minute.count") do
20 | post minutes_url, params: { minute: { date: @minute.date, number: @minute.number } }
21 | end
22 |
23 | assert_redirected_to minute_url(Minute.last)
24 | end
25 |
26 | test "should show minute" do
27 | get minute_url(@minute)
28 | assert_response :success
29 | end
30 |
31 | test "should get edit" do
32 | get edit_minute_url(@minute)
33 | assert_response :success
34 | end
35 |
36 | test "should update minute" do
37 | patch minute_url(@minute), params: { minute: { date: @minute.date, number: @minute.number } }
38 | assert_redirected_to minute_url(@minute)
39 | end
40 |
41 | test "should destroy minute" do
42 | assert_difference("Minute.count", -1) do
43 | delete minute_url(@minute)
44 | end
45 |
46 | assert_redirected_to minutes_url
47 | end
48 | end
49 |
--------------------------------------------------------------------------------
/test/system/agreements_test.rb:
--------------------------------------------------------------------------------
1 | require "application_system_test_case"
2 |
3 | class AgreementsTest < ApplicationSystemTestCase
4 | setup do
5 | @agreement = agreements(:one)
6 | end
7 |
8 | test "visiting the index" do
9 | visit agreements_url
10 | assert_selector "h1", text: "Agreements"
11 | end
12 |
13 | test "should create agreement" do
14 | visit agreements_url
15 | click_on "New agreement"
16 |
17 | fill_in "Agreementnumber", with: @agreement.agreementNumber
18 | fill_in "Articlenumber", with: @agreement.articleNumber
19 | click_on "Create Agreement"
20 |
21 | assert_text "Agreement was successfully created"
22 | click_on "Back"
23 | end
24 |
25 | test "should update Agreement" do
26 | visit agreement_url(@agreement)
27 | click_on "Edit this agreement", match: :first
28 |
29 | fill_in "Agreementnumber", with: @agreement.agreementNumber
30 | fill_in "Articlenumber", with: @agreement.articleNumber
31 | click_on "Update Agreement"
32 |
33 | assert_text "Agreement was successfully updated"
34 | click_on "Back"
35 | end
36 |
37 | test "should destroy Agreement" do
38 | visit agreement_url(@agreement)
39 | click_on "Destroy this agreement", match: :first
40 |
41 | assert_text "Agreement was successfully destroyed"
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/test/controllers/projects_controller_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class ProjectsControllerTest < ActionDispatch::IntegrationTest
4 | setup do
5 | @project = projects(:one)
6 | end
7 |
8 | test "should get index" do
9 | get projects_url
10 | assert_response :success
11 | end
12 |
13 | test "should get new" do
14 | get new_project_url
15 | assert_response :success
16 | end
17 |
18 | test "should create project" do
19 | assert_difference("Project.count") do
20 | post projects_url, params: { project: { code: @project.code, name: @project.name } }
21 | end
22 |
23 | assert_redirected_to project_url(Project.last)
24 | end
25 |
26 | test "should show project" do
27 | get project_url(@project)
28 | assert_response :success
29 | end
30 |
31 | test "should get edit" do
32 | get edit_project_url(@project)
33 | assert_response :success
34 | end
35 |
36 | test "should update project" do
37 | patch project_url(@project), params: { project: { code: @project.code, name: @project.name } }
38 | assert_redirected_to project_url(@project)
39 | end
40 |
41 | test "should destroy project" do
42 | assert_difference("Project.count", -1) do
43 | delete project_url(@project)
44 | end
45 |
46 | assert_redirected_to projects_url
47 | end
48 | end
49 |
--------------------------------------------------------------------------------
/test/system/transactions_test.rb:
--------------------------------------------------------------------------------
1 | require "application_system_test_case"
2 |
3 | class TransactionsTest < ApplicationSystemTestCase
4 | setup do
5 | @transaction = transactions(:one)
6 | end
7 |
8 | test "visiting the index" do
9 | visit transactions_url
10 | assert_selector "h1", text: "Transactions"
11 | end
12 |
13 | test "should create transaction" do
14 | visit transactions_url
15 | click_on "New transaction"
16 |
17 | fill_in "Agreementnumber", with: @transaction.agreementNumber
18 | fill_in "Status", with: @transaction.status
19 | click_on "Create Transaction"
20 |
21 | assert_text "Transaction was successfully created"
22 | click_on "Back"
23 | end
24 |
25 | test "should update Transaction" do
26 | visit transaction_url(@transaction)
27 | click_on "Edit this transaction", match: :first
28 |
29 | fill_in "Agreementnumber", with: @transaction.agreementNumber
30 | fill_in "Status", with: @transaction.status
31 | click_on "Update Transaction"
32 |
33 | assert_text "Transaction was successfully updated"
34 | click_on "Back"
35 | end
36 |
37 | test "should destroy Transaction" do
38 | visit transaction_url(@transaction)
39 | click_on "Destroy this transaction", match: :first
40 |
41 | assert_text "Transaction was successfully destroyed"
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/app/views/minutes/articles/_articles_form.html.erb:
--------------------------------------------------------------------------------
1 | <%= form_with(model: minute) do |f| %>
2 |
3 |
Artículos a agregar:
4 |
5 |
6 | <%= f.fields_for :articles, Article.new, child_index: "TEMPLATE_RECORD" do |article| %>
7 | <%= render "minutes/articles/articles_fields", f: article, minute: minute %>
8 | <% end %>
9 |
10 |
11 |
12 |
13 |
14 | <%= link_to "#", data: { action: "nested-form#add_association" }, class:"btn btn-sm btn-primary" do %>
15 |
16 | Agregar razón
17 | <% end %>
18 |
19 |
20 |
21 |
22 | <%= f.fields_for :articles do |article| %>
23 | <%= render "minutes/articles/articles_fields", f: article, minute: minute %>
24 | <% end %>
25 |
26 |
27 |
28 |
29 | <%= button_tag(:class => "btn btn-primary") do %>
30 |
31 | Guardar
32 | <% end %>
33 |
34 |
35 | <% end %>
36 |
--------------------------------------------------------------------------------
/app/views/shared/_investigator_table.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Cédula
5 | Nombre
6 | Apellido
7 | Email
8 |
9 | <% if view == 'investigator' %>
10 | Acciones
11 | <% else %>
12 | Agregar al proyecto
13 | <% end %>
14 |
15 |
16 |
17 |
18 | <% @investigators.each do |investigator| %>
19 | <% if view != 'investigator' %>
20 |
21 | <% else %>
22 |
23 | <% end %>
24 | <%= investigator.id_card %>
25 | <%= investigator.first_name %>
26 | <%= investigator.last_name %>
27 | <%= investigator.email %>
28 |
29 | <% if view == 'investigator' %>
30 | <%= render 'investigators/investigator_table_actions', investigator: investigator %>
31 | <% else %>
32 | <%= f.fields_for :investigators do |investigator_subform| %>
33 | <%= render 'projects/project_form/add_investigator_actions', investigador: investigator, investigator_subform: investigator_subform %>
34 | <%end%>
35 | <% end %>
36 |
37 |
38 | <% end %>
39 |
40 |
41 |
--------------------------------------------------------------------------------
/test/controllers/agreements_controller_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class AgreementsControllerTest < ActionDispatch::IntegrationTest
4 | setup do
5 | @agreement = agreements(:one)
6 | end
7 |
8 | test "should get index" do
9 | get agreements_url
10 | assert_response :success
11 | end
12 |
13 | test "should get new" do
14 | get new_agreement_url
15 | assert_response :success
16 | end
17 |
18 | test "should create agreement" do
19 | assert_difference("Agreement.count") do
20 | post agreements_url, params: { agreement: { agreementNumber: @agreement.agreementNumber, articleNumber: @agreement.articleNumber } }
21 | end
22 |
23 | assert_redirected_to agreement_url(Agreement.last)
24 | end
25 |
26 | test "should show agreement" do
27 | get agreement_url(@agreement)
28 | assert_response :success
29 | end
30 |
31 | test "should get edit" do
32 | get edit_agreement_url(@agreement)
33 | assert_response :success
34 | end
35 |
36 | test "should update agreement" do
37 | patch agreement_url(@agreement), params: { agreement: { agreementNumber: @agreement.agreementNumber, articleNumber: @agreement.articleNumber } }
38 | assert_redirected_to agreement_url(@agreement)
39 | end
40 |
41 | test "should destroy agreement" do
42 | assert_difference("Agreement.count", -1) do
43 | delete agreement_url(@agreement)
44 | end
45 |
46 | assert_redirected_to agreements_url
47 | end
48 | end
49 |
--------------------------------------------------------------------------------
/test/controllers/transactions_controller_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class TransactionsControllerTest < ActionDispatch::IntegrationTest
4 | setup do
5 | @transaction = transactions(:one)
6 | end
7 |
8 | test "should get index" do
9 | get transactions_url
10 | assert_response :success
11 | end
12 |
13 | test "should get new" do
14 | get new_transaction_url
15 | assert_response :success
16 | end
17 |
18 | test "should create transaction" do
19 | assert_difference("Transaction.count") do
20 | post transactions_url, params: { transaction: { agreementNumber: @transaction.agreementNumber, status: @transaction.status } }
21 | end
22 |
23 | assert_redirected_to transaction_url(Transaction.last)
24 | end
25 |
26 | test "should show transaction" do
27 | get transaction_url(@transaction)
28 | assert_response :success
29 | end
30 |
31 | test "should get edit" do
32 | get edit_transaction_url(@transaction)
33 | assert_response :success
34 | end
35 |
36 | test "should update transaction" do
37 | patch transaction_url(@transaction), params: { transaction: { agreementNumber: @transaction.agreementNumber, status: @transaction.status } }
38 | assert_redirected_to transaction_url(@transaction)
39 | end
40 |
41 | test "should destroy transaction" do
42 | assert_difference("Transaction.count", -1) do
43 | delete transaction_url(@transaction)
44 | end
45 |
46 | assert_redirected_to transactions_url
47 | end
48 | end
49 |
--------------------------------------------------------------------------------
/test/system/investigators_test.rb:
--------------------------------------------------------------------------------
1 | require "application_system_test_case"
2 |
3 | class InvestigatorsTest < ApplicationSystemTestCase
4 | setup do
5 | @investigator = investigators(:one)
6 | end
7 |
8 | test "visiting the index" do
9 | visit investigators_url
10 | assert_selector "h1", text: "Investigators"
11 | end
12 |
13 | test "should create investigator" do
14 | visit investigators_url
15 | click_on "New investigator"
16 |
17 | fill_in "Email", with: @investigator.email
18 | fill_in "First name", with: @investigator.first_name
19 | fill_in "Id card", with: @investigator.id_card
20 | fill_in "Last name", with: @investigator.last_name
21 | click_on "Create Investigator"
22 |
23 | assert_text "Investigator was successfully created"
24 | click_on "Back"
25 | end
26 |
27 | test "should update Investigator" do
28 | visit investigator_url(@investigator)
29 | click_on "Edit this investigator", match: :first
30 |
31 | fill_in "Email", with: @investigator.email
32 | fill_in "First name", with: @investigator.first_name
33 | fill_in "Id card", with: @investigator.id_card
34 | fill_in "Last name", with: @investigator.last_name
35 | click_on "Update Investigator"
36 |
37 | assert_text "Investigator was successfully updated"
38 | click_on "Back"
39 | end
40 |
41 | test "should destroy Investigator" do
42 | visit investigator_url(@investigator)
43 | click_on "Destroy this investigator", match: :first
44 |
45 | assert_text "Investigator was successfully destroyed"
46 | end
47 | end
48 |
--------------------------------------------------------------------------------
/test/controllers/investigators_controller_test.rb:
--------------------------------------------------------------------------------
1 | require "test_helper"
2 |
3 | class InvestigatorsControllerTest < ActionDispatch::IntegrationTest
4 | setup do
5 | @investigator = investigators(:one)
6 | end
7 |
8 | test "should get index" do
9 | get investigators_url
10 | assert_response :success
11 | end
12 |
13 | test "should get new" do
14 | get new_investigator_url
15 | assert_response :success
16 | end
17 |
18 | test "should create investigator" do
19 | assert_difference("Investigator.count") do
20 | post investigators_url, params: { investigator: { email: @investigator.email, first_name: @investigator.first_name, id_card: @investigator.id_card, last_name: @investigator.last_name } }
21 | end
22 |
23 | assert_redirected_to investigator_url(Investigator.last)
24 | end
25 |
26 | test "should show investigator" do
27 | get investigator_url(@investigator)
28 | assert_response :success
29 | end
30 |
31 | test "should get edit" do
32 | get edit_investigator_url(@investigator)
33 | assert_response :success
34 | end
35 |
36 | test "should update investigator" do
37 | patch investigator_url(@investigator), params: { investigator: { email: @investigator.email, first_name: @investigator.first_name, id_card: @investigator.id_card, last_name: @investigator.last_name } }
38 | assert_redirected_to investigator_url(@investigator)
39 | end
40 |
41 | test "should destroy investigator" do
42 | assert_difference("Investigator.count", -1) do
43 | delete investigator_url(@investigator)
44 | end
45 |
46 | assert_redirected_to investigators_url
47 | end
48 | end
49 |
--------------------------------------------------------------------------------
/app/controllers/Users/registrations_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class Users::RegistrationsController < Devise::RegistrationsController
4 | # before_action :configure_sign_up_params, only: [:create]
5 | # before_action :configure_account_update_params, only: [:update]
6 |
7 | # GET /resource/sign_up
8 | # def new
9 | # super
10 | # end
11 |
12 | # POST /resource
13 | # def create
14 | # super
15 | # end
16 |
17 | # GET /resource/edit
18 | # def edit
19 | # super
20 | # end
21 |
22 | # PUT /resource
23 | # def update
24 | # super
25 | # end
26 |
27 | # DELETE /resource
28 | # def destroy
29 | # super
30 | # end
31 |
32 | # GET /resource/cancel
33 | # Forces the session data which is usually expired after sign
34 | # in to be expired now. This is useful if the user wants to
35 | # cancel oauth signing in/up in the middle of the process,
36 | # removing all OAuth session data.
37 | # def cancel
38 | # super
39 | # end
40 |
41 | # protected
42 |
43 | # If you have extra params to permit, append them to the sanitizer.
44 | # def configure_sign_up_params
45 | # devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])
46 | # end
47 |
48 | # If you have extra params to permit, append them to the sanitizer.
49 | # def configure_account_update_params
50 | # devise_parameter_sanitizer.permit(:account_update, keys: [:attribute])
51 | # end
52 |
53 | # The path used after sign up.
54 | # def after_sign_up_path_for(resource)
55 | # super(resource)
56 | # end
57 |
58 | # The path used after sign up for inactive accounts.
59 | # def after_inactive_sign_up_path_for(resource)
60 | # super(resource)
61 | # end
62 | end
63 |
--------------------------------------------------------------------------------
/db/migrate/20220618171429_devise_create_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class DeviseCreateUsers < ActiveRecord::Migration[7.0]
4 | def change
5 | create_table :users do |t|
6 | ## Database authenticatable
7 | t.string :email, null: false, default: ""
8 | t.string :encrypted_password, null: false, default: ""
9 |
10 | ## Recoverable
11 | t.string :reset_password_token
12 | t.datetime :reset_password_sent_at
13 |
14 | ## Rememberable
15 | t.datetime :remember_created_at
16 |
17 | ##User specific
18 | t.string :name, null: false
19 | t.string :phone, null: false
20 | t.string :id_card, null: false, unique: true
21 | t.integer :role, default: 0, null: false
22 |
23 | ## Trackable
24 | # t.integer :sign_in_count, default: 0, null: false
25 | # t.datetime :current_sign_in_at
26 | # t.datetime :last_sign_in_at
27 | # t.string :current_sign_in_ip
28 | # t.string :last_sign_in_ip
29 |
30 | ## Confirmable
31 | # t.string :confirmation_token
32 | # t.datetime :confirmed_at
33 | # t.datetime :confirmation_sent_at
34 | # t.string :unconfirmed_email # Only if using reconfirmable
35 |
36 | ## Lockable
37 | # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
38 | # t.string :unlock_token # Only if unlock strategy is :email or :both
39 | # t.datetime :locked_at
40 |
41 |
42 | t.timestamps null: false
43 | end
44 |
45 | add_index :users, :email, unique: true
46 | add_index :users, :reset_password_token, unique: true
47 | # add_index :users, :confirmation_token, unique: true
48 | # add_index :users, :unlock_token, unique: true
49 | end
50 | end
51 |
--------------------------------------------------------------------------------
/public/500.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | We're sorry, but something went wrong (500)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
We're sorry, but something went wrong.
62 |
63 |
If you are the application owner check the logs for more information.
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/app/views/investigators/_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= form_with(model: investigator) do |form| %>
3 | <% if investigator.errors.any? %>
4 |
5 |
<%= pluralize(investigator.errors.count, "error") %> prohibited this investigator from being saved:
6 |
7 | <% investigator.errors.each do |error| %>
8 | <%= error.full_message %>
9 | <% end %>
10 |
11 |
12 | <% end %>
13 |
14 |
15 | <%= form.label "Nombre", style: "display: block"%>
16 |
17 |
18 | <%= form.text_field :first_name, class: "form-control"%>
19 |
20 |
21 |
22 |
23 | <%= form.label "Apellido", style: "display: block"%>
24 |
25 |
26 | <%= form.text_field :last_name, class: "form-control"%>
27 |
28 |
29 |
30 |
31 | <%= form.label "Cédula", style: "display: block"%>
32 |
33 |
34 | <%= form.text_field :id_card, class: "form-control"%>
35 |
36 |
37 |
38 |
39 | <%= form.label "Correo electrónico", style: "display: block"%>
40 |
41 |
42 | <%= form.text_field :email, class: "form-control"%>
43 |
44 |
45 |
46 |
47 | <%= button_tag( :class => "btn btn-primary") do %>
48 |
49 | Guardar
50 | <% end %>
51 |
52 |
53 | <% end %>
54 |
55 |
--------------------------------------------------------------------------------
/config/puma.rb:
--------------------------------------------------------------------------------
1 | # Puma can serve each request in a thread from an internal thread pool.
2 | # The `threads` method setting takes two numbers: a minimum and maximum.
3 | # Any libraries that use thread pools should be configured to match
4 | # the maximum value specified for Puma. Default is set to 5 threads for minimum
5 | # and maximum; this matches the default thread size of Active Record.
6 | #
7 | max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8 | min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
9 | threads min_threads_count, max_threads_count
10 |
11 | # Specifies the `worker_timeout` threshold that Puma will use to wait before
12 | # terminating a worker in development environments.
13 | #
14 | worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
15 |
16 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
17 | #
18 | port ENV.fetch("PORT") { 3000 }
19 |
20 | # Specifies the `environment` that Puma will run in.
21 | #
22 | environment ENV.fetch("RAILS_ENV") { "development" }
23 |
24 | # Specifies the `pidfile` that Puma will use.
25 | pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
26 |
27 | # Specifies the number of `workers` to boot in clustered mode.
28 | # Workers are forked web server processes. If using threads and workers together
29 | # the concurrency of the application would be max `threads` * `workers`.
30 | # Workers do not work on JRuby or Windows (both of which do not support
31 | # processes).
32 | #
33 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
34 |
35 | # Use the `preload_app!` method when specifying a `workers` number.
36 | # This directive tells Puma to first boot the application and load code
37 | # before forking the application. This takes advantage of Copy On Write
38 | # process behavior so workers use less memory.
39 | #
40 | # preload_app!
41 |
42 | # Allow puma to be restarted by `bin/rails restart` command.
43 | plugin :tmp_restart
44 |
--------------------------------------------------------------------------------
/public/422.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The change you wanted was rejected (422)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The change you wanted was rejected.
62 |
Maybe you tried to change something you didn't have access to.
63 |
64 |
If you are the application owner check the logs for more information.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The page you were looking for doesn't exist (404)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The page you were looking for doesn't exist.
62 |
You may have mistyped the address or the page may have moved.
63 |
64 |
If you are the application owner check the logs for more information.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/app/controllers/agreements_controller.rb:
--------------------------------------------------------------------------------
1 | class AgreementsController < ApplicationController
2 | before_action :set_agreement, only: %i[ show edit update destroy ]
3 |
4 | # GET /agreements or /agreements.json
5 | def index
6 | @agreements = Agreement.all
7 | end
8 |
9 | # GET /agreements/1 or /agreements/1.json
10 | def show
11 | end
12 |
13 | # GET /agreements/new
14 | def new
15 | @agreement = Agreement.new
16 | end
17 |
18 | # GET /agreements/1/edit
19 | def edit
20 | end
21 |
22 | # POST /agreements or /agreements.json
23 | def create
24 | @agreement = Agreement.new(agreement_params)
25 |
26 | respond_to do |format|
27 | if @agreement.save
28 | format.html { redirect_to agreement_url(@agreement), notice: "Agreement was successfully created." }
29 | format.json { render :show, status: :created, location: @agreement }
30 | else
31 | format.html { render :new, status: :unprocessable_entity }
32 | format.json { render json: @agreement.errors, status: :unprocessable_entity }
33 | end
34 | end
35 | end
36 |
37 | # PATCH/PUT /agreements/1 or /agreements/1.json
38 | def update
39 | respond_to do |format|
40 | if @agreement.update(agreement_params)
41 | format.html { redirect_to agreement_url(@agreement), notice: "Agreement was successfully updated." }
42 | format.json { render :show, status: :ok, location: @agreement }
43 | else
44 | format.html { render :edit, status: :unprocessable_entity }
45 | format.json { render json: @agreement.errors, status: :unprocessable_entity }
46 | end
47 | end
48 | end
49 |
50 | # DELETE /agreements/1 or /agreements/1.json
51 | def destroy
52 | @agreement.destroy
53 |
54 | respond_to do |format|
55 | format.html { redirect_to agreements_url, notice: "Agreement was successfully destroyed." }
56 | format.json { head :no_content }
57 | end
58 | end
59 |
60 | private
61 | # Use callbacks to share common setup or constraints between actions.
62 | def set_agreement
63 | @agreement = Agreement.find(params[:id])
64 | end
65 |
66 | # Only allow a list of trusted parameters through.
67 | def agreement_params
68 | params.require(:agreement).permit(:agreementNumber, :articleNumber)
69 | end
70 | end
71 |
--------------------------------------------------------------------------------
/app/controllers/transactions_controller.rb:
--------------------------------------------------------------------------------
1 | class TransactionsController < ApplicationController
2 | before_action :set_transaction, only: %i[ show edit update destroy ]
3 |
4 | # GET /transactions or /transactions.json
5 | def index
6 | @transactions = Transaction.all
7 | end
8 |
9 | # GET /transactions/1 or /transactions/1.json
10 | def show
11 | end
12 |
13 | # GET /transactions/new
14 | def new
15 | @transaction = Transaction.new
16 | end
17 |
18 | # GET /transactions/1/edit
19 | def edit
20 | end
21 |
22 | # POST /transactions or /transactions.json
23 | def create
24 | @transaction = Transaction.new(transaction_params)
25 |
26 | respond_to do |format|
27 | if @transaction.save
28 | format.html { redirect_to transaction_url(@transaction), notice: "Transaction was successfully created." }
29 | format.json { render :show, status: :created, location: @transaction }
30 | else
31 | format.html { render :new, status: :unprocessable_entity }
32 | format.json { render json: @transaction.errors, status: :unprocessable_entity }
33 | end
34 | end
35 | end
36 |
37 | # PATCH/PUT /transactions/1 or /transactions/1.json
38 | def update
39 | respond_to do |format|
40 | if @transaction.update(transaction_params)
41 | format.html { redirect_to transaction_url(@transaction), notice: "Transaction was successfully updated." }
42 | format.json { render :show, status: :ok, location: @transaction }
43 | else
44 | format.html { render :edit, status: :unprocessable_entity }
45 | format.json { render json: @transaction.errors, status: :unprocessable_entity }
46 | end
47 | end
48 | end
49 |
50 | # DELETE /transactions/1 or /transactions/1.json
51 | def destroy
52 | @transaction.destroy
53 |
54 | respond_to do |format|
55 | format.html { redirect_to transactions_url, notice: "Transaction was successfully destroyed." }
56 | format.json { head :no_content }
57 | end
58 | end
59 |
60 | private
61 | # Use callbacks to share common setup or constraints between actions.
62 | def set_transaction
63 | @transaction = Transaction.find(params[:id])
64 | end
65 |
66 | # Only allow a list of trusted parameters through.
67 | def transaction_params
68 | params.require(:transaction).permit(:agreementNumber, :status)
69 | end
70 | end
71 |
--------------------------------------------------------------------------------
/db/migrate/20220621045601_create_active_storage_tables.active_storage.rb:
--------------------------------------------------------------------------------
1 | # This migration comes from active_storage (originally 20170806125915)
2 | class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
3 | def change
4 | # Use Active Record's configured type for primary and foreign keys
5 | primary_key_type, foreign_key_type = primary_and_foreign_key_types
6 |
7 | create_table :active_storage_blobs, id: primary_key_type do |t|
8 | t.string :key, null: false
9 | t.string :filename, null: false
10 | t.string :content_type
11 | t.text :metadata
12 | t.string :service_name, null: false
13 | t.bigint :byte_size, null: false
14 | t.string :checksum
15 |
16 | if connection.supports_datetime_with_precision?
17 | t.datetime :created_at, precision: 6, null: false
18 | else
19 | t.datetime :created_at, null: false
20 | end
21 |
22 | t.index [ :key ], unique: true
23 | end
24 |
25 | create_table :active_storage_attachments, id: primary_key_type do |t|
26 | t.string :name, null: false
27 | t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type
28 | t.references :blob, null: false, type: foreign_key_type
29 |
30 | if connection.supports_datetime_with_precision?
31 | t.datetime :created_at, precision: 6, null: false
32 | else
33 | t.datetime :created_at, null: false
34 | end
35 |
36 | t.index [ :record_type, :record_id, :name, :blob_id ], name: :index_active_storage_attachments_uniqueness, unique: true
37 | t.foreign_key :active_storage_blobs, column: :blob_id
38 | end
39 |
40 | create_table :active_storage_variant_records, id: primary_key_type do |t|
41 | t.belongs_to :blob, null: false, index: false, type: foreign_key_type
42 | t.string :variation_digest, null: false
43 |
44 | t.index [ :blob_id, :variation_digest ], name: :index_active_storage_variant_records_uniqueness, unique: true
45 | t.foreign_key :active_storage_blobs, column: :blob_id
46 | end
47 | end
48 |
49 | private
50 | def primary_and_foreign_key_types
51 | config = Rails.configuration.generators
52 | setting = config.options[config.orm][:primary_key_type]
53 | primary_key_type = setting || :primary_key
54 | foreign_key_type = setting || :bigint
55 | [primary_key_type, foreign_key_type]
56 | end
57 | end
58 |
--------------------------------------------------------------------------------
/app/controllers/investigators_controller.rb:
--------------------------------------------------------------------------------
1 | class InvestigatorsController < ApplicationController
2 | before_action :set_investigator, only: %i[ show edit update destroy ]
3 |
4 | # GET /investigators or /investigators.json
5 | def index
6 | #byebug
7 | @q = Investigator.ransack(params[:q])
8 | @q.combinator = 'or'
9 | @investigators = @q.result
10 | end
11 |
12 | def search
13 | index
14 | render :index
15 | end
16 |
17 | # GET /investigators/1 or /investigators/1.json
18 | def show
19 | end
20 |
21 | # GET /investigators/new
22 | def new
23 | @investigator = Investigator.new
24 | end
25 |
26 | # GET /investigators/1/edit
27 | def edit
28 | end
29 |
30 | # POST /investigators or /investigators.json
31 | def create
32 | @investigator = Investigator.new(investigator_params)
33 |
34 | respond_to do |format|
35 | if @investigator.save
36 | format.html { redirect_to investigator_url(@investigator), notice: "Investigator was successfully created." }
37 | format.json { render :show, status: :created, location: @investigator }
38 | else
39 | format.html { render :new, status: :unprocessable_entity }
40 | format.json { render json: @investigator.errors, status: :unprocessable_entity }
41 | end
42 | end
43 | end
44 |
45 | # PATCH/PUT /investigators/1 or /investigators/1.json
46 | def update
47 | respond_to do |format|
48 | if @investigator.update(investigator_params)
49 | format.html { redirect_to investigator_url(@investigator), notice: "Investigator was successfully updated." }
50 | format.json { render :show, status: :ok, location: @investigator }
51 | else
52 | format.html { render :edit, status: :unprocessable_entity }
53 | format.json { render json: @investigator.errors, status: :unprocessable_entity }
54 | end
55 | end
56 | end
57 |
58 | # DELETE /investigators/1 or /investigators/1.json
59 | def destroy
60 | @investigator.destroy
61 |
62 | respond_to do |format|
63 | format.html { redirect_to investigators_url, notice: "Investigator was successfully destroyed." }
64 | format.json { head :no_content }
65 | end
66 | end
67 |
68 | private
69 | # Use callbacks to share common setup or constraints between actions.
70 | def set_investigator
71 | @investigator = Investigator.find(params[:id])
72 | end
73 |
74 | # Only allow a list of trusted parameters through.
75 | def investigator_params
76 | params.require(:investigator).permit(:first_name, :last_name, :id_card, :email)
77 | end
78 | end
79 |
--------------------------------------------------------------------------------
/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | require "active_support/core_ext/integer/time"
2 |
3 | # The test environment is used exclusively to run your application's
4 | # test suite. You never need to work with it otherwise. Remember that
5 | # your test database is "scratch space" for the test suite and is wiped
6 | # and recreated between test runs. Don't rely on the data there!
7 |
8 | Rails.application.configure do
9 | # Settings specified here will take precedence over those in config/application.rb.
10 |
11 | # Turn false under Spring and add config.action_view.cache_template_loading = true.
12 | config.cache_classes = true
13 |
14 | # Eager loading loads your whole application. When running a single test locally,
15 | # this probably isn't necessary. It's a good idea to do in a continuous integration
16 | # system, or in some way before deploying your code.
17 | config.eager_load = ENV["CI"].present?
18 |
19 | # Configure public file server for tests with Cache-Control for performance.
20 | config.public_file_server.enabled = true
21 | config.public_file_server.headers = {
22 | "Cache-Control" => "public, max-age=#{1.hour.to_i}"
23 | }
24 |
25 | # Show full error reports and disable caching.
26 | config.consider_all_requests_local = true
27 | config.action_controller.perform_caching = false
28 | config.cache_store = :null_store
29 |
30 | # Raise exceptions instead of rendering exception templates.
31 | config.action_dispatch.show_exceptions = false
32 |
33 | # Disable request forgery protection in test environment.
34 | config.action_controller.allow_forgery_protection = false
35 |
36 | # Store uploaded files on the local file system in a temporary directory.
37 | config.active_storage.service = :test
38 |
39 | config.action_mailer.perform_caching = false
40 |
41 | # Tell Action Mailer not to deliver emails to the real world.
42 | # The :test delivery method accumulates sent emails in the
43 | # ActionMailer::Base.deliveries array.
44 | config.action_mailer.delivery_method = :test
45 |
46 | # Print deprecation notices to the stderr.
47 | config.active_support.deprecation = :stderr
48 |
49 | # Raise exceptions for disallowed deprecations.
50 | config.active_support.disallowed_deprecation = :raise
51 |
52 | # Tell Active Support which deprecation messages to disallow.
53 | config.active_support.disallowed_deprecation_warnings = []
54 |
55 | # Raises error for missing translations.
56 | # config.i18n.raise_on_missing_translations = true
57 |
58 | # Annotate rendered view with file names.
59 | # config.action_view.annotate_rendered_view_with_filenames = true
60 | end
61 |
--------------------------------------------------------------------------------
/.byebug_history:
--------------------------------------------------------------------------------
1 | continue
2 | next
3 | articles
4 | next
5 | articles
6 | next
7 | params[:minute][:articles_attributes].values
8 | params
9 | @params
10 | clear
11 | continue
12 | next
13 | @minute.valid?
14 | next
15 | exit
16 | params[:minute][:articles_attributes]
17 | params[:minute][:articles]
18 | params
19 | exit
20 | params
21 | exit
22 | EXIT
23 | params[:minute][:articles]
24 | exit
25 | cancel
26 | params[:minute][:articles]
27 | params
28 | params[:minutes]
29 | params[:minutes][:articles]
30 | params[:articles]
31 | params
32 | exit
33 | continue
34 | @minute
35 | continue
36 | exit
37 | @project_investigator = ProjectInvestigator.new(project_id: @project.id, investigator_id: @investigators_to_add.first.id, role: 0)
38 | @investigators_to_add.first.id
39 | @investigators_to_add.first
40 | @project
41 | @project_investigator = ProjectInvestigator.new(project_id: @project.id, investigator_id: @investigators_to_add.first.id, role: 0)
42 | next
43 | exit
44 | next
45 | continue
46 | next
47 | exit
48 | params
49 | continue
50 | params
51 | exit
52 | @investigators
53 | next
54 | continue
55 | params
56 | @investigators
57 | next
58 | continue
59 | next
60 | continue
61 | next
62 | exit
63 | params[:project][:investigators].each { |investigator|
64 | if investigator[1] == "1" then @investigators << Investigator.find(investigator[0]) end
65 | }
66 | params[:project][:investigators].each { |investigator| investigator[0] }
67 | params[:project][:investigators].each { |investigator| }
68 | params[:project][:investigators].each
69 | params[:project][:investigators].map { |id| Investigator.find(id) }
70 | params[:project][:investigators].each.first[0]
71 | params[:project][:investigators].each.first.key
72 | params[:project][:investigators].each.first
73 | params[:project][:investigators].each
74 | params[:project][:investigators].methods
75 | params[:project][:investigators].all
76 | params[:project][:investigators][1]
77 | params[:project][:investigators].first
78 | params[:project][:investigators]
79 | params
80 | params[investigator]
81 | params[:investigator]
82 | params[:investigators]
83 | continue
84 | params
85 | continue
86 | params
87 | continue
88 | params.valid?
89 | params
90 | exit
91 | cancel
92 | params[:secondary_investigators]
93 | params
94 | exit
95 | params
96 | continue
97 | @project.valid?
98 | next
99 | continue
100 | next
101 | @project.valid?
102 | next
103 | params
104 | continue
105 | next
106 | continue
107 | exit
108 | next
109 | @investigators = @q.result
110 | next
111 | continue
112 | next
113 | continue
114 | @q = Investigator.ransack(params[:q])
115 | params
116 |
--------------------------------------------------------------------------------
/app/controllers/minutes_controller.rb:
--------------------------------------------------------------------------------
1 | class MinutesController < ApplicationController
2 | before_action :set_minute, only: %i[ show edit update destroy ]
3 | before_action :set_projects, only: [:new, :edit, :create, :update, :destroy]
4 |
5 | # GET /minutes or /minutes.json
6 | def index
7 | @minutes = Minute.all
8 | end
9 |
10 | # GET /minutes/1 or /minutes/1.json
11 | def show
12 | end
13 |
14 | # GET /minutes/new
15 | def new
16 | @minute = Minute.new
17 | end
18 |
19 | # GET /minutes/1/edit
20 | def edit
21 | end
22 |
23 | # POST /minutes or /minutes.json
24 | def create
25 | byebug
26 | @minute = Minute.new(minute_params)
27 | articles = recieve_articles
28 | respond_to do |format|
29 | if @minute.save
30 | articles.each { |article| Article.create(number: article[:number], minute_id: @minute.id, project_id: article[:project_id]) }
31 | format.html { redirect_to minute_url(@minute), notice: "Minute was successfully created." }
32 | format.json { render :show, status: :created, location: @minute }
33 | else
34 | format.html { render :new, status: :unprocessable_entity }
35 | format.json { render json: @minute.errors, status: :unprocessable_entity }
36 | end
37 | end
38 | end
39 |
40 | # PATCH/PUT /minutes/1 or /minutes/1.json
41 | def update
42 | respond_to do |format|
43 | if @minute.update(minute_params)
44 | format.html { redirect_to minute_url(@minute), notice: "Minute was successfully updated." }
45 | format.json { render :show, status: :ok, location: @minute }
46 | else
47 | format.html { render :edit, status: :unprocessable_entity }
48 | format.json { render json: @minute.errors, status: :unprocessable_entity }
49 | end
50 | end
51 | end
52 |
53 | # DELETE /minutes/1 or /minutes/1.json
54 | def destroy
55 | @minute.destroy
56 |
57 | respond_to do |format|
58 | format.html { redirect_to minutes_url, notice: "Minute was successfully destroyed." }
59 | format.json { head :no_content }
60 | end
61 | end
62 |
63 | private
64 | # Use callbacks to share common setup or constraints between actions.
65 | def set_minute
66 | @minute = Minute.find(params[:id])
67 | end
68 |
69 | # Only allow a list of trusted parameters through.
70 | def minute_params
71 | params.require(:minute).permit(:number, :date, :file, articles: [:_destroy, :number, :minute_id, :project_id])
72 | end
73 |
74 | def set_projects
75 | @projects = Project.all
76 | end
77 |
78 | def recieve_articles
79 | if params[:minute]
80 | return params[:minute][:articles_attributes].values
81 | end
82 | end
83 | end
84 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 | git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3 |
4 | ruby "3.1.2"
5 |
6 | # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
7 | gem "rails", "~> 7.0.3"
8 |
9 | # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
10 | gem "sprockets-rails"
11 |
12 | # Use sqlite3 as the database for Active Record
13 | gem "sqlite3", "~> 1.4"
14 |
15 | # Use the Puma web server [https://github.com/puma/puma]
16 | gem "puma", "~> 5.0"
17 |
18 | # Bundle and transpile JavaScript [https://github.com/rails/jsbundling-rails]
19 | gem "jsbundling-rails"
20 |
21 | # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
22 | gem "turbo-rails"
23 |
24 | # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
25 | gem "stimulus-rails"
26 |
27 | # Bundle and process CSS [https://github.com/rails/cssbundling-rails]
28 | gem "cssbundling-rails"
29 |
30 | # Build JSON APIs with ease [https://github.com/rails/jbuilder]
31 | gem "jbuilder"
32 |
33 | # Use Redis adapter to run Action Cable in production
34 | # gem "redis", "~> 4.0"
35 |
36 | # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
37 | # gem "kredis"
38 |
39 | # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
40 | # gem "bcrypt", "~> 3.1.7"
41 |
42 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
43 | gem "tzinfo-data"#, platforms: %i[ mingw mswin x64_mingw jruby ]
44 |
45 | # Reduces boot times through caching; required in config/boot.rb
46 | gem "bootsnap", require: false
47 |
48 | # Use Sass to process CSS
49 | # gem "sassc-rails"
50 |
51 | # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
52 | # gem "image_processing", "~> 1.2"
53 |
54 | group :development, :test do
55 | # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
56 | gem "debug", platforms: %i[ mri mingw x64_mingw ]
57 | end
58 |
59 | group :development do
60 | # Use console on exceptions pages [https://github.com/rails/web-console]
61 | gem "web-console"
62 |
63 | # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
64 | # gem "rack-mini-profiler"
65 |
66 | # Speed up commands on slow machines / big apps [https://github.com/rails/spring]
67 | # gem "spring"
68 | end
69 |
70 | group :test do
71 | # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
72 | gem "capybara"
73 | gem "selenium-webdriver"
74 | gem "webdrivers"
75 | end
76 |
77 | gem "devise", "~> 4.8"
78 |
79 | gem "byebug", "~> 11.1"
80 |
81 | gem "ransack", "~> 3.2"
82 |
83 | gem "rspec", "~> 3.11"
84 |
--------------------------------------------------------------------------------
/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | require "active_support/core_ext/integer/time"
2 |
3 | Rails.application.configure do
4 | # Settings specified here will take precedence over those in config/application.rb.
5 |
6 | # In the development environment your application's code is reloaded any time
7 | # it changes. This slows down response time but is perfect for development
8 | # since you don't have to restart the web server when you make code changes.
9 | config.cache_classes = false
10 |
11 | # Do not eager load code on boot.
12 | config.eager_load = false
13 |
14 | # Show full error reports.
15 | config.consider_all_requests_local = true
16 |
17 | # Enable server timing
18 | config.server_timing = true
19 |
20 | # Enable/disable caching. By default caching is disabled.
21 | # Run rails dev:cache to toggle caching.
22 | if Rails.root.join("tmp/caching-dev.txt").exist?
23 | config.action_controller.perform_caching = true
24 | config.action_controller.enable_fragment_cache_logging = true
25 |
26 | config.cache_store = :memory_store
27 | config.public_file_server.headers = {
28 | "Cache-Control" => "public, max-age=#{2.days.to_i}"
29 | }
30 | else
31 | config.action_controller.perform_caching = false
32 |
33 | config.cache_store = :null_store
34 | end
35 |
36 | # Store uploaded files on the local file system (see config/storage.yml for options).
37 | config.active_storage.service = :local
38 |
39 | # Don't care if the mailer can't send.
40 | config.action_mailer.raise_delivery_errors = false
41 |
42 | config.action_mailer.perform_caching = false
43 |
44 | # Print deprecation notices to the Rails logger.
45 | config.active_support.deprecation = :log
46 |
47 | # Raise exceptions for disallowed deprecations.
48 | config.active_support.disallowed_deprecation = :raise
49 |
50 | # Tell Active Support which deprecation messages to disallow.
51 | config.active_support.disallowed_deprecation_warnings = []
52 |
53 | # Raise an error on page load if there are pending migrations.
54 | config.active_record.migration_error = :page_load
55 |
56 | # Highlight code that triggered database queries in logs.
57 | config.active_record.verbose_query_logs = true
58 |
59 | # Suppress logger output for asset requests.
60 | config.assets.quiet = true
61 |
62 | config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
63 |
64 | # Raises error for missing translations.
65 | # config.i18n.raise_on_missing_translations = true
66 |
67 | # Annotate rendered view with file names.
68 | # config.action_view.annotate_rendered_view_with_filenames = true
69 |
70 | # Uncomment if you wish to allow Action Cable access from any origin.
71 | # config.action_cable.disable_request_forgery_protection = true
72 | end
73 |
--------------------------------------------------------------------------------
/app/views/users/registrations/edit.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Editar cuenta
5 |
6 |
7 |
8 |
9 | <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
10 | <%= render "users/shared/error_messages", resource: resource %>
11 |
12 | <%= f.label "Nombre" %>
13 | <%= f.text_field :name, class: "form-control", readonly: true %>
14 |
15 |
16 |
17 | <%= f.label "Número de cédula" %>
18 | <%= f.text_field :id_card, class: "form-control", readonly: true %>
19 |
20 |
21 |
22 | <%= f.label "Teléfono" %>
23 | <%= f.text_field :phone, class: "form-control", readonly: true %>
24 |
25 |
26 |
27 | <%= f.label "Correo electrónico" %>
28 | <%= f.text_field :email, class: "form-control", readonly: true %>
29 |
30 |
31 | <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
32 |
Currently waiting confirmation for: <%= resource.unconfirmed_email %>
33 | <% end %>
34 |
35 | <%= f.label "Nueva contraseña" %> (Dejar en blanco si se no se desea actualizar)
36 | <%= f.password_field :password, autocomplete: "new-password", class: "form-control" %>
37 | <% if @minimum_password_length %>
38 | <%= @minimum_password_length %> caracteres mínimos
39 | <% end %>
40 |
41 |
42 |
43 | <%= f.label "Confirmación de la nueva contraseña" %>
44 | <%= f.password_field :password_confirmation, autocomplete: "new-password", class: "form-control" %>
45 |
46 |
47 | <%= f.label "Contraseña actual" %> (Se necesita la contraseña actual para actualizar los datos)
48 | <%= f.password_field :current_password, autocomplete: "current-password", class: "form-control" %>
49 |
50 |
51 |
52 |
53 |
54 | <%= button_tag( :class => "btn btn-primary") do %>
55 |
56 | Actualizar
57 | <% end %>
58 |
59 |
60 | <%= link_to :back, class:"btn btn-primary" do %>
61 |
62 | Volver
63 | <% end %>
64 |
65 |
66 |
67 | <% end %>
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # frozen_string_literal: true
3 |
4 | #
5 | # This file was generated by Bundler.
6 | #
7 | # The application 'bundle' is installed as part of a gem, and
8 | # this file is here to facilitate running it.
9 | #
10 |
11 | require "rubygems"
12 |
13 | m = Module.new do
14 | module_function
15 |
16 | def invoked_as_script?
17 | File.expand_path($0) == File.expand_path(__FILE__)
18 | end
19 |
20 | def env_var_version
21 | ENV["BUNDLER_VERSION"]
22 | end
23 |
24 | def cli_arg_version
25 | return unless invoked_as_script? # don't want to hijack other binstubs
26 | return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
27 | bundler_version = nil
28 | update_index = nil
29 | ARGV.each_with_index do |a, i|
30 | if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
31 | bundler_version = a
32 | end
33 | next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
34 | bundler_version = $1
35 | update_index = i
36 | end
37 | bundler_version
38 | end
39 |
40 | def gemfile
41 | gemfile = ENV["BUNDLE_GEMFILE"]
42 | return gemfile if gemfile && !gemfile.empty?
43 |
44 | File.expand_path("../Gemfile", __dir__)
45 | end
46 |
47 | def lockfile
48 | lockfile =
49 | case File.basename(gemfile)
50 | when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
51 | else "#{gemfile}.lock"
52 | end
53 | File.expand_path(lockfile)
54 | end
55 |
56 | def lockfile_version
57 | return unless File.file?(lockfile)
58 | lockfile_contents = File.read(lockfile)
59 | return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
60 | Regexp.last_match(1)
61 | end
62 |
63 | def bundler_requirement
64 | @bundler_requirement ||=
65 | env_var_version || cli_arg_version ||
66 | bundler_requirement_for(lockfile_version)
67 | end
68 |
69 | def bundler_requirement_for(version)
70 | return "#{Gem::Requirement.default}.a" unless version
71 |
72 | bundler_gem_version = Gem::Version.new(version)
73 |
74 | requirement = bundler_gem_version.approximate_recommendation
75 |
76 | return requirement unless Gem.rubygems_version < Gem::Version.new("2.7.0")
77 |
78 | requirement += ".a" if bundler_gem_version.prerelease?
79 |
80 | requirement
81 | end
82 |
83 | def load_bundler!
84 | ENV["BUNDLE_GEMFILE"] ||= gemfile
85 |
86 | activate_bundler
87 | end
88 |
89 | def activate_bundler
90 | gem_error = activation_error_handling do
91 | gem "bundler", bundler_requirement
92 | end
93 | return if gem_error.nil?
94 | require_error = activation_error_handling do
95 | require "bundler/version"
96 | end
97 | return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
98 | warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
99 | exit 42
100 | end
101 |
102 | def activation_error_handling
103 | yield
104 | nil
105 | rescue StandardError, LoadError => e
106 | e
107 | end
108 | end
109 |
110 | m.load_bundler!
111 |
112 | if m.invoked_as_script?
113 | load Gem.bin_path("bundler", "bundle")
114 | end
115 |
--------------------------------------------------------------------------------
/app/controllers/projects_controller.rb:
--------------------------------------------------------------------------------
1 | class ProjectsController < ApplicationController
2 | before_action :set_project, only: %i[ show edit update destroy ]
3 | before_action :set_investigators, only: %i[ new edit create update ]
4 |
5 | # GET /projects or /projects.json
6 | def index
7 | @projects = Project.all
8 | end
9 |
10 | # GET /projects/1 or /projects/1.json
11 | def show
12 | end
13 |
14 | # GET /projects/new
15 | def new
16 | if @investigators.empty?
17 | flash[:notice] = "No se han agregado investigadores a la base de datos. Para agregar un proyecto, debe agregar al menos un investigador."
18 | redirect_to new_investigator_path
19 | else
20 | @project = Project.new
21 | end
22 | end
23 |
24 | # GET /projects/1/edit
25 | def edit
26 | end
27 |
28 | # POST /projects or /projects.json
29 | def create
30 | byebug
31 | get_investigators_passed_in_params
32 | create_project
33 | respond_to do |format|
34 | if @project.save
35 | add_investigators_to_project
36 | format.html { redirect_to project_url(@project), notice: "Project was successfully created." }
37 | format.json { render :show, status: :created, location: @project }
38 | else
39 | format.html { render :new, status: :unprocessable_entity }
40 | format.json { render json: @project.errors, status: :unprocessable_entity }
41 | end
42 | end
43 | end
44 |
45 | # PATCH/PUT /projects/1 or /projects/1.json
46 | def update
47 | respond_to do |format|
48 | if @project.update(project_params)
49 | format.html { redirect_to project_url(@project), notice: "Project was successfully updated." }
50 | format.json { render :show, status: :ok, location: @project }
51 | else
52 | format.html { render :edit, status: :unprocessable_entity }
53 | format.json { render json: @project.errors, status: :unprocessable_entity }
54 | end
55 | end
56 | end
57 |
58 | # DELETE /projects/1 or /projects/1.json
59 | def destroy
60 | @project.destroy
61 |
62 | respond_to do |format|
63 | format.html { redirect_to projects_url, notice: "Project was successfully destroyed." }
64 | format.json { head :no_content }
65 | end
66 | end
67 |
68 | private
69 |
70 | # Use callbacks to share common setup or constraints between actions.
71 | def set_project
72 | @project = Project.find(params[:id])
73 | end
74 |
75 | def set_investigators
76 | @investigators = Investigator.all
77 | end
78 |
79 | # Only allow a list of trusted parameters through.
80 | def create_project
81 | @project = Project.new
82 | @project.code = params[:project][:code]
83 | @project.name = params[:project][:name]
84 | end
85 |
86 | def add_investigators_to_project
87 | @investigators_to_add.each { |investigator|
88 | if investigator == @investigators_to_add.first then
89 | @project_investigator = ProjectInvestigator.create(project_id: @project.id, investigator_id: investigator.id, role: 0)
90 | else
91 | @project_investigator = ProjectInvestigator.create(project_id: @project.id, investigator_id: investigator.id, role: 1)
92 | end }
93 | end
94 |
95 | def get_investigators_passed_in_params
96 | @investigators_to_add = Array.new
97 | principal_investigator_id_card = params[:project][:principal_investigator].split("-")[0]
98 | principal_investigator = Investigator.find_by(id_card: principal_investigator_id_card)
99 | @investigators_to_add << principal_investigator
100 | params[:project][:investigators].each { |investigator|
101 | if investigator[1] == "1" then @investigators_to_add << Investigator.find(investigator[0]) end
102 | }
103 | end
104 | end
105 |
--------------------------------------------------------------------------------
/config/environments/production.rb:
--------------------------------------------------------------------------------
1 | require "active_support/core_ext/integer/time"
2 |
3 | Rails.application.configure do
4 | # Settings specified here will take precedence over those in config/application.rb.
5 |
6 | # Code is not reloaded between requests.
7 | config.cache_classes = true
8 |
9 | # Eager load code on boot. This eager loads most of Rails and
10 | # your application in memory, allowing both threaded web servers
11 | # and those relying on copy on write to perform better.
12 | # Rake tasks automatically ignore this option for performance.
13 | config.eager_load = true
14 |
15 | # Full error reports are disabled and caching is turned on.
16 | config.consider_all_requests_local = false
17 | config.action_controller.perform_caching = true
18 |
19 | # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
20 | # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
21 | # config.require_master_key = true
22 |
23 | # Disable serving static files from the `/public` folder by default since
24 | # Apache or NGINX already handles this.
25 | config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
26 |
27 | # Compress CSS using a preprocessor.
28 | # config.assets.css_compressor = :sass
29 |
30 | # Do not fallback to assets pipeline if a precompiled asset is missed.
31 | config.assets.compile = false
32 |
33 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
34 | # config.asset_host = "http://assets.example.com"
35 |
36 | # Specifies the header that your server uses for sending files.
37 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
38 | # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
39 |
40 | # Store uploaded files on the local file system (see config/storage.yml for options).
41 | config.active_storage.service = :local
42 |
43 | # Mount Action Cable outside main process or domain.
44 | # config.action_cable.mount_path = nil
45 | # config.action_cable.url = "wss://example.com/cable"
46 | # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
47 |
48 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
49 | # config.force_ssl = true
50 |
51 | # Include generic and useful information about system operation, but avoid logging too much
52 | # information to avoid inadvertent exposure of personally identifiable information (PII).
53 | config.log_level = :info
54 |
55 | # Prepend all log lines with the following tags.
56 | config.log_tags = [ :request_id ]
57 |
58 | # Use a different cache store in production.
59 | # config.cache_store = :mem_cache_store
60 |
61 | # Use a real queuing backend for Active Job (and separate queues per environment).
62 | # config.active_job.queue_adapter = :resque
63 | # config.active_job.queue_name_prefix = "CoordinacionDocencia_production"
64 |
65 | config.action_mailer.perform_caching = false
66 |
67 | # Ignore bad email addresses and do not raise email delivery errors.
68 | # Set this to true and configure the email server for immediate delivery to raise delivery errors.
69 | # config.action_mailer.raise_delivery_errors = false
70 |
71 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
72 | # the I18n.default_locale when a translation cannot be found).
73 | config.i18n.fallbacks = true
74 |
75 | # Don't log any deprecations.
76 | config.active_support.report_deprecations = false
77 |
78 | # Use default logging formatter so that PID and timestamp are not suppressed.
79 | config.log_formatter = ::Logger::Formatter.new
80 |
81 | # Use a different logger for distributed setups.
82 | # require "syslog/logger"
83 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
84 |
85 | if ENV["RAILS_LOG_TO_STDOUT"].present?
86 | logger = ActiveSupport::Logger.new(STDOUT)
87 | logger.formatter = config.log_formatter
88 | config.logger = ActiveSupport::TaggedLogging.new(logger)
89 | end
90 |
91 | # Do not dump schema after migrations.
92 | config.active_record.dump_schema_after_migration = false
93 | end
94 |
--------------------------------------------------------------------------------
/config/locales/devise.en.yml:
--------------------------------------------------------------------------------
1 | # Additional translations at https://github.com/heartcombo/devise/wiki/I18n
2 |
3 | en:
4 | devise:
5 | confirmations:
6 | confirmed: "Your email address has been successfully confirmed."
7 | send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
8 | send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
9 | failure:
10 | already_authenticated: "You are already signed in."
11 | inactive: "Your account is not activated yet."
12 | invalid: "Invalid %{authentication_keys} or password."
13 | locked: "Your account is locked."
14 | last_attempt: "You have one more attempt before your account is locked."
15 | not_found_in_database: "Invalid %{authentication_keys} or password."
16 | timeout: "Your session expired. Please sign in again to continue."
17 | unauthenticated: "You need to sign in or sign up before continuing."
18 | unconfirmed: "You have to confirm your email address before continuing."
19 | mailer:
20 | confirmation_instructions:
21 | subject: "Confirmation instructions"
22 | reset_password_instructions:
23 | subject: "Reset password instructions"
24 | unlock_instructions:
25 | subject: "Unlock instructions"
26 | email_changed:
27 | subject: "Email Changed"
28 | password_change:
29 | subject: "Password Changed"
30 | omniauth_callbacks:
31 | failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
32 | success: "Successfully authenticated from %{kind} account."
33 | passwords:
34 | no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
35 | send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
36 | send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
37 | updated: "Your password has been changed successfully. You are now signed in."
38 | updated_not_active: "Your password has been changed successfully."
39 | registrations:
40 | destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
41 | signed_up: "Welcome! You have signed up successfully."
42 | signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
43 | signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
44 | signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
45 | update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirmation link to confirm your new email address."
46 | updated: "Your account has been updated successfully."
47 | updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again."
48 | sessions:
49 | signed_in: "Signed in successfully."
50 | signed_out: "Signed out successfully."
51 | already_signed_out: "Signed out successfully."
52 | unlocks:
53 | send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
54 | send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
55 | unlocked: "Your account has been unlocked successfully. Please sign in to continue."
56 | errors:
57 | messages:
58 | already_confirmed: "was already confirmed, please try signing in"
59 | confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
60 | expired: "has expired, please request a new one"
61 | not_found: "not found"
62 | not_locked: "was not locked"
63 | not_saved:
64 | one: "1 error prohibited this %{resource} from being saved:"
65 | other: "%{count} errors prohibited this %{resource} from being saved:"
66 |
--------------------------------------------------------------------------------
/app/views/shared/_navigation.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= link_to "Page Name", root_path, class: "navbar-brand", id: "logo", rel: "prev" %>
4 |
5 |
6 |
7 |
8 | <% if current_user %>
9 |
68 | <% end %>
69 | <% if current_user %>
70 |
90 | <% else %>
91 |
103 | <% end %>
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/db/schema.rb:
--------------------------------------------------------------------------------
1 | # This file is auto-generated from the current state of the database. Instead
2 | # of editing this file, please use the migrations feature of Active Record to
3 | # incrementally modify your database, and then regenerate this schema definition.
4 | #
5 | # This file is the source Rails uses to define your schema when running `bin/rails
6 | # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7 | # be faster and is potentially less error prone than running all of your
8 | # migrations from scratch. Old migrations may fail to apply correctly if those
9 | # migrations use external dependencies or application code.
10 | #
11 | # It's strongly recommended that you check this file into your version control system.
12 |
13 | ActiveRecord::Schema[7.0].define(version: 2022_08_08_195327) do
14 | create_table "active_storage_attachments", force: :cascade do |t|
15 | t.string "name", null: false
16 | t.string "record_type", null: false
17 | t.bigint "record_id", null: false
18 | t.bigint "blob_id", null: false
19 | t.datetime "created_at", null: false
20 | t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
21 | t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
22 | end
23 |
24 | create_table "active_storage_blobs", force: :cascade do |t|
25 | t.string "key", null: false
26 | t.string "filename", null: false
27 | t.string "content_type"
28 | t.text "metadata"
29 | t.string "service_name", null: false
30 | t.bigint "byte_size", null: false
31 | t.string "checksum"
32 | t.datetime "created_at", null: false
33 | t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
34 | end
35 |
36 | create_table "active_storage_variant_records", force: :cascade do |t|
37 | t.bigint "blob_id", null: false
38 | t.string "variation_digest", null: false
39 | t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
40 | end
41 |
42 | create_table "agreements", force: :cascade do |t|
43 | t.integer "agreementNumber"
44 | t.integer "articleNumber"
45 | t.string "description"
46 | t.datetime "created_at", null: false
47 | t.datetime "updated_at", null: false
48 | t.integer "article_id", null: false
49 | end
50 |
51 | create_table "articles", force: :cascade do |t|
52 | t.string "number"
53 | t.integer "minute_id"
54 | t.integer "project_id"
55 | t.datetime "created_at", null: false
56 | t.datetime "updated_at", null: false
57 | end
58 |
59 | create_table "investigators", force: :cascade do |t|
60 | t.string "first_name"
61 | t.string "last_name"
62 | t.string "id_card"
63 | t.string "email"
64 | t.datetime "created_at", null: false
65 | t.datetime "updated_at", null: false
66 | end
67 |
68 | create_table "minutes", force: :cascade do |t|
69 | t.integer "number"
70 | t.date "date"
71 | t.datetime "created_at", null: false
72 | t.datetime "updated_at", null: false
73 | end
74 |
75 | create_table "project_investigators", force: :cascade do |t|
76 | t.integer "project_id", null: false
77 | t.integer "investigator_id", null: false
78 | t.integer "role", default: 0, null: false
79 | t.datetime "created_at", null: false
80 | t.datetime "updated_at", null: false
81 | end
82 |
83 | create_table "projects", force: :cascade do |t|
84 | t.string "code", null: false
85 | t.string "name", null: false
86 | t.datetime "created_at", null: false
87 | t.datetime "updated_at", null: false
88 | end
89 |
90 | create_table "transactions", force: :cascade do |t|
91 | t.integer "agreementNumber"
92 | t.integer "status", default: 0, null: false
93 | t.string "description"
94 | t.datetime "created_at", null: false
95 | t.datetime "updated_at", null: false
96 | t.integer "agreement_id", null: false
97 | end
98 |
99 | create_table "users", force: :cascade do |t|
100 | t.string "email", default: "", null: false
101 | t.string "encrypted_password", default: "", null: false
102 | t.string "reset_password_token"
103 | t.datetime "reset_password_sent_at"
104 | t.datetime "remember_created_at"
105 | t.string "name", null: false
106 | t.string "phone", null: false
107 | t.string "id_card", null: false
108 | t.integer "role", default: 0, null: false
109 | t.datetime "created_at", null: false
110 | t.datetime "updated_at", null: false
111 | t.index ["email"], name: "index_users_on_email", unique: true
112 | t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
113 | end
114 |
115 | add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
116 | add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
117 | add_foreign_key "agreements", "articles"
118 | add_foreign_key "project_investigators", "investigators"
119 | add_foreign_key "project_investigators", "projects", on_delete: :cascade
120 | add_foreign_key "transactions", "agreements"
121 | end
122 |
--------------------------------------------------------------------------------
/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | actioncable (7.0.3.1)
5 | actionpack (= 7.0.3.1)
6 | activesupport (= 7.0.3.1)
7 | nio4r (~> 2.0)
8 | websocket-driver (>= 0.6.1)
9 | actionmailbox (7.0.3.1)
10 | actionpack (= 7.0.3.1)
11 | activejob (= 7.0.3.1)
12 | activerecord (= 7.0.3.1)
13 | activestorage (= 7.0.3.1)
14 | activesupport (= 7.0.3.1)
15 | mail (>= 2.7.1)
16 | net-imap
17 | net-pop
18 | net-smtp
19 | actionmailer (7.0.3.1)
20 | actionpack (= 7.0.3.1)
21 | actionview (= 7.0.3.1)
22 | activejob (= 7.0.3.1)
23 | activesupport (= 7.0.3.1)
24 | mail (~> 2.5, >= 2.5.4)
25 | net-imap
26 | net-pop
27 | net-smtp
28 | rails-dom-testing (~> 2.0)
29 | actionpack (7.0.3.1)
30 | actionview (= 7.0.3.1)
31 | activesupport (= 7.0.3.1)
32 | rack (~> 2.0, >= 2.2.0)
33 | rack-test (>= 0.6.3)
34 | rails-dom-testing (~> 2.0)
35 | rails-html-sanitizer (~> 1.0, >= 1.2.0)
36 | actiontext (7.0.3.1)
37 | actionpack (= 7.0.3.1)
38 | activerecord (= 7.0.3.1)
39 | activestorage (= 7.0.3.1)
40 | activesupport (= 7.0.3.1)
41 | globalid (>= 0.6.0)
42 | nokogiri (>= 1.8.5)
43 | actionview (7.0.3.1)
44 | activesupport (= 7.0.3.1)
45 | builder (~> 3.1)
46 | erubi (~> 1.4)
47 | rails-dom-testing (~> 2.0)
48 | rails-html-sanitizer (~> 1.1, >= 1.2.0)
49 | activejob (7.0.3.1)
50 | activesupport (= 7.0.3.1)
51 | globalid (>= 0.3.6)
52 | activemodel (7.0.3.1)
53 | activesupport (= 7.0.3.1)
54 | activerecord (7.0.3.1)
55 | activemodel (= 7.0.3.1)
56 | activesupport (= 7.0.3.1)
57 | activestorage (7.0.3.1)
58 | actionpack (= 7.0.3.1)
59 | activejob (= 7.0.3.1)
60 | activerecord (= 7.0.3.1)
61 | activesupport (= 7.0.3.1)
62 | marcel (~> 1.0)
63 | mini_mime (>= 1.1.0)
64 | activesupport (7.0.3.1)
65 | concurrent-ruby (~> 1.0, >= 1.0.2)
66 | i18n (>= 1.6, < 2)
67 | minitest (>= 5.1)
68 | tzinfo (~> 2.0)
69 | addressable (2.8.0)
70 | public_suffix (>= 2.0.2, < 5.0)
71 | bcrypt (3.1.18)
72 | bindex (0.8.1)
73 | bootsnap (1.13.0)
74 | msgpack (~> 1.2)
75 | builder (3.2.4)
76 | byebug (11.1.3)
77 | capybara (3.37.1)
78 | addressable
79 | matrix
80 | mini_mime (>= 0.1.3)
81 | nokogiri (~> 1.8)
82 | rack (>= 1.6.0)
83 | rack-test (>= 0.6.3)
84 | regexp_parser (>= 1.5, < 3.0)
85 | xpath (~> 3.2)
86 | childprocess (4.1.0)
87 | concurrent-ruby (1.1.10)
88 | crass (1.0.6)
89 | cssbundling-rails (1.1.1)
90 | railties (>= 6.0.0)
91 | debug (1.6.1)
92 | irb (>= 1.3.6)
93 | reline (>= 0.3.1)
94 | devise (4.8.1)
95 | bcrypt (~> 3.0)
96 | orm_adapter (~> 0.1)
97 | railties (>= 4.1.0)
98 | responders
99 | warden (~> 1.2.3)
100 | diff-lcs (1.5.0)
101 | digest (3.1.0)
102 | erubi (1.11.0)
103 | globalid (1.0.0)
104 | activesupport (>= 5.0)
105 | i18n (1.12.0)
106 | concurrent-ruby (~> 1.0)
107 | io-console (0.5.11)
108 | irb (1.4.1)
109 | reline (>= 0.3.0)
110 | jbuilder (2.11.5)
111 | actionview (>= 5.0.0)
112 | activesupport (>= 5.0.0)
113 | jsbundling-rails (1.0.3)
114 | railties (>= 6.0.0)
115 | loofah (2.18.0)
116 | crass (~> 1.0.2)
117 | nokogiri (>= 1.5.9)
118 | mail (2.7.1)
119 | mini_mime (>= 0.1.1)
120 | marcel (1.0.2)
121 | matrix (0.4.2)
122 | method_source (1.0.0)
123 | mini_mime (1.1.2)
124 | minitest (5.16.2)
125 | msgpack (1.5.4)
126 | net-imap (0.2.3)
127 | digest
128 | net-protocol
129 | strscan
130 | net-pop (0.1.1)
131 | digest
132 | net-protocol
133 | timeout
134 | net-protocol (0.1.3)
135 | timeout
136 | net-smtp (0.3.1)
137 | digest
138 | net-protocol
139 | timeout
140 | nio4r (2.5.8)
141 | nokogiri (1.13.8-x64-mingw-ucrt)
142 | racc (~> 1.4)
143 | nokogiri (1.13.8-x86_64-linux)
144 | racc (~> 1.4)
145 | orm_adapter (0.5.0)
146 | public_suffix (4.0.7)
147 | puma (5.6.4)
148 | nio4r (~> 2.0)
149 | racc (1.6.0)
150 | rack (2.2.4)
151 | rack-test (2.0.2)
152 | rack (>= 1.3)
153 | rails (7.0.3.1)
154 | actioncable (= 7.0.3.1)
155 | actionmailbox (= 7.0.3.1)
156 | actionmailer (= 7.0.3.1)
157 | actionpack (= 7.0.3.1)
158 | actiontext (= 7.0.3.1)
159 | actionview (= 7.0.3.1)
160 | activejob (= 7.0.3.1)
161 | activemodel (= 7.0.3.1)
162 | activerecord (= 7.0.3.1)
163 | activestorage (= 7.0.3.1)
164 | activesupport (= 7.0.3.1)
165 | bundler (>= 1.15.0)
166 | railties (= 7.0.3.1)
167 | rails-dom-testing (2.0.3)
168 | activesupport (>= 4.2.0)
169 | nokogiri (>= 1.6)
170 | rails-html-sanitizer (1.4.3)
171 | loofah (~> 2.3)
172 | railties (7.0.3.1)
173 | actionpack (= 7.0.3.1)
174 | activesupport (= 7.0.3.1)
175 | method_source
176 | rake (>= 12.2)
177 | thor (~> 1.0)
178 | zeitwerk (~> 2.5)
179 | rake (13.0.6)
180 | ransack (3.2.1)
181 | activerecord (>= 6.1.5)
182 | activesupport (>= 6.1.5)
183 | i18n
184 | regexp_parser (2.5.0)
185 | reline (0.3.1)
186 | io-console (~> 0.5)
187 | responders (3.0.1)
188 | actionpack (>= 5.0)
189 | railties (>= 5.0)
190 | rexml (3.2.5)
191 | rspec (3.11.0)
192 | rspec-core (~> 3.11.0)
193 | rspec-expectations (~> 3.11.0)
194 | rspec-mocks (~> 3.11.0)
195 | rspec-core (3.11.0)
196 | rspec-support (~> 3.11.0)
197 | rspec-expectations (3.11.0)
198 | diff-lcs (>= 1.2.0, < 2.0)
199 | rspec-support (~> 3.11.0)
200 | rspec-mocks (3.11.1)
201 | diff-lcs (>= 1.2.0, < 2.0)
202 | rspec-support (~> 3.11.0)
203 | rspec-support (3.11.0)
204 | rubyzip (2.3.2)
205 | selenium-webdriver (4.3.0)
206 | childprocess (>= 0.5, < 5.0)
207 | rexml (~> 3.2, >= 3.2.5)
208 | rubyzip (>= 1.2.2, < 3.0)
209 | websocket (~> 1.0)
210 | sprockets (4.1.1)
211 | concurrent-ruby (~> 1.0)
212 | rack (> 1, < 3)
213 | sprockets-rails (3.4.2)
214 | actionpack (>= 5.2)
215 | activesupport (>= 5.2)
216 | sprockets (>= 3.0.0)
217 | sqlite3 (1.4.4)
218 | stimulus-rails (1.1.0)
219 | railties (>= 6.0.0)
220 | strscan (3.0.4)
221 | thor (1.2.1)
222 | timeout (0.3.0)
223 | turbo-rails (1.1.1)
224 | actionpack (>= 6.0.0)
225 | activejob (>= 6.0.0)
226 | railties (>= 6.0.0)
227 | tzinfo (2.0.5)
228 | concurrent-ruby (~> 1.0)
229 | tzinfo-data (1.2022.1)
230 | tzinfo (>= 1.0.0)
231 | warden (1.2.9)
232 | rack (>= 2.0.9)
233 | web-console (4.2.0)
234 | actionview (>= 6.0.0)
235 | activemodel (>= 6.0.0)
236 | bindex (>= 0.4.0)
237 | railties (>= 6.0.0)
238 | webdrivers (5.0.0)
239 | nokogiri (~> 1.6)
240 | rubyzip (>= 1.3.0)
241 | selenium-webdriver (~> 4.0)
242 | websocket (1.2.9)
243 | websocket-driver (0.7.5)
244 | websocket-extensions (>= 0.1.0)
245 | websocket-extensions (0.1.5)
246 | xpath (3.2.0)
247 | nokogiri (~> 1.8)
248 | zeitwerk (2.6.0)
249 |
250 | PLATFORMS
251 | x64-mingw-ucrt
252 | x86_64-linux
253 |
254 | DEPENDENCIES
255 | bootsnap
256 | byebug (~> 11.1)
257 | capybara
258 | cssbundling-rails
259 | debug
260 | devise (~> 4.8)
261 | jbuilder
262 | jsbundling-rails
263 | puma (~> 5.0)
264 | rails (~> 7.0.3)
265 | ransack (~> 3.2)
266 | rspec (~> 3.11)
267 | selenium-webdriver
268 | sprockets-rails
269 | sqlite3 (~> 1.4)
270 | stimulus-rails
271 | turbo-rails
272 | tzinfo-data
273 | web-console
274 | webdrivers
275 |
276 | RUBY VERSION
277 | ruby 3.1.2p20
278 |
279 | BUNDLED WITH
280 | 2.3.14
281 |
--------------------------------------------------------------------------------
/yarn.lock:
--------------------------------------------------------------------------------
1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2 | # yarn lockfile v1
3 |
4 |
5 | "@esbuild/linux-loong64@0.14.53":
6 | version "0.14.53"
7 | resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.14.53.tgz#251b4cd6760fadb4d68a05815e6dc5e432d69cd6"
8 | integrity sha512-W2dAL6Bnyn4xa/QRSU3ilIK4EzD5wgYXKXJiS1HDF5vU3675qc2bvFyLwbUcdmssDveyndy7FbitrCoiV/eMLg==
9 |
10 | "@hotwired/stimulus@^3.0.1":
11 | version "3.0.1"
12 | resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.0.1.tgz#141f15645acaa3b133b7c247cad58ae252ffae85"
13 | integrity sha512-oHsJhgY2cip+K2ED7vKUNd2P+BEswVhrCYcJ802DSsblJFv7mPFVk3cQKvm2vHgHeDVdnj7oOKrBbzp1u8D+KA==
14 |
15 | "@hotwired/turbo-rails@^7.1.3":
16 | version "7.1.3"
17 | resolved "https://registry.yarnpkg.com/@hotwired/turbo-rails/-/turbo-rails-7.1.3.tgz#a4e04ecb800a06e7f9aa6e298170fa4580b74216"
18 | integrity sha512-6qKgn75bMWKx0bJgmSfrdC73EJkGLoSWZPAssvcd3nE7ZpDZff6f67j5OQNjjpRgNB7OFruom6VWguGQGu1fQg==
19 | dependencies:
20 | "@hotwired/turbo" "^7.1.0"
21 | "@rails/actioncable" "^7.0"
22 |
23 | "@hotwired/turbo@^7.1.0":
24 | version "7.1.0"
25 | resolved "https://registry.yarnpkg.com/@hotwired/turbo/-/turbo-7.1.0.tgz#27e44e0e3dc5bd1d4bda0766d579cf5a14091cd7"
26 | integrity sha512-Q8kGjqwPqER+CtpQudbH+3Zgs2X4zb6pBAlr6NsKTXadg45pAOvxI9i4QpuHbwSzR2+x87HUm+rot9F/Pe8rxA==
27 |
28 | "@popperjs/core@^2.11.5":
29 | version "2.11.5"
30 | resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.5.tgz#db5a11bf66bdab39569719555b0f76e138d7bd64"
31 | integrity sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==
32 |
33 | "@rails/actioncable@^7.0":
34 | version "7.0.3"
35 | resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-7.0.3.tgz#71f08e958883af64f6a20489318b5e95d2c6dc5b"
36 | integrity sha512-Iefl21FZD+ck1di6xSHMYzSzRiNJTHV4NrAzCfDfqc/wPz4xncrP8f2/fJ+2jzwKIaDn76UVMsALh7R5OzsF8Q==
37 |
38 | anymatch@~3.1.2:
39 | version "3.1.2"
40 | resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
41 | integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==
42 | dependencies:
43 | normalize-path "^3.0.0"
44 | picomatch "^2.0.4"
45 |
46 | binary-extensions@^2.0.0:
47 | version "2.2.0"
48 | resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
49 | integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==
50 |
51 | bootstrap-icons@^1.9.1:
52 | version "1.9.1"
53 | resolved "https://registry.yarnpkg.com/bootstrap-icons/-/bootstrap-icons-1.9.1.tgz#cf22d91a25447645e45c49ebde4e56eafdfe761b"
54 | integrity sha512-d4ZkO30MIkAhQ2nNRJqKXJVEQorALGbLWTuRxyCTJF96lRIV6imcgMehWGJUiJMJhglN0o2tqLIeDnMdiQEE9g==
55 |
56 | bootstrap@^5.2.0:
57 | version "5.2.0"
58 | resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.2.0.tgz#838727fb60f1630db370fe57c63cbcf2962bb3d3"
59 | integrity sha512-qlnS9GL6YZE6Wnef46GxGv1UpGGzAwO0aPL1yOjzDIJpeApeMvqV24iL+pjr2kU4dduoBA9fINKWKgMToobx9A==
60 |
61 | braces@~3.0.2:
62 | version "3.0.2"
63 | resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
64 | integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
65 | dependencies:
66 | fill-range "^7.0.1"
67 |
68 | "chokidar@>=3.0.0 <4.0.0":
69 | version "3.5.3"
70 | resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
71 | integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==
72 | dependencies:
73 | anymatch "~3.1.2"
74 | braces "~3.0.2"
75 | glob-parent "~5.1.2"
76 | is-binary-path "~2.1.0"
77 | is-glob "~4.0.1"
78 | normalize-path "~3.0.0"
79 | readdirp "~3.6.0"
80 | optionalDependencies:
81 | fsevents "~2.3.2"
82 |
83 | esbuild-android-64@0.14.53:
84 | version "0.14.53"
85 | resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.14.53.tgz#259bc3ef1399a3cad8f4f67c40ee20779c4de675"
86 | integrity sha512-fIL93sOTnEU+NrTAVMIKiAw0YH22HWCAgg4N4Z6zov2t0kY9RAJ50zY9ZMCQ+RT6bnOfDt8gCTnt/RaSNA2yRA==
87 |
88 | esbuild-android-arm64@0.14.53:
89 | version "0.14.53"
90 | resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.53.tgz#2158253d4e8f9fdd2a081bbb4f73b8806178841e"
91 | integrity sha512-PC7KaF1v0h/nWpvlU1UMN7dzB54cBH8qSsm7S9mkwFA1BXpaEOufCg8hdoEI1jep0KeO/rjZVWrsH8+q28T77A==
92 |
93 | esbuild-darwin-64@0.14.53:
94 | version "0.14.53"
95 | resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.53.tgz#b4681831fd8f8d06feb5048acbe90d742074cc2a"
96 | integrity sha512-gE7P5wlnkX4d4PKvLBUgmhZXvL7lzGRLri17/+CmmCzfncIgq8lOBvxGMiQ4xazplhxq+72TEohyFMZLFxuWvg==
97 |
98 | esbuild-darwin-arm64@0.14.53:
99 | version "0.14.53"
100 | resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.53.tgz#d267d957852d121b261b3f76ead86e5b5463acc9"
101 | integrity sha512-otJwDU3hnI15Q98PX4MJbknSZ/WSR1I45il7gcxcECXzfN4Mrpft5hBDHXNRnCh+5858uPXBXA1Vaz2jVWLaIA==
102 |
103 | esbuild-freebsd-64@0.14.53:
104 | version "0.14.53"
105 | resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.53.tgz#aca2af6d72b537fe66a38eb8f374fb66d4c98ca0"
106 | integrity sha512-WkdJa8iyrGHyKiPF4lk0MiOF87Q2SkE+i+8D4Cazq3/iqmGPJ6u49je300MFi5I2eUsQCkaOWhpCVQMTKGww2w==
107 |
108 | esbuild-freebsd-arm64@0.14.53:
109 | version "0.14.53"
110 | resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.53.tgz#76282e19312d914c34343c8a7da6cc5f051580b9"
111 | integrity sha512-9T7WwCuV30NAx0SyQpw8edbKvbKELnnm1FHg7gbSYaatH+c8WJW10g/OdM7JYnv7qkimw2ZTtSA+NokOLd2ydQ==
112 |
113 | esbuild-linux-32@0.14.53:
114 | version "0.14.53"
115 | resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.53.tgz#1045d34cf7c5faaf2af3b29cc1573b06580c37e5"
116 | integrity sha512-VGanLBg5en2LfGDgLEUxQko2lqsOS7MTEWUi8x91YmsHNyzJVT/WApbFFx3MQGhkf+XdimVhpyo5/G0PBY91zg==
117 |
118 | esbuild-linux-64@0.14.53:
119 | version "0.14.53"
120 | resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.53.tgz#ab3f2ee2ebb5a6930c72d9539cb34b428808cbe4"
121 | integrity sha512-pP/FA55j/fzAV7N9DF31meAyjOH6Bjuo3aSKPh26+RW85ZEtbJv9nhoxmGTd9FOqjx59Tc1ZbrJabuiXlMwuZQ==
122 |
123 | esbuild-linux-arm64@0.14.53:
124 | version "0.14.53"
125 | resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.53.tgz#1f5530412f6690949e78297122350488d3266cfe"
126 | integrity sha512-GDmWITT+PMsjCA6/lByYk7NyFssW4Q6in32iPkpjZ/ytSyH+xeEx8q7HG3AhWH6heemEYEWpTll/eui3jwlSnw==
127 |
128 | esbuild-linux-arm@0.14.53:
129 | version "0.14.53"
130 | resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.53.tgz#a44ec9b5b42007ab6c0d65a224ccc6bbd97c54cf"
131 | integrity sha512-/u81NGAVZMopbmzd21Nu/wvnKQK3pT4CrvQ8BTje1STXcQAGnfyKgQlj3m0j2BzYbvQxSy+TMck4TNV2onvoPA==
132 |
133 | esbuild-linux-mips64le@0.14.53:
134 | version "0.14.53"
135 | resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.53.tgz#a4d0b6b17cfdeea4e41b0b085a5f73d99311be9f"
136 | integrity sha512-d6/XHIQW714gSSp6tOOX2UscedVobELvQlPMkInhx1NPz4ThZI9uNLQ4qQJHGBGKGfu+rtJsxM4NVHLhnNRdWQ==
137 |
138 | esbuild-linux-ppc64le@0.14.53:
139 | version "0.14.53"
140 | resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.53.tgz#8c331822c85465434e086e3e6065863770c38139"
141 | integrity sha512-ndnJmniKPCB52m+r6BtHHLAOXw+xBCWIxNnedbIpuREOcbSU/AlyM/2dA3BmUQhsHdb4w3amD5U2s91TJ3MzzA==
142 |
143 | esbuild-linux-riscv64@0.14.53:
144 | version "0.14.53"
145 | resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.53.tgz#36fd75543401304bea8a2d63bf8ea18aaa508e00"
146 | integrity sha512-yG2sVH+QSix6ct4lIzJj329iJF3MhloLE6/vKMQAAd26UVPVkhMFqFopY+9kCgYsdeWvXdPgmyOuKa48Y7+/EQ==
147 |
148 | esbuild-linux-s390x@0.14.53:
149 | version "0.14.53"
150 | resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.53.tgz#1622677ab6824123f48f75d3afc031cd41936129"
151 | integrity sha512-OCJlgdkB+XPYndHmw6uZT7jcYgzmx9K+28PVdOa/eLjdoYkeAFvH5hTwX4AXGLZLH09tpl4bVsEtvuyUldaNCg==
152 |
153 | esbuild-netbsd-64@0.14.53:
154 | version "0.14.53"
155 | resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.53.tgz#e86d0efd0116658be335492ed12e66b26b4baf52"
156 | integrity sha512-gp2SB+Efc7MhMdWV2+pmIs/Ja/Mi5rjw+wlDmmbIn68VGXBleNgiEZG+eV2SRS0kJEUyHNedDtwRIMzaohWedQ==
157 |
158 | esbuild-openbsd-64@0.14.53:
159 | version "0.14.53"
160 | resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.53.tgz#9bcbbe6f86304872c6e91f64c8eb73fc29c3588b"
161 | integrity sha512-eKQ30ZWe+WTZmteDYg8S+YjHV5s4iTxeSGhJKJajFfQx9TLZJvsJX0/paqwP51GicOUruFpSUAs2NCc0a4ivQQ==
162 |
163 | esbuild-sunos-64@0.14.53:
164 | version "0.14.53"
165 | resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.53.tgz#f7a872f7460bfb7b131f7188a95fbce3d1c577e8"
166 | integrity sha512-OWLpS7a2FrIRukQqcgQqR1XKn0jSJoOdT+RlhAxUoEQM/IpytS3FXzCJM6xjUYtpO5GMY0EdZJp+ur2pYdm39g==
167 |
168 | esbuild-windows-32@0.14.53:
169 | version "0.14.53"
170 | resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.53.tgz#c5e3ca50e2d1439cc2c9fe4defa63bcd474ce709"
171 | integrity sha512-m14XyWQP5rwGW0tbEfp95U6A0wY0DYPInWBB7D69FAXUpBpBObRoGTKRv36lf2RWOdE4YO3TNvj37zhXjVL5xg==
172 |
173 | esbuild-windows-64@0.14.53:
174 | version "0.14.53"
175 | resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.53.tgz#ec2ab4a60c5215f092ffe1eab6d01319e88238af"
176 | integrity sha512-s9skQFF0I7zqnQ2K8S1xdLSfZFsPLuOGmSx57h2btSEswv0N0YodYvqLcJMrNMXh6EynOmWD7rz+0rWWbFpIHQ==
177 |
178 | esbuild-windows-arm64@0.14.53:
179 | version "0.14.53"
180 | resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.53.tgz#f71d403806bdf9f4a1f9d097db9aec949bd675c8"
181 | integrity sha512-E+5Gvb+ZWts+00T9II6wp2L3KG2r3iGxByqd/a1RmLmYWVsSVUjkvIxZuJ3hYTIbhLkH5PRwpldGTKYqVz0nzQ==
182 |
183 | esbuild@^0.14.53:
184 | version "0.14.53"
185 | resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.53.tgz#20b1007f686e8584f2a01a1bec5a37aac9498ce4"
186 | integrity sha512-ohO33pUBQ64q6mmheX1mZ8mIXj8ivQY/L4oVuAshr+aJI+zLl+amrp3EodrUNDNYVrKJXGPfIHFGhO8slGRjuw==
187 | optionalDependencies:
188 | "@esbuild/linux-loong64" "0.14.53"
189 | esbuild-android-64 "0.14.53"
190 | esbuild-android-arm64 "0.14.53"
191 | esbuild-darwin-64 "0.14.53"
192 | esbuild-darwin-arm64 "0.14.53"
193 | esbuild-freebsd-64 "0.14.53"
194 | esbuild-freebsd-arm64 "0.14.53"
195 | esbuild-linux-32 "0.14.53"
196 | esbuild-linux-64 "0.14.53"
197 | esbuild-linux-arm "0.14.53"
198 | esbuild-linux-arm64 "0.14.53"
199 | esbuild-linux-mips64le "0.14.53"
200 | esbuild-linux-ppc64le "0.14.53"
201 | esbuild-linux-riscv64 "0.14.53"
202 | esbuild-linux-s390x "0.14.53"
203 | esbuild-netbsd-64 "0.14.53"
204 | esbuild-openbsd-64 "0.14.53"
205 | esbuild-sunos-64 "0.14.53"
206 | esbuild-windows-32 "0.14.53"
207 | esbuild-windows-64 "0.14.53"
208 | esbuild-windows-arm64 "0.14.53"
209 |
210 | fill-range@^7.0.1:
211 | version "7.0.1"
212 | resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
213 | integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
214 | dependencies:
215 | to-regex-range "^5.0.1"
216 |
217 | fsevents@~2.3.2:
218 | version "2.3.2"
219 | resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
220 | integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
221 |
222 | glob-parent@~5.1.2:
223 | version "5.1.2"
224 | resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
225 | integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
226 | dependencies:
227 | is-glob "^4.0.1"
228 |
229 | immutable@^4.0.0:
230 | version "4.1.0"
231 | resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.1.0.tgz#f795787f0db780183307b9eb2091fcac1f6fafef"
232 | integrity sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==
233 |
234 | is-binary-path@~2.1.0:
235 | version "2.1.0"
236 | resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
237 | integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==
238 | dependencies:
239 | binary-extensions "^2.0.0"
240 |
241 | is-extglob@^2.1.1:
242 | version "2.1.1"
243 | resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
244 | integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==
245 |
246 | is-glob@^4.0.1, is-glob@~4.0.1:
247 | version "4.0.3"
248 | resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084"
249 | integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==
250 | dependencies:
251 | is-extglob "^2.1.1"
252 |
253 | is-number@^7.0.0:
254 | version "7.0.0"
255 | resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
256 | integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
257 |
258 | normalize-path@^3.0.0, normalize-path@~3.0.0:
259 | version "3.0.0"
260 | resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
261 | integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
262 |
263 | picomatch@^2.0.4, picomatch@^2.2.1:
264 | version "2.3.1"
265 | resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
266 | integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
267 |
268 | readdirp@~3.6.0:
269 | version "3.6.0"
270 | resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
271 | integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==
272 | dependencies:
273 | picomatch "^2.2.1"
274 |
275 | sass@^1.54.3:
276 | version "1.54.3"
277 | resolved "https://registry.yarnpkg.com/sass/-/sass-1.54.3.tgz#37baa2652f7f1fdadb73240ee9a2b9b81fabb5c4"
278 | integrity sha512-fLodey5Qd41Pxp/Tk7Al97sViYwF/TazRc5t6E65O7JOk4XF8pzwIW7CvCxYVOfJFFI/1x5+elDyBIixrp+zrw==
279 | dependencies:
280 | chokidar ">=3.0.0 <4.0.0"
281 | immutable "^4.0.0"
282 | source-map-js ">=0.6.2 <2.0.0"
283 |
284 | "source-map-js@>=0.6.2 <2.0.0":
285 | version "1.0.2"
286 | resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
287 | integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==
288 |
289 | to-regex-range@^5.0.1:
290 | version "5.0.1"
291 | resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
292 | integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==
293 | dependencies:
294 | is-number "^7.0.0"
295 |
--------------------------------------------------------------------------------
/config/initializers/devise.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # Assuming you have not yet modified this file, each configuration option below
4 | # is set to its default value. Note that some are commented out while others
5 | # are not: uncommented lines are intended to protect your configuration from
6 | # breaking changes in upgrades (i.e., in the event that future versions of
7 | # Devise change the default values for those options).
8 | #
9 | # Use this hook to configure devise mailer, warden hooks and so forth.
10 | # Many of these configuration options can be set straight in your model.
11 | Devise.setup do |config|
12 | # The secret key used by Devise. Devise uses this key to generate
13 | # random tokens. Changing this key will render invalid all existing
14 | # confirmation, reset password and unlock tokens in the database.
15 | # Devise will use the `secret_key_base` as its `secret_key`
16 | # by default. You can change it below and use your own secret key.
17 | # config.secret_key = '764327b746adc93d5f7f745e2f6fb482cbd11cf83b3f82fac38bdb551541f1bda73800a1ee6d42fca3ab52d201e6728e14bb10121239855ced1f6112fd99d452'
18 |
19 | # ==> Controller configuration
20 | # Configure the parent class to the devise controllers.
21 | # config.parent_controller = 'DeviseController'
22 |
23 | # ==> Mailer Configuration
24 | # Configure the e-mail address which will be shown in Devise::Mailer,
25 | # note that it will be overwritten if you use your own mailer class
26 | # with default "from" parameter.
27 | config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
28 |
29 | # Configure the class responsible to send e-mails.
30 | # config.mailer = 'Devise::Mailer'
31 |
32 | # Configure the parent class responsible to send e-mails.
33 | # config.parent_mailer = 'ActionMailer::Base'
34 |
35 | # ==> ORM configuration
36 | # Load and configure the ORM. Supports :active_record (default) and
37 | # :mongoid (bson_ext recommended) by default. Other ORMs may be
38 | # available as additional gems.
39 | require 'devise/orm/active_record'
40 |
41 | # ==> Configuration for any authentication mechanism
42 | # Configure which keys are used when authenticating a user. The default is
43 | # just :email. You can configure it to use [:username, :subdomain], so for
44 | # authenticating a user, both parameters are required. Remember that those
45 | # parameters are used only when authenticating and not when retrieving from
46 | # session. If you need permissions, you should implement that in a before filter.
47 | # You can also supply a hash where the value is a boolean determining whether
48 | # or not authentication should be aborted when the value is not present.
49 | # config.authentication_keys = [:email]
50 |
51 | # Configure parameters from the request object used for authentication. Each entry
52 | # given should be a request method and it will automatically be passed to the
53 | # find_for_authentication method and considered in your model lookup. For instance,
54 | # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
55 | # The same considerations mentioned for authentication_keys also apply to request_keys.
56 | # config.request_keys = []
57 |
58 | # Configure which authentication keys should be case-insensitive.
59 | # These keys will be downcased upon creating or modifying a user and when used
60 | # to authenticate or find a user. Default is :email.
61 | config.case_insensitive_keys = [:email]
62 |
63 | # Configure which authentication keys should have whitespace stripped.
64 | # These keys will have whitespace before and after removed upon creating or
65 | # modifying a user and when used to authenticate or find a user. Default is :email.
66 | config.strip_whitespace_keys = [:email]
67 |
68 | # Tell if authentication through request.params is enabled. True by default.
69 | # It can be set to an array that will enable params authentication only for the
70 | # given strategies, for example, `config.params_authenticatable = [:database]` will
71 | # enable it only for database (email + password) authentication.
72 | # config.params_authenticatable = true
73 |
74 | # Tell if authentication through HTTP Auth is enabled. False by default.
75 | # It can be set to an array that will enable http authentication only for the
76 | # given strategies, for example, `config.http_authenticatable = [:database]` will
77 | # enable it only for database authentication.
78 | # For API-only applications to support authentication "out-of-the-box", you will likely want to
79 | # enable this with :database unless you are using a custom strategy.
80 | # The supported strategies are:
81 | # :database = Support basic authentication with authentication key + password
82 | # config.http_authenticatable = false
83 |
84 | # If 401 status code should be returned for AJAX requests. True by default.
85 | # config.http_authenticatable_on_xhr = true
86 |
87 | # The realm used in Http Basic Authentication. 'Application' by default.
88 | # config.http_authentication_realm = 'Application'
89 |
90 | # It will change confirmation, password recovery and other workflows
91 | # to behave the same regardless if the e-mail provided was right or wrong.
92 | # Does not affect registerable.
93 | # config.paranoid = true
94 |
95 | # By default Devise will store the user in session. You can skip storage for
96 | # particular strategies by setting this option.
97 | # Notice that if you are skipping storage for all authentication paths, you
98 | # may want to disable generating routes to Devise's sessions controller by
99 | # passing skip: :sessions to `devise_for` in your config/routes.rb
100 | config.skip_session_storage = [:http_auth]
101 |
102 | # By default, Devise cleans up the CSRF token on authentication to
103 | # avoid CSRF token fixation attacks. This means that, when using AJAX
104 | # requests for sign in and sign up, you need to get a new CSRF token
105 | # from the server. You can disable this option at your own risk.
106 | # config.clean_up_csrf_token_on_authentication = true
107 |
108 | # When false, Devise will not attempt to reload routes on eager load.
109 | # This can reduce the time taken to boot the app but if your application
110 | # requires the Devise mappings to be loaded during boot time the application
111 | # won't boot properly.
112 | # config.reload_routes = true
113 |
114 | # ==> Configuration for :database_authenticatable
115 | # For bcrypt, this is the cost for hashing the password and defaults to 12. If
116 | # using other algorithms, it sets how many times you want the password to be hashed.
117 | # The number of stretches used for generating the hashed password are stored
118 | # with the hashed password. This allows you to change the stretches without
119 | # invalidating existing passwords.
120 | #
121 | # Limiting the stretches to just one in testing will increase the performance of
122 | # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
123 | # a value less than 10 in other environments. Note that, for bcrypt (the default
124 | # algorithm), the cost increases exponentially with the number of stretches (e.g.
125 | # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
126 | config.stretches = Rails.env.test? ? 1 : 12
127 |
128 | # Set up a pepper to generate the hashed password.
129 | # config.pepper = '0c6a240c5d48d41455cdc627fb596fca013400403077d2e18f09c015cda61b81212776c1aade1deb4ed55c480ce9bbdc81c2574a872e8ee019877517bd47307d'
130 |
131 | # Send a notification to the original email when the user's email is changed.
132 | # config.send_email_changed_notification = false
133 |
134 | # Send a notification email when the user's password is changed.
135 | # config.send_password_change_notification = false
136 |
137 | # ==> Configuration for :confirmable
138 | # A period that the user is allowed to access the website even without
139 | # confirming their account. For instance, if set to 2.days, the user will be
140 | # able to access the website for two days without confirming their account,
141 | # access will be blocked just in the third day.
142 | # You can also set it to nil, which will allow the user to access the website
143 | # without confirming their account.
144 | # Default is 0.days, meaning the user cannot access the website without
145 | # confirming their account.
146 | # config.allow_unconfirmed_access_for = 2.days
147 |
148 | # A period that the user is allowed to confirm their account before their
149 | # token becomes invalid. For example, if set to 3.days, the user can confirm
150 | # their account within 3 days after the mail was sent, but on the fourth day
151 | # their account can't be confirmed with the token any more.
152 | # Default is nil, meaning there is no restriction on how long a user can take
153 | # before confirming their account.
154 | # config.confirm_within = 3.days
155 |
156 | # If true, requires any email changes to be confirmed (exactly the same way as
157 | # initial account confirmation) to be applied. Requires additional unconfirmed_email
158 | # db field (see migrations). Until confirmed, new email is stored in
159 | # unconfirmed_email column, and copied to email column on successful confirmation.
160 | config.reconfirmable = true
161 |
162 | # Defines which key will be used when confirming an account
163 | # config.confirmation_keys = [:email]
164 |
165 | # ==> Configuration for :rememberable
166 | # The time the user will be remembered without asking for credentials again.
167 | # config.remember_for = 2.weeks
168 |
169 | # Invalidates all the remember me tokens when the user signs out.
170 | config.expire_all_remember_me_on_sign_out = true
171 |
172 | # If true, extends the user's remember period when remembered via cookie.
173 | # config.extend_remember_period = false
174 |
175 | # Options to be passed to the created cookie. For instance, you can set
176 | # secure: true in order to force SSL only cookies.
177 | # config.rememberable_options = {}
178 |
179 | # ==> Configuration for :validatable
180 | # Range for password length.
181 | config.password_length = 6..128
182 |
183 | # Email regex used to validate email formats. It simply asserts that
184 | # one (and only one) @ exists in the given string. This is mainly
185 | # to give user feedback and not to assert the e-mail validity.
186 | config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
187 |
188 | # ==> Configuration for :timeoutable
189 | # The time you want to timeout the user session without activity. After this
190 | # time the user will be asked for credentials again. Default is 30 minutes.
191 | # config.timeout_in = 30.minutes
192 |
193 | # ==> Configuration for :lockable
194 | # Defines which strategy will be used to lock an account.
195 | # :failed_attempts = Locks an account after a number of failed attempts to sign in.
196 | # :none = No lock strategy. You should handle locking by yourself.
197 | # config.lock_strategy = :failed_attempts
198 |
199 | # Defines which key will be used when locking and unlocking an account
200 | # config.unlock_keys = [:email]
201 |
202 | # Defines which strategy will be used to unlock an account.
203 | # :email = Sends an unlock link to the user email
204 | # :time = Re-enables login after a certain amount of time (see :unlock_in below)
205 | # :both = Enables both strategies
206 | # :none = No unlock strategy. You should handle unlocking by yourself.
207 | # config.unlock_strategy = :both
208 |
209 | # Number of authentication tries before locking an account if lock_strategy
210 | # is failed attempts.
211 | # config.maximum_attempts = 20
212 |
213 | # Time interval to unlock the account if :time is enabled as unlock_strategy.
214 | # config.unlock_in = 1.hour
215 |
216 | # Warn on the last attempt before the account is locked.
217 | # config.last_attempt_warning = true
218 |
219 | # ==> Configuration for :recoverable
220 | #
221 | # Defines which key will be used when recovering the password for an account
222 | # config.reset_password_keys = [:email]
223 |
224 | # Time interval you can reset your password with a reset password key.
225 | # Don't put a too small interval or your users won't have the time to
226 | # change their passwords.
227 | config.reset_password_within = 6.hours
228 |
229 | # When set to false, does not sign a user in automatically after their password is
230 | # reset. Defaults to true, so a user is signed in automatically after a reset.
231 | # config.sign_in_after_reset_password = true
232 |
233 | # ==> Configuration for :encryptable
234 | # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
235 | # You can use :sha1, :sha512 or algorithms from others authentication tools as
236 | # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
237 | # for default behavior) and :restful_authentication_sha1 (then you should set
238 | # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
239 | #
240 | # Require the `devise-encryptable` gem when using anything other than bcrypt
241 | # config.encryptor = :sha512
242 |
243 | # ==> Scopes configuration
244 | # Turn scoped views on. Before rendering "sessions/new", it will first check for
245 | # "users/sessions/new". It's turned off by default because it's slower if you
246 | # are using only default views.
247 | # config.scoped_views = false
248 |
249 | # Configure the default scope given to Warden. By default it's the first
250 | # devise role declared in your routes (usually :user).
251 | # config.default_scope = :user
252 |
253 | # Set this configuration to false if you want /users/sign_out to sign out
254 | # only the current scope. By default, Devise signs out all scopes.
255 | # config.sign_out_all_scopes = true
256 |
257 | # ==> Navigation configuration
258 | # Lists the formats that should be treated as navigational. Formats like
259 | # :html, should redirect to the sign in page when the user does not have
260 | # access, but formats like :xml or :json, should return 401.
261 | #
262 | # If you have any extra navigational formats, like :iphone or :mobile, you
263 | # should add them to the navigational formats lists.
264 | #
265 | # The "*/*" below is required to match Internet Explorer requests.
266 | # config.navigational_formats = ['*/*', :html]
267 |
268 | # The default HTTP method used to sign out a resource. Default is :delete.
269 | config.sign_out_via = :delete
270 |
271 | # ==> OmniAuth
272 | # Add a new OmniAuth provider. Check the wiki for more information on setting
273 | # up on your models and hooks.
274 | # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
275 |
276 | # ==> Warden configuration
277 | # If you want to use other strategies, that are not supported by Devise, or
278 | # change the failure app, you can configure them inside the config.warden block.
279 | #
280 | # config.warden do |manager|
281 | # manager.intercept_401 = false
282 | # manager.default_strategies(scope: :user).unshift :some_external_strategy
283 | # end
284 |
285 | # ==> Mountable engine configurations
286 | # When using Devise inside an engine, let's call it `MyEngine`, and this engine
287 | # is mountable, there are some extra configurations to be taken into account.
288 | # The following options are available, assuming the engine is mounted as:
289 | #
290 | # mount MyEngine, at: '/my_engine'
291 | #
292 | # The router that invoked `devise_for`, in the example above, would be:
293 | # config.router_name = :my_engine
294 | #
295 | # When using OmniAuth, Devise cannot automatically set OmniAuth path,
296 | # so you need to do it manually. For the users scope, it would be:
297 | # config.omniauth_path_prefix = '/my_engine/users/auth'
298 |
299 | # ==> Turbolinks configuration
300 | # If your app is using Turbolinks, Turbolinks::Controller needs to be included to make redirection work correctly:
301 | #
302 | # ActiveSupport.on_load(:devise_failure_app) do
303 | # include Turbolinks::Controller
304 | # end
305 |
306 | # ==> Configuration for :registerable
307 |
308 | # When set to false, does not sign a user in automatically after their password is
309 | # changed. Defaults to true, so a user is signed in automatically after changing a password.
310 | # config.sign_in_after_change_password = true
311 | end
312 |
--------------------------------------------------------------------------------