straight-pager-31449
02/17/2023, 2:45 PMlemon-spoon-80671
02/17/2023, 3:50 PMripe-article-50191
02/22/2023, 8:30 AMripe-article-50191
02/22/2023, 8:33 AMundefined method "new" for nil:NilClass
field = field_klass.new id, form: form, view: view, **args, &block
in partial view with the nested fields
<%= avo_edit_field :answer, as: :string, form: f, help: "Write the answer", required: true %>
Any help or idea?straight-pager-31449
02/22/2023, 2:23 PMcurved-father-82134
02/22/2023, 2:23 PMfield :user_id, as: :select, options: User.all.pluck(:first_name, :id), name: I18n.t('avo.order.select_customer')
`
It's working fine while using website. All the Linter and Test cases are fine. but on Github showing me this.
When i remove this field or use it like this way field :user_id, as: :select, options: {'Tracy': '1',
It's work as expected.
Can you pleas guide me where I'm wrong. Thanks in advance.powerful-planet-46063
02/23/2023, 12:20 AMCurrent
successfully? For me the user is reached by parts of Avo (logged in and displayed in the menu) but is not being passed into the Pundit policy. I have come up with a work around which I can gladly share but given that the following is in the docs I'm wondering If Im missing something.
ruby
Avo.configure do |config|
config.current_user_method do
Current.user
end
end
strong-restaurant-36788
02/23/2023, 2:35 AMstrong-restaurant-36788
02/23/2023, 2:37 AMpowerful-planet-46063
02/23/2023, 2:41 AMCurrent.user || Session.find_by_id(cookies.signed[:session_token])&.user
Where Current.user
is essentially set the same way anyway so it's mostly a matter of redundancy here.strong-restaurant-36788
02/23/2023, 3:23 AMlemon-wall-20836
02/23/2023, 8:32 AMCurrent
and current_user
threadboundless-artist-39401
02/23/2023, 10:17 AMnarrow-laptop-54609
02/23/2023, 4:04 PMnarrow-laptop-54609
02/23/2023, 4:31 PMnarrow-laptop-54609
02/23/2023, 4:32 PMnice-ambulance-76519
02/23/2023, 5:15 PMnarrow-laptop-54609
02/23/2023, 5:19 PMhide_on
nice-ambulance-76519
02/23/2023, 5:19 PMstraight-pager-31449
02/26/2023, 4:50 AMwooden-island-51391
02/26/2023, 7:52 AMstraight-pager-31449
02/26/2023, 11:08 AMlemon-wall-20836
02/26/2023, 1:44 PMlemon-wall-20836
02/26/2023, 1:44 PMpowerful-planet-46063
02/26/2023, 7:27 PMquiet-winter-98496
02/27/2023, 12:42 PMmammoth-guitar-49791
02/27/2023, 2:30 PMswift-businessperson-84139
02/28/2023, 6:23 AMboundless-artist-39401
02/28/2023, 5:36 PMswift-businessperson-84139
03/01/2023, 4:55 AMhas_many :employees, lambda {
where(business_people: { relationship: BusinessPerson.relationships[:employee] })
}, through: :business_people, source: :person, class_name: 'Person'
To an avo field for a resource.
I have tried:
field :employees,
as: :has_many,
through: :business_people,
use_resource: PersonResource,
scope: -> { query.where(business_people: { relationship: BusinessPerson.relationships[:employee] }) }
but it's not setting business_people.relationship
properly.