Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/friendly_id/history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ module FriendlyId
# end
# end
# end
#
# ### Dependent
#
# This module adds a polymorphic `has_many :slugs, ...` association to the model class.
# By default slugs will be destroyed when the record is destroyed.
# You can change this behavior with the `dependent` configuration option in
# `initializers/friendly_id.rb`.
#
# @guide end
module History
Expand Down
12 changes: 12 additions & 0 deletions lib/friendly_id/initializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,16 @@
# text.to_slug.normalize! :transliterations => [:russian, :latin]
# end
# }
#
# FriendlyId's history module adds a polymorphic `has_many :slugs, ...` association
# to the model. By default slugs will be destroyed when the record is destroyed.
#
# To disable this use `false`. Other options include:
# - :delete
# - :destroy_async
# - :nullify
# - :restrict_with_exception
# - :restrict_with_error
#
# config.dependent :destroy
end