Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Problem customizing tenant identifier in image paths #18

Open
MarkMT opened this issue Feb 28, 2016 · 0 comments
Open

Problem customizing tenant identifier in image paths #18

MarkMT opened this issue Feb 28, 2016 · 0 comments

Comments

@MarkMT
Copy link

MarkMT commented Feb 28, 2016

The README states the following regarding customizing the tenant identifier:

By default tenant will resolve to Apartment::Tenant.current_tenant but you can change it - eg. suppose you use databases like tenant_12345 and only want tenant id in file path, then add following line to config/initializers/apartment.rb

Spree::Image.tenant_proc = -> { Apartment::Tenant.current_tenant.match(/(\d+)/)[1] }

However in practice I don't think this works as the tenant_proc method is not defined until the engine's activate method is called, which doesn't seem to occur until after the initializers have been run.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant