├── log └── .keep ├── storage └── .keep ├── tmp ├── .keep └── pids │ └── .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 │ ├── group_test.rb │ ├── user_test.rb │ ├── transaction_test.rb │ └── transaction_group_test.rb ├── system │ └── .keep ├── controllers │ ├── .keep │ ├── groups_controller_test.rb │ └── users_controller_test.rb ├── fixtures │ ├── .keep │ ├── files │ │ └── .keep │ ├── users.yml │ ├── transaction_groups.yml │ ├── groups.yml │ └── transactions.yml ├── integration │ └── .keep ├── application_system_test_case.rb ├── channels │ └── application_cable │ │ └── connection_test.rb └── test_helper.rb ├── app ├── assets │ ├── images │ │ ├── .keep │ │ ├── baby.jpg │ │ ├── empty.png │ │ ├── home.jpg │ │ ├── pet.jpeg │ │ ├── sport.png │ │ ├── user.png │ │ ├── jewelry.jpg │ │ ├── watch.jpeg │ │ ├── clothing.jpeg │ │ └── transaction_icons │ │ │ ├── i4.jpg │ │ │ ├── tr.png │ │ │ └── i6.webp │ ├── config │ │ └── manifest.js │ ├── fonts │ │ ├── Proxima_Nova_Bold.otf │ │ └── Proxima_Nova_Light.otf │ └── stylesheets │ │ ├── groups.scss │ │ ├── users.scss │ │ ├── fonts.scss │ │ └── application.scss ├── models │ ├── concerns │ │ └── .keep │ ├── application_record.rb │ ├── transaction_group.rb │ ├── group.rb │ ├── user.rb │ └── transaction.rb ├── controllers │ ├── concerns │ │ └── .keep │ ├── pages_controller.rb │ ├── users_controller.rb │ ├── application_controller.rb │ ├── groups_controller.rb │ └── transactions_controller.rb ├── views │ ├── pages │ │ └── home.html.erb │ ├── layouts │ │ ├── mailer.text.erb │ │ ├── _footer.html.erb │ │ ├── mailer.html.erb │ │ ├── _messages.erb │ │ ├── application.html.erb │ │ └── _navigation.html.erb │ ├── transactions │ │ ├── index.html.erb │ │ ├── _list.html.erb │ │ ├── show.html.erb │ │ ├── edit.html.erb │ │ └── new.html.erb │ ├── devise │ │ ├── unlocks │ │ │ └── new.html.erb │ │ ├── passwords │ │ │ ├── new.html.erb │ │ │ └── edit.html.erb │ │ ├── confirmations │ │ │ └── new.html.erb │ │ ├── sessions │ │ │ └── new.html.erb │ │ ├── registrations │ │ │ ├── new.html.erb │ │ │ └── edit.html.erb │ │ └── shared │ │ │ └── _links.html.erb │ ├── groups │ │ ├── index.html.erb │ │ ├── edit.html.erb │ │ ├── new.html.erb │ │ └── show.html.erb │ └── users │ │ └── show.html.erb ├── helpers │ ├── users_helper.rb │ ├── groups_helper.rb │ └── application_helper.rb ├── channels │ └── application_cable │ │ ├── channel.rb │ │ └── connection.rb ├── mailers │ └── application_mailer.rb ├── javascript │ ├── channels │ │ ├── index.js │ │ └── consumer.js │ └── packs │ │ └── application.js └── jobs │ └── application_job.rb ├── .browserslistrc ├── .rspec ├── .tool-versions ├── .rubocop.yml ├── config ├── spring.rb ├── webpack │ ├── test.js │ ├── production.js │ ├── development.js │ └── environment.js ├── environment.rb ├── initializers │ ├── mime_types.rb │ ├── filter_parameter_logging.rb │ ├── application_controller_renderer.rb │ ├── cookies_serializer.rb │ ├── backtrace_silencers.rb │ ├── wrap_parameters.rb │ ├── inflections.rb │ ├── assets.rb │ ├── content_security_policy.rb │ └── devise.rb ├── cable.yml ├── boot.rb ├── routes.rb ├── credentials.yml.enc ├── cloudinary.yml ├── application.rb ├── locales │ ├── en.yml │ └── devise.en.yml ├── storage.yml ├── puma.rb ├── environments │ ├── test.rb │ ├── development.rb │ └── production.rb ├── webpacker.yml └── database.yml ├── config.ru ├── db ├── migrate │ ├── 20210105150603_create_groups.rb │ ├── 20210107171213_add_group_to_users.rb │ ├── 20210105150602_create_transactions.rb │ ├── 20210107181023_change_transaction_id.rb │ ├── 20210105151333_add_fields_to_group.rb │ ├── 20210104153730_create_users.rb │ ├── 20210107173809_create_transaction_groups.rb │ ├── 20210105151616_add_fields_to_transaction_table.rb │ ├── 20210111041457_create_active_storage_tables.active_storage.rb │ └── 20210105221042_add_devise_to_users.rb ├── seeds.rb └── schema.rb ├── Rakefile ├── postcss.config.js ├── bin ├── rake ├── rails ├── yarn ├── webpack ├── webpack-dev-server ├── spring ├── setup └── bundle ├── .stylelintrc.json ├── package.json ├── spec ├── model │ ├── group_spec.rb │ ├── transaction_spec.rb │ └── user_spec.rb ├── controller │ └── user_spec.rb ├── rails_helper.rb └── spec_helper.rb ├── .gitignore ├── .github └── workflows │ └── linters.yml ├── .robocop.yml ├── babel.config.js ├── .rubocop_todo.yml ├── Gemfile ├── README.md └── Gemfile.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 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.browserslistrc: -------------------------------------------------------------------------------- 1 | defaults 2 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/files/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --require spec_helper 2 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | ruby 3.0.0 2 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/apple-touch-icon-precomposed.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | inherit_from: .rubocop_todo.yml 2 | -------------------------------------------------------------------------------- /app/views/pages/home.html.erb: -------------------------------------------------------------------------------- 1 |
Helooooo
-------------------------------------------------------------------------------- /app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /app/helpers/users_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module UsersHelper 4 | end 5 | -------------------------------------------------------------------------------- /app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../stylesheets .css 3 | -------------------------------------------------------------------------------- /app/helpers/groups_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module GroupsHelper 4 | end 5 | -------------------------------------------------------------------------------- /app/assets/images/baby.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkrtichSargsyan/Transactions/HEAD/app/assets/images/baby.jpg -------------------------------------------------------------------------------- /app/assets/images/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkrtichSargsyan/Transactions/HEAD/app/assets/images/empty.png -------------------------------------------------------------------------------- /app/assets/images/home.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkrtichSargsyan/Transactions/HEAD/app/assets/images/home.jpg -------------------------------------------------------------------------------- /app/assets/images/pet.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkrtichSargsyan/Transactions/HEAD/app/assets/images/pet.jpeg -------------------------------------------------------------------------------- /app/assets/images/sport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkrtichSargsyan/Transactions/HEAD/app/assets/images/sport.png -------------------------------------------------------------------------------- /app/assets/images/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkrtichSargsyan/Transactions/HEAD/app/assets/images/user.png -------------------------------------------------------------------------------- /app/assets/images/jewelry.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkrtichSargsyan/Transactions/HEAD/app/assets/images/jewelry.jpg -------------------------------------------------------------------------------- /app/assets/images/watch.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkrtichSargsyan/Transactions/HEAD/app/assets/images/watch.jpeg -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /app/assets/images/clothing.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkrtichSargsyan/Transactions/HEAD/app/assets/images/clothing.jpeg -------------------------------------------------------------------------------- /app/assets/fonts/Proxima_Nova_Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkrtichSargsyan/Transactions/HEAD/app/assets/fonts/Proxima_Nova_Bold.otf -------------------------------------------------------------------------------- /app/assets/fonts/Proxima_Nova_Light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkrtichSargsyan/Transactions/HEAD/app/assets/fonts/Proxima_Nova_Light.otf -------------------------------------------------------------------------------- /app/assets/images/transaction_icons/i4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkrtichSargsyan/Transactions/HEAD/app/assets/images/transaction_icons/i4.jpg -------------------------------------------------------------------------------- /app/assets/images/transaction_icons/tr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkrtichSargsyan/Transactions/HEAD/app/assets/images/transaction_icons/tr.png -------------------------------------------------------------------------------- /app/assets/images/transaction_icons/i6.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MkrtichSargsyan/Transactions/HEAD/app/assets/images/transaction_icons/i6.webp -------------------------------------------------------------------------------- /app/controllers/pages_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class PagesController < ApplicationController 4 | def home; end 5 | end 6 | -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ApplicationRecord < ActiveRecord::Base 4 | self.abstract_class = true 5 | end 6 | -------------------------------------------------------------------------------- /app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module ApplicationCable 4 | class Channel < ActionCable::Channel::Base 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /config/spring.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Spring.watch( 4 | '.ruby-version', 5 | '.rbenv-vars', 6 | 'tmp/restart.txt', 7 | 'tmp/caching-dev.txt' 8 | ) 9 | -------------------------------------------------------------------------------- /app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module ApplicationCable 4 | class Connection < ActionCable::Connection::Base 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /test/fixtures/users.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | name: MyString 5 | 6 | two: 7 | name: MyString 8 | -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ApplicationMailer < ActionMailer::Base 4 | default from: 'from@example.com' 5 | layout 'mailer' 6 | end 7 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # This file is used by Rack-based servers to start the application. 4 | 5 | require_relative 'config/environment' 6 | 7 | run Rails.application 8 | -------------------------------------------------------------------------------- /config/webpack/test.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = process.env.NODE_ENV || 'development' 2 | 3 | const environment = require('./environment') 4 | 5 | module.exports = environment.toWebpackConfig() 6 | -------------------------------------------------------------------------------- /app/models/transaction_group.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class TransactionGroup < ApplicationRecord 4 | belongs_to :transfer, class_name: 'Transaction' 5 | belongs_to :group 6 | end 7 | -------------------------------------------------------------------------------- /config/webpack/production.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = process.env.NODE_ENV || 'production' 2 | 3 | const environment = require('./environment') 4 | 5 | module.exports = environment.toWebpackConfig() 6 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Load the Rails application. 4 | require_relative 'application' 5 | 6 | # Initialize the Rails application. 7 | Rails.application.initialize! 8 | -------------------------------------------------------------------------------- /config/webpack/development.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = process.env.NODE_ENV || 'development' 2 | 3 | const environment = require('./environment') 4 | 5 | module.exports = environment.toWebpackConfig() 6 | -------------------------------------------------------------------------------- /db/migrate/20210105150603_create_groups.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class CreateGroups < ActiveRecord::Migration[6.0] 4 | def change 5 | create_table :groups, &:timestamps 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20210107171213_add_group_to_users.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class AddGroupToUsers < ActiveRecord::Migration[6.0] 4 | def change 5 | add_reference :groups, :user 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/group_test.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'test_helper' 4 | 5 | class GroupTest < ActiveSupport::TestCase 6 | # test "the truth" do 7 | # assert true 8 | # end 9 | end 10 | -------------------------------------------------------------------------------- /test/models/user_test.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'test_helper' 4 | 5 | class UserTest < ActiveSupport::TestCase 6 | # test "the truth" do 7 | # assert true 8 | # end 9 | end 10 | -------------------------------------------------------------------------------- /app/assets/stylesheets/groups.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Groups controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: https://sass-lang.com/ 4 | -------------------------------------------------------------------------------- /db/migrate/20210105150602_create_transactions.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class CreateTransactions < ActiveRecord::Migration[6.0] 4 | def change 5 | create_table :transactions, &:timestamps 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /test/models/transaction_test.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'test_helper' 4 | 5 | class TransactionTest < ActiveSupport::TestCase 6 | # test "the truth" do 7 | # assert true 8 | # end 9 | end 10 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # Be sure to restart your server when you modify this file. 3 | 4 | # Add new mime types for use in respond_to blocks: 5 | # Mime::Type.register "text/richtext", :rtf 6 | -------------------------------------------------------------------------------- /test/models/transaction_group_test.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'test_helper' 4 | 5 | class TransactionGroupTest < ActiveSupport::TestCase 6 | # test "the truth" do 7 | # assert true 8 | # end 9 | end 10 | -------------------------------------------------------------------------------- /test/application_system_test_case.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'test_helper' 4 | 5 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase 6 | driven_by :selenium, using: :chrome, screen_size: [1400, 1400] 7 | end 8 | -------------------------------------------------------------------------------- /test/fixtures/transaction_groups.yml: -------------------------------------------------------------------------------- 1 | # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html 2 | 3 | one: 4 | transaction_id: 1 5 | group_id: 1 6 | 7 | two: 8 | transaction_id: 1 9 | group_id: 1 10 | -------------------------------------------------------------------------------- /db/migrate/20210107181023_change_transaction_id.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ChangeTransactionId < ActiveRecord::Migration[6.0] 4 | def change 5 | rename_column :transaction_groups, :transaction_id, :transfer_id 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /test/controllers/groups_controller_test.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'test_helper' 4 | 5 | class GroupsControllerTest < ActionDispatch::IntegrationTest 6 | # test "the truth" do 7 | # assert true 8 | # end 9 | end 10 | -------------------------------------------------------------------------------- /test/controllers/users_controller_test.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'test_helper' 4 | 5 | class UsersControllerTest < ActionDispatch::IntegrationTest 6 | # test "the truth" do 7 | # assert true 8 | # end 9 | end 10 | -------------------------------------------------------------------------------- /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: Transactions_production 11 | -------------------------------------------------------------------------------- /app/javascript/channels/index.js: -------------------------------------------------------------------------------- 1 | // Load all the channels within this directory and all subdirectories. 2 | // Channel files must be named *_channel.js. 3 | 4 | const channels = require.context('.', true, /_channel\.js$/) 5 | channels.keys().forEach(channels) 6 | -------------------------------------------------------------------------------- /db/migrate/20210105151333_add_fields_to_group.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class AddFieldsToGroup < ActiveRecord::Migration[6.0] 4 | def change 5 | add_column :groups, :name, :string 6 | add_column :groups, :icon, :string 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /app/assets/stylesheets/users.scss: -------------------------------------------------------------------------------- 1 | // Place all the styles related to the Users controller here. 2 | // They will automatically be included in application.css. 3 | // You can use Sass (SCSS) here: https://sass-lang.com/ 4 | 5 | .user_icon { 6 | width: 150px; 7 | } 8 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 4 | 5 | require 'bundler/setup' # Set up gems listed in the Gemfile. 6 | require 'bootsnap/setup' # Speed up boot time by caching expensive operations. 7 | -------------------------------------------------------------------------------- /db/migrate/20210104153730_create_users.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class CreateUsers < ActiveRecord::Migration[6.0] 4 | def change 5 | create_table :users do |t| 6 | t.string :name 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /app/views/layouts/_footer.html.erb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Add your own tasks in files placed in lib/tasks ending in .rake, 4 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 5 | 6 | require_relative 'config/application' 7 | 8 | Rails.application.load_tasks 9 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Be sure to restart your server when you modify this file. 4 | 5 | # Configure sensitive parameters which will be filtered from the log file. 6 | Rails.application.config.filter_parameters += [:password] 7 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | require('postcss-import'), 4 | require('postcss-flexbugs-fixes'), 5 | require('postcss-preset-env')({ 6 | autoprefixer: { 7 | flexbox: 'no-2009' 8 | }, 9 | stage: 3 10 | }) 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | begin 5 | load File.expand_path('spring', __dir__) 6 | rescue LoadError => e 7 | raise unless e.message.include?('spring') 8 | end 9 | require_relative '../config/boot' 10 | require 'rake' 11 | Rake.application.run 12 | -------------------------------------------------------------------------------- /app/javascript/channels/consumer.js: -------------------------------------------------------------------------------- 1 | // Action Cable provides the framework to deal with WebSockets in Rails. 2 | // You can generate new channels where WebSocket features live using the `rails generate channel` command. 3 | 4 | import { createConsumer } from "@rails/actioncable" 5 | 6 | export default createConsumer() 7 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # Be sure to restart your server when you modify this file. 3 | 4 | # ActiveSupport::Reloader.to_prepare do 5 | # ApplicationController.renderer.defaults.merge!( 6 | # http_host: 'example.org', 7 | # https: false 8 | # ) 9 | # end 10 | -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Be sure to restart your server when you modify this file. 4 | 5 | # Specify a serializer for the signed and encrypted cookie jars. 6 | # Valid options are :json, :marshal, and :hybrid. 7 | Rails.application.config.action_dispatch.cookies_serializer = :json 8 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | begin 5 | load File.expand_path('spring', __dir__) 6 | rescue LoadError => e 7 | raise unless e.message.include?('spring') 8 | end 9 | APP_PATH = File.expand_path('../config/application', __dir__) 10 | require_relative '../config/boot' 11 | require 'rails/commands' 12 | -------------------------------------------------------------------------------- /bin/yarn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | APP_ROOT = File.expand_path('..', __dir__) 5 | Dir.chdir(APP_ROOT) do 6 | exec 'yarnpkg', *ARGV 7 | rescue Errno::ENOENT 8 | warn 'Yarn executable was not detected in the system.' 9 | warn 'Download Yarn at https://yarnpkg.com/en/docs/install' 10 | exit 1 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20210107173809_create_transaction_groups.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class CreateTransactionGroups < ActiveRecord::Migration[6.0] 4 | def change 5 | create_table :transaction_groups do |t| 6 | t.integer :transaction_id 7 | t.integer :group_id 8 | 9 | t.timestamps 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ApplicationJob < ActiveJob::Base 4 | # Automatically retry jobs that encountered a deadlock 5 | # retry_on ActiveRecord::Deadlocked 6 | 7 | # Most jobs are safe to ignore if the underlying records are no longer available 8 | # discard_on ActiveJob::DeserializationError 9 | end 10 | -------------------------------------------------------------------------------- /.stylelintrc.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "extends": ["stylelint-config-standard"], 4 | "plugins": ["stylelint-scss", "stylelint-csstree-validator"], 5 | "rules": { 6 | "at-rule-no-unknown": null, 7 | "scss/at-rule-no-unknown": true, 8 | "csstree/validator": true 9 | }, 10 | "ignoreFiles": ["build/**", "dist/**", "**/reset*.css", "**/bootstrap*.css"] 11 | } -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Rails.application.routes.draw do 4 | devise_for :users 5 | resources :users do 6 | resources :transactions 7 | end 8 | resources :groups 9 | get 'new_user_transaction', to: 'users#new_user_transaction' 10 | get 'user_transactions', to: 'users#user_transactions' 11 | root to: 'users#show' 12 | end 13 | -------------------------------------------------------------------------------- /config/webpack/environment.js: -------------------------------------------------------------------------------- 1 | const { environment } = require('@rails/webpacker') 2 | const webpack = require("webpack"); 3 | 4 | environment.plugins.append( 5 | "Provide", 6 | new webpack.ProvidePlugin({ 7 | $: "jquery", 8 | jQuery: "jquery", 9 | Popper: ["popper.js", "default"] // for Bootstrap 4 10 | }) 11 | ); 12 | 13 | 14 | module.exports = environment 15 | -------------------------------------------------------------------------------- /db/migrate/20210105151616_add_fields_to_transaction_table.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class AddFieldsToTransactionTable < ActiveRecord::Migration[6.0] 4 | def change 5 | add_column :transactions, :name, :string 6 | add_column :transactions, :amount, :integer 7 | add_reference :transactions, :author, foreign_key: { to_table: :users } 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /test/channels/application_cable/connection_test.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'test_helper' 4 | 5 | class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase 6 | # test "connects with cookies" do 7 | # cookies.signed[:user_id] = 42 8 | # 9 | # connect 10 | # 11 | # assert_equal connection.user_id, "42" 12 | # end 13 | end 14 | -------------------------------------------------------------------------------- /test/fixtures/groups.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 | -------------------------------------------------------------------------------- /test/fixtures/transactions.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/transactions/index.html.erb: -------------------------------------------------------------------------------- 1 |TOTAL PAYMENTS $<%= @total_amount %>
4 | <%= link_to 'Create new transaction', new_user_transaction_path,class:'btn btn-default btn-primary' %> 5 |Created by: <%= group.user.name %>
11 |Edit Group
14 | <%= form_with model: @group, url: group_path,class:'col-md-8 mx-md-auto mt-2',local: true do |f| %> 15 |Create Group
14 | <%= form_with scope: :group, url: groups_path,class:'col-md-8 mx-md-auto mt-2',local: true do |f| %> 15 |Details
3 |Date: <%= @transaction.created_at.to_formatted_s(:long) %>
12 |Created by: <%= transaction.author.name %>
23 | <%= transaction.created_at.to_formatted_s(:long) %> 24 |<%= t('.unhappy') %>? <%= link_to t('.cancel_my_account'), registration_path(resource_name), data: { confirm: t('.are_you_sure') }, method: :delete %>.
36 | 37 | <%= link_to t('.back'), :back %> 38 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module ApplicationHelper 4 | def show_user_name(current_user) 5 | if signed_in? 6 | "Expensivest
33 | #{link_to @most_expensive_transaction.name, user_transaction_path(current_user, @most_expensive_transaction)} 34 |Cheapest
37 | #{link_to @most_cheapest_transaction.name, user_transaction_path(current_user, @most_cheapest_transaction)} 38 |If you are the application owner check the logs for more information.
64 |Maybe you tried to change something you didn't have access to.
63 |If you are the application owner check the logs for more information.
65 |You may have mistyped the address or the page may have moved.
63 |If you are the application owner check the logs for more information.
65 |
](https://github.com/MkrtichSargsyan)
73 | [
](https://twitter.com/MkrtichSargsyan)
74 | [
](https://www.linkedin.com/in/mkrtich-sargsyan/)
75 | [
](mailto:mkrtichsargsyan24@gmail.com)
76 |
77 |
78 |
79 | ## 🤝 Contributing
80 |
81 | Contributions, issues and feature requests are welcome!
82 |
83 | Feel free to check the issues page.
84 |
85 |
86 |
87 | ## Show your support
88 |
89 | Give a ⭐️ if you like this project!
90 |
91 | ## Acknowledgments
92 |
93 | Design idea by [Gregoire Vella](https://www.behance.net/gregoirevella)
94 |
95 | - The Odin Project
96 | - Stackoverflow
97 | - YouTube player page
98 |
--------------------------------------------------------------------------------
/spec/rails_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # This file is copied to spec/ when you run 'rails generate rspec:install'
4 | require 'spec_helper'
5 | ENV['RAILS_ENV'] ||= 'test'
6 | require File.expand_path('../config/environment', __dir__)
7 | # Prevent database truncation if the environment is production
8 | if Rails.env.production?
9 | abort('The Rails environment is running in production mode!')
10 | end
11 | require 'rspec/rails'
12 | # Add additional requires below this line. Rails is not loaded until this point!
13 |
14 | # Requires supporting ruby files with custom matchers and macros, etc, in
15 | # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
16 | # run as spec files by default. This means that files in spec/support that end
17 | # in _spec.rb will both be required and run as specs, causing the specs to be
18 | # run twice. It is recommended that you do not name files matching this glob to
19 | # end with _spec.rb. You can configure this pattern with the --pattern
20 | # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
21 | #
22 | # The following line is provided for convenience purposes. It has the downside
23 | # of increasing the boot-up time by auto-requiring all files in the support
24 | # directory. Alternatively, in the individual `*_spec.rb` files, manually
25 | # require only the support files necessary.
26 | #
27 | # Dir[Rails.root.join('spec', 'support', '**', '*.rb')].sort.each { |f| require f }
28 |
29 | # Checks for pending migrations and applies them before tests are run.
30 | # If you are not using ActiveRecord, you can remove these lines.
31 | begin
32 | ActiveRecord::Migration.maintain_test_schema!
33 | rescue ActiveRecord::PendingMigrationError => e
34 | puts e.to_s.strip
35 | exit 1
36 | end
37 | RSpec.configure do |config|
38 | # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
39 | config.fixture_path = "#{::Rails.root}/spec/fixtures"
40 |
41 | # If you're not using ActiveRecord, or you'd prefer not to run each of your
42 | # examples within a transaction, remove the following line or assign false
43 | # instead of true.
44 | config.use_transactional_fixtures = true
45 |
46 | # You can uncomment this line to turn off ActiveRecord support entirely.
47 | # config.use_active_record = false
48 |
49 | # RSpec Rails can automatically mix in different behaviours to your tests
50 | # based on their file location, for example enabling you to call `get` and
51 | # `post` in specs under `spec/controllers`.
52 | #
53 | # You can disable this behaviour by removing the line below, and instead
54 | # explicitly tag your specs with their type, e.g.:
55 | #
56 | # RSpec.describe UsersController, type: :controller do
57 | # # ...
58 | # end
59 | #
60 | # The different available types are documented in the features, such as in
61 | # https://relishapp.com/rspec/rspec-rails/docs
62 | config.infer_spec_type_from_file_location!
63 |
64 | # Filter lines from Rails gems in backtraces.
65 | config.filter_rails_from_backtrace!
66 | # arbitrary gems may also be filtered via:
67 | # config.filter_gems_from_backtrace("gem name")
68 | end
69 |
--------------------------------------------------------------------------------
/config/database.yml:
--------------------------------------------------------------------------------
1 | # PostgreSQL. Versions 9.3 and up are supported.
2 | #
3 | # Install the pg driver:
4 | # gem install pg
5 | # On macOS with Homebrew:
6 | # gem install pg -- --with-pg-config=/usr/local/bin/pg_config
7 | # On macOS with MacPorts:
8 | # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
9 | # On Windows:
10 | # gem install pg
11 | # Choose the win32 build.
12 | # Install PostgreSQL and put its /bin directory on your path.
13 | #
14 | # Configure Using Gemfile
15 | # gem 'pg'
16 | #
17 | default: &default
18 | adapter: postgresql
19 | encoding: unicode
20 | # For details on connection pooling, see Rails configuration guide
21 | # https://guides.rubyonrails.org/configuring.html#database-pooling
22 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
23 |
24 | development:
25 | <<: *default
26 | database: Transactions_development
27 |
28 | # The specified database role being used to connect to postgres.
29 | # To create additional roles in postgres see `$ createuser --help`.
30 | # When left blank, postgres will use the default role. This is
31 | # the same name as the operating system user that initialized the database.
32 | #username: Transactions
33 |
34 | # The password associated with the postgres role (username).
35 | #password:
36 |
37 | # Connect on a TCP socket. Omitted by default since the client uses a
38 | # domain socket that doesn't need configuration. Windows does not have
39 | # domain sockets, so uncomment these lines.
40 | #host: localhost
41 |
42 | # The TCP port the server listens on. Defaults to 5432.
43 | # If your server runs on a different port number, change accordingly.
44 | #port: 5432
45 |
46 | # Schema search path. The server defaults to $user,public
47 | #schema_search_path: myapp,sharedapp,public
48 |
49 | # Minimum log levels, in increasing order:
50 | # debug5, debug4, debug3, debug2, debug1,
51 | # log, notice, warning, error, fatal, and panic
52 | # Defaults to warning.
53 | #min_messages: notice
54 |
55 | # Warning: The database defined as "test" will be erased and
56 | # re-generated from your development database when you run "rake".
57 | # Do not set this db to the same as development or production.
58 | test:
59 | <<: *default
60 | database: Transactions_test
61 |
62 | # As with config/credentials.yml, you never want to store sensitive information,
63 | # like your database password, in your source code. If your source code is
64 | # ever seen by anyone, they now have access to your database.
65 | #
66 | # Instead, provide the password as a unix environment variable when you boot
67 | # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
68 | # for a full rundown on how to provide these environment variables in a
69 | # production deployment.
70 | #
71 | # On Heroku and other platform providers, you may have a full connection URL
72 | # available as an environment variable. For example:
73 | #
74 | # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
75 | #
76 | # You can use this database configuration with:
77 | #
78 | # production:
79 | # url: <%= ENV['DATABASE_URL'] %>
80 | #
81 | production:
82 | <<: *default
83 | database: Transactions_production
84 | username: Transactions
85 | password: <%= ENV['TRANSACTIONS_DATABASE_PASSWORD'] %>
86 |
--------------------------------------------------------------------------------
/db/schema.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # This file is auto-generated from the current state of the database. Instead
4 | # of editing this file, please use the migrations feature of Active Record to
5 | # incrementally modify your database, and then regenerate this schema definition.
6 | #
7 | # This file is the source Rails uses to define your schema when running `rails
8 | # db:schema:load`. When creating a new database, `rails db:schema:load` tends to
9 | # be faster and is potentially less error prone than running all of your
10 | # migrations from scratch. Old migrations may fail to apply correctly if those
11 | # migrations use external dependencies or application code.
12 | #
13 | # It's strongly recommended that you check this file into your version control system.
14 |
15 | ActiveRecord::Schema.define(version: 20_210_111_041_457) do
16 | # These are extensions that must be enabled in order to support this database
17 | enable_extension 'plpgsql'
18 |
19 | create_table 'active_storage_attachments', force: :cascade do |t|
20 | t.string 'name', null: false
21 | t.string 'record_type', null: false
22 | t.bigint 'record_id', null: false
23 | t.bigint 'blob_id', null: false
24 | t.datetime 'created_at', null: false
25 | t.index ['blob_id'], name: 'index_active_storage_attachments_on_blob_id'
26 | t.index %w[record_type record_id name blob_id], name: 'index_active_storage_attachments_uniqueness', unique: true
27 | end
28 |
29 | create_table 'active_storage_blobs', force: :cascade do |t|
30 | t.string 'key', null: false
31 | t.string 'filename', null: false
32 | t.string 'content_type'
33 | t.text 'metadata'
34 | t.bigint 'byte_size', null: false
35 | t.string 'checksum', null: false
36 | t.datetime 'created_at', null: false
37 | t.index ['key'], name: 'index_active_storage_blobs_on_key', unique: true
38 | end
39 |
40 | create_table 'groups', force: :cascade do |t|
41 | t.datetime 'created_at', precision: 6, null: false
42 | t.datetime 'updated_at', precision: 6, null: false
43 | t.string 'name'
44 | t.string 'icon'
45 | t.bigint 'user_id'
46 | t.index ['user_id'], name: 'index_groups_on_user_id'
47 | end
48 |
49 | create_table 'transaction_groups', force: :cascade do |t|
50 | t.integer 'transfer_id'
51 | t.integer 'group_id'
52 | t.datetime 'created_at', precision: 6, null: false
53 | t.datetime 'updated_at', precision: 6, null: false
54 | end
55 |
56 | create_table 'transactions', force: :cascade do |t|
57 | t.datetime 'created_at', precision: 6, null: false
58 | t.datetime 'updated_at', precision: 6, null: false
59 | t.string 'name'
60 | t.integer 'amount'
61 | t.bigint 'author_id'
62 | t.index ['author_id'], name: 'index_transactions_on_author_id'
63 | end
64 |
65 | create_table 'users', force: :cascade do |t|
66 | t.string 'name'
67 | t.datetime 'created_at', precision: 6, null: false
68 | t.datetime 'updated_at', precision: 6, null: false
69 | t.string 'email', default: '', null: false
70 | t.string 'encrypted_password', default: '', null: false
71 | t.string 'reset_password_token'
72 | t.datetime 'reset_password_sent_at'
73 | t.datetime 'remember_created_at'
74 | t.index ['email'], name: 'index_users_on_email', unique: true
75 | t.index ['reset_password_token'], name: 'index_users_on_reset_password_token', unique: true
76 | end
77 |
78 | add_foreign_key 'active_storage_attachments', 'active_storage_blobs', column: 'blob_id'
79 | add_foreign_key 'transactions', 'users', column: 'author_id'
80 | end
81 |
--------------------------------------------------------------------------------
/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($PROGRAM_NAME) == 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 | unless 'update'.start_with?(ARGV.first || ' ')
27 | return
28 | end # must be running `bundle update`
29 |
30 | bundler_version = nil
31 | update_index = nil
32 | ARGV.each_with_index do |a, i|
33 | if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
34 | bundler_version = a
35 | end
36 | unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
37 | next
38 | end
39 |
40 | bundler_version = Regexp.last_match(1)
41 | update_index = i
42 | end
43 | bundler_version
44 | end
45 |
46 | def gemfile
47 | gemfile = ENV['BUNDLE_GEMFILE']
48 | return gemfile if gemfile && !gemfile.empty?
49 |
50 | File.expand_path('../Gemfile', __dir__)
51 | end
52 |
53 | def lockfile
54 | lockfile =
55 | case File.basename(gemfile)
56 | when 'gems.rb' then gemfile.sub(/\.rb$/, gemfile)
57 | else "#{gemfile}.lock"
58 | end
59 | File.expand_path(lockfile)
60 | end
61 |
62 | def lockfile_version
63 | return unless File.file?(lockfile)
64 |
65 | lockfile_contents = File.read(lockfile)
66 | unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
67 | return
68 | end
69 |
70 | Regexp.last_match(1)
71 | end
72 |
73 | def bundler_version
74 | @bundler_version ||=
75 | env_var_version || cli_arg_version ||
76 | lockfile_version
77 | end
78 |
79 | def bundler_requirement
80 | return "#{Gem::Requirement.default}.a" unless bundler_version
81 |
82 | bundler_gem_version = Gem::Version.new(bundler_version)
83 |
84 | requirement = bundler_gem_version.approximate_recommendation
85 |
86 | unless Gem::Version.new(Gem::VERSION) < Gem::Version.new('2.7.0')
87 | return requirement
88 | end
89 |
90 | requirement += '.a' if bundler_gem_version.prerelease?
91 |
92 | requirement
93 | end
94 |
95 | def load_bundler!
96 | ENV['BUNDLE_GEMFILE'] ||= gemfile
97 |
98 | activate_bundler
99 | end
100 |
101 | def activate_bundler
102 | gem_error = activation_error_handling do
103 | gem 'bundler', bundler_requirement
104 | end
105 | return if gem_error.nil?
106 |
107 | require_error = activation_error_handling do
108 | require 'bundler/version'
109 | end
110 | if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
111 | return
112 | end
113 |
114 | 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}'`"
115 | exit 42
116 | end
117 |
118 | def activation_error_handling
119 | yield
120 | nil
121 | rescue StandardError, LoadError => e
122 | e
123 | end
124 | end
125 |
126 | m.load_bundler!
127 |
128 | load Gem.bin_path('bundler', 'bundle') if m.invoked_as_script?
129 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # This file was generated by the `rails generate rspec:install` command. Conventionally, all
4 | # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
5 | # The generated `.rspec` file contains `--require spec_helper` which will cause
6 | # this file to always be loaded, without a need to explicitly require it in any
7 | # files.
8 | #
9 | # Given that it is always loaded, you are encouraged to keep this file as
10 | # light-weight as possible. Requiring heavyweight dependencies from this file
11 | # will add to the boot time of your test suite on EVERY test run, even for an
12 | # individual file that may not need all of that loaded. Instead, consider making
13 | # a separate helper file that requires the additional dependencies and performs
14 | # the additional setup, and require it from the spec files that actually need
15 | # it.
16 | #
17 | # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
18 | RSpec.configure do |config|
19 | # rspec-expectations config goes here. You can use an alternate
20 | # assertion/expectation library such as wrong or the stdlib/minitest
21 | # assertions if you prefer.
22 | config.expect_with :rspec do |expectations|
23 | # This option will default to `true` in RSpec 4. It makes the `description`
24 | # and `failure_message` of custom matchers include text for helper methods
25 | # defined using `chain`, e.g.:
26 | # be_bigger_than(2).and_smaller_than(4).description
27 | # # => "be bigger than 2 and smaller than 4"
28 | # ...rather than:
29 | # # => "be bigger than 2"
30 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true
31 | end
32 |
33 | # rspec-mocks config goes here. You can use an alternate test double
34 | # library (such as bogus or mocha) by changing the `mock_with` option here.
35 | config.mock_with :rspec do |mocks|
36 | # Prevents you from mocking or stubbing a method that does not exist on
37 | # a real object. This is generally recommended, and will default to
38 | # `true` in RSpec 4.
39 | mocks.verify_partial_doubles = true
40 | end
41 |
42 | # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
43 | # have no way to turn it off -- the option exists only for backwards
44 | # compatibility in RSpec 3). It causes shared context metadata to be
45 | # inherited by the metadata hash of host groups and examples, rather than
46 | # triggering implicit auto-inclusion in groups with matching metadata.
47 | config.shared_context_metadata_behavior = :apply_to_host_groups
48 |
49 | # The settings below are suggested to provide a good initial experience
50 | # with RSpec, but feel free to customize to your heart's content.
51 | # # This allows you to limit a spec run to individual examples or groups
52 | # # you care about by tagging them with `:focus` metadata. When nothing
53 | # # is tagged with `:focus`, all examples get run. RSpec also provides
54 | # # aliases for `it`, `describe`, and `context` that include `:focus`
55 | # # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
56 | # config.filter_run_when_matching :focus
57 | #
58 | # # Allows RSpec to persist some state between runs in order to support
59 | # # the `--only-failures` and `--next-failure` CLI options. We recommend
60 | # # you configure your source control system to ignore this file.
61 | # config.example_status_persistence_file_path = "spec/examples.txt"
62 | #
63 | # # Limits the available syntax to the non-monkey patched syntax that is
64 | # # recommended. For more details, see:
65 | # # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
66 | # # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
67 | # # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
68 | # config.disable_monkey_patching!
69 | #
70 | # # Many RSpec users commonly either run the entire suite or an individual
71 | # # file, and it's useful to allow more verbose output when running an
72 | # # individual spec file.
73 | # if config.files_to_run.one?
74 | # # Use the documentation formatter for detailed output,
75 | # # unless a formatter has already been configured
76 | # # (e.g. via a command-line flag).
77 | # config.default_formatter = "doc"
78 | # end
79 | #
80 | # # Print the 10 slowest examples and example groups at the
81 | # # end of the spec run, to help surface which specs are running
82 | # # particularly slow.
83 | # config.profile_examples = 10
84 | #
85 | # # Run specs in random order to surface order dependencies. If you find an
86 | # # order dependency and want to debug it, you can fix the order by providing
87 | # # the seed, which is printed after each run.
88 | # # --seed 1234
89 | # config.order = :random
90 | #
91 | # # Seed global randomization in this process using the `--seed` CLI option.
92 | # # Setting this allows you to use `--seed` to deterministically reproduce
93 | # # test failures related to randomization by passing the same `--seed` value
94 | # # as the one that triggered the failure.
95 | # Kernel.srand config.seed
96 | end
97 |
--------------------------------------------------------------------------------
/config/environments/production.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
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 = true
32 |
33 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
34 | # config.action_controller.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 = :cloudinary
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 | # Use the lowest log level to ensure availability of diagnostic information
52 | # when problems arise.
53 | config.log_level = :debug
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 = "Transactions_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 | # Send deprecation notices to registered listeners.
76 | config.active_support.deprecation = :notify
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 |
94 | # Inserts middleware to perform automatic connection switching.
95 | # The `database_selector` hash is used to pass options to the DatabaseSelector
96 | # middleware. The `delay` is used to determine how long to wait after a write
97 | # to send a subsequent read to the primary.
98 | #
99 | # The `database_resolver` class is used by the middleware to determine which
100 | # database is appropriate to use based on the time delay.
101 | #
102 | # The `database_resolver_context` class is used by the middleware to set
103 | # timestamps for the last write to the primary. The resolver uses the context
104 | # class timestamps to determine how long to wait before reading from the
105 | # replica.
106 | #
107 | # By default Rails will store a last write timestamp in the session. The
108 | # DatabaseSelector middleware is designed as such you can define your own
109 | # strategy for connection switching and pass that into the middleware through
110 | # these configuration options.
111 | # config.active_record.database_selector = { delay: 2.seconds }
112 | # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
113 | # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
114 | end
115 |
--------------------------------------------------------------------------------
/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | actioncable (6.0.3.5)
5 | actionpack (= 6.0.3.5)
6 | nio4r (~> 2.0)
7 | websocket-driver (>= 0.6.1)
8 | actionmailbox (6.0.3.5)
9 | actionpack (= 6.0.3.5)
10 | activejob (= 6.0.3.5)
11 | activerecord (= 6.0.3.5)
12 | activestorage (= 6.0.3.5)
13 | activesupport (= 6.0.3.5)
14 | mail (>= 2.7.1)
15 | actionmailer (6.0.3.5)
16 | actionpack (= 6.0.3.5)
17 | actionview (= 6.0.3.5)
18 | activejob (= 6.0.3.5)
19 | mail (~> 2.5, >= 2.5.4)
20 | rails-dom-testing (~> 2.0)
21 | actionpack (6.0.3.5)
22 | actionview (= 6.0.3.5)
23 | activesupport (= 6.0.3.5)
24 | rack (~> 2.0, >= 2.0.8)
25 | rack-test (>= 0.6.3)
26 | rails-dom-testing (~> 2.0)
27 | rails-html-sanitizer (~> 1.0, >= 1.2.0)
28 | actiontext (6.0.3.5)
29 | actionpack (= 6.0.3.5)
30 | activerecord (= 6.0.3.5)
31 | activestorage (= 6.0.3.5)
32 | activesupport (= 6.0.3.5)
33 | nokogiri (>= 1.8.5)
34 | actionview (6.0.3.5)
35 | activesupport (= 6.0.3.5)
36 | builder (~> 3.1)
37 | erubi (~> 1.4)
38 | rails-dom-testing (~> 2.0)
39 | rails-html-sanitizer (~> 1.1, >= 1.2.0)
40 | activejob (6.0.3.5)
41 | activesupport (= 6.0.3.5)
42 | globalid (>= 0.3.6)
43 | activemodel (6.0.3.5)
44 | activesupport (= 6.0.3.5)
45 | activerecord (6.0.3.5)
46 | activemodel (= 6.0.3.5)
47 | activesupport (= 6.0.3.5)
48 | activestorage (6.0.3.5)
49 | actionpack (= 6.0.3.5)
50 | activejob (= 6.0.3.5)
51 | activerecord (= 6.0.3.5)
52 | marcel (~> 0.3.1)
53 | activesupport (6.0.3.5)
54 | concurrent-ruby (~> 1.0, >= 1.0.2)
55 | i18n (>= 0.7, < 2)
56 | minitest (~> 5.1)
57 | tzinfo (~> 1.1)
58 | zeitwerk (~> 2.2, >= 2.2.2)
59 | addressable (2.7.0)
60 | public_suffix (>= 2.0.2, < 5.0)
61 | ast (2.4.2)
62 | autoprefixer-rails (10.2.4.0)
63 | execjs
64 | aws_cf_signer (0.1.3)
65 | bcrypt (3.1.16)
66 | bindex (0.8.1)
67 | bootsnap (1.7.2)
68 | msgpack (~> 1.0)
69 | bootstrap (4.6.0)
70 | autoprefixer-rails (>= 9.1.0)
71 | popper_js (>= 1.14.3, < 2)
72 | sassc-rails (>= 2.0.0)
73 | builder (3.2.4)
74 | byebug (11.1.3)
75 | capybara (3.35.3)
76 | addressable
77 | mini_mime (>= 0.1.3)
78 | nokogiri (~> 1.8)
79 | rack (>= 1.6.0)
80 | rack-test (>= 0.6.3)
81 | regexp_parser (>= 1.5, < 3.0)
82 | xpath (~> 3.2)
83 | childprocess (3.0.0)
84 | cloudinary (1.18.1)
85 | aws_cf_signer
86 | rest-client
87 | concurrent-ruby (1.1.8)
88 | crass (1.0.6)
89 | devise (4.7.3)
90 | bcrypt (~> 3.0)
91 | orm_adapter (~> 0.1)
92 | railties (>= 4.1.0)
93 | responders
94 | warden (~> 1.2.3)
95 | devise-bootstrap-views (1.1.0)
96 | diff-lcs (1.4.4)
97 | domain_name (0.5.20190701)
98 | unf (>= 0.0.5, < 1.0.0)
99 | erubi (1.10.0)
100 | execjs (2.7.0)
101 | ffi (1.14.2)
102 | globalid (0.4.2)
103 | activesupport (>= 4.2.0)
104 | hirb (0.7.3)
105 | http-accept (1.7.0)
106 | http-cookie (1.0.3)
107 | domain_name (~> 0.5)
108 | i18n (1.8.8)
109 | concurrent-ruby (~> 1.0)
110 | jaro_winkler (1.5.4)
111 | jbuilder (2.11.2)
112 | activesupport (>= 5.0.0)
113 | listen (3.4.1)
114 | rb-fsevent (~> 0.10, >= 0.10.3)
115 | rb-inotify (~> 0.9, >= 0.9.10)
116 | loofah (2.9.0)
117 | crass (~> 1.0.2)
118 | nokogiri (>= 1.5.9)
119 | mail (2.7.1)
120 | mini_mime (>= 0.1.1)
121 | marcel (0.3.3)
122 | mimemagic (~> 0.3.2)
123 | method_source (1.0.0)
124 | mime-types (3.3.1)
125 | mime-types-data (~> 3.2015)
126 | mime-types-data (3.2020.1104)
127 | mimemagic (0.3.5)
128 | mini_mime (1.0.2)
129 | minitest (5.14.3)
130 | msgpack (1.4.2)
131 | netrc (0.11.0)
132 | nio4r (2.5.5)
133 | nokogiri (1.11.1-x86_64-linux)
134 | racc (~> 1.4)
135 | orm_adapter (0.5.0)
136 | parallel (1.20.1)
137 | parser (3.0.0.0)
138 | ast (~> 2.4.1)
139 | pg (1.2.3)
140 | popper_js (1.16.0)
141 | public_suffix (4.0.6)
142 | puma (4.3.7)
143 | nio4r (~> 2.0)
144 | racc (1.5.2)
145 | rack (2.2.3)
146 | rack-proxy (0.6.5)
147 | rack
148 | rack-test (1.1.0)
149 | rack (>= 1.0, < 3)
150 | rails (6.0.3.5)
151 | actioncable (= 6.0.3.5)
152 | actionmailbox (= 6.0.3.5)
153 | actionmailer (= 6.0.3.5)
154 | actionpack (= 6.0.3.5)
155 | actiontext (= 6.0.3.5)
156 | actionview (= 6.0.3.5)
157 | activejob (= 6.0.3.5)
158 | activemodel (= 6.0.3.5)
159 | activerecord (= 6.0.3.5)
160 | activestorage (= 6.0.3.5)
161 | activesupport (= 6.0.3.5)
162 | bundler (>= 1.3.0)
163 | railties (= 6.0.3.5)
164 | sprockets-rails (>= 2.0.0)
165 | rails-dom-testing (2.0.3)
166 | activesupport (>= 4.2.0)
167 | nokogiri (>= 1.6)
168 | rails-html-sanitizer (1.3.0)
169 | loofah (~> 2.3)
170 | railties (6.0.3.5)
171 | actionpack (= 6.0.3.5)
172 | activesupport (= 6.0.3.5)
173 | method_source
174 | rake (>= 0.8.7)
175 | thor (>= 0.20.3, < 2.0)
176 | rainbow (3.0.0)
177 | rake (13.0.3)
178 | rb-fsevent (0.10.4)
179 | rb-inotify (0.10.1)
180 | ffi (~> 1.0)
181 | regexp_parser (2.0.3)
182 | responders (3.0.1)
183 | actionpack (>= 5.0)
184 | railties (>= 5.0)
185 | rest-client (2.1.0)
186 | http-accept (>= 1.7.0, < 2.0)
187 | http-cookie (>= 1.0.2, < 2.0)
188 | mime-types (>= 1.16, < 4.0)
189 | netrc (~> 0.8)
190 | rexml (3.2.4)
191 | rspec-core (3.10.1)
192 | rspec-support (~> 3.10.0)
193 | rspec-expectations (3.10.1)
194 | diff-lcs (>= 1.2.0, < 2.0)
195 | rspec-support (~> 3.10.0)
196 | rspec-mocks (3.10.2)
197 | diff-lcs (>= 1.2.0, < 2.0)
198 | rspec-support (~> 3.10.0)
199 | rspec-rails (4.0.2)
200 | actionpack (>= 4.2)
201 | activesupport (>= 4.2)
202 | railties (>= 4.2)
203 | rspec-core (~> 3.10)
204 | rspec-expectations (~> 3.10)
205 | rspec-mocks (~> 3.10)
206 | rspec-support (~> 3.10)
207 | rspec-support (3.10.2)
208 | rubocop (0.81.0)
209 | jaro_winkler (~> 1.5.1)
210 | parallel (~> 1.10)
211 | parser (>= 2.7.0.1)
212 | rainbow (>= 2.2.2, < 4.0)
213 | rexml
214 | ruby-progressbar (~> 1.7)
215 | unicode-display_width (>= 1.4.0, < 2.0)
216 | ruby-progressbar (1.11.0)
217 | rubyzip (2.3.0)
218 | sass-rails (6.0.0)
219 | sassc-rails (~> 2.1, >= 2.1.1)
220 | sassc (2.4.0)
221 | ffi (~> 1.9)
222 | sassc-rails (2.1.2)
223 | railties (>= 4.0.0)
224 | sassc (>= 2.0)
225 | sprockets (> 3.0)
226 | sprockets-rails
227 | tilt
228 | selenium-webdriver (3.142.7)
229 | childprocess (>= 0.5, < 4.0)
230 | rubyzip (>= 1.2.2)
231 | spring (2.1.1)
232 | spring-watcher-listen (2.0.1)
233 | listen (>= 2.7, < 4.0)
234 | spring (>= 1.2, < 3.0)
235 | sprockets (4.0.2)
236 | concurrent-ruby (~> 1.0)
237 | rack (> 1, < 3)
238 | sprockets-rails (3.2.2)
239 | actionpack (>= 4.0)
240 | activesupport (>= 4.0)
241 | sprockets (>= 3.0.0)
242 | thor (1.1.0)
243 | thread_safe (0.3.6)
244 | tilt (2.0.10)
245 | turbolinks (5.2.1)
246 | turbolinks-source (~> 5.2)
247 | turbolinks-source (5.2.0)
248 | tzinfo (1.2.9)
249 | thread_safe (~> 0.1)
250 | unf (0.1.4)
251 | unf_ext
252 | unf_ext (0.0.7.7)
253 | unicode-display_width (1.7.0)
254 | warden (1.2.9)
255 | rack (>= 2.0.9)
256 | web-console (4.1.0)
257 | actionview (>= 6.0.0)
258 | activemodel (>= 6.0.0)
259 | bindex (>= 0.4.0)
260 | railties (>= 6.0.0)
261 | webdrivers (4.5.0)
262 | nokogiri (~> 1.6)
263 | rubyzip (>= 1.3.0)
264 | selenium-webdriver (>= 3.0, < 4.0)
265 | webpacker (4.3.0)
266 | activesupport (>= 4.2)
267 | rack-proxy (>= 0.6.1)
268 | railties (>= 4.2)
269 | websocket-driver (0.7.3)
270 | websocket-extensions (>= 0.1.0)
271 | websocket-extensions (0.1.5)
272 | xpath (3.2.0)
273 | nokogiri (~> 1.8)
274 | zeitwerk (2.4.2)
275 |
276 | PLATFORMS
277 | x86_64-linux
278 |
279 | DEPENDENCIES
280 | bootsnap (>= 1.4.2)
281 | bootstrap
282 | byebug
283 | capybara
284 | cloudinary
285 | devise
286 | devise-bootstrap-views (~> 1.0)
287 | hirb
288 | jbuilder (~> 2.7)
289 | listen (~> 3.2)
290 | pg (>= 0.18, < 2.0)
291 | puma (~> 4.1)
292 | rails (~> 6.0.3, >= 6.0.3.4)
293 | rake
294 | rspec-rails
295 | rubocop (~> 0.81.0)
296 | sass-rails (>= 6)
297 | selenium-webdriver
298 | spring
299 | spring-watcher-listen (~> 2.0.0)
300 | turbolinks (~> 5)
301 | tzinfo-data
302 | web-console (>= 3.3.0)
303 | webdrivers
304 | webpacker (~> 4.0)
305 |
306 | RUBY VERSION
307 | ruby 3.0.0p0
308 |
309 | BUNDLED WITH
310 | 2.2.9
311 |
--------------------------------------------------------------------------------
/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 = 'a9701164f000d6967fdc3cd18747b3a80aef63ed0d2ddeccfa90ba4b839116415c91b944c539517ca845e9c8bae46c421af9346dbf2a1456ba751e41cb8e68ca'
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 = 'dcac4cebddb3822655b9e4196692d5f2f522084b25848d3fde12786d902452897d747ad173afd741e6add625e0b25501702a9d532994b31b469a7e5f5b24f3d8'
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 |
--------------------------------------------------------------------------------