master
E. Almqvist 3 years ago
parent 1ec469ba1e
commit 9c12a8907f
  1. 13
      src/db_models.rb

@ -142,6 +142,19 @@ class Role < EntityModel
data = self.get("*", "name = ?", name).first
data && Role.new(data)
end
def self.create(name, color="#ffffff", flags=0)
data = {
name: name,
color: color,
flags: flags
}
self.insert data
end
def self.edit(roleid, data)
self.update data, "id = ?", roleid
end
end

Loading…
Cancel
Save