dazzling-kite-85871
07/21/2021, 2:01 PMrefined-furniture-64458
07/21/2021, 2:01 PMdazzling-kite-85871
07/21/2021, 2:02 PMgem "avo", "~> 1.8"
dazzling-kite-85871
07/21/2021, 2:04 PMdazzling-kite-85871
07/21/2021, 2:11 PMavo (1.11.6)
refined-furniture-64458
07/21/2021, 2:12 PMrefined-furniture-64458
07/21/2021, 2:13 PMdazzling-kite-85871
07/21/2021, 2:14 PMdazzling-kite-85871
07/23/2021, 5:35 PMconfig.load_defaults 6.0
and config.load_defaults 6.1
Thanks for being so ready to jump on the problem!able-potato-47775
07/28/2021, 7:13 PMname
to fields such as has_many
, e.g.
field :goal_templates, as: :has_and_belongs_to_many, name: "Goal templates"
such that it can affect the displayed name for the relationship?
or, is there another way to handle this? thanks!lemon-wall-20836
07/29/2021, 9:55 AMhas_many
naming bugcool-greece-65430
08/06/2021, 3:04 PMlemon-wall-20836
08/07/2021, 9:02 AMlemon-wall-20836
08/07/2021, 9:03 AMcool-greece-65430
08/07/2021, 1:17 PMlemon-wall-20836
08/09/2021, 8:23 AMlemon-wall-20836
08/09/2021, 8:23 AMresolve_find_scope
to do thatlemon-wall-20836
08/09/2021, 8:24 AMbrief-king-35906
08/09/2021, 11:32 AMbrief-king-35906
08/09/2021, 11:32 AMcool-greece-65430
08/09/2021, 4:36 PMbrief-king-35906
08/09/2021, 4:49 PMresolve_find_scope
helper provides the model's class directly. so if you want to make sure the find scope only includes users which have not been deleted you'd do something like:
ruby
class UserResource < Avo::BaseResource
self.resolve_find_scope = ->(model_class:) do
# model_class here is User so to do something like:
# User.where(deleted_at: nil)
model_class.where(deleted_at: nil)
end
end
brief-king-35906
08/09/2021, 4:50 PMUser.where(deleted_at: nil).find(whatever_id)
brief-king-35906
08/09/2021, 4:51 PMfind
method so you don't need to add that in the resolve_find_scope
lemon-wall-20836
08/10/2021, 7:17 PMlemon-wall-20836
08/10/2021, 7:17 PMmodel_class.where(deleted_at: nil)
is the qeuvalent of User.where(deleted_at: nil)
agreeable-action-34041
08/11/2021, 4:04 AMbin/rails generate avo:field custom_text
then tried to use it for a string column...
field :name, as: :custom_text
But it doesn't work. The field just disappears from view. Can anyone help?agreeable-action-34041
08/11/2021, 4:07 AMlemon-wall-20836
08/11/2021, 9:00 AMagreeable-action-34041
08/11/2021, 10:02 AM