Module: FileContainer

Defined in:
app/models/file_container.rb

Defined Under Namespace

Modules: Associations

Class Method Summary collapse

Class Method Details

.allObject



16
17
18
# File 'app/models/file_container.rb', line 16

def self.all
  @all ||= types.map{|t| t.where(1)} # lazy load :all of each type
end

.included(base) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'app/models/file_container.rb', line 6

def self.included(base)
  return if @@types.include?(base)
  
  @@types << base

  base.instance_eval do
    include Associations
  end
end