JPHorta JPHorta - 1 year ago 90
Ruby Question

ActiveRecord cache_timestamp_format configuration not being applied

I'm trying to change the migration version timestamp format by setting this configuration

config.active_record.cache_timestamp_format = :nsec
in the
or in
, like it is said here

The problem is that this configuration is being ignored, regardless of the format I set there, when I generate a new migration, the timestamp format stays the same.

Am I doing something wrong here?

Answer Source

Because apparently rails migration is ignoring it:

Also - according to the docs, :nsec is the default used in the cache_key and I don't see anything related to migrations there.

Though I suppose if you are using rails cache you'll see a different key by changing that option.

(you can see the allowed values with Time::DATE_FORMATS)

The only configuration, that I can see, is allowed to migration names is to use integer vs timestamps: config.active_record.timestamped_migrations

And if you're not working alone, you should also leave that option as is.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download