Skip to content

Commit

Permalink
Use the content model field display for output
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Youch committed Aug 5, 2010
1 parent 3b72a97 commit fb7571f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/models/content_model_segment_field.rb
Expand Up @@ -84,10 +84,15 @@ def self.field_heading(field)
end

def self.get_handler_data(ids, fields)
self.content_model.content_model.find(:all, :conditions => {self.end_user_field => ids}).index_by(&self.end_user_field)
self.content_model.content_model.find(:all, :conditions => {self.end_user_field => ids}).group_by(&self.end_user_field)
end

def self.field_output(user, handler_data, field)
UserSegment::FieldType.field_output(user, handler_data, field)
info = UserSegment::FieldHandler.display_fields[field]
return unless info
display_field = info[:display_field]
handler_data[user.id].collect do |data|
self.content_model.field(display_field).content_display(data, :excerpt)
end.join(', ')
end
end

0 comments on commit fb7571f

Please sign in to comment.