Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Refactor app/adapters #79

Open
dazza-codes opened this issue Sep 27, 2016 · 1 comment
Open

Refactor app/adapters #79

dazza-codes opened this issue Sep 27, 2016 · 1 comment

Comments

@dazza-codes
Copy link
Contributor

dazza-codes commented Sep 27, 2016

While looking at app/adapters/adapter.rb and app/adapters/abstract_adapter.rb, it seems they could be combined into one class, unless there is a design pattern involved? Also, it's not entirely clear why the abstract_adapter.rb requires both class and instance methods (it seems lines 50-57 try to create instance methods that delegate to class methods for :simple_maps and :to_maps, but they seem to be instance methods already in adapter.rb).

Adapter#map_to_public is not fully covered by unit tests.

Extracted this issue from #77

@dazza-codes
Copy link
Contributor Author

The AbstractAdapter#to_public_hash seems to be memoized, but that could prevent field additions or deletions from showing up? Perhaps it should not be memoized?

The #to_json instance method calls a class method, i.e.

  def to_json(options = {})
    return self.to_public_hash.to_json(options)
  end

It seems it could be calling an instance method, i.e.

  def to_json(options = {})
    to_public_hash.to_json(options)
  end

This method is not covered by unit tests (looking at simplecov report). Also, the rhs return value from AbstractAdapter#merge_strategy is not covered by unit tests.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants