https://avo.cool logo
Join Discord
Powered by
# avo-2
  • CVE-2024-22191 for Avo 2.46.0
    m

    miniature-optician-85831

    01/18/2024, 7:30 AM
    Thread automatically created by gee_forr in #740893011994738751
    l
    f
    • 3
    • 15
  • just found a fun issue... Using avo breaks runn...
    a

    alert-monkey-67616

    01/23/2024, 1:37 AM
    just found a fun issue... Using avo breaks running
    bin/rails db:drop db:create db:migrate db:seed
    because avo's routes eagerly load all resources, and then all model classes for those resources
    m
    l
    l
    • 4
    • 11
  • Hi I'm adding stimulus integration into resourc...
    m

    miniature-optician-85831

    01/29/2024, 6:09 PM
    Thread automatically created by Volodymyr in #740893011994738751
    e
    l
    • 3
    • 11
  • Hi guys, there is a way to change avo actions f...
    v

    victorious-kangaroo-12568

    02/01/2024, 5:51 PM
    Hi guys, there is a way to change avo actions folders with extra namespace? for example: path: app/avo/actions/users/activate.rb action:
    Copy code
    module Avo
      module Actions
        module Users
          class Activate < Avo::BaseAction
    resource action Users::Activate i'm having issues with eager loading
    Copy code
    on_file_autoloaded': expected file app/avo/actions/users/activate.rb to define constant Users::Activate, but didn't
    if I change on action module Users module Activate to ->
    class Users::Activate < Avo::BaseAction
    works, but i want to use module notations. Any suggestions here?
    m
    l
    • 3
    • 4
  • Howdy folks ... just started working with Avo t...
    m

    miniature-optician-85831

    02/04/2024, 2:06 AM
    Thread automatically created by r.j.o. in #740893011994738751
    l
    • 2
    • 2
  • Question .... is there a way to customize a has...
    m

    miniature-optician-85831

    02/04/2024, 2:08 AM
    Thread automatically created by r.j.o. in #740893011994738751
    l
    s
    l
    • 4
    • 9
  • G'day folks. Question -- we're wondering if it'...
    m

    miniature-optician-85831

    02/07/2024, 3:55 PM
    Thread automatically created by dark_panda9293 in #740893011994738751
    l
    • 2
    • 4
  • Will there be an avo 2 release as well?
    m

    miniature-optician-85831

    02/13/2024, 5:19 PM
    Thread automatically created by segiddins in #740893011994738751
    l
    a
    l
    • 4
    • 7
  • Linked belongs_to fields + attach_scope
    b

    better-restaurant-41251

    02/19/2024, 3:20 AM
    My
    ClientResource
    has two
    belongs_to
    fields—`hospital` and `hospital_contact`—that are linked. That is, when a user is editing a
    Client
    and selects a
    hospital
    , the
    hospital_contact
    select should only show contacts associated with that hospital. I've gotten part of the way there using
    attach_scope
    , like so:
    Copy code
    ruby
    field :hospital_contact,
      as: :belongs_to,
      attach_scope: -> { query.active.from_hospital(parent.hospital_id) },
      required: false
    This works when editing an existing
    Client
    , but falls over when the
    hospital
    is updated (but not saved) or when creating a new
    Client
    , because it's reading the
    hospital_id
    from the
    parent
    rather than getting it from the previous field. Is there a way to modify the field's
    attach_scope
    based on the previous field's value? (I think if this were a
    select
    and not a
    belongs_to
    , I could do it with computed options?)
    l
    l
    • 3
    • 5
  • Hello! Why when I get this: The suggestions don...
    f

    freezing-cricket-25904

    03/21/2024, 6:31 PM
    Hello! Why when I get this: The suggestions don't popup unless I write something https://cdn.discordapp.com/attachments/740893011994738751/1220439749878222899/image.png?ex=660ef217&is=65fc7d17&hm=0685810b7156abd2609f0d1b86f584cb087735ef7db2df0358046b52d0ff5a71& https://cdn.discordapp.com/attachments/740893011994738751/1220439750176145418/image.png?ex=660ef217&is=65fc7d17&hm=da4d0012f678cae2d8c6dcbae4dd0af2a5044c8658f392081b6b2fc24be549d8&
    m
    l
    • 3
    • 19
  • Hello Guys, the AVO 2 is still receiving bugs u...
    q

    quaint-pencil-2979

    03/22/2024, 11:44 AM
    Hello Guys, the AVO 2 is still receiving bugs updates or only for AVO 3?
    m
    l
    l
    • 4
    • 7
  • Hello! I have these models: ``` class TaskList ...
    m

    miniature-optician-85831

    03/27/2024, 9:35 PM
    Thread automatically created by Sillygirrrl☁ in #740893011994738751
    l
    • 2
    • 3
  • Hey guys, I'm at a bit of a loss here with the ...
    m

    miniature-optician-85831

    04/10/2024, 6:10 AM
    Thread automatically created by Nolan in #740893011994738751
    l
    c
    • 3
    • 14
  • Hey guys,@Adrian M @Paul Bob ! I hope you all a...
    l

    late-leather-46322

    05/10/2024, 1:36 PM
    Hey guys,@lemon-wall-20836 @loud-jewelry-99127 ! I hope you all are doing good. I have a question: Is it possible to make the entire row clickable on the index view? For example, if I click anywhere on a row representing a record, can I be redirected to the edit view of that specific record? Similar to using link_to_record: true for a specific field, how can I achieve this functionality for the entire row? Does Avo have any built-in method for this integration?
    m
    l
    l
    • 4
    • 17
  • Hi all. We are currently experiencing a strange...
    w

    wonderful-application-19261

    05/16/2024, 12:42 PM
    Hi all. We are currently experiencing a strange issue. When setting up Avo on our development branch everything works perfectly. However when building our docker image the initialization fails as the Avo logger cannot find the file /logs/avo.log, reluctantly we removed this log file from our gitignore just to investigate the problem further but we are still experiencing the same error. We do not want to commit log files to our repo, has anyone experienced the same problem or have any advice? The error message is as follows:
    Copy code
    rake aborted!
    Errno::ENOENT: No such file or directory @ rb_sysopen - /application/log/avo.log (Errno::ENOENT)
    Thank you advance
    m
    l
    a
    • 4
    • 19
  • Hi all, I have some css issues with pagination ...
    v

    victorious-kangaroo-12568

    05/21/2024, 7:26 PM
    Hi all, I have some css issues with pagination on avo (2.51.0), anyone had this issue too ? I update from 2.40 to 2.51 (the text is in portuguese) https://cdn.discordapp.com/attachments/740893011994738751/1242559151020965888/Screenshot_2024-05-21_at_16.23.08.png?ex=664e46e3&is=664cf563&hm=6a0f6bf12a050c263b2665d42c6d36c89db16e308bf4404984c86c7d0b399d87&
    m
    f
    • 3
    • 5
  • Hey all, i'm using avo (2.51.0), and after I m...
    v

    victorious-kangaroo-12568

    05/22/2024, 9:04 PM
    Hey all, i'm using avo (2.51.0), and after I migrated from avo 2.40 all my index pages have order by created_at ASC, but I need to change for DSC globally for all index pages. Reading the docs, I can't find anything that helped me, anyone have some ideias? On avo 2.40
    Copy code
    Started GET "/admin/resources/users" for ::1 at 2024-05-22 18:13:53 -0300
      User Load (1.7ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["id", "38b63179-b9a4-4a2d-8c49-4eb0b84c78f6"], ["LIMIT", 1]]
    Processing by Avo::UsersController#index as HTML
      User Count (0.8ms)  SELECT COUNT(*) FROM "users"
      User Load (1.3ms)  SELECT "users".* FROM "users" ORDER BY users.created_at desc LIMIT $1 OFFSET $2  [["LIMIT", 72], ["OFFSET", 0]]
    On Avo 2.51
    Copy code
    Started GET "/admin/resources/users" for ::1 at 2024-05-22 18:14:53 -0300
      ActiveRecord::SchemaMigration Pluck (1.6ms)  SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
      User Load (3.0ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."created_at" ASC, "users"."id" ASC LIMIT $2  [["id", "38b63179-b9a4-4a2d-8c49-4eb0b84c78f6"], ["LIMIT", 1]]
    Processing by Avo::UsersController#index as HTML
    [Avo] Performing request to avohq.io API to check license availability.
    Started GET "/admin/resources/users" for ::1 at 2024-05-22 18:14:53 -0300
      User Load (1.1ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."created_at" ASC, "users"."id" ASC LIMIT $2
    m
    l
    • 3
    • 5
  • In production when trying to create a new resou...
    f

    faint-manchester-51052

    05/27/2024, 6:13 PM
    In production when trying to create a new resource (an article, for instance), I'm getting "You might have missed something. Please check the form." with no additional context. The exact same form works fine locally. Production server logs aren't showing any particular error messages either.
    m
    l
    • 3
    • 15
  • Hi guys, @Adrian M @Paul Bob ! I hope you all a...
    l

    late-leather-46322

    05/28/2024, 10:43 AM
    Hi guys, @lemon-wall-20836 @loud-jewelry-99127 ! I hope you all are doing good. I have a question: I've implemented two cards: PartialCard and MetricCard. PartialCard is used as a scope, allowing for multiple time ranges like Today, Yesterday, and Last Month. When the user selects a filter, the MetricCard value is displayed according to that scope. However, selecting a range causes the cards to break, showing this error: > Failed to load sales generated metric frame > This is not an issue with Avo. Use this page to see why this frame failed to load. When I click on the provided link, I am redirected to another page where my card is displayed. Why is that?
    m
    • 2
    • 1
  • Hi guys, there is a way to change all orderging...
    v

    victorious-kangaroo-12568

    06/10/2024, 7:19 PM
    Hi guys, there is a way to change all orderging from resources inside a has_many field? I would like to change the default order from all my has_many fields, but I didnt find anything on documentation, I triyed to change my resolve_query_scope but works only in index pages I'm using 2.51 version
    m
    l
    • 3
    • 8
  • resouce.model coming back nil?
    b

    better-restaurant-41251

    06/11/2024, 2:18 PM
    We have a system test (using Capybara) for our Avo-backed app that randomly, and infrequently, fails. A little bit of context: we're adding a custom field type for phone numbers that handles formatting (using https://github.com/daddyz/phonelib) to the e164 format before saving them to the DB. The error:
    Copy code
    ruby
    Error:
    PhoneNumberFieldTest#test_editing_a_phone_number_that_is_already_properly_formatted:
    ActionView::Template::Error: undefined method `has_opted_for_meal_service' for nil:NilClass
        app/avo/resources/client_resource.rb:292:in `block (4 levels) in <class:ClientResource>'
    The line throwing the error is for a tab that is conditionally visible. We do that with this code:
    Copy code
    ruby
        tab "Meal" do
          panel do
            with_options visible: ->(resource:) { resource.model.has_opted_for_meal_service } do
    Any ideas what might be causing
    resource.model
    to occasionally be
    nil
    ? And/or how to shore up test setup/teardown/isolation so that it's more consistent?
    m
    l
    • 3
    • 15
  • Hello, we're looking for help to upgrade Avo 2 ...
    s

    silly-lion-46554

    07/01/2024, 8:29 AM
    Hello, we're looking for help to upgrade Avo 2 to Avo 3 at RubyGems.org. I was able to use auto-upgrade tool and few manual changes to get at least app boot and running, but there is still a lot of problems and tests failing. The biggest problem I do see is multiple gems for Avo 3 since RubyGems.org is app with open source code and we have no way to add other than public gems into Gemfile. Is there any suggestion for this? We would like to avoid kind of conditional gem deployment. Currently I see a lot of errors like following one. Are those caused by missing
    avo-*
    private gem? Is Avo 3 still friendly to open apps as Avo 2 was?
    Copy code
    AbstractController::ActionNotFound: The action 'index' could not be found for Avo::SearchController
    m
    l
    a
    • 4
    • 44
  • I have openned Avo 2 PR to fix the RubyGems.org...
    s

    silly-lion-46554

    07/01/2024, 6:05 PM
    I have openned Avo 2 PR to fix the RubyGems.org problem. https://github.com/avo-hq/avo/pull/2927 is it worth to open other PRs to onboard latest Rails and Rubies to CI?
    m
    l
    • 3
    • 31
  • i'm trying to add an Avo::Cards::ChartkickCard ...
    e

    eager-dream-725

    07/19/2024, 2:36 PM
    i'm trying to add an Avo::Cards::ChartkickCard pie chart to a pdf export from an avo action. any hints?
    m
    • 2
    • 1
  • looks like pagy 9 isnt compatible with avo2
    a

    alert-monkey-67616

    07/25/2024, 1:21 AM
    looks like pagy 9 isnt compatible with avo2
    m
    l
    l
    • 4
    • 8
  • Could not find a declaration file for module 's...
    m

    miniature-optician-85831

    08/06/2024, 11:30 AM
    Thread automatically created by john.troy in #740893011994738751
  • I think I'm running into an issue and I'm not s...
    m

    mammoth-guitar-49791

    10/02/2024, 8:54 AM
    I think I'm running into an issue and I'm not sure if I'm doing anything wrong in the setup. I have a Picture/Video model that inherits from Medium. and resource is NIL on the show view of medium.
    Copy code
    ruby
    class MediumResource < Avo::BaseResource
      field :utm_parameter, as: :has_one, only_on: :show
    end
    class Medium < ApplicationRecord
      has_one :utm_parameter, dependent: :destroy
    end
    class UtmParameter < ApplicationRecord
      belongs_to :medium
    end
    class UtmParameterResource < Avo::BaseResource
      self.title = :id
    
      field :utm_source, as: :text
      field :utm_medium, as: :text
      field :utm_campaign, as: :text
    end
    # frozen_string_literal: true
    
    class MediumPolicy < ApplicationPolicy
      def index?
        admin?
      end
    
      def show?
        true
      end
    
      def edit?
        true
      end
    
      def create?
        true
      end
    
      def update?
        true
      end
    
      def view_utm_parameter
        true
      end
    
      class Scope < Scope
        def resolve
          scope.all
        end
      end
    end
    Copy code
    ruby
    undefined method `authorization' for nil:NilClass
    
            service = resource.authorization
                              ^^^^^^^^^^^^^^
    https://cdn.discordapp.com/attachments/740893011994738751/1290960151213379584/image.png?ex=66fe5bd4&is=66fd0a54&hm=660a09b050c6d396e149b111173ae7edbe3ca62a701af7653c92a72b89df89f6&
    m
    l
    • 3
    • 6
  • Anonymizing fields + Monkey Patching issue
    l

    lively-knife-78496

    01/03/2025, 2:07 PM
    Hello Avocados, I'm working on a solution to anonymize information on the resource screens, and started planning around having a new attribute for the resource where I would add the symbol IDs of the fields that should be anonymized. The new attribute part I could implement by monkey patching Avo::Resources::Base, but I'm hitting a snag here because I can't seem able to monkey patch the fill record method or any other method there. Anyone has stumbled on something like this?
    Copy code
    # frozen_string_literal: true
    
    module Avo
      module Resources
        class Base
          class_attribute :anonymized_fields, default: []
        end
      end
    end
    Every time I try and override the fill record method for instance, it's simply ignored and goes straight to the regular method
    m
    l
    • 3
    • 2
  • Hi all, Is there a way to overwrite the default...
    s

    straight-lion-45603

    01/14/2025, 1:04 PM
    Hi all, Is there a way to overwrite the default behavior when clicking Enter key in the Search Bar which currently cancels the search? Typically, pressing Enter in a search bar initiates the search or redirects to a search results page so this ux seems a bit counter intuitive. https://cdn.discordapp.com/attachments/740893011994738751/1328711356387426435/image.png?ex=6787b261&is=678660e1&hm=84921829e37f9097ef0b9cd97a9a7ac448560451e9a1b4aa7616070c99a03f64&
    m
    l
    • 3
    • 3
  • Hi there! I was wondering if there is a way to ...
    m

    most-lighter-79679

    05/07/2025, 3:53 PM
    Hi there! I was wondering if there is a way to remove the
    Create new
    button from a
    belongs_to
    field? Thanks for the help! https://cdn.discordapp.com/attachments/740893011994738751/1369703695897329795/Screenshot_2025-05-07_at_9.52.37_AM.png?ex=681cd378&is=681b81f8&hm=fb4b24e793356a93d17f5a8e891dab0700e871c6c7aec108a5647455f95ad172&
    m
    l
    • 3
    • 14