Live-run finding: the full suite against Couchbase was 423 examples with 17
failures — all in embedding_spec. The session report claimed embedded specs
were 'excluded by design', but the exclusion filter targeted a :embedding tag
no example carries, so the file ran (and failed) all along.
Three fixes:
- HasManyEmbedded::Property#build wired parent_object before installing the
collection ivar on the parent; parent_object= reaches back into the parent's
collection getter, which re-entered build -> SystemStackError on any access
to embedded documents loaded from the database. Install the ivar first.
- EmbeddedClass.all / .count referenced raw JS views (all_documents /
all_documents_for_count) that the N1QL port silently drops, so .all returned
[] and .count raised NoMethodError. Rebuilt them by enumerating the parent
documents (same work as the old view scan, client-side; an UNNEST query can
replace it later).
- Only reverse lookups (N1QL on a foreign key inside an embedded array) remain
unsupported: tagged :embedded_in_reverse_lookup and excluded in spec_helper
with an explanatory comment, replacing the broken :embedding filter line.
embedding_spec.rb: 16 examples, 0 failures against live Couchbase 8.0.1 CE.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
A from-scratch fork of simply_couch's model layer that runs on Couchbase
natively: `include SimplyBased::Model` instead of `include SimplyCouch::Model`.
- SimplyBased::Store replaces the CouchDB layer: KV documents, N1QL/SQL++
finders + lazily-created GSIs, CAS mapped onto _rev. No design documents or
JavaScript map/reduce — the hand-written association views become N1QL
(belongs_to/has_many/has_one scalar FK; habtm via ANY ... SATISFIES + array
index, or KV multi-get on the storing side).
- Redis replacements on the same cluster: Counter (atomic increment/decrement),
Cache (ActiveSupport::Cache::Store over KV+TTL, drop-in Rails.cache/ActiveJob),
Lock (insert-if-absent + TTL + CAS-checked release).
- Runs the simply_couch test suite against live Couchbase: 378/432 applicable
examples green (CouchDB-mechanic specs tagged :couchdb_only and excluded).
- Remaining: ancestry (tree) + embedded_in reverse-lookups (recursive/embedded
N1QL) and a few pagination/lifecycle edges.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>