miniature-optician-85831
11/17/2023, 12:45 AMminiature-optician-85831
11/21/2023, 7:24 PMcalm-gold-48525
11/22/2023, 5:00 PMminiature-optician-85831
11/22/2023, 9:18 PMminiature-optician-85831
11/22/2023, 9:18 PMminiature-optician-85831
11/23/2023, 8:52 PMminiature-optician-85831
11/23/2023, 10:22 PMminiature-optician-85831
11/25/2023, 2:26 PMfamous-motherboard-45406
11/25/2023, 2:39 PMruby
self.search_query = -> do
if params[:global]
# Perform global search
scope.ransack(id_eq: params[:q], nom_cont: params[:q], accountnr_cont: params[:q], m: "or").result(distinct: false)
else
# Perform resource search
scope.ransack(id_eq: params[:q], nom_or_ville_cont: params[:q], accountnr_cont: params[:q], m: "or").result(distinct: false)
end
end
miniature-optician-85831
11/29/2023, 1:13 PMminiature-optician-85831
12/01/2023, 2:13 PMminiature-optician-85831
12/05/2023, 2:38 PMminiature-optician-85831
12/19/2023, 7:54 PMminiature-optician-85831
12/27/2023, 7:54 PMminiature-optician-85831
01/12/2024, 11:17 AMminiature-optician-85831
01/12/2024, 11:17 AMminiature-optician-85831
01/12/2024, 11:21 AMminiature-optician-85831
01/18/2024, 7:30 AMalert-monkey-67616
01/23/2024, 1:37 AMbin/rails db:drop db:create db:migrate db:seed
because avo's routes eagerly load all resources, and then all model classes for those resourcesminiature-optician-85831
01/29/2024, 6:09 PMvictorious-kangaroo-12568
02/01/2024, 5:51 PMmodule Avo
module Actions
module Users
class Activate < Avo::BaseAction
resource
action Users::Activate
i'm having issues with eager loading
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?miniature-optician-85831
02/04/2024, 2:06 AMminiature-optician-85831
02/04/2024, 2:08 AMminiature-optician-85831
02/07/2024, 3:55 PMminiature-optician-85831
02/13/2024, 5:19 PMbetter-restaurant-41251
02/19/2024, 3:20 AMClientResource
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:
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?)freezing-cricket-25904
03/21/2024, 6:31 PMquaint-pencil-2979
03/22/2024, 11:44 AMminiature-optician-85831
03/27/2024, 9:35 PMminiature-optician-85831
04/10/2024, 6:10 AM