module ActiveRecord
module Mixin
alias old_id id
def id
old_id.to_i
end
def hello
"hellooooooooooooo"
end
end
end
ActiveRecord::Base.send :include, ActiveRecord::Mixin
I make is because:
id column in oracle is number type,not number(10), @user.id return 123.0,not 123,so I would like to do it by extend ar.
But my way above does not work for me,it still show number with dot zero,123.0.
How to make id auto invove id.to_i???