-
Notifications
You must be signed in to change notification settings - Fork 67
Incompatibilities with "service_id" as a column name #36
Comments
I'm running into the same issue. Any idea when this will be resolved? I would recommend renaming |
Also, what is the purpose of defining these methods on the Model? If you don't need to override the global And in what scenario would you need to override the global |
Hi, Sorry for the delay in getting to this issue. It's definitely something to resolve. As a simple measure, we will rename this attribute to be much more unique. That should remove the 99% of collision.
The customer id and service id represent two separate things. In the relational sense, a customer has many services.
In order to perform surrogate-key purging, you need access to that particular Fastly service's unique identifier. The particular concept of this plugin was to provide simple capabilities to allow easy edge caching and purging at the model level in Rails applications. Depending on the purpose of your application and your usage of Fastly, you may want to be able map models to different Fastly services. If you are interested in more information on all the different Fastly features, definitely check out https://docs.fastly.com/, or get in touch with us, we'd be happy to help. It's possible there's another implementation that could totally rid us of worrying about collision in any scenario, but it would probably take a bit more rethinking, and renaming seems a lot simpler and easy to resolve the issue at hand. Thanks again for pointing this issue out. |
Thanks for the explanation, and the fix! I totally missed that the Customer ID and Service ID are different. Makes sense. Perhaps it would help to add a link to this FAQ in this repo's Readme, and/or add a label for "Service ID" on the Fastly website to make it clearer. |
At the moment, this gem isn't compatible with any rails application that has a table with a column named "service_id".
It throws
My application has a table with a column name of "service_id", so this is problematic.
The text was updated successfully, but these errors were encountered: