You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Company model, with fields name and slug:
class Company < ActiveRecord::Base
acts_as_url :name, url_attribute: :slug
end
For new records, the gem converts asian characters to phonetic letters fine. Now I'm just trying to do the same for all of the existing records in our database.
For example here's one existing record we want to fix the slug for:
After running the initialize_urls method, I expect the slug to be updated with the phonetic letters, but they don't change.
Here's the rake task that starts off the process:
# Rake task that iterates through all of the Companies in the database
# and regenerates their slug values from their name attribute.
task regenerate_company_slugs: :environment do
Company.initialize_urls
end
The text was updated successfully, but these errors were encountered:
what do you think about having another method do this functionality. initialize [to me] is the right term here as it's [to me] stating it will set one if not set. thoughts?
I have a Company model, with fields name and slug:
For new records, the gem converts asian characters to phonetic letters fine. Now I'm just trying to do the same for all of the existing records in our database.
For example here's one existing record we want to fix the slug for:
After running the
initialize_urls
method, I expect the slug to be updated with the phonetic letters, but they don't change.Here's the rake task that starts off the process:
The text was updated successfully, but these errors were encountered: