Skip to content

Commit

Permalink
Added data model class
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Youch committed Nov 4, 2010
1 parent 0b3fb77 commit 48ffc1e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/models/market_segment.rb
Expand Up @@ -123,6 +123,21 @@ def self.push_everyone_segment
MarketSegment.first(:conditions => {:segment_type => 'everyone'}) || MarketSegment.create(:name => 'Everyone', :segment_type => 'everyone', :options => {})
end

def data_model_class
case self.segment_type
when 'subscription'
UserSubscriptionEntry
when 'user_segment'
EndUser
when 'everyone'
EndUser
when 'content_model'
self.content_model.content_model
else
nil
end
end

private

def subscription_target_count(options={})
Expand Down

0 comments on commit 48ffc1e

Please sign in to comment.