Question about Rails magic:
I was playing with IRB and the tainted? method, then I just did the following:
>> User.first.attributes.collect { |column, value| [column, value.tainted?] }
=> [["phone", true], ["state", false], ["persistence_token", true], ["last_login_ip", true], ["country", true], ["login_count", false], ["last_request_at", false], ["id", false], ["forname", true], ["current_login_at", false], ["name", true]]
Does anyone know why some of the params are tainted and some are not? And if there is a way to select which column should be tainted?
EDIT:
Thanks for the answers.
@sgtFloyd: I just tried to update manually the country. and here is what's happening:
>> u = User.first
>> u.country = "USA"
=> "USA"
>> u.country.tainted?
=> false
>> u.save
=> true
>> u.country.tainted?
=> false
>> u.reload
>> u.country.tainted?
=> true
>> u.country.class
=> String # it's also string in the database
EDIT 2:
I removed everything inside the User model, and some String columns do not appear tainted whereas some do...
Thanks a lot!