Skip to content

Commit

Permalink
Switch @user ivar in Vote and Naming classes to User.current
Browse files Browse the repository at this point in the history
Make usage consistent in advance of thread-safety work
  • Loading branch information
nimmolo committed Feb 29, 2024
1 parent 49eb128 commit d87782a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/naming.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def self.construct(args, observation)
naming = Naming.new(args)
naming.created_at = now
naming.updated_at = now
naming.user = @user
naming.user = User.current
naming.observation = observation
naming
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/vote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def self.construct(args, naming)
vote.assign_attributes(args.permit(:favorite, :value)) if args
vote.created_at = now
vote.updated_at = now
vote.user = @user
vote.user = User.current
vote.naming = naming
vote.observation = naming.observation
vote
Expand Down

0 comments on commit d87782a

Please sign in to comment.