hyperstack-org / hyperstack-org/hyperstack

trying to destroy an item that is not included in the default scope fails

Aperta
#260 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
good first issue
Lingua principale
JavaScript
Stelle
538
Fork
41
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

If you have a default_scope (other than just `all`) then some records are not included by a simple query. However you can get you can override the default scope using `unscoped`. This means you can get the id of records that are not in the default scope.

If you try to destroy one of those records, it doesn't work.

Fix would be on about line 590 of `isomorphic_base.rb` in the server side `destroy_record` method. Just change `model.find(id)` to `model.unscoped.find(id)`

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.