diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-22 19:55:08 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-23 18:32:22 +0300 |
commit | 206953a430e442fbbd06984b1120890dbf8d3f79 (patch) | |
tree | 74922128d6a26bc0c9024b8588c9f38a6250cc0d /lib/api/users.rb | |
parent | f72a65603db4dfdb41f327ab03892eed5dadb57e (diff) |
Prefer leading style for Style/DotPosition
Diffstat (limited to 'lib/api/users.rb')
-rw-r--r-- | lib/api/users.rb | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/api/users.rb b/lib/api/users.rb index 94b2b6653d2..9824f8c2ce6 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -117,13 +117,13 @@ module API if user.save present user, with: Entities::UserPublic else - conflict!('Email has already been taken') if User. - where(email: user.email). - count > 0 + conflict!('Email has already been taken') if User + .where(email: user.email) + .count > 0 - conflict!('Username has already been taken') if User. - where(username: user.username). - count > 0 + conflict!('Username has already been taken') if User + .where(username: user.username) + .count > 0 render_validation_error!(user) end @@ -151,12 +151,12 @@ module API not_found!('User') unless user conflict!('Email has already been taken') if params[:email] && - User.where(email: params[:email]). - where.not(id: user.id).count > 0 + User.where(email: params[:email]) + .where.not(id: user.id).count > 0 conflict!('Username has already been taken') if params[:username] && - User.where(username: params[:username]). - where.not(id: user.id).count > 0 + User.where(username: params[:username]) + .where.not(id: user.id).count > 0 user_params = declared_params(include_missing: false) identity_attrs = user_params.slice(:provider, :extern_uid) @@ -354,11 +354,11 @@ module API user = User.find_by(id: params[:id]) not_found!('User') unless user - events = user.events. - merge(ProjectsFinder.new.execute(current_user)). - references(:project). - with_associations. - recent + events = user.events + .merge(ProjectsFinder.new.execute(current_user)) + .references(:project) + .with_associations + .recent present paginate(events), with: Entities::Event end |