When I try to add a new role I get the attached error. The problem is 
that postgresql doesn't like the NULL being passed in for the two non 
null columnds omnipotent and system_role, even though they have a 
default set to false, this is overriden by the INSERT SQL statement 
explicitly setting those columns to NULL.

The work around I have used is to simply add two checkboxes for those 
fields...

<p><label for="role_omnipotent">Omnipotent</label><br/>
<%= check_box 'role', 'omnipotent' %></p>

<p><label for="role_system_role">System Role</label><br/>
<%= check_box 'role', 'system_role' %></p>

to the app/views/role/new.rhtml

the error I get when I try to create the new role was...

PGError: ERROR:  ExecInsert: Fail to add null value in not null 
attribute omnipotent
: INSERT INTO roles ("name", "omnipotent", "description", "system_role") 
VALUES('Exec', NULL, 'Executive', NULL)

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
engine-users mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org

Reply via email to