try it
class Test < ActiveRecord::Base attr_accessor :newattr end
you can access it, for example
@test = Test.new @test.newattr = "value"
As you can see, this property is not a hash. therefore it uses syntax . . however, if you want it to behave like a hash, you can do this without defining a new attribute
@test.all @test.each do |elm| new_elm = {} new_elm[:newatt] = 'added string' end
Finally, I'm not quite sure what you are trying to do. if that doesn't make sense to you, kindly rephrase your question so that we can better understand the problem.
source share