In the docs, there is an example of using lambdas with the store_in macro:
store_in database: ->
However, it does not work as expected:
Thread.current[:database] = 'first'
Band.database_name #=> :first
Thread.current[:database] = 'second'
Band.database_name #=> :first (when :second is expected)
I believe this is because #database_name memoizes the name when it is called for the first time.
Same thing happens for #collection_name as well.