Skip to content

Commit

Permalink
Lint a random file (#3022)
Browse files Browse the repository at this point in the history
* lint a random file

* don't use such a long line

---------

Co-authored-by: Jeff Ohrstrom <johrstrom@osc.edu>
  • Loading branch information
osc-bot and johrstrom authored Sep 11, 2023
1 parent bdb704b commit d6f8b1c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/dashboard/app/models/usr_product.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# frozen_string_literal: true

# A Product class for shard (usr) apps.
class UsrProduct < Product
validate :assets_exist, on: :show_app, if: :passenger_rails_app?

def assets_exist
errors.add(:base, "Build missing assets with <strong>Precompile Assets</strong>") unless router.path.join("public", "assets").directory?
return if router.path.join('public', 'assets').directory?

errors.add(:base, 'Build missing assets with <strong>Precompile Assets</strong>')
end

class << self
def all
router.apps.map {|a| new(name: a.name, found: true)}
router.apps.map { |a| new(name: a.name, found: true) }
end

def find(name)
raise Product::NotFound unless router.new(name).path.exist?

new(name: name, found: true)
end

Expand Down

0 comments on commit d6f8b1c

Please sign in to comment.