Recent submissions

Comment · 1 year ago
I do this often:

```ruby

if (user = User.find_by(email: '[email protected]'))

  user.update(status: 'active')
end

```

Is it better to do this instead?

```ruby

user = User.find_by(email: '[email protected]')

user.update(status: 'active') if user.present?

```

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton