Can I aggregate over a calculated field?

I have a File resource, that has calculation :extension, I then have another resource called Attachment, that has_many :files. Is it possible to do this:
first :extension, :file, :extension do
public? true
end
first :extension, :file, :extension do
public? true
end
6 Replies
sevenseacat
sevenseacat•2mo ago
give it a try and see 🙂
Straffern
StraffernOP•2mo ago
I did, but I got nil. But no errors.. I guess it is a bug in my code.. Was just confused
sevenseacat
sevenseacat•2mo ago
is your relationship name correct? file?
Straffern
StraffernOP•2mo ago
Yeah, fixed that but still getting nil.
sevenseacat
sevenseacat•2mo ago
I mean that's a valid value if the attachment has no files
Straffern
StraffernOP•2mo ago
Hmm. I'll figure it out. I guess my change that is supposed to create the files might silently fail or something.. I g2g now, but thanks for trying to help 😇

Did you find this page helpful?