Question: Are these 2 code snippets equivalent if the user's subscription has not been set:

```
user.subscription.nil?

```

and

```
user.subscription

```

In the models:
Subscription

```
belongs_to :user

```

User

```
has_one :subscription

```

Answer: 
If you want to check that the association is *not* present, these are equivalent:

```
user.subscription.nil?     # true if missing, false otherwise
user.subscription.blank?   # true if missing, false otherwise
!user.subscription         # true if missing, false otherwise

```

And if you want to check that the association *is* present, these are equivalent (in terms of truthy and falsey):

```
user.subscription.present? # true if present, false otherwise
user.subscription          # subscription if present, nil otherwise
!!user.subscription        # true if present, false otherwise

```
Not only that they are different, but they are almost the opposite. If the property is set to anything but `nil`, then the former will return `false`, and the latter will return whatever value. If the property is set to `nil` or is not set, then the former is `true`, the latter is `nil`. The only case when the two return the same value is when the property is set to `false`.