Merge pull request #10138 from opf/fix/zeitwerk-check

Add zeitwerk:check action runner
pull/10141/head
Oliver Günther 3 years ago committed by GitHub
commit 6bdfb2e381
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/workflows/test-core.yml
  2. 1
      docker/ci/entrypoint.sh
  3. 6
      modules/budgets/lib/budgets/hooks/work_package_hook.rb
  4. 20
      modules/reporting/lib/open_project/reporting/patches/big_decimal_patch.rb

@ -80,6 +80,8 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- uses: actions/setup-node@v2
with:
node-version: '14'

@ -57,6 +57,7 @@ fi
if [ "$1" == "run-units" ]; then
shift
execute "time bundle exec rake zeitwerk:check"
execute "cd frontend && npm install && npm run test"
execute "time bundle exec rspec -I spec_legacy spec_legacy"
if ! execute "time bundle exec rake parallel:units" ; then

@ -26,7 +26,9 @@
# See COPYRIGHT and LICENSE files for more details.
#++
class Budgets::Hooks::WorkPackageHook < OpenProject::Hook::ViewListener
module Budgets
module Hooks
class WorkPackageHook < ::OpenProject::Hook::ViewListener
# Updates the cost object after a move
#
# Context:
@ -71,3 +73,5 @@ class Budgets::Hooks::WorkPackageHook < OpenProject::Hook::ViewListener
''
end
end
end
end

@ -26,13 +26,20 @@
# See COPYRIGHT and LICENSE files for more details.
#++
module OpenProject::Reporting::Patches::BigDecimalPatch
module OpenProject
module Reporting
module Patches
module BigDecimalPatch
class BigDecimal
def to_d; self end
def to_d
self
end
end
class Integer
def to_d; to_f.to_d end
def to_d
to_f.to_d
end
end
class String
@ -42,6 +49,11 @@ module OpenProject::Reporting::Patches::BigDecimalPatch
end
class NilClass
def to_d; 0 end
def to_d
0
end
end
end
end
end
end

Loading…
Cancel
Save