rubysherpas / forem

The best Rails 3 and Rails 4 forum engine. Ever.
http://forem.herokuapp.com
MIT License
1.55k stars 422 forks source link

Missing created_at and updated columns in forem_forums table #656

Open edmondchui opened 9 years ago

edmondchui commented 9 years ago

Is that intentional or oversight? created_at and updated_at exists in forem_categories, forem_topics, forem_posts.

radar commented 9 years ago
add_column :forem_forums, :created_at, :datetime, null: false
add_column :forem_forums, :updated_at, :datetime, null: false

We don't have a need for them in forums (or categories for that matter). So when I created the forums table I probably removed them from there, but didn't do it when I created the categories table.

edmondchui commented 9 years ago

A possible use case for forem_forums to have timestamp could be when we use key-based caching (with updated_at being part of the cache key).

If there is any new or updated posts, we can touch the belonging topic and in turns the belonging forum. We can then use the timestamp-based cache key to check against the cache.

radar commented 9 years ago

That sounds like a good idea. Please submit a patch to add these keys.

cjbottaro commented 9 years ago

+1 on the key based caching. I recently looked at the source and none of the associations have touch: true on them... so need another PR for that.