https://avo.cool logo
Join Discord
Powered by
# avo-2
  • l

    loud-jewelry-99127

    05/11/2022, 3:16 PM
    im trying to make an attach_scope for my has_many through association
  • l

    loud-jewelry-99127

    05/11/2022, 3:16 PM
    someone already made a query for Has many thorough what can put here please?
  • l

    loud-jewelry-99127

    05/11/2022, 3:17 PM
    i want to exlude present records from new attach select
  • l

    loud-jewelry-99127

    05/11/2022, 3:23 PM
    i solved it
  • l

    loud-jewelry-99127

    05/11/2022, 3:23 PM
  • l

    lemon-wall-20836

    05/11/2022, 4:05 PM
    that's perfect!👆
  • l

    lemon-wall-20836

    05/11/2022, 4:06 PM
    https://github.com/avo-hq/avo/blob/main/spec/dummy/app/avo/resources/user_resource.rb#L54
  • l

    lemon-wall-20836

    05/11/2022, 4:06 PM
    this is how we used it to filter out the records we already attached
  • l

    loud-jewelry-99127

    05/11/2022, 4:12 PM
    how can be the user_id nil in that situation?
  • l

    loud-jewelry-99127

    05/11/2022, 4:16 PM
    ah i get it
  • l

    loud-jewelry-99127

    05/11/2022, 4:16 PM
    you don't want posts with user associated
  • l

    loud-jewelry-99127

    05/16/2022, 9:12 AM
    Hello, is there a way to tell avo not to cache a resource?
  • l

    loud-jewelry-99127

    05/16/2022, 9:16 AM
    in this piece of code i'm having trouble to refresh that credits field, i have some actions who changes customer_transactions in DB and even if i refresh my resource the real value is not displayed only after a rails restart or changes + CTRL+S in the resource
  • l

    loud-jewelry-99127

    05/16/2022, 9:17 AM
    i think is because resource is cached and do not update after every action
  • l

    loud-jewelry-99127

    05/16/2022, 9:17 AM
    i tried reload and redirect_to but that bring up the cached resource too i think
  • l

    lemon-wall-20836

    05/16/2022, 9:19 AM
    https://docs.avohq.io/2.0/customization.html#cache-resources-on-index-view
  • l

    lemon-wall-20836

    05/16/2022, 9:20 AM
    you can disable that using an option in the initializer
  • l

    lemon-wall-20836

    05/16/2022, 9:20 AM
    that's going to break the cache on the index view
  • l

    lemon-wall-20836

    05/16/2022, 9:21 AM
    Avo doesn't cache anything in other views
  • l

    loud-jewelry-99127

    05/16/2022, 9:32 AM
    and it can't be apply for only one resource right?
  • l

    loud-jewelry-99127

    05/16/2022, 9:32 AM
    i did this hack and it works but i dont want to commit this =')))
  • l

    lemon-wall-20836

    05/16/2022, 9:33 AM
    hmm, that's a bit hacky
  • l

    loud-jewelry-99127

    05/16/2022, 9:33 AM
    a bit? it's a lot! =')))
  • l

    lemon-wall-20836

    05/16/2022, 9:33 AM
    and that internal might change at any point 🙂
  • l

    loud-jewelry-99127

    05/16/2022, 9:33 AM
    https://tenor.com/view/hacker-typing-hacking-computer-codes-gif-17417874
  • l

    lemon-wall-20836

    05/16/2022, 9:33 AM
    yeah. I'm down with hacky solutions. I use them, but the internals are not "stable"
  • l

    lemon-wall-20836

    05/16/2022, 9:34 AM
    but I love the perseverence in solving that :))
  • l

    loud-jewelry-99127

    05/16/2022, 9:34 AM
    that's why i don't want to commit this, i'm going with the index cache off for now, thanks for the suggestion
  • l

    lemon-wall-20836

    05/16/2022, 9:35 AM
    for sure! anytime!
  • l

    loud-jewelry-99127

    05/16/2022, 2:41 PM
    Hello, it's me again! 😄 It's there any way to change the resource field name on a has_one association? Using the
    Copy code
    as: :has_one, name: 'example'
    don't work on this kind of associations
1...363738...64Latest