Skip to content

Instantly share code, notes, and snippets.

@agungsetiawan
Created March 18, 2020 14:53
Show Gist options
  • Save agungsetiawan/d8d248d8bec7d904f6faab39f04d7b0b to your computer and use it in GitHub Desktop.
Save agungsetiawan/d8d248d8bec7d904f6faab39f04d7b0b to your computer and use it in GitHub Desktop.
class AssetType < ApplicationRecord
has_many :asset_inventories
#some codes omitted
def accuracy_status
if accuracy > 100
'warning'
elsif accuracy >= 80 && accuracy <= 100
'success'
else accuracy < 80
'danger'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment