Class: Effective::BannerAd
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Effective::BannerAd
- Defined in:
- app/models/effective/banner_ad.rb
Instance Method Summary collapse
Instance Method Details
#redirect_path ⇒ Object
47 48 49 |
# File 'app/models/effective/banner_ad.rb', line 47 def redirect_path "/ad/#{slug}" if url.present? end |
#to_s ⇒ Object
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 |