Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slugs do not initialize #177

Closed
vanboom opened this issue Nov 12, 2014 · 6 comments
Closed

Slugs do not initialize #177

vanboom opened this issue Nov 12, 2014 · 6 comments

Comments

@vanboom
Copy link

vanboom commented Nov 12, 2014

When mongoid-slug is added to an existing application, the Model.slugs field is blank until every document is re-saved.

Suggestion: have a rake task or some default logic in mongoid-slug that will handle this initial case. Applications with large data sets that have business logic around "updated_at" may not want to re-save each instance to get the slug behavior.

Thanks!

@digitalplaywright
Copy link
Collaborator

That would be a great addition to the wiki. Maybe something could be based around the migration document? Especially the slow migration template.

@pencilcheck
Copy link

Yea, would be nice to have it generated initially for existing documents, was confused why it didn't work.
👍

@tbbooher
Copy link

agreed, at least for me . . . very grateful for this issue.

@anuja-joshi
Copy link
Contributor

@digitalplaywright I am looking into this issue and wrote a rake task that will set slug for existing records, to load this task into Rails we need to use Rails::Railtie, that will be Rails specific. Do you want this task to support any other frameworks ?

@simi
Copy link
Contributor

simi commented Oct 18, 2015

@anuja-joshi You can add just task file and inform users to load that rake tasks file into their rake stack.

anuja-joshi pushed a commit to joshsoftware/mongoid-slug that referenced this issue Nov 3, 2015
anuja-joshi pushed a commit to joshsoftware/mongoid-slug that referenced this issue Nov 3, 2015
anuja-joshi pushed a commit to joshsoftware/mongoid-slug that referenced this issue Nov 3, 2015
anuja-joshi pushed a commit to joshsoftware/mongoid-slug that referenced this issue Nov 4, 2015
… cases

refs mongoid#177 RuboCop fixes

updated README and removed class variable
anuja-joshi pushed a commit to joshsoftware/mongoid-slug that referenced this issue Nov 4, 2015
… cases

refs mongoid#177 RuboCop fixes

updated README and removed class variable

updated test cases
anuja-joshi pushed a commit to joshsoftware/mongoid-slug that referenced this issue Dec 16, 2015
… cases

refs mongoid#177 RuboCop fixes

updated README and removed class variable

updated test cases
anuja-joshi pushed a commit to joshsoftware/mongoid-slug that referenced this issue Jan 21, 2016
@dblock dblock closed this as completed in 8abb60d Jan 21, 2016
@dblock
Copy link
Collaborator

dblock commented Jan 21, 2016

A rake task was added in 8abb60d.

anujaware pushed a commit to joshsoftware/mongoid-slug that referenced this issue Feb 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants