Hobo / hobo

The web app builder for Rails (moved from tablatom/hobo)
http://hobocentral.net
103 stars 39 forks source link

Migration generator misidentifies default: false as changed every time #184

Closed stevemadere closed 8 years ago

stevemadere commented 8 years ago

If any field has the property default: false, after the first migration creating the field, all subsequent hobo generated migrations include a command to change the column to default: false even though it already has default: false.

This PR fixes the problem which was caused by the database schema interrogation returning a property of "false" for the default instead of the boolean value false.

The fix is to specially compare boolean default values by converting them to strings prior to comparison so that false becomes "false" which will compare equivalent to "false".

iox commented 8 years ago

Thanks a lot @stevemadere , I have suffered this before.