Skip to content
Browse files

added usable model

  • Loading branch information...
1 parent a474aa6 commit 73788f3d483b9e79fb104fb5af9a3fd36ceb879b @Crunch09 committed Mar 24, 2013
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/models/usable.rb
View
12 lib/models/usable.rb
@@ -0,0 +1,12 @@
+class Usable
+
+ attr_accessor :usables
+
+ def self.all
+ return @usables unless @usables.nil?
+ combined = Refinery::Reports::Vehicle.all + Refinery::Reports::Person.all
+ hsh = combined.group_by{|u| u.department.intern? ? 'intern' : 'extern'}
+ @usables = hsh.each{|k,v| hsh[k] = v.group_by{|r| r.department.name}}
+ @usables
+ end
+end

0 comments on commit 73788f3

Please sign in to comment.
Something went wrong with that request. Please try again.