I have a model for one of my database tables. I want to override the column name for that particular table. How would I achieve it.
For example, let my table be called DUMMY and it has one column called col_a
col_a
20
34
42
23
12
I would be doing a @dummy.col_a
. Now this method should return me 0 for numbers ending with 0 and for everything else, it should return the original value. I could do that by defining a new method, but I want to override the column name itself. Please help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…