Skip to content
Snippets Groups Projects
Commit 302cfa73 authored by Alexandre Peres Arias's avatar Alexandre Peres Arias
Browse files

fix query bug

parent 21d58f3b
No related branches found
No related tags found
No related merge requests found
......@@ -75,7 +75,7 @@ class Management::UsersController < ManagementController
# Use callbacks to share common setup or constraints between actions.
def set_user
@user = user_repository.find params[:id]
@user = user_repository.find(params[:id])
end
# Never trust parameters from the scary internet, only allow the white list through.
......
......@@ -31,11 +31,6 @@ module OrientDb
(result.count > 0)
end
def all
result = connection.query sprintf("SELECT FROM USER")
end
private
def odb_class
......
......@@ -32,6 +32,10 @@ class UserRepositoryProxy
user.save!
end
def all
User.includes(:roles).all
end
def method_missing(method_name, *arguments, &block)
User.send(method_name, *arguments, &block)
end
......
......@@ -5,7 +5,7 @@
<% admins = Array.new %>
<% @users = User.all%>
<% @users = User.includes(:roles).all%>
<% @users.all.each do |user|%>
<% admins << user if user.roles[0].name == "admin" %>
<% end %>
......
......@@ -5,7 +5,7 @@
<% curators = Array.new %>
<% @users = User.all%>
<% @users = User.includes(:roles).all%>
<% @users.all.each do |user|%>
<% curators << user if user.roles[0].name == "curator" %>
<% end %>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment