Skip to content

Commit

Permalink
added usable model
Browse files Browse the repository at this point in the history
  • Loading branch information
Crunch09 committed Mar 24, 2013
1 parent a474aa6 commit 73788f3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/models/usable.rb
Original file line number Diff line number Diff line change
@@ -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.