resolve/refinerycms — Issue #1134: Dashboard breaks if an engine's database table contains a row with a blank updated_at timestamp
Author: dpie
Created: 2011-11-09 18:05:35+00:00
State: open

I ran across the following error on the /refinery/dashboard screen using Refinery 1.0.8 and Ruby 1.9.2-p290 ("School" is the name of our model):

ArgumentError in Admin::DashboardController#index
comparison of School with Resource failed

It seems this error appears when at least one row in a given engine's database table contains a blank updated_at field.

In our case, for this Schools engine we imported the initial data from a CSV file via a SQL statement. This means the updated_at field that is normally auto-updated by Rails upon save remained blank. The workaround was simple -- in Refinery, just re-save all rows that lack an updated_at timestamp.

So my question is, does Refinery require that the updated_at field exists and be non-blank in all engine database tables (typically created using the t.timestamps syntax in a migration file)? Or is this a bug, and Dashboard should not be reliant upon a non-blank updated_at field?