JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources

Neo4j ORM Issues (non ActiveRecord)

Offen
#796 5 Kommentare 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Ruby
Sterne
2.3k
Forks
546
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi. I'm working on a rails project using the Neo4j ORM which tries to mimic ActiveRecord, but doesn't use ActiveRecord. GET-ing things works fine, but as soon as I want to POST I get errors.

I've started using 0.8.0.beta1 to overcome the ActiveRecordOperationsProcessor issues fixed in #192, but have run into a new error uninitialized constant JSONAPI::ActsAsResourceController::ActiveRecord in ActsAsResourceController line 84

As I was writing this I just realised I can monkey patch with the following, but this probably isn't a good long term solution. It seems to be working with very minimal testing though.

module JSONAPI
  module ActsAsResourceController

    def transaction
      lambda { |&block|
        Neo4j::Transaction.run do |tx|
          block.yield
        end
      }
    end

    def rollback
      lambda {
        fail tx.mark_failed
      }
    end

  end
end

Does anyone have any advice on this situation? Is this an issue for other non ActiveRecord ORM's.

Thanks for your help.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne bei lib/jsonapi/acts_as_resource_controller.rb Zeile 84 und prüfe, wie Transaktion und Rollback von ActiveRecord abhängen. Führe einen POST mit dem Neo4j ORM erneut aus und vergleiche anschließend das Transaktionsverhalten des Controllers mit dem im Issue gezeigten Monkey Patch. Als erledigt gilt die Aufgabe, wenn POST-Anfragen funktionieren, ohne auf eine ActiveRecord-Konstante zu verweisen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
neo4j, rails, ruby
Bereich
api, backend, databases
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.