pawurb / dont_you_count

Disable count queries for selected Active Admin tables.
MIT License
7 stars 2 forks source link

README not clear about models with multiple words or namespaced #3

Open MathieuDerelle opened 6 years ago

MathieuDerelle commented 6 years ago

My model was named ReceiptSubpicture and it took me a bit to realize that I needed config.dont_count = ['receipt subpicture']

I'm not sure how it works with namespaced models and such

https://github.com/kaminari/kaminari/blob/v0.17.0/lib/kaminari/models/active_record_relation_methods.rb#L12

It would be easier to just use model_name instead of entry_name Maybe model_name.tableize if we want something snake_cased

pawurb commented 6 years ago

Honestly I am surprised anyone uses this gem.

You would need to insert some debugger into the

def total_count(column_name = :all, options = {})

monkey patch, to see how entry_name variable looks for namespaced models.

MathieuDerelle commented 6 years ago

yep, thats what I did to find the solution

(our monolithic rails app is stuck at rails 3 and AA 0.6 :D )