Skip to content

Instantly share code, notes, and snippets.

@Sporky023
Created February 24, 2012 19:17
Show Gist options
  • Save Sporky023/1903084 to your computer and use it in GitHub Desktop.
Save Sporky023/1903084 to your computer and use it in GitHub Desktop.
def can_compute_performance?(start_date, end_date)
- !checking? && (balances.count(:select => 'distinct period', :conditions => { :period => (start_date..end_date)}) > 1)
+ has_at_least_one_period = balances.count(
+ :select => 'distinct period',
+ :conditions => {:period => (start_date..end_date)}
+ ) > 1
+ is_not_checking = !checking?
+
+ is_not_checking && has_at_least_one_period
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment