Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: d34d247590
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (23 sloc) 0.669 kB
# Run with script/rails runner run_test.rb
def show_friendly_id_slugs
FriendlyId::Slug.all.each do |s|
puts s.inspect
end
puts "---------------------\n\n"
end
# Start from scratch.
Tag.delete_all
FriendlyId::Slug.delete_all
puts 'Creating new tag. Will save in friendly_id_slugs.'
t = Tag.create(:name => 'Tag_first')
show_friendly_id_slugs
puts 'Updating tag. Will not update in friendly_id_slugs.'
t = Tag.first
t.name = 'Tag_first_changed'
t.save
show_friendly_id_slugs
puts 'Deleting friendly_id_slugs in order to rebuild the slugs. Will not create entry in friendly_id_slugs.'
FriendlyId::Slug.delete_all
t = Tag.last
t.save
show_friendly_id_slugs
Jump to Line
Something went wrong with that request. Please try again.