Skip to content

Commit 1f9a808

Browse files
committed
Run app:update to implement version changes (6.0 -> 6.1.7)
1 parent e5532a6 commit 1f9a808

27 files changed

+324
-68
lines changed

app/controllers/admin_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def get_user
3434
def update_user
3535
user = User.find_by_id(params[:admin_id])
3636
if user
37-
user.update_attributes(user_params.reject { |k| k == ("password" || "password_confirmation") })
37+
user.update(user_params.reject { |k| k == ("password" || "password_confirmation") })
3838
pass = params[:user][:password]
3939
user.password = pass if !(pass.blank?)
4040
user.save!

app/controllers/application_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ApplicationController < ActionController::Base
1010

1111
# Update: this became default behaviour from Rails 5, so we need to
1212
# disable it until we figure out how to implement properly:
13-
# skip_before_action :verify_authenticity_token
13+
skip_before_action :verify_authenticity_token
1414

1515
private
1616

app/controllers/users_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def update
2929
user = User.where("id = '#{params[:user][:id]}'")[0]
3030

3131
if user
32-
user.update_attributes(user_params_without_password)
32+
user.update(user_params_without_password)
3333
if params[:user][:password].present? && (params[:user][:password] == params[:user][:password_confirmation])
3434
user.password = params[:user][:password]
3535
end

bin/rails

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env ruby
22
APP_PATH = File.expand_path('../config/application', __dir__)
3-
require_relative '../config/boot'
4-
require 'rails/commands'
3+
require_relative "../config/boot"
4+
require "rails/commands"

bin/rake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env ruby
2-
require_relative '../config/boot'
3-
require 'rake'
2+
require_relative "../config/boot"
3+
require "rake"
44
Rake.application.run

bin/setup

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env ruby
2-
require 'fileutils'
3-
include FileUtils
2+
require "fileutils"
43

54
# path to your application root.
65
APP_ROOT = File.expand_path('..', __dir__)
@@ -9,24 +8,25 @@ def system!(*args)
98
system(*args) || abort("\n== Command #{args} failed ==")
109
end
1110

12-
chdir APP_ROOT do
13-
# This script is a starting point to setup your application.
11+
FileUtils.chdir APP_ROOT do
12+
# This script is a way to set up or update your development environment automatically.
13+
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
1414
# Add necessary setup steps to this file.
1515

1616
puts '== Installing dependencies =='
1717
system! 'gem install bundler --conservative'
1818
system('bundle check') || system!('bundle install')
1919

20-
# Install JavaScript dependencies if using Yarn
21-
# system('bin/yarn')
20+
# Install JavaScript dependencies
21+
system! 'bin/yarn'
2222

2323
# puts "\n== Copying sample files =="
2424
# unless File.exist?('config/database.yml')
25-
# cp 'config/database.yml.sample', 'config/database.yml'
25+
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
2626
# end
2727

2828
puts "\n== Preparing database =="
29-
system! 'bin/rails db:setup'
29+
system! 'bin/rails db:reset'
3030

3131
puts "\n== Removing old logs and tempfiles =="
3232
system! 'bin/rails log:clear tmp:clear'

bin/yarn

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
#!/usr/bin/env ruby
22
APP_ROOT = File.expand_path('..', __dir__)
33
Dir.chdir(APP_ROOT) do
4-
begin
5-
exec "yarnpkg", *ARGV
6-
rescue Errno::ENOENT
4+
yarn = ENV["PATH"].split(File::PATH_SEPARATOR).
5+
select { |dir| File.expand_path(dir) != __dir__ }.
6+
product(["yarn", "yarn.cmd", "yarn.ps1"]).
7+
map { |dir, file| File.expand_path(file, dir) }.
8+
find { |file| File.executable?(file) }
9+
10+
if yarn
11+
exec yarn, *ARGV
12+
else
713
$stderr.puts "Yarn executable was not detected in the system."
814
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
915
exit 1

config.ru

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# frozen_string_literal: true
21
# This file is used by Rack-based servers to start the application.
32

4-
require ::File.expand_path("../config/environment", __FILE__)
3+
require_relative "config/environment"
4+
55
run Rails.application
6+
Rails.application.load_server

config/application.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ class Application < Rails::Application
1212
# Initialize configuration defaults for originally generated Rails version.
1313
config.load_defaults 5.2
1414

15-
# Settings in config/environments/* take precedence over those specified here.
16-
# Application configuration can go into files in config/initializers
17-
# -- all .rb files in that directory are automatically loaded after loading
18-
# the framework and any gems in your application.
15+
# Configuration for the application, engines, and railties goes here.
16+
# These settings can be overridden in specific environments using the files
17+
# in config/environments, which are processed later.
1918

2019
# RAILSGOAT SPECIFC CONFIGURATION
2120
# Disable changes to actve_record belongs_to which breaks associations in RailsGoat from 5 onwards
@@ -25,5 +24,8 @@ class Application < Rails::Application
2524
config.action_controller.per_form_csrf_tokens = false
2625

2726
config.action_dispatch.return_only_media_type_on_content_type = false
27+
28+
# config.time_zone = "Central Time (US & Canada)"
29+
# config.eager_load_paths << Rails.root.join("extras")
2830
end
2931
end

config/boot.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
22

3-
require 'bundler/setup' # Set up gems listed in the Gemfile.
4-
require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
3+
require "bundler/setup" # Set up gems listed in the Gemfile.
4+
require "bootsnap/setup" # Speed up boot time by caching expensive operations.

0 commit comments

Comments
 (0)