Maintains period fields on any counter column in your database
sudo gem install periodic_counter
You should already have a counter column (let's call it X) that is being incremented by some external process.
X_data varchar column with a length of 2048.
Add your periodic counters (all integers):
Currently only days of the week and ActiveSupport's time extensions are supported for time periods. If no digit is present, "1" is assumed.
Create a file,
my_table_name: - my_counter
The plugin assumes that the
config directory also houses your
Create cron entry
Add the following command to your crontab at a period of your choosing:
cd /path/to/your/app && RAILS_ENV=production periodic_counter