loomio/loomio — pull request #858 by AaronThornton00 (2013-06-30 00:15:09+00:00)
Title: Remove phase from motion and fix close date issue

When an admin closes a proposal the close date displayed is the dat it was suppose to close not the date is was closed.

This area of the code is the oldest and very unclean. This code separates out the functionality of tracking 'when the motion is closing' and 'if it has closed' into two different fields so there is no interference.
Scopes and queries are cleaner.

- Created a new column closing_at populated with close_at data
- Renamed close_at to closed_at and set to NULL any motions in phase 'voting'
- Removed column 'phase' An 'open' motion is now any motion with 'closed_at IS NULL'
- Change validate presence to closing_at
- Update all instances of close_at to closing_at or closed_at
- Created methods open? and closed? for motion
- Created open_motions and closed_motions for user, group and discussion
- Simplified close_motion to close!