From cc667efcb1388a6e5ceb49be302a291d2e8af542 Mon Sep 17 00:00:00 2001 From: Priit Tamboom Date: Mon, 13 Oct 2014 11:25:53 +0300 Subject: [PATCH] Fixed epp_session --- app/models/epp_session.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/epp_session.rb b/app/models/epp_session.rb index 325440e0d..816155f21 100644 --- a/app/models/epp_session.rb +++ b/app/models/epp_session.rb @@ -1,9 +1,13 @@ class EppSession < ActiveRecord::Base before_save :marshal_data! + # rubocop: disable Rails/ReadWriteAttribute + # Turned back to read_attribute, thus in Rails 4 + # there is differences between self[:data] and read_attribute. def data - @data ||= self.class.unmarshal(self[:data]) || {} + @data ||= self.class.unmarshal(read_attribute(:data)) || {} end + # rubocop: enable Rails/ReadWriteAttribute def [](key) data[key.to_sym]