1- use schema:: buckets;
2- use schema:: junction_bucket_users;
3- use user:: User ;
1+ use crate :: schema:: buckets;
2+ use crate :: schema:: junction_bucket_users;
3+ use crate :: user:: User ;
44use error:: JoeResult ;
55use diesel:: prelude:: * ;
66use diesel;
@@ -72,10 +72,10 @@ pub struct UsersInBucketData {
7272impl Bucket {
7373 /// Get buckets that are public, but the user is not a member of
7474 pub fn get_public_buckets ( user_uuid : UserUuid , conn : & PgConnection ) -> JoeResult < Vec < Bucket > > {
75- use schema:: buckets:: dsl:: * ;
76- use schema:: buckets;
77- use schema:: junction_bucket_users as junctions;
78- use schema:: junction_bucket_users:: dsl:: junction_bucket_users;
75+ use crate :: schema:: buckets:: dsl:: * ;
76+ use crate :: schema:: buckets;
77+ use crate :: schema:: junction_bucket_users as junctions;
78+ use crate :: schema:: junction_bucket_users:: dsl:: junction_bucket_users;
7979
8080 // Don't return any buckets with these ids
8181 let bucket_uuids_in_which_the_user_is_already_a_member_or_has_requested_to_join: Vec < Uuid > = junction_bucket_users
@@ -94,7 +94,7 @@ impl Bucket {
9494 }
9595
9696 pub fn add_user_to_bucket ( new_bucket_user : NewBucketUser , conn : & PgConnection ) -> JoeResult < ( ) > {
97- use schema:: junction_bucket_users;
97+ use crate :: schema:: junction_bucket_users;
9898
9999 diesel:: insert_into ( junction_bucket_users:: table)
100100 . values ( & new_bucket_user)
@@ -104,8 +104,8 @@ impl Bucket {
104104 }
105105
106106 pub fn get_buckets_user_belongs_to ( user_uuid : UserUuid , conn : & PgConnection ) -> JoeResult < Vec < Bucket > > {
107- use schema:: junction_bucket_users:: dsl:: junction_bucket_users;
108- use schema:: junction_bucket_users as junctions;
107+ use crate :: schema:: junction_bucket_users:: dsl:: junction_bucket_users;
108+ use crate :: schema:: junction_bucket_users as junctions;
109109
110110 junction_bucket_users
111111 . filter ( junctions:: user_uuid. eq ( user_uuid. 0 ) )
@@ -120,9 +120,9 @@ impl Bucket {
120120 /// Gets users depending on the approval column.
121121 /// It will exclude the user making the request.
122122 fn get_users_approval ( bucket_uuid : BucketUuid , user_uuid : UserUuid , approval : bool , conn : & PgConnection ) -> JoeResult < Vec < User > > {
123- use schema:: junction_bucket_users:: dsl:: junction_bucket_users;
124- use schema:: junction_bucket_users as junctions;
125- use schema:: users;
123+ use crate :: schema:: junction_bucket_users:: dsl:: junction_bucket_users;
124+ use crate :: schema:: junction_bucket_users as junctions;
125+ use crate :: schema:: users;
126126
127127 junction_bucket_users
128128 . filter ( junctions:: bucket_uuid. eq ( bucket_uuid. 0 ) )
@@ -145,9 +145,9 @@ impl Bucket {
145145 }
146146
147147 pub fn get_users_requiring_approval_for_owned_buckets ( bucket_owner_uuid : UserUuid , conn : & PgConnection ) -> JoeResult < Vec < UsersInBucketData > > {
148- use schema:: junction_bucket_users:: dsl:: * ;
149- use schema:: junction_bucket_users as junctions;
150- use schema:: buckets;
148+ use crate :: schema:: junction_bucket_users:: dsl:: * ;
149+ use crate :: schema:: junction_bucket_users as junctions;
150+ use crate :: schema:: buckets;
151151
152152 let buckets: Vec < Bucket > = junction_bucket_users
153153 . filter ( junctions:: user_uuid. eq (
@@ -174,8 +174,8 @@ impl Bucket {
174174
175175 /// Is the user the owner of the bucket
176176 pub fn is_user_owner ( user_uuid : UserUuid , bucket_uuid : BucketUuid , conn : & PgConnection ) -> bool {
177- use schema:: junction_bucket_users:: dsl:: junction_bucket_users;
178- use schema:: junction_bucket_users as junctions;
177+ use crate :: schema:: junction_bucket_users:: dsl:: junction_bucket_users;
178+ use crate :: schema:: junction_bucket_users as junctions;
179179
180180
181181 junction_bucket_users
@@ -189,8 +189,8 @@ impl Bucket {
189189
190190 /// Is the user in the bucket, and approved by a bucket owner?
191191 pub fn is_user_approved ( user_uuid : UserUuid , bucket_uuid : BucketUuid , conn : & PgConnection ) -> bool {
192- use schema:: junction_bucket_users:: dsl:: junction_bucket_users;
193- use schema:: junction_bucket_users as junctions;
192+ use crate :: schema:: junction_bucket_users:: dsl:: junction_bucket_users;
193+ use crate :: schema:: junction_bucket_users as junctions;
194194
195195
196196 junction_bucket_users
@@ -202,7 +202,7 @@ impl Bucket {
202202 }
203203
204204 pub fn apply_changeset ( changeset : BucketUserChangeset , conn : & PgConnection ) -> JoeResult < BucketUser > {
205- use schema:: junction_bucket_users;
205+ use crate :: schema:: junction_bucket_users;
206206
207207 diesel:: update ( junction_bucket_users:: table)
208208 . set ( & changeset)
@@ -211,8 +211,8 @@ impl Bucket {
211211 }
212212
213213 pub fn set_bucket_publicity ( bucket_uuid : BucketUuid , publicity : bool , conn : & PgConnection ) -> JoeResult < ( ) > {
214- use schema:: buckets:: dsl:: * ;
215- use schema:: buckets;
214+ use crate :: schema:: buckets:: dsl:: * ;
215+ use crate :: schema:: buckets;
216216
217217
218218 let target = buckets. filter (
@@ -234,8 +234,8 @@ impl Bucket {
234234 }
235235
236236 pub fn set_user_approval ( user_uuid : UserUuid , bucket_uuid : BucketUuid , approval : bool , conn : & PgConnection ) -> JoeResult < ( ) > {
237- use schema:: junction_bucket_users:: dsl:: junction_bucket_users;
238- use schema:: junction_bucket_users as junctions;
237+ use crate :: schema:: junction_bucket_users:: dsl:: junction_bucket_users;
238+ use crate :: schema:: junction_bucket_users as junctions;
239239
240240
241241 let target = junction_bucket_users
@@ -253,7 +253,7 @@ impl Bucket {
253253 /// Removes the user from the junction table for the given bucket.
254254 /// This has the effect of denying any request to join the bucket, as well as kicking a user out of the bucket.
255255 pub fn remove_user_from_bucket ( user_uuid : UserUuid , bucket_uuid : BucketUuid , conn : & PgConnection ) -> JoeResult < ( ) > {
256- use schema:: junction_bucket_users as junctions;
256+ use crate :: schema:: junction_bucket_users as junctions;
257257
258258
259259 diesel:: delete ( junctions:: table)
0 commit comments