« Back to channel list

#RubyOnRails - 27 February 2018

« Back 1 day Forward 1 day »
[00:03:46] mostlybadfly: has joined #RubyOnRails
[00:05:35] ramfjord: Actually I resorted to using fixtures to initialize the primary table rows so they would be visible to the consumer thread, and stubbed out the creation of the foreign key constrained rows (tested separately and in the primary thread). I've been trying to slowly wean this code base off of fixtures in favor of factories, so it's a bit sad to have to go back to them, but otherwise I couldn't get the
[00:05:41] ramfjord: threaded connection to see the factory rows I was making :(
[00:10:19] ephemer0l_: has joined #RubyOnRails
[00:11:19] alfiemax: has joined #RubyOnRails
[00:12:13] tcopeland: has joined #RubyOnRails
[00:21:36] quazimodo: has joined #RubyOnRails
[00:26:15] guacamole: has joined #RubyOnRails
[00:38:22] timdotrb: has joined #RubyOnRails
[00:45:12] alfiemax: has joined #RubyOnRails
[01:02:23] alfiemax: has joined #RubyOnRails
[01:35:05] timdotrb: has joined #RubyOnRails
[01:47:50] ramfjord: has joined #RubyOnRails
[01:51:06] alfiemax: has joined #RubyOnRails
[01:51:12] SteenJobs_: has joined #RubyOnRails
[01:53:52] ramfjord: has joined #RubyOnRails
[01:59:49] ramfjord: has joined #RubyOnRails
[02:02:06] cjoshmartin: has joined #RubyOnRails
[02:07:00] ramfjord: has joined #RubyOnRails
[02:12:53] darkhanb: has joined #RubyOnRails
[02:13:47] ramfjord: has joined #RubyOnRails
[02:19:44] ramfjord: has joined #RubyOnRails
[02:25:44] ramfjord: has joined #RubyOnRails
[02:44:13] cjoshmartin: has joined #RubyOnRails
[02:46:45] alfiemax: has joined #RubyOnRails
[02:59:35] alfiemax: has joined #RubyOnRails
[03:04:36] ResidentBiscuit: has joined #RubyOnRails
[03:14:25] fragamus: has joined #RubyOnRails
[03:16:36] alfiemax: has joined #RubyOnRails
[03:18:35] Coldblackice: has joined #RubyOnRails
[03:24:32] jottr: has joined #RubyOnRails
[03:37:36] alfiemax: has joined #RubyOnRails
[03:39:05] jottr: has joined #RubyOnRails
[03:44:27] _aeris_: has joined #RubyOnRails
[03:49:52] jottr: has joined #RubyOnRails
[03:55:45] jottr: has joined #RubyOnRails
[04:01:50] jottr: has joined #RubyOnRails
[04:17:21] jottr: has joined #RubyOnRails
[04:21:13] alfiemax: has joined #RubyOnRails
[04:23:51] nickjj_: has joined #RubyOnRails
[04:25:08] jottr: has joined #RubyOnRails
[04:25:15] trautwein: has joined #RubyOnRails
[04:31:43] jottr: has joined #RubyOnRails
[04:41:32] arthurz: has joined #RubyOnRails
[04:42:51] arthurz: Hi all, assuming I am in dev environment with my app deployed and served via Nginx and I needed to do a change in code in a controller, how to then compile it into the `public` folder?
[04:45:51] jottr: has joined #RubyOnRails
[04:53:28] jottr: has joined #RubyOnRails
[04:53:30] alfiemax: has joined #RubyOnRails
[05:07:43] jottr: has joined #RubyOnRails
[05:16:27] alfiemax: has joined #RubyOnRails
[05:18:31] jottr: has joined #RubyOnRails
[05:29:49] sevenseacat: has joined #RubyOnRails
[05:31:11] mtkd: has joined #RubyOnRails
[05:33:50] jottr: has joined #RubyOnRails
[05:36:17] srinidhi: has joined #RubyOnRails
[05:37:48] alfiemax: has joined #RubyOnRails
[05:47:28] jottr: has joined #RubyOnRails
[05:55:01] alfiemax: has joined #RubyOnRails
[05:57:16] mtkd: has joined #RubyOnRails
[06:01:12] jottr: has joined #RubyOnRails
[06:09:06] jottr: has joined #RubyOnRails
[06:17:05] alfiemax: has joined #RubyOnRails
[06:18:24] jottr: has joined #RubyOnRails
[06:25:34] jottr: has joined #RubyOnRails
[06:27:37] MrCrackPotBuilde: has joined #RubyOnRails
[06:30:02] srinidhi: has joined #RubyOnRails
[06:32:17] jottr: has joined #RubyOnRails
[06:33:32] cjoshmartin: has joined #RubyOnRails
[06:33:49] dionysus69: has joined #RubyOnRails
[06:33:54] baweaver: arthurz: Controllers would automatically "reload"
[06:34:26] baweaver: public is for static resources like stylesheets and javascript which you would need to rig things in RAILS_ENV=development to do.
[06:42:37] ramfjord: has joined #RubyOnRails
[06:43:23] jottr: has joined #RubyOnRails
[06:45:21] alfiemax: has joined #RubyOnRails
[06:55:22] jottr: has joined #RubyOnRails
[07:04:00] alfiemax: has joined #RubyOnRails
[07:07:36] jottr: has joined #RubyOnRails
[07:10:55] dminuoso: ACTION reloads baweaver
[07:11:27] dminuoso: baweaver: Im doing it with the parser combinators btw.
[07:11:45] dminuoso: Not the article, but a repo.
[07:22:28] jottr: has joined #RubyOnRails
[07:31:14] darkhanb: has joined #RubyOnRails
[07:34:35] mtkd: has joined #RubyOnRails
[07:38:10] jottr: has joined #RubyOnRails
[07:50:12] alfiemax: has joined #RubyOnRails
[07:50:56] jottr: has joined #RubyOnRails
[07:59:20] KeyJoo: has joined #RubyOnRails
[08:00:11] conta: has joined #RubyOnRails
[08:04:53] jottr: has joined #RubyOnRails
[08:05:28] cschneid: has joined #RubyOnRails
[08:12:52] jottr: has joined #RubyOnRails
[08:14:14] KeyJoo: has joined #RubyOnRails
[08:14:56] schneider: has joined #RubyOnRails
[08:20:13] jottr: has joined #RubyOnRails
[08:22:32] sidx64: has joined #RubyOnRails
[08:27:08] mtkd: has joined #RubyOnRails
[08:33:54] jottr: has joined #RubyOnRails
[08:42:29] ramfjord: has joined #RubyOnRails
[08:46:24] jottr: has joined #RubyOnRails
[08:58:29] jottr: has joined #RubyOnRails
[09:04:15] mikecmpbll: has joined #RubyOnRails
[09:05:30] jottr: has joined #RubyOnRails
[09:13:20] jottr: has joined #RubyOnRails
[09:22:59] jottr: has joined #RubyOnRails
[09:29:31] alfiemax: has joined #RubyOnRails
[09:29:49] jottr: has joined #RubyOnRails
[09:29:53] wojnar: has joined #RubyOnRails
[09:36:15] Ergo: has joined #RubyOnRails
[09:43:45] Fusselgesicht: has joined #RubyOnRails
[09:43:56] DrYockel: has joined #RubyOnRails
[09:44:53] jottr: has joined #RubyOnRails
[09:45:02] arBmind: has joined #RubyOnRails
[09:56:13] jottr: has joined #RubyOnRails
[10:07:43] jottr: has joined #RubyOnRails
[10:21:20] jottr: has joined #RubyOnRails
[10:21:34] mtkd: has joined #RubyOnRails
[10:29:44] marr: has joined #RubyOnRails
[10:32:58] jottr: has joined #RubyOnRails
[10:40:09] jottr: has joined #RubyOnRails
[10:42:19] ramfjord: has joined #RubyOnRails
[10:50:27] jottr: has joined #RubyOnRails
[10:56:59] Sylario: has joined #RubyOnRails
[11:00:36] jottr: has joined #RubyOnRails
[11:05:28] uks: has joined #RubyOnRails
[11:12:57] hmaronon: has joined #RubyOnRails
[11:12:59] jottr: has joined #RubyOnRails
[11:13:58] alfiemax: has joined #RubyOnRails
[11:21:34] jottr: has joined #RubyOnRails
[11:29:58] sidx64: has joined #RubyOnRails
[11:31:56] jottr: has joined #RubyOnRails
[11:34:10] morantron: has joined #RubyOnRails
[11:37:18] apparition: has joined #RubyOnRails
[11:38:30] schneider: has joined #RubyOnRails
[11:41:08] sidx64: has joined #RubyOnRails
[11:41:08] jottr: has joined #RubyOnRails
[11:44:26] KeyJoo: has joined #RubyOnRails
[11:52:16] jottr: has joined #RubyOnRails
[11:53:02] cstls: has joined #RubyOnRails
[11:59:31] jottr: has joined #RubyOnRails
[12:02:26] Cavallari: has joined #RubyOnRails
[12:07:13] mostlybadfly: has joined #RubyOnRails
[12:07:31] workmad3: has joined #RubyOnRails
[12:07:41] jottr: has joined #RubyOnRails
[12:14:09] cstls: has joined #RubyOnRails
[12:18:56] jottr: has joined #RubyOnRails
[12:19:55] apeiros: has joined #RubyOnRails
[12:24:03] Less: has joined #RubyOnRails
[12:25:19] jottr: has joined #RubyOnRails
[12:26:44] mtkd: has joined #RubyOnRails
[12:31:58] alfiemax: has joined #RubyOnRails
[12:36:43] jottr: has joined #RubyOnRails
[12:40:18] daemonwrangler: has joined #RubyOnRails
[12:50:14] jottr: has joined #RubyOnRails
[12:59:42] jottr: has joined #RubyOnRails
[13:01:50] cstls: has joined #RubyOnRails
[13:06:46] jottr: has joined #RubyOnRails
[13:07:51] alfiemax: has joined #RubyOnRails
[13:23:52] aguestuser: has joined #RubyOnRails
[13:24:23] morfin60: has joined #RubyOnRails
[13:26:31] morfin60: i use JSONResources and have resource for model Pool in list i need to get some parameters from non-relational database for each Pool instance how do i avoid querying database 2 times for each Pool instance?
[13:28:22] morfin60: queries could be placed in an array(as example: {start: 0, queries: [{metric: 'foo.bar', tags: {pool: 1, type: 'total'}, aggregate: 'sum'}, {metric: 'foo.bar', tags: {pool: 2, type: 'total'}, aggregate: 'sum'}]
[13:34:49] roshanavand: has joined #RubyOnRails
[13:43:19] ramfjord: has joined #RubyOnRails
[13:48:25] alfiemax: has joined #RubyOnRails
[13:51:04] cstls: has joined #RubyOnRails
[14:06:11] Saukk: has joined #RubyOnRails
[14:09:15] cschneid: has joined #RubyOnRails
[14:11:13] arthurz: Hi all, assuming I am in dev environment with my app deployed and served via Nginx and I needed to do a change in code in a controller, how to then compile it into the `public` folder?
[14:11:43] mr-spoon: has joined #RubyOnRails
[14:28:48] alfiemax: has joined #RubyOnRails
[14:30:09] lupine: has joined #RubyOnRails
[14:31:54] mtkd: has joined #RubyOnRails
[14:37:24] wojnar: you dont compile controller to public folder
[14:38:27] wojnar: you can run nginx with passenger using development or production mode, when in development u can see changes immediately, and in production after restart because of caching
[14:39:05] wojnar: after nginx restart ofc
[14:39:21] wojnar: depends on your passenger config file
[14:39:33] Cavallari: has joined #RubyOnRails
[14:47:08] arthurz: ah OK, thank you very much @wojnar
[14:47:51] arthurz: for the record, the people in the #nginx channel are very adamant about Passanger being the root of all evil. I am curious why?
[14:48:12] wojnar: no idea, me and my company are fine with it
[14:48:40] arthurz: it is abouit it root access rights I was hinted
[14:50:28] wojnar: there is rvm installed for local user which works fine with passenger
[14:50:39] wojnar: i never had security issues
[14:50:42] wojnar: just performance
[14:51:37] wojnar: since i remember nginx + passenger was fine and easy to maintain
[14:55:06] alfiemax: has joined #RubyOnRails
[15:00:56] riotjoe: has joined #RubyOnRails
[15:03:01] krawchyk: has joined #RubyOnRails
[15:27:29] alfiemax: has joined #RubyOnRails
[15:28:08] cabotto: has joined #RubyOnRails
[15:30:49] krawchyk: has joined #RubyOnRails
[15:42:42] desperek: has joined #RubyOnRails
[15:44:30] riotjones: has joined #RubyOnRails
[15:44:48] Sylario: I always feels weird using apache, it's crazy how little it's used in RoR circles
[15:45:36] dionysus69: has joined #RubyOnRails
[15:46:32] Sylario: But I knew Apache before even knowing how to code, and I always had something more useful to do than to learn how to use a new web server
[15:52:46] arthurz: Where to see errors for a RoR app in dev mode?
[15:52:56] fryguy: logs/development.log
[15:53:11] riotjones: Isn't apache overbloated?
[15:56:58] arthurz: Hmm, where is the default/typicall location of the Foreman script?
[15:57:29] fryguy: arthurz: Procfile, in the root of the project
[15:58:29] arthurz: Thank you so much @fryguy
[16:00:32] arthurz: why `bundle exec sidekiq Could not locate Gemfile or .bundle/ directory`?
[16:02:57] arthurz: G-d it only works if in the web app root dir
[16:03:16] uks: has joined #RubyOnRails
[16:14:47] krawchyk: has joined #RubyOnRails
[16:19:36] krawchyk: has joined #RubyOnRails
[16:22:21] regedit: has joined #RubyOnRails
[16:26:18] cschneid: has joined #RubyOnRails
[16:27:25] cjoshmartin: has joined #RubyOnRails
[16:33:56] troys: has joined #RubyOnRails
[16:36:34] mtkd: has joined #RubyOnRails
[16:38:29] krawchyk: has joined #RubyOnRails
[16:43:52] schneider: has joined #RubyOnRails
[16:49:24] krawchyk: has joined #RubyOnRails
[16:49:55] beingjohnm_: my views are getting very hard to follow as my app gets more complex
[16:52:31] jottr_: has joined #RubyOnRails
[16:56:36] krawchyk: has joined #RubyOnRails
[16:59:47] krawchyk: has joined #RubyOnRails
[17:00:21] schneider: has joined #RubyOnRails
[17:07:05] [Butch]: has joined #RubyOnRails
[17:15:25] dviola: has joined #RubyOnRails
[17:15:31] cjoshmartin: has joined #RubyOnRails
[17:16:01] cjoshmartin: has joined #RubyOnRails
[17:16:05] jcarl43: has joined #RubyOnRails
[17:18:07] one_zero: has joined #RubyOnRails
[17:18:15] Dimik: has joined #RubyOnRails
[17:23:47] cjoshmartin: has joined #RubyOnRails
[17:29:04] cjoshmartin: has joined #RubyOnRails
[17:29:08] tycoon177: how can i manually configure a rack cache control header for the /media/ path on my server?
[17:29:57] tycoon177: i want it to always include ", immutable" at the end. every image state will have a different url and will not need to change
[17:29:59] apeiros: has joined #RubyOnRails
[17:31:26] guacamole: has joined #RubyOnRails
[17:31:43] darkhanb: has joined #RubyOnRails
[17:41:39] conta: has joined #RubyOnRails
[17:48:00] choke: has joined #RubyOnRails
[17:49:05] srinidhi: has joined #RubyOnRails
[17:50:25] jottr_: has joined #RubyOnRails
[18:10:11] tubbo: has joined #RubyOnRails
[18:10:22] mikecmpbll: has joined #RubyOnRails
[18:11:13] cjoshmartin: has joined #RubyOnRails
[18:18:01] dionysus69: has joined #RubyOnRails
[18:18:09] Cavallari: has joined #RubyOnRails
[18:20:49] jottr_: has joined #RubyOnRails
[18:23:38] mikkel-: has joined #RubyOnRails
[18:24:29] mikkel-: If I want to do a query like `Order.where.not(some_field: :some_other_field)` is that possible with active record?
[18:25:03] mikkel-: Where some_field and :some_other_field both are columns in a database for Order
[18:25:42] ams__: has joined #RubyOnRails
[18:29:04] jokke: hi! i have a rails 4 project and want to use respond_to / respond_with. I need to customize the rendering for json though. Here's what i've tried: https://p.jokke.space/hmP6/
[18:29:24] jokke: this doesn't however affect the output of the json format at all
[18:34:51] krawchyk: has joined #RubyOnRails
[18:40:36] lupine: has joined #RubyOnRails
[18:41:39] mtkd: has joined #RubyOnRails
[18:41:41] sameerynho: has joined #RubyOnRails
[18:44:15] ramfjord: has joined #RubyOnRails
[18:45:01] beingjohnm_: mikkel-: Order.where("some_field != some_other_field")
[18:45:52] mikkel-: beingjohnm_: Of course thanks!
[19:07:22] krawchyk: has joined #RubyOnRails
[19:10:26] jottr_: has joined #RubyOnRails
[19:14:26] cjoshmartin: has joined #RubyOnRails
[19:14:34] tycoon177: is there a way to modify the rack-cache `Cache-Control` header? I have some assets that I would like to add `, immutable` to the end to prevent compatible browsers to not make any sort of request the second time the asset is linked
[19:15:03] tycoon177: all i have found, even by reading the source of rack-cache is the ability to change the timeout
[19:15:08] tycoon177: er, the max age
[19:17:38] jottr_: has joined #RubyOnRails
[19:31:44] conta: has joined #RubyOnRails
[19:32:51] jottr_: has joined #RubyOnRails
[19:35:19] ule: you can do this via varnish/nginx as well
[19:35:58] tycoon177: ule: set the header via one of those?
[19:36:01] mtkd: has joined #RubyOnRails
[19:40:10] veloutin: anyone familiar with the implications of the FileStore cache extending Strategy::LocalCache ? Does it mean during a request the same cache key will return the same object?
[19:40:48] kies: has joined #RubyOnRails
[19:41:08] veloutin: in 'rails c production', I'm not seeing the same object being returned, but it looks like changing the returned object affected multiple code locations using the same cached value
[19:42:10] jottr_: has joined #RubyOnRails
[19:44:03] MrPunkin: has joined #RubyOnRails
[19:48:35] AnotherOne: has joined #RubyOnRails
[19:49:02] lord4163: has joined #RubyOnRails
[19:51:09] jottr_: has joined #RubyOnRails
[19:51:54] schneider: has joined #RubyOnRails
[19:53:31] MrPunkin: has left #RubyOnRails: ()
[19:59:57] jottr_: has joined #RubyOnRails
[20:01:34] schneider: has joined #RubyOnRails
[20:02:35] kies: has joined #RubyOnRails
[20:04:04] veinofstars: has joined #RubyOnRails
[20:04:35] veinofstars: is there a name for the feature of unicorn that will keep the last working version of a Rails app in memory and on workers if the new version fails to start on the master?
[20:04:51] veinofstars: or is that just a feature of preload_app being true?
[20:05:04] alfiemax: has joined #RubyOnRails
[20:07:18] uks: has joined #RubyOnRails
[20:10:17] schneider: has joined #RubyOnRails
[20:10:55] jottr_: has joined #RubyOnRails
[20:14:27] newton: has joined #RubyOnRails
[20:14:30] sidx64_: has joined #RubyOnRails
[20:15:07] newton: is there a way I can have find not convert a string like '9abcd' to 9 and treat it like the actual id being requested?
[20:17:24] havenwood: newton: Do you want an error raised instead?
[20:17:48] schneider: has joined #RubyOnRails
[20:17:54] newton: havenwood: yes, like the usual RecordNotFound
[20:20:41] havenwood: newton: find_by! id: '9abcd' #!> ActiveRecord::RecordNotFound
[20:20:49] newton: thank you
[20:21:18] jottr_: has joined #RubyOnRails
[20:22:02] alfiemax: has joined #RubyOnRails
[20:22:41] havenwood: newton: Oops, sorry I'm wrong. #find_by! also uses #to_i cooercion.
[20:23:50] havenwood: newton: Find(Integer('9abcd')) isn't very fun.
[20:24:24] havenwood: newton: That's a tricky one.
[20:24:41] newton: it's funny because find_by!('9abc') is actually giving me what I want but the query is clearly weird
[20:26:35] newton: oh lol nvm
[20:27:10] jottr_: has joined #RubyOnRails
[20:29:13] pmtob: has joined #RubyOnRails
[20:30:34] pmtob: Good day beautiful people, I come looking for some help...currently trying to upgrade to Rails 5.2 RC1 from Rails 5.1 and am running into an interesting issue with 'No route matches /whatever' that does not exist in Rails 5.1. Might someone have a few moments to help?
[20:32:25] cstls: has joined #RubyOnRails
[20:32:29] havenwood: pmtob: Gist the relevant route? Any ideas what's different about it?
[20:32:40] jAndres123: has joined #RubyOnRails
[20:33:47] pmtob: There are quite a few tests thatre failing (via assert_routing)...after spending some time in Routes.rb, there isnt much of a pattern across the ones that have failed
[20:34:26] fcser__: has joined #RubyOnRails
[20:34:34] pmtob: Have you heard of anyone else running into this issue?
[20:35:01] pmtob: The tests pass locally when using `bin/rails test` but fail when using `bundle exec ruby -Itest` which is interesting
[20:35:02] jAndres123: how can i retrieve records and put specific row to the top?
[20:37:24] jottr_: has joined #RubyOnRails
[20:37:37] jAndres123: is that posible in one single line?
[20:37:44] workmad3: has joined #RubyOnRails
[20:39:08] jAndres123: please help!
[20:39:29] alfiemax: has joined #RubyOnRails
[20:40:39] jAndres123: guys help me
[20:41:02] zleap: has joined #RubyOnRails
[20:41:39] havenwood: jAndres123: #order
[20:42:08] jAndres123: havenwood: how?
[20:42:31] havenwood: jAndres123: do you know SQL?
[20:42:43] jAndres123: havenwood yes
[20:43:06] jAndres123: but i think you haven't understood waht i need
[20:43:32] jottr_: has joined #RubyOnRails
[20:44:03] havenwood: jAndres123: You don't want to change to order of an Active Record collection? What do you want to do?
[20:44:19] Radar: GOOD MORNING
[20:44:25] jAndres123: [record_1, record_2, record_3, record_4, record_5, record_6, record_7, record_8] this are records in the db, ok?
[20:44:36] jAndres123: i want retrieve all
[20:44:56] Radar: !enternotspace
[20:44:56] helpa: The enter key should not be used as a space bar. Lines on IRC can be up to 400 characters long.
[20:45:14] jAndres123: i nedd for example, record_4 at the top
[20:45:30] Radar: Why is it important to have record 4 at the top? Where is this presented in the UI?
[20:46:16] jAndres123: It's important, is a game in phaser and i think is the best way
[20:46:32] Radar: I don't understand "is a game in phaser"
[20:46:38] havenwood: pew pew lasers?
[20:46:52] Radar: Is this presented in a dropdown box of some sort?
[20:46:55] jAndres123: phaser is a framework to build games
[20:47:35] jAndres123: so, it's my frontend
[20:47:42] Radar: !enternotspace
[20:47:42] helpa: The enter key should not be used as a space bar. Lines on IRC can be up to 400 characters long.
[20:47:46] Radar: second warning
[20:48:06] Radar: Third time's a mute for 15 mins so that you can do some meditation or something and slow the hell down.
[20:48:29] Radar: Spend time helping us understand the problem you're solving so that we can give you a good solution to the problem.
[20:48:35] pmtob: Eagerly awaiting the 15 min window so I can request some help
[20:48:44] Radar: pmtob: !rule3
[20:48:44] helpa: pmtob: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[20:49:02] Radar: ACTION looks at the topic; says "nope, rules link is still there"
[20:49:12] Radar: ACTION wonders why people aren't reading them this morning
[20:49:33] Radar: pmtob: !rule0 also
[20:49:33] helpa: pmtob: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[20:49:42] conta: has joined #RubyOnRails
[20:49:42] jAndres123: ok, this question in stackoverflow explains what i need to do https://stackoverflow.com/questions/48743316/ruby-on-rails-active-record-sort-and-put-specific-row-to-the-top
[20:50:08] Radar: jAndres123: This'll be the last time I ask: please tell us _why_ you want to do this.
[20:50:24] Radar: And answer my questions when I ask them.
[20:50:28] Radar: [07:47:06] <Radar> Is this presented in a dropdown box of some sort?
[20:52:04] alfiemax: has joined #RubyOnRails
[20:54:51] Radar: jAndres123: are you still there?
[20:55:10] jottr_: has joined #RubyOnRails
[20:55:46] Radar: Ok, next one. pmtob how goes the code sharing?
[20:56:07] jAndres123: I'm building a game with the framework phaser,through a GET request i want to retrieve all the records from a database table named "cities".I need the city of the user who make the request at the top of the bunch returned. Why has to be that way? Well i think is the best way to my fronted to handle, if is not posible, i will try another way
[20:56:45] Radar: jAndres123: I will ask once more: is this list of cities presented in a dropdown box of some sort?
[20:58:44] pmtob: Radar, I have a pastebin ready for you with one example of the error + the setup in routes. Holding off on pasting until jAndres has a resolution before jumping in
[20:58:53] Radar: pmtob: !whypbsucks
[20:58:53] helpa: pmtob: Pastebin sucks because it loads slowly, has ads which are distracting and has terrible formatting. Please use Gist (http://gist.github.com) instead.
[20:58:56] Radar: pmtob: Gist please.
[20:59:00] jAndres123: No, not in a dropbox, it's a map, with all the user's cities placed randomly, except the logged user wich is centered in the game map
[20:59:07] Radar: pmtob: and feel free to paste now. I feel like jAndres123 is going to take allllllll day.
[20:59:30] Radar: jAndres123: Do you have a utility method like "user.city" to get that user's city?
[21:00:53] Radar: "except the logged user wich is centered in the game map"
[21:01:00] Radar: Do you have a way to get to this user's city?
[21:01:17] jAndres123: yes, user_id
[21:01:25] Radar: this user's _city_
[21:01:37] Radar: Can you do: user = User.first; user.city?
[21:01:40] Radar: Is that a thing your application provides?
[21:02:50] cstls: has joined #RubyOnRails
[21:03:11] Radar: City.where("id != ?", user.city_id).unshift(user.city)
[21:03:20] Radar: will give you a list of cities, with the user's city at the front of that list.
[21:05:51] jottr_: has joined #RubyOnRails
[21:07:37] conta: has joined #RubyOnRails
[21:08:51] alfiemax: has joined #RubyOnRails
[21:10:51] jAndres123: undefined method unshift
[21:12:04] jottr_: has joined #RubyOnRails
[21:12:10] Radar: City.where("id != ?", user.city_id).to_a.unshift(user.city)
[21:12:41] Radar: Probably because `where` returns an ActiveRecord::Relation object, which doesn't have an `unshift` method. But if you call `to_a` on it, it converts it to an array, which _does_ have unshift.
[21:12:44] Radar: pmtob: still need help?
[21:16:03] pmtob: Is it possible to create an anonymous gist?
[21:16:05] dionysus69: has joined #RubyOnRails
[21:16:15] Radar: pmtob: yes. Just log out and then create one.
[21:17:33] jAndres123: Thanks Radar, you where very helpfull
[21:17:35] pmtob: Cool, here you go, an example: https://gist.github.com/anonymous/352b2603de99787c5dee4b914f5e9fc8
[21:18:34] jottr_: has joined #RubyOnRails
[21:18:52] pmtob: It appears to be specific to controller tests + the routes work fine via dev environment.
[21:26:02] alfiemax: has joined #RubyOnRails
[21:26:51] jottr_: has joined #RubyOnRails
[21:32:50] Radar: pmtob: point me to the route in that gist where it defines the route /organisations
[21:33:05] Radar: "/organizations*" (with a z)
[21:33:10] Radar: https://gist.github.com/anonymous/352b2603de99787c5dee4b914f5e9fc8#file-for-radar-L7
[21:33:19] Radar: Because this line will only define DELETE /organizations/:id
[21:33:26] Radar: I do not see anything defining a route for `/organizations`
[21:33:36] Radar: pmtob: can you show me the contents of that controller test too?
[21:34:07] pmtob: If I understand correctly, wont it define a route for everything EXCEPT delete?
[21:34:31] pmtob: This routing structure works perfectly fine with Rails 5.1
[21:34:43] pmtob: And all versions before that as well
[21:36:14] Radar: I am not reading it correctly, sorry.
[21:36:29] Radar: Yes, it will define it for everything _except_ that route.
[21:36:38] Radar: pmtob: can you show me the controller test please?
[21:37:06] pmtob: No worries, FWIW, when I run rails routes, /organizations is 100% there in the list
[21:37:34] Radar: I'm thinking other things in the controller test may effect how the route is matched. Computers are no good at lying to us.
[21:37:53] pmtob: Sure, let me grab you a snip
[21:38:09] pmtob: Im thinking it might be something within test_helper.rb, but havent been able to figure that out (theres a ton going on in there)
[21:38:16] jottr_: has joined #RubyOnRails
[21:38:27] pmtob: I'm really just looking for some input on things to try, let me grab you that snippet
[21:39:19] pmtob: https://gist.github.com/anonymous/a16a1ac8eea53c5962788aef64b29669
[21:39:25] pmtob: Test is very straight forward
[21:42:00] Radar: what's in the test helper?
[21:42:19] pmtob: Again, just so you know, this fails when executing the test via `bundle exec ruby -Itest` but not when run with `bin/rails test`
[21:42:50] pmtob: However, when using Rails 5.1, it passes with both
[21:45:10] jottr_: has joined #RubyOnRails
[21:54:25] jottr_: has joined #RubyOnRails
[22:00:28] alfiemax: has joined #RubyOnRails
[22:02:02] jottr_: has joined #RubyOnRails
[22:09:10] marr: has joined #RubyOnRails
[22:09:33] ramfjord: has joined #RubyOnRails
[22:11:18] cjoshmartin: has joined #RubyOnRails
[22:11:25] jottr_: has joined #RubyOnRails
[22:17:33] alfiemax: has joined #RubyOnRails
[22:19:22] timdotrb: has joined #RubyOnRails
[22:21:14] cjoshmartin: has joined #RubyOnRails
[22:25:28] jottr_: has joined #RubyOnRails
[22:28:30] crankharder: has joined #RubyOnRails
[22:38:32] workmad3: has joined #RubyOnRails
[22:39:34] chromis: has left #RubyOnRails: ()
[22:40:12] jottr_: has joined #RubyOnRails
[22:41:21] guacamole: has joined #RubyOnRails
[22:41:59] srruby: has joined #RubyOnRails
[22:42:27] srruby: Upgrading from Rails3.2 I'm having problem with this nested include:
[22:43:00] srruby: :include => [{:check_point => :check_point_category}],
[22:45:28] srruby: has joined #RubyOnRails
[22:46:26] baweaver: Query.includes(check_point: :check_point_category).where...
[22:47:51] jottr_: has joined #RubyOnRails
[22:50:42] srruby: has joined #RubyOnRails
[22:52:35] Radar: pmtob: did you share your test_helper yet?
[22:55:00] pmtob: No, theres a lot going on in there and im not sure its OK to share the file. Going to come back to working on the issue tomorrow...need to prevent burnout
[22:55:10] Radar: pmtob: ok. See you tomorrow then :)
[22:55:25] pmtob: Thanks for your time!
[22:58:03] quazimodo: has joined #RubyOnRails
[22:59:34] jottr_: has joined #RubyOnRails
[23:00:56] ramfjord: has joined #RubyOnRails
[23:18:45] riotjones: has joined #RubyOnRails
[23:30:06] defsdoor: has joined #RubyOnRails
[23:30:58] riotjones: has joined #RubyOnRails
[23:38:09] alfiemax: has joined #RubyOnRails
[23:39:57] srruby: has joined #RubyOnRails
[23:40:27] hmaronon: has joined #RubyOnRails
[23:55:26] alfiemax: has joined #RubyOnRails