Skip to content

Commit

Permalink
Add validation to ensure > 10% unused space
Browse files Browse the repository at this point in the history
  • Loading branch information
mbklein committed Nov 22, 2013
1 parent 57fcf92 commit ecbb3a9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/avalon/about/matterhorn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class Matterhorn < AboutPage::Configuration::Node
end
}
end
validates_each :storage do |record, attr, value|
if record.storage['percentage_free'] < 10
record.errors.add attr, "#{record.storage['percentage_free']}% free"
end
end

def initialize(rubyhorn)
@rubyhorn = rubyhorn
Expand Down

0 comments on commit ecbb3a9

Please sign in to comment.