Class: Effective::Permalink

Inherits:
ApplicationRecord
  • Object
show all
Includes:
PgSearch::Model
Defined in:
app/models/effective/permalink.rb

Instance Method Summary collapse

Instance Method Details

#redirect_pathObject



48
49
50
# File 'app/models/effective/permalink.rb', line 48

def redirect_path
  "/link/#{slug}"
end

#targetObject



52
53
54
# File 'app/models/effective/permalink.rb', line 52

def target
  url.present? ? :url : :attachment
end

#to_sObject



44
45
46
# File 'app/models/effective/permalink.rb', line 44

def to_s
  title.presence || model_name.human
end