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

Adding support for static and dynamic collections #33

Closed
wants to merge 1 commit into from

Conversation

@wesg
Copy link

commented May 8, 2012

Adding support for static and dynamic collections. (Dynamic collections can call a method to get a URL from each object in the collection - keeps things DRY)

Background - I've been using Big_sitemap for generating a sitemap dynamically, passing in collections returned by scope, and then calling a method to get the URL for that object instance. Different models have slightly different methods to call for vanity URLs (and some classes have multiple methods for different URLs).

Building a sitemap this way using blocks in the BigSitemap.generate() block was getting a bit messy so I reopened the BigSitemap class and added a couple of methods to DRY things up ........ submitting the pull request as I think other may find it useful - I'm prepared to tweak, incorporate feedback and try a second explanation in the README if it's not clear enough.

Regards,
Wesley
@wesg

Adding support for static and dynamic collections. (Dynamic collectio…
…ns can call a method to get a URL from each object in the collection - keeps things DRY).
@wesg

This comment has been minimized.

Copy link
Author

commented Feb 3, 2013

Hi @alexrabarts - any feedback on this commit?

@alexrabarts

This comment has been minimized.

Copy link
Owner

commented Feb 6, 2013

Hi @wesg, sorry for the late response - this project has taken somewhat of a backseat to massive_sitemap. I like the idea of being able to handle static collections. It might make sense to include this into the add method, rather than adding a new method.

I was trying to remove logic that required passing method names around - hence the deprecation of the find_method option and moving to the block syntax. I'm not hugely keen on adding this back in. Also, I'm guessing most people won't have a method on their models that return the record's URL.

@wesg

This comment has been minimized.

Copy link
Author

commented Feb 6, 2013

Thanks for the feedback @alexrabarts - hadn't seen massive_sitemap. I might rework my pull request according to your feedback, resubmit and then see if there's anything useful from it that might be of benefit in massive_sitemap.

@wesg wesg closed this Aug 16, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.