Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #855 from Charcoal-SE/Mak-combined-fix-for-mimemag…
Browse files Browse the repository at this point in the history
…ic-issue

Combined fix for Mimemagic issue
  • Loading branch information
makyen committed Apr 13, 2021
2 parents e352bc0 + d3e63da commit 223cea4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/ci.yml
Expand Up @@ -22,6 +22,10 @@ on:
env:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
# The actions/cache holds old cache entries for 7 days and has no method of invalidating entries.
# The only thing that can be done is to change the key value to force the cache to miss.
# The ACTION_CACHE_VERSION is just a value to change if we don't want to use previously cached data.
ACTION_CACHE_VERSION: cache_version_1

jobs:
rubocop:
Expand All @@ -39,9 +43,9 @@ jobs:
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
key: ${{ runner.os }}-gems-${{ env.ACTION_CACHE_VERSION }}-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
${{ runner.os }}-gems-${{ env.ACTION_CACHE_VERSION }}-
- name: Install dependencies
run: |
sudo apt-get install libsqlite3-dev
Expand Down Expand Up @@ -88,21 +92,24 @@ jobs:
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
key: ${{ runner.os }}-gems-${{ env.ACTION_CACHE_VERSION }}-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
${{ runner.os }}-gems-${{ env.ACTION_CACHE_VERSION }}-
- name: Cache yarn packages
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-yarn-${{ hashFiles('**/Gemfile.lock') }}
key: ${{ runner.os }}-node-modules-yarn-${{ env.ACTION_CACHE_VERSION }}-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-node-modules-yarn-
${{ runner.os }}-node-modules-yarn-${{ env.ACTION_CACHE_VERSION }}-
- name: Install dependencies
run: |
sudo apt-get install libsqlite3-dev
bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
yarn install
- name: Start MySQL
run: |
sudo systemctl start mysql.service
- name: Configure
run: |
mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
Expand All @@ -112,7 +119,7 @@ jobs:
database: metasmoke_test
username: root
password: root
host: 127.0.0.1
host: localhost
port: ${{ job.services.mysql.ports['3306'] }}
' > config/database.yml
mkdir -p config && echo 'test:
Expand Down Expand Up @@ -151,9 +158,9 @@ jobs:
- uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-npm-${{ hashFiles('**/Gemfile.lock') }}
key: ${{ runner.os }}-node-modules-npm-${{ env.ACTION_CACHE_VERSION }}-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-node-modules-npm-
${{ runner.os }}-node-modules-npm-${{ env.ACTION_CACHE_VERSION }}-
- run: ls
- name: Install dependencies
run: npm install
Expand Down
4 changes: 3 additions & 1 deletion Gemfile.lock
Expand Up @@ -243,7 +243,9 @@ GEM
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.0512)
mimemagic (0.3.5)
mimemagic (0.3.10)
nokogiri (~> 1)
rake
mini_mime (1.0.2)
mini_portile2 (2.5.0)
minitest (5.14.2)
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/application_controller.rb
Expand Up @@ -145,7 +145,7 @@ def location_storable?
request.get? && is_navigational_format? && !devise_controller? && !request.xhr?
end

def after_sign_in_path_for(resource)
stored_location_for(resource) || super
def store_user_location!
store_location_for(:user, request.fullpath)
end
end

0 comments on commit 223cea4

Please sign in to comment.