#RubyOnRails - 21 March 2019
« Back 1 day Forward 1 day »
[01:27:26] ss942: I have problem with .order() inside controller, when I add this query takes centuries. And I have no idea how to fix it.
[01:27:26] ss942: Project.first.documents.joins("LEFT JOIN custom_values AS cv ON custom_values.customized_id = documents.id AND custom_values.custom_field_id = 55").limit(5)
[01:27:27] ss942: Project.first.documents.joins("LEFT JOIN custom_values AS cv ON custom_values.customized_id = documents.id AND custom_values.custom_field_id = 55").order(custom_values.value).limit(5)
[07:03:45] dionysus69: which is normally a convention, I have a spec with parent and 2 children, should I test all 3 in parent spec or should I maximize division between the specs?
[08:00:31] guyzmo: ss942 - that's because when you do limit(5) the query takes only the needed time to take 5 elements out of the database, without looking further
[08:01:50] guyzmo: ss942 - when you add `order(...)` (same thing goes for `distinct`), the db needs to crawl through the whole table to compare all the values, to display them in order
[08:37:53] albipri: I'm having issue in installing rack-mini-profiler in my Rails app in my local development environment.
[08:37:55] albipri: I also tried to add `require: false` to the gemfile entry for rack-mini-profiler
[12:07:34] garyserj: where is rails located in mac osx? (i'm having trouble installing it so perhaps somebody can do which rails and let me know the path? thanks)
[12:49:56] Cork: is it possible to get activerecord to use stable names for dynamicly joined tables?
[14:44:10] yoshie902a: If anyone is really talented and take a shot at a harder join, please let help with this.. https://stackoverflow.com/questions/55272545/joins-one-way-but-not-the-other
[15:30:18] yoshie902a: alexeev: I did show the models, which should be enough, but glad to share more
[17:58:25] Dbugger: Was it possible to create with a contructor not only the attributes of a model, but also of its references?
[20:13:55] srruby: In a controller index method, I have code like: CustomerMachine.joins([:customer,:machine]).order('customers.name,machines.name')