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

#published?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'app/models/effective/permalink.rb', line 56

def published?
  true
end

#redirect_pathObject



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

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

#targetObject



60
61
62
# File 'app/models/effective/permalink.rb', line 60

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

#to_sObject



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

def to_s
  title.presence || model_name.human
end