module Permalinkable::InstanceMethods

Public Instance Methods

to_param() click to toggle source
# File lib/permalinkable/permalinkable.rb, line 31
def to_param
  existing_permalink = send(permalink_options[:permalink_field_name])
  (existing_permalink.present? && existing_permalink) || id.to_s
end

Private Instance Methods

fpe() click to toggle source
# File lib/permalinkable/permalinkable.rb, line 51
def fpe
  @fpe ||= Base64.urlsafe_encode64(self.class.permalink_cipher.update('%11s' % self.id))
end