From f8c895f8eb93b2e818485085f232fe30a179805e Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Sun, 3 Mar 2013 12:37:08 +1100 Subject: Extract method that knows who can update the state of a request --- lib/ability.rb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 lib/ability.rb (limited to 'lib/ability.rb') diff --git a/lib/ability.rb b/lib/ability.rb new file mode 100644 index 000000000..2865ccb1c --- /dev/null +++ b/lib/ability.rb @@ -0,0 +1,5 @@ +module Ability + def self.can_update_request_state?(user, request) + (user && request.is_old_unclassified?) || request.is_owning_user?(user) + end +end \ No newline at end of file -- cgit v1.2.3