Mostly in rails if you write my_obj.attr 开发者_运维知识库it looks up attr in the database and reports it back. How do you create a custom def attr method that internally queries the database for attr