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

Version Path
frozen_record-0.16.0 spec/support/animal.rb
frozen_record-0.15.0 spec/support/animal.rb
frozen_record-0.14.0 spec/support/animal.rb
frozen_record-0.13.0 spec/support/animal.rb
frozen_record-0.12.1 spec/support/animal.rb
frozen_record-0.12.0 spec/support/animal.rb
frozen_record-0.11.0 spec/support/animal.rb
frozen_record-0.10.0 spec/support/animal.rb