ankane / ahoy

Simple, powerful, first-party analytics for Rails
MIT License
4.23k stars 377 forks source link

Introduce `Ahoy::Tracker#with_store` to temporarily swap stores #545

Closed seanpdoyle closed 11 months ago

seanpdoyle commented 11 months ago

To temporarily switch to another store, call ahoy.with_store(store_class, &block):

ahoy.with_store Ahoy::CustomStore do |custom_store|
  # use a different store
end
ankane commented 11 months ago

Hi @seanpdoyle, thanks for the PR. However, I don't think it's common enough to add.