Module Channelify
In: app/models/channelify.rb

Methods

Attributes

channels  [RW] 
tree  [RW] 

Public Instance methods

[Source]

    # File app/models/channelify.rb, line 21
21:   def department_channel(dept)
22:     (@channels.present? && dept.present?) ? @channels.detect {|ch| ch.tag_list.include?(dept.tag_name)} : nil
23:   end

[Source]

    # File app/models/channelify.rb, line 5
 5:   def department_channels
 6:     unless @department_channels
 7:       dept_tags = Department.tag_names
 8:       @department_channels = self.channels.map {|c| c if (c.tag_list & dept_tags).length > 0}.compact
 9:     end
10:     @department_channels
11:   end

[Source]

    # File app/models/channelify.rb, line 17
17:   def departments
18:     Department.find(:all, :order => 'internal_id')
19:   end

[Source]

    # File app/models/channelify.rb, line 13
13:   def other_channels
14:     @other_channels ||= self.channels - self.department_channels
15:   end

[Validate]