mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Fixed epp_session
This commit is contained in:
parent
ee2d93128c
commit
cc667efcb1
1 changed files with 5 additions and 1 deletions
|
@ -1,9 +1,13 @@
|
||||||
class EppSession < ActiveRecord::Base
|
class EppSession < ActiveRecord::Base
|
||||||
before_save :marshal_data!
|
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
|
def data
|
||||||
@data ||= self.class.unmarshal(self[:data]) || {}
|
@data ||= self.class.unmarshal(read_attribute(:data)) || {}
|
||||||
end
|
end
|
||||||
|
# rubocop: enable Rails/ReadWriteAttribute
|
||||||
|
|
||||||
def [](key)
|
def [](key)
|
||||||
data[key.to_sym]
|
data[key.to_sym]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue