Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorbhembree
     
    Hi again,

    Kaste, thanks for your reply to my last message. The helper method route works fine.

    My problem now is that I and using Postgres as the database. I have a class that has a boolean attribute (along with a number of text attributes). I used the scaffold to generate the default behavior for this class. When I fill out the form for this class and try to save it, I get an error on the boolean (it wants to treat it as an integer). Which methods, in which classes do I need to override in order to get the save to work correctly? I've looked around the code and tried doing some type-casting in several places but none it seems to help.

    thanks for your help

    Barry
    • CommentAuthorKaste
     

    cant confirm; cant reproduce.

    AkInstaller uses numeric(1) for booleans by the way.

    • CommentAuthorbhembree
     
    Kaste,

    This is the error I get.

    Notice: ERROR: column "status" is of type boolean but expression is of type integer at character 71 HINT: You will need to rewrite or cast the expression. in /home/bhembree/workspace/akelos/lib/AkActiveRecord.php on line 513

    Postgres treats a boolean as a boolean (mysql treats it as a small int). It seems like active record is trying to save it as an int rather than a boolean.
    • CommentAuthorKaste
     

    You said:

    Postgres treats a boolean as a boolean (mysql treats it as a small int). It seems like active record is trying to save it as an int rather than a boolean.

    I said:

    AkInstaller uses numeric(1) for booleans by the way.

    So, if you use AkInstaller/migrate to create your tables, there should be no problem. You're right: Akelos - right now - uses int's for booleans, and therefore creates numeric-columns for postgre (instead of using the boolean-type). (we're faking mysql-behavior on postgre.)

    (I'm half way through a fix/commit for this and other related issues, BTW.)

    • CommentAuthorbhembree
     
    Ahh, that was my problem. The first time I created the table I used the migrate method but I set the default value of the boolean to false. The second time I tried it I just modified the table using phpPgAdmin.

    Thanks for your help.

    Barry