lib/sequel/plugins/json_columns.rb in sequel-json_columns-1.0.2 vs lib/sequel/plugins/json_columns.rb in sequel-json_columns-1.1.2
- old
+ new
@@ -1,11 +1,11 @@
require 'sequel'
require 'json'
module Sequel::Plugins
module JsonColumns
- VERSION = "1.0.2"
+ VERSION = "1.1.2"
module ClassMethods
def json_column(column_name)
column_name = column_name.to_sym
@@ -23,9 +23,14 @@
end
end
end
module InstanceMethods
+ def refresh
+ super
+ @serialized_data = nil
+ end
+
def before_save
(@serialized_data || {}).keys.each do |k|
values[k] = @serialized_data[k].to_json
end