nandosola / dilithium-rb

A tiny framework to power your enterprise-ish stuff in Ruby
BSD 3-Clause "New" or "Revised" License
3 stars 3 forks source link

Should fetch_all fetch all items including those with active: false? #58

Closed mcamou closed 10 years ago

mcamou commented 10 years ago

In the original discussion we came to the conclusion that the handling of active was an application-level issue. However, we have now decided that Dilithium should handle soft-deletes via the active attribute (i.e., we're using it internally). Doesn't this mean that fetch_all should always fetch only those items with active: true? Perhaps add a boolean parameter such as:

  def fetch_all(fetch_inactive = true)

I'm setting the default to true for backwards compatibility since I don't know how much the client code currently depends on this feature.

I realize this is more for the view than for anything else, but it does introduce a possible performance issue (especially since currently fetch_all does N+1 queries)

mcamou commented 10 years ago

This is now included in the fix for #28