Sha256: e8e27b5c797a10988ce7ef8d20caa039c30f87df1d17d572f5ce1a650459bda6

Contents?: true

Size: 369 Bytes

Versions: 8

Compression:

Stored size: 369 Bytes

Contents

module DynamicScaffold
  module JSONObject
    module Model
      extend ActiveSupport::Concern

      module ClassMethods
        def  dump(obj)
          obj = obj.attributes if obj.is_a? ActiveModel::Attributes
          obj.to_json if obj
        end

        def load(source)
          new(source ? JSON.parse(source) : {})
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dynamic_scaffold-1.12.2 lib/dynamic_scaffold/json_object/model.rb
dynamic_scaffold-1.12.1 lib/dynamic_scaffold/json_object/model.rb
dynamic_scaffold-1.12.0 lib/dynamic_scaffold/json_object/model.rb
dynamic_scaffold-1.11.0 lib/dynamic_scaffold/json_object/model.rb
dynamic_scaffold-1.10.0 lib/dynamic_scaffold/json_object/model.rb
dynamic_scaffold-1.9.0 lib/dynamic_scaffold/json_object/model.rb
dynamic_scaffold-1.8.1 lib/dynamic_scaffold/json_object/model.rb
dynamic_scaffold-1.8.0 lib/dynamic_scaffold/json_object/model.rb