DB table User with a column name uid, create a method uid in the User model. When you submit a form with the field of :uid, it calls the User method uid. I had never seen this explained anywhere and no idea Rails did this.
Is this a good way to put in logic for that column, or should this be avoided?
It’s a great way to add logic to your model. Read more about it here:
http://api.rubyonrails.org/classes/ActiveRecord/Base.html
under “Overwriting default accessors”.