Tickets

#19 (Open) [PATCH] fix default_page to work with mysql

last changed by Chris Anderton

When specifying a page as the ‘default_page’ then it causes an error.

I’m not sure if this is database specific – i’m using MySQL.

The default_page column is defined as a tinyint whereas the code is treating it as a boolean.

The line in the model (page.rb):

Page.connection.execute(“UPDATE pages SET default_page = FALSE WHERE default_page IS TRUE;”)

Causes the error on my install.

A quick google looks like it’s the ‘IS’ part that is Postgre specific – changing the line to:

Page.connection.execute(“UPDATE pages SET default_page = FALSE WHERE default_page = TRUE;”)

Should allow it to work on MySQL as well as Postgre.

http://pastie.caboo.se/122384