DAddYE/mini_record — Issue #17: [BUG] Always running query, plus not closing connections
Author: cj
Created: 2012-02-03 15:26:02+00:00
State: open

So I have:

```
class Call < ActiveRecord::Base

col :receptionist_id, as: :integer, limit: 11
col :closed, :holiday, as: :boolean, default: 0
col :to, :from, :sid, :api_version, :status
col :start, :end, as: :datetime
col :duration, as: :integer
timestamps

end
```

And on every page load it runs:

```
DEBUG - (18.0ms) ALTER TABLE `calls` CHANGE `receptionist_id` `receptionist_id` int(11) DEFAULT NULL
DEBUG - (13.4ms) ALTER TABLE `calls` CHANGE `closed` `closed` tinyint(1) DEFAULT 0
DEBUG - (14.5ms) ALTER TABLE `calls` CHANGE `holiday` `holiday` tinyint(1) DEFAULT 0
```

I've also been running into this (which I think is related) as it runs before the stuff above:

```
DEBUG - RELOAD (0.0883ms) /Users/cj/Dropbox/sd/acd/receptionist/app/models/calls.rb
DEPRECATION WARNING: Database connections will not be closed automatically, please close your
database connection at the end of the thread by calling `close` on your
connection. For example: ActiveRecord::Base.connection.close
. (called from mon_synchronize at /Users/cj/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211)
DEPRECATION WARNING: Database connections will not be closed automatically, please close your
database connection at the end of the thread by calling `close` on your
connection. For example: ActiveRecord::Base.connection.close
. (called from mon_synchronize at /Users/cj/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211)
DEPRECATION WARNING: Database connections will not be closed automatically, please close your
database connection at the end of the thread by calling `close` on your
connection. For example: ActiveRecord::Base.connection.close
. (called from mon_synchronize at /Users/cj/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211)
DEPRECATION WARNING: Database connections will not be closed automatically, please close your
database connection at the end of the thread by calling `close` on your
connection. For example: ActiveRecord::Base.connection.close
```