stringex icon indicating copy to clipboard operation
stringex copied to clipboard

Add support for nil scope values (such as deleted_at), with unit test

Open masonhale opened this issue 8 years ago • 0 comments

Current scope implementation fails if one or more of the scope attribute values is nil.

One may want to use nullable values as scope parameters when using stringex/acts_as_url in combination with a 'soft-delete' solution such as https://github.com/JackDanger/permanent_records

In this case, 'live' records will have a nil value for the deleted_at column, but deleted records will have a specific value. By including the deleted_at column in the acts_as_url scope, one can ensure that url slugs for live records will be unique, while also avoiding having 'deleted' records polluting the available URL space.

masonhale avatar Jul 18 '17 15:07 masonhale