In keeping with Ruby's idiom of using a question mark in boolean methods (e.g. person.is_smart?
), I'd like to do the same for an ActiveRecord field in Rails:
rails generate model Person is_smart?:boolean
I haven't actually run the above statement. I assume that database fields can't have a question mark in them. Will rails deal with this appropriately? Is the best practice to simply leave question marks off of models?
Using Rails 3.2.8
smart
and then add custom accessors so you can sayis_smart?
when you're talking to an actual Person? – Mortaris_smart?
as a variable. – Fitment