Open link in a new tab

Content

Expand project menu

Unknown column 'roles.type' in 'where clause' in version 3

(Mysql2::Error: Unknown column ‘roles.type’ in ‘where clause’: SELECT `roles`.* FROM `roles` WHERE `roles`.`builtin` = 0 AND `roles`.`type` = ‘Role’ ORDER BY position):

<% roles = Role.find_all_givable %>

role.rb, no STI so this is strange :(

# Find all the roles that can be given to a project member
def self.find_all_givable
find(:all, :conditions => {:builtin => 0}, :order => ‘position’)
end

the schema.rb for role is:

create_table “roles”, :force => true do |t|
t.string “name”, :limit => 30, :default => “”, :null => false
t.integer “position”, :default => 1
t.boolean “assignable”, :default => true
t.integer “builtin”, :default => 0, :null => false
t.text “permissions”
end

Message actions