Closed tobinibot closed 8 years ago
@sorentwo I added some the additional :expires_in
expansion code into the merged_options
method, it seemed like a good spot because this method is called for each method that takes options. Let me know if you don’t like this approach.
Ok, let me rethink this whole thing. It was mostly a convenience for new users anyways. Just thought it might be nice since other stores (well, at least the default mem_store
) can handle those Duration
objects. Calling to_i
myself is not a problem.
I’ll reopen something if I come up with something that I'm happy with and we can continue the discussion. Thanks, this has been informative and fun!
When configuring readthis, it would be nice to be able to pass in
ActiveSupport::Duration
objects as the:expires_in
parameter, without having to manually call theto_i
method on them.This PR adds the ability to use objects that respond to the
to_i
method as the:expires_in
parameter. As stated above, this is mainly to supportActiveSupport::Duration
objects, but there could obviously be many other uses.