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



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

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

#targetObject



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

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

#to_sObject



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

def to_s
  title.presence || model_name.human
end