Class: Effective::BannerAd

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/effective/banner_ad.rb

Instance Method Summary collapse

Instance Method Details

#redirect_pathObject



47
48
49
# File 'app/models/effective/banner_ad.rb', line 47

def redirect_path
  "/ad/#{slug}" if url.present?
end

#to_sObject



43
44
45
# File 'app/models/effective/banner_ad.rb', line 43

def to_s
  name.presence || model_name.human
end

#track!(action: 'click', user: nil, details: nil) ⇒ Object



51
52
53
# File 'app/models/effective/banner_ad.rb', line 51

def track!(action: 'click', user: nil, details: nil)
  tracks.create!(action: action, user: user, details: details)
end