concept false in category rails

appears as: false
Rails 4 in Action: Revised Edition of Rails 3 in Action

This is an excerpt from Manning's book Rails 4 in Action: Revised Edition of Rails 3 in Action.

Just as in the show and edit actions, the @purchase object is first fetched by the call to before_action :set_purchase. The parameters from the form are sent through in the same fashion as they were in the create action, coming through as purchase_params. Rather than instantiating a new object by using the new class method, you use update on the existing @purchase object. This does what it says: updates the attributes. What it doesn’t say, though, is that it validates the attributes and, if the attributes are valid, saves the record and returns true. If they aren’t valid, it returns false.

But you’ll want to modify this migration so that when users are created, the admin field is set to false rather than defaulting to nil. Even though nil is “falsey” in Ruby, it’s clearer to make it explicitly false. nil means users have no admin information, but they do: they’re not an admin. It’s better to be explicit about things.