mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +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
|
||||
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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue