lib/super_auth/permission.rb in super_auth-0.1.3 vs lib/super_auth/permission.rb in super_auth-0.1.4

- old
+ new

@@ -1,24 +1,24 @@ -class SuperAuth::Permission < Sequel::Model(:permissions) +class SuperAuth::Permission < Sequel::Model(:super_auth_permissions) one_to_many :edges dataset_module do def with_edges - join(:edges, permission_id: :id).select_all(:permissions) + join(:super_auth_edges, permission_id: :id).select_all(:super_auth_permissions) end def with_roles - with_edges.join(Role.from(Role.trees).as(:roles), id: :role_id).select( - Sequel[:permissions][:id].as(:id), - Sequel[:permissions][:id].as(:permission_id), + with_edges.join(Role.from(Role.trees).as(:roles), id: :role_id).select( + Sequel[:super_auth_permissions][:id].as(:id), + Sequel[:super_auth_permissions][:id].as(:permission_id), Sequel[:roles][:id].as(:role_id), - Sequel[:permissions][:name].as(:permission_name), + Sequel[:super_auth_permissions][:name].as(:permission_name), Sequel[:roles][:name].as(:role_name), - Sequel[:edges][:id].as(:edge_id), - Sequel[:edges][:permission_id].as(:edge_permission_id), - Sequel[:edges][:group_id].as(:edge_group_id), - Sequel[:edges][:user_id].as(:edge_user_id), - Sequel[:edges][:role_id].as(:edge_role_id), + Sequel[:super_auth_edges][:id].as(:edge_id), + Sequel[:super_auth_edges][:permission_id].as(:edge_permission_id), + Sequel[:super_auth_edges][:group_id].as(:edge_group_id), + Sequel[:super_auth_edges][:user_id].as(:edge_user_id), + Sequel[:super_auth_edges][:role_id].as(:edge_role_id), :role_path, :role_name_path, :parent_id ) end