store as Hash Table with Hstore, wrong ordering in Hash after Save
class Service < ActiveRecord::Base
serialize :properties, ActiveRecord::Coders::Hstore
end
service = Service.new
service.properties = { "aaa" => 1, "zz" => 2, "cc" => 3, "d" => 4 }
#=> { "aaa" => 1, "zz" => 2, "cc" => 3, "d" => 4 }
service.save
reload!
service = Service.find(:id)
service.properties
#=> { "d" => "4", "cc" => "3", "zz" => 2, "aaa" => 1 }
Bug::: wrong ordering after save
Is it because after serialize that it orders by Tree. Any ideas or anyone had faced this problem before? Thanks in advance.