Sha256: 107fef7116d70d8a06d4f0a0ebb687846413fa06ea935c4831df5a0a05aa4b60
Contents?: true
Size: 283 Bytes
Versions: 8
Compression:
Stored size: 283 Bytes
Contents
module JsonBackend extend self def filename(model_name) "#{model_name.underscore.pluralize}.json" end def load(file_path) json_data = File.read(file_path) JSON.parse(json_data) || [] end end class Animal < FrozenRecord::Base self.backend = JsonBackend end
Version data entries
8 entries across 8 versions & 1 rubygems