Skip to content

generate Paperclip urls with data provided via Elastic search #586

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

Closed
wants to merge 1 commit into from

Conversation

equivalent
Copy link
Contributor

@equivalent equivalent commented Jun 30, 2016

instructions how to render Paperclip urls without ActiveRecord calls

Based on this article: http://www.eq8.eu/blogs/26-rendering-paperclip-url-via-elasticsearch-without-making-calls-to-activerecord-db

...closed the old PR and reopening it in order to retriger CLA github hook

@equivalent
Copy link
Contributor Author

@karmi any feedback on this PR ?

karmi added a commit that referenced this pull request Feb 11, 2017
…associations

The example did a good job for demonstrating how to set up relationships between
models and how to index the "core" model, but it didn't really demonstrated
the difference between the `records` and `results` of the response.

Related: #586
@karmi
Copy link
Contributor

karmi commented Feb 11, 2017

Hi Tomas, apologies for the lack of feedback on this patch as well!

I've been thinking about it, and while I understand the general motivation of what you're trying to demonstrate, I'm worried that the focus of this example is not clear enough.

First, I'm worried that people see "paperclip" in the example name and get an idea that it will show how to handle attachments, only to be frustrated later, because it doesn't :)

Second, if all we're trying to demonstrate here is that it's frequently best to work with the data loaded from Elasticsearch, the activerecord_associations.rb should be the place to do that. I've expanded this example in the attached commit (a086ded). Can you look at it and ping me back if you think it's more or less what you had in mind? Maybe we can either further expand the "associaton" example, or work on the "paperclip" example to cover more features in a clear way.

@equivalent
Copy link
Contributor Author

hi @karmi ,

sorry I didn't get back sooner,

basically my aim is to demonstrate how to render the paperclip (or Carrierwave doesn't really matter) image url without touching relational database.
My only motivation for this PR was that I wrote that blog post where I demonstrate how to do this and I told myself: I may as well just create PR here :)

back to your points:

1 yes, fully agree. It's hard to explain that this is just for "view" only in one file. Therefore for sake not to cause confusion I'm ok to close this PR

2 pretty much yes, I understand you are trying to explain general principle so that people understand how to approach this type of data where as my PR was just Copy - Paste - Edit solution for the lazy ones :)

so I'm ok to close this PR

@tylerjl tylerjl closed this Apr 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants