activeadmin


ActiveAdmin limiting has_many association retrieval?


Hi this is my first spin with active admin, I have the two models:
Patient
Attributes
Where a Patient has_many Attributes
I created a patient resource like this:
rails g active_admin:resource patient
It seemed to work fine, however: the query active admin is creating:
Patient Load (0.9ms) SELECT "patient".* FROM "patient" ORDER BY "patient"."id" desc LIMIT 30 OFFSET 0
Attribute Load (1878.2ms) SELECT "attributes".* FROM "attributes"
The problem is with the second one, because I have about 200 000 Attributes so SELECT * "attributes" is killing my computer.
I've been looking for an hour on how to limit the second query. Any help is appreciated. Thanks.
So I figured out why the query tried to select all of the attributes.
ActiveAdmin tries to create a filter area, by default and retrieves all possibilities for the belongs_to association in order to create a drop down.
To get around this I wrote a custom filter which excludes the attribute like:
filter :name

Related Links

Render plain form html from ActiveAdmin instead of full page
Customize ActiveAdmin Page based on Roles
NoMethodError error for search_methods activeadmin
rails concerns - superclass mismatch error with active_admin in gems list
How to filter by “is not” in active admin/ransack
Active Admin image upload with refile
AuthorizationAdapter in ActiveAdmin
ActiveAdmin and Rails Engine. How do you keep the path name the same?
Active admin defining scope for custom page
ActiveAdmin: Can I redirect the user to the index after they create/edit something?
Active admin and Pundit
Sortable for has_many does not sort properly
select2 remove tag_list item
Adding Numeric Range Filtering to ActiveAdmin
undefined method `destroy_user_session_path' for active admin with cancancan and sorcery
Active admin not working in production mode

Categories

HOME
weblogic12c
blast
mpdf
tcsh
out-of-memory
mathematical-optimization
google-sheets-query
dji-sdk
u-boot
selection
msmq
reportviewer
stack-overflow
swarm
cqrs
getopenfilename
pm2
global-variables
uima
fosuserbundle
exec-maven-plugin
jaspersoft-studio
android-custom-view
akka-persistence
liferay-6.2
qa
device
websphere-portal
eclipse-emf
managed-c++
window-managers
points
miniprofiler
bonita
region
docx4j
intune
es6-modules
quick-nimble
universal
custom-keyboard
amazon-kms
django-smart-selects
assemblies
game-center
suds
grails-spring-security
fiware-wirecloud
type-inference
moinmoin
music21
axis
tinyioc
cordova-ios
entropy
subforms
google-news
ltrace
processor
xcopy
okta-api
onepage-checkout
management-studio-express
android-expansion-files
miniconda
mixins
enaml
embeddedwebserver
angular-amd
explain
kefir.js
nanomsg
adhoc-polymorphism
encryption-symmetric
image-rotation
xhprof
hyperloglog
sqlbindparameter
tabletools
code39
particle-swarm
jquery-transit
cmath
session-0-isolation
multiscaleimage
jquery-dialog
image-scanner
affinetransform
nsrangeexception
space-partitioning
mongrel2
mongrel
firephp
processors
fxruby
accumulator
account-management

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App