ho un appuntamento fisso per il modello "Versione software":Rails, infissi e default_scope
testing:
id: 4
version: "4.0"
file_name: MyString4
is_testing: true
E un ambito predefinito per il modello:
default_scope where(is_testing: false)
Se faccio questo in un test:
software_versions(:testing)
ottengo un errore:
ActiveRecord::RecordNotFound: Couldn't find SoftwareVersion with id=4 [WHERE `software_versions`.`is_testing` = 0]
È il comportamento previsto? E come lo sovrascrivo?
Bene nel dispositivo si specifica che is_testing è true e l'ambito predefinito del modello è 'is_testing: false', quindi come può essere trovato il record? –