Skip to content

Instantly share code, notes, and snippets.

@paul
Created December 3, 2010 00:25
Show Gist options
  • Save paul/726371 to your computer and use it in GitHub Desktop.
Save paul/726371 to your computer and use it in GitHub Desktop.
class Escalation
scope :active, where(:current_escalation_state_id => EscalationState.active)
def self.visible_to(account)
where(:escalation_definition_id => EscalationDefinition.visible_to(account))
end
end
__END__
[Test]>> Escalation.visible_to(a).active.class
=> ActiveRecord::Relation
[Test]>> Escalation.active.visible_to(a).class
=> Array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment