perf(null-zone): replace open struct by struct

This commit is contained in:
Colin Darie 2024-01-16 18:45:01 +01:00
parent 461e311d3d
commit fa74cdb4c7
No known key found for this signature in database
GPG key ID: 8C76CADD40253590

View file

@ -1,12 +1,13 @@
class NullZone
include ActiveModel::Model
ReflectionAssociation = Struct.new(:class_name)
def procedures
Procedure.where(zone: nil).where.not(published_at: nil).order(published_at: :desc)
end
def self.reflect_on_association(association)
OpenStruct.new(class_name: "Procedure") if association == :procedures
ReflectionAssociation.new("Procedure") if association == :procedures
end
def label