Question: ```
  if params[:parent_type] == "Order"
    parent_id = nil
  else
    parent_id = params[:parent_id]
  end

```

Would a Ruby person laugh at me for writing it this way? It doesn't seem particularly concise like some Ruby code I've seen.

Answer: 
I like:

```
parent_id = (params[:parent_type] == "Order" ? nil : params[:parent_id])
```
We can use Ruby ternary operator. Something like it:

```
parent_id = params[:parent_type] == "Order" ? nil : params[:parent_id]

```

If `parent_id` is set with `nil` value, we can write an unless syntax:

```
parent_id = params[:parent_id] unless params[:parent_type] == "Order"

```

Or write a simple Ruby if-else in a different way you did it:

```
parent_id = if (params[:parent_type] == "Order")
  nil
else
  params[:parent_id]
end

```

For more [**Idiomatic Ruby**](https://medium.com/the-renaissance-developer/idiomatic-ruby-1b5fa1445098) way to code, I found an [**awesome article**](https://medium.com/the-renaissance-developer/idiomatic-ruby-1b5fa1445098) about that.