« Back to channel list

#RubyOnRails - 30 April 2018

« Back 1 day Forward 1 day »
[00:02:30] ghormoon: has joined #RubyOnRails
[00:14:03] fschuindt: Solved this one, it as missing '' around the YYYY-MM-DD date. :]]
[00:14:36] ghormoon: has joined #RubyOnRails
[00:27:24] alfiemax: has joined #RubyOnRails
[00:40:43] one_zero: has joined #RubyOnRails
[00:42:31] amperry: has joined #RubyOnRails
[00:42:53] amperry: hi folks, anyone here use Trailblazer?
[01:07:30] alfiemax: has joined #RubyOnRails
[01:15:51] ltd: has joined #RubyOnRails
[01:24:24] cschneid_: has joined #RubyOnRails
[01:25:54] t0adst00l: has joined #RubyOnRails
[01:25:58] alfiemax: has joined #RubyOnRails
[01:35:42] lordpdd: has joined #RubyOnRails
[01:37:31] lordpdd: I'm running a few (million) AR queries on irb/console and I notice that every iteration takes longer than the previous one, any idea how to check what's slowing down the process?
[01:44:10] fryguy: memory consumption
[01:44:12] fryguy: most likely
[01:46:49] lordpdd: would adding GC.start help at all?
[01:46:56] lordpdd: or clearing the AR cache?
[01:55:49] alfiemax: has joined #RubyOnRails
[02:02:01] fryguy: GC.start shouldn't do anything, ruby will run the garbage collector as it goes
[02:02:15] fryguy: your loop might be holding onto records such that ruby can't garbage collect them
[02:06:48] cschneid_: has joined #RubyOnRails
[02:13:35] Saukk: has joined #RubyOnRails
[02:16:32] beilabs: has joined #RubyOnRails
[02:19:46] beilabs: has joined #RubyOnRails
[02:27:01] kapil___: has joined #RubyOnRails
[02:30:47] alfiemax: has joined #RubyOnRails
[02:49:50] Technodrome: has joined #RubyOnRails
[02:51:32] cschneid_: has joined #RubyOnRails
[02:52:48] orbyt_: has joined #RubyOnRails
[03:08:58] cschneid_: has joined #RubyOnRails
[03:17:59] beilabs: has joined #RubyOnRails
[03:19:36] cagomez: has joined #RubyOnRails
[03:22:24] cagomez: has joined #RubyOnRails
[03:24:03] cagomez: has joined #RubyOnRails
[03:35:34] cschneid_: has joined #RubyOnRails
[03:41:03] blitz: has joined #RubyOnRails
[03:45:04] Technodrome: has joined #RubyOnRails
[03:50:56] cschneid_: has joined #RubyOnRails
[04:25:55] cschneid_: has joined #RubyOnRails
[05:00:08] cschneid_: has joined #RubyOnRails
[05:08:07] ferr1: has joined #RubyOnRails
[05:18:53] Technodrome: has joined #RubyOnRails
[06:07:40] reber: has joined #RubyOnRails
[06:18:16] cschneid_: has joined #RubyOnRails
[06:26:27] alfiemax: has joined #RubyOnRails
[06:31:13] conta: has joined #RubyOnRails
[06:37:31] jane_booty_doe: has joined #RubyOnRails
[06:44:45] apeiros: has joined #RubyOnRails
[06:56:52] cschneid_: has joined #RubyOnRails
[07:20:20] roshanavand: has joined #RubyOnRails
[07:20:43] roshanavand: has joined #RubyOnRails
[07:23:09] alfiemax: has joined #RubyOnRails
[07:27:50] schneider: has joined #RubyOnRails
[07:36:28] srinidhi: has joined #RubyOnRails
[07:37:44] dedeqtor: has joined #RubyOnRails
[07:47:57] defsdoor: has joined #RubyOnRails
[07:53:49] jane_booty_doe: has joined #RubyOnRails
[07:55:49] roshanavand: has joined #RubyOnRails
[07:56:18] roshanavand: has joined #RubyOnRails
[08:04:20] cschneid_: has joined #RubyOnRails
[08:24:15] NL3limin4t0r: has joined #RubyOnRails
[08:33:16] sameerynho: has joined #RubyOnRails
[08:36:37] alfiemax: has joined #RubyOnRails
[08:37:35] cabotto: has joined #RubyOnRails
[08:41:46] cschneid_: has joined #RubyOnRails
[08:43:41] drale2k_: has joined #RubyOnRails
[08:59:34] _cabotto: has joined #RubyOnRails
[09:15:28] ur5us: has joined #RubyOnRails
[09:17:44] cschneid_: has joined #RubyOnRails
[09:23:50] dionysus69: has joined #RubyOnRails
[09:27:05] dionysus69: has joined #RubyOnRails
[09:32:21] apeiros: has joined #RubyOnRails
[09:33:53] schneider: has joined #RubyOnRails
[09:37:48] Torrone: has joined #RubyOnRails
[09:41:30] cabotto: has joined #RubyOnRails
[09:41:32] Torrone: Hello, not sure if it's the right place to ask: I have a script in ruby that's supposed to run on an ubuntu server. I've made a bash script that launches the ruby script, very basic, and I've put an execution call in /etc/crontab. Whenever I run the bash script from the terminal, everything works fine. When I let crontab run it, however, I get an error (it seems to be missing a gem). What's going on? I've put the ruby version explicitly
[09:41:32] Torrone: at the beginning of the ruby script
[09:41:49] Torrone: (it's the same as when I type which ruby))
[09:43:56] Torrone: what's going wrong here?
[09:46:21] _cabotto: has joined #RubyOnRails
[09:58:08] cschneid_: has joined #RubyOnRails
[09:58:42] drale2k_: has joined #RubyOnRails
[09:59:45] Torrone: has left #RubyOnRails: ("Leaving")
[10:02:10] cabotto: has joined #RubyOnRails
[10:07:26] blackmesa: has joined #RubyOnRails
[10:13:38] skroon: has joined #RubyOnRails
[10:14:14] skroon: I'm running Rails 5.0.2 and I would like to upgrade to Rails 5.0.7 can I just update the Gemfile, and that's it? or is there additional steps to be taken?
[10:14:48] tbuehlmann: skroon: you'd have to at least run `$ bundle update rails`
[10:15:06] skroon: tbuehlmann: right, thanks
[10:16:26] Radar: skroon: there's no API changes between those two versions. You will be fine to just bump the version.
[10:18:37] skroon: Radar: awesome, thanks for that info... where could I figure out if there were a api change?
[10:19:33] prahal: has joined #RubyOnRails
[10:38:50] Radar: skroon: usually a good guide is: did the middle version number bump? Then maybe.
[10:39:00] Abhijit: has joined #RubyOnRails
[10:39:15] Radar: Rails has been pretty good recently with not breaking API compatibility in bugfix releases.
[10:43:31] cschneid_: has joined #RubyOnRails
[10:45:13] kurko_: has joined #RubyOnRails
[10:52:21] srinidhi: has joined #RubyOnRails
[10:56:26] conta: has joined #RubyOnRails
[11:01:52] i4: has joined #RubyOnRails
[11:01:59] i4: hi there!
[11:03:08] i4: How can I get the index number of hash key? HASH.each_with_index ? Or maybe there some another option?
[11:04:02] Cavallari: has joined #RubyOnRails
[11:05:56] Radar: i4: why do you want to do that?
[11:16:58] i4: Radar, I want to compare which key with value in the Hash or Array == indexed number?
[11:17:14] i4: I have 10 sites in one domain
[11:17:31] i4: and there is needed for cross subdomains implementation
[11:21:10] cschneid_: has joined #RubyOnRails
[11:21:45] cabotto: has joined #RubyOnRails
[11:23:27] ur5us: has joined #RubyOnRails
[11:26:00] conta: has joined #RubyOnRails
[11:28:46] drale2k_: has joined #RubyOnRails
[11:37:17] prahal: has joined #RubyOnRails
[11:52:51] sevenseacat: has joined #RubyOnRails
[11:57:12] cschneid_: has joined #RubyOnRails
[12:02:41] BrianJ: has joined #RubyOnRails
[12:02:51] prahal: has joined #RubyOnRails
[12:06:40] drale2k_: has joined #RubyOnRails
[12:07:57] srinidhi: has joined #RubyOnRails
[12:10:36] cabotto: has joined #RubyOnRails
[12:21:59] Milos: has joined #RubyOnRails
[12:23:28] Ropeney: has joined #RubyOnRails
[12:27:51] srinidhi: has joined #RubyOnRails
[12:32:45] cschneid_: has joined #RubyOnRails
[12:41:00] cpruitt: has joined #RubyOnRails
[12:43:55] Cavallari1: has joined #RubyOnRails
[12:47:57] blackmesa: has joined #RubyOnRails
[12:49:34] marr: has joined #RubyOnRails
[13:02:07] apeiros_: has joined #RubyOnRails
[13:07:57] jnollette: has joined #RubyOnRails
[13:08:45] Technodrome: has joined #RubyOnRails
[13:13:02] cschneid_: has joined #RubyOnRails
[13:24:57] kapil___: how to find primary keys of a table?
[13:34:22] nzst: has joined #RubyOnRails
[13:35:25] rfoust: has joined #RubyOnRails
[13:36:52] jane_booty_doe: has joined #RubyOnRails
[13:44:26] mroutis: has joined #RubyOnRails
[13:51:23] cschneid_: has joined #RubyOnRails
[13:52:55] Puffball: has joined #RubyOnRails
[13:59:14] blackmesa: has joined #RubyOnRails
[14:17:16] SteenJobs: has joined #RubyOnRails
[14:20:40] prahal: has joined #RubyOnRails
[14:21:28] prahal: has joined #RubyOnRails
[14:23:25] amperry: anyone here use Trailblazer?
[14:31:51] drale2k_: @kapil___ : any decent db GUI client will show you the layout. I am using https://eggerapps.at/postico/
[14:32:05] drale2k_: sure there is a way on the CLI too
[14:32:29] SteenJobs: has joined #RubyOnRails
[14:33:34] drale2k_: I want to use ActiveStorage via REST API but i can't find anything about what kind of file type to send to the API
[14:33:46] drale2k_: all the tutorials are with html forms
[14:37:35] havenwood: amperry: Considering using Trailblazer or have a question or just generally wanting to talk patterns?
[14:40:15] amperry: havenwood: tried implementing a service with tb, could not understand what was going wrong.
[14:40:34] amperry: havenwood: https://gist.github.com/amp108/1e64155a4e052a9688ab81ce59d15243
[14:41:22] amperry: now rewriting it as a "vanilla" service object, because at least I understand the calling semantics.
[14:44:29] bryanculver: has joined #RubyOnRails
[14:46:16] bryanculver: I'm having an issue with dependent: :destroy not being acted on when updating a collection via assignment
[14:46:19] bryanculver: Example: https://gist.github.com/bryanculver/35e97d56988a00ac47560268e1e0e18e
[14:47:12] bryanculver: When I update the event's users (which is an has_many through), deleted associations aren't calling the has_many's has_one's destroy
[14:47:32] bryanculver: Is this expected behavior?
[14:48:14] bryanculver: Using Rails v5.1.5
[14:49:10] drale2k_: bryanculver: i think "dependent: :destroy" only kicks in when you call .destroy / .destroy_all on the record or collection
[14:50:01] bryanculver: Ok, so I'll have to cycle through the collection instead of the simple assignment operator
[14:51:44] amperry: has joined #RubyOnRails
[14:51:57] bryanculver: Well that's a bummer because that isn't expected behavior
[14:54:32] nzst: bryanculver: http://guides.rubyonrails.org/association_basics.html#options-for-belongs-to-dependent
[14:55:54] defsdoor: has joined #RubyOnRails
[14:56:11] bryanculver: @nzst I don't see what you're referencing in that link
[15:00:43] nzst: idk, just poking around the docs http://guides.rubyonrails.org/association_basics.html#has-many-association-reference
[15:03:23] greengriminal: has joined #RubyOnRails
[15:05:17] drale2k_: If i want to send files using ActiveStorage via a REST API endpoint from let's say an iOS app, do i need to mimic a html form? Or does ActiveStorage require something else? i am quite confused by this and all the tutorials i can find are using html forms to upload files
[15:07:58] amperry: has joined #RubyOnRails
[15:13:26] dionysus69: how do I force capistrano to use phased restart instead of just restart?
[15:13:44] schneider-: has joined #RubyOnRails
[15:13:59] dionysus69: cap env deploy uses restart and I couldn't find a place to configure it :\
[15:16:28] nzst: bryanculver: So it seems like the assignment operator uses delete() not destroy() , so callbacks aren't called. http://api.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-delete . What I can't find is the source for when deletes are called using the 'updating via assignment' method you were using. Sometimes there is a comment or commit trail that explains why, in this case why updating via assignment uses delete and not
[15:16:45] Technodrome: has joined #RubyOnRails
[15:17:31] bryanculver: I'll have to see if switching everything to delete would work but I still doubt it would chain
[15:18:31] nzst: yea, i was poking around here https://github.com/rails/rails/tree/master/activerecord/lib/active_record/associations
[15:18:43] bryanculver: I don't use any X_destroy hooks so I could conceivably switch but that isn't how you'd expect it to work
[15:18:59] bryanculver: I would assume delete would cause the problem I am having
[15:19:42] bryanculver: Gonna throw up a ticket in Github to see if I can get some reasoning answers (and maybe suggest a documentation update to showcase if it is expected)
[15:20:31] cjohnson: Does anybody know if in rails 4, background jobs have activerecord query cache enabled by default?
[15:20:40] cjohnson: And is there a config setting that controls this behavior?
[15:20:48] amperry: has joined #RubyOnRails
[15:21:05] cjohnson: sidekiq's docs make mention that "as of rails 5, its on by defualt" so that implies to me that before 5, it was not
[15:30:40] Nick-S: has joined #RubyOnRails
[15:30:54] Nick-S: yo guys, anyone implemented recaptcha?
[15:31:36] schneider-: has joined #RubyOnRails
[15:38:13] srinidhi: has joined #RubyOnRails
[15:48:11] cjohnson: I have, what's the question
[15:52:14] AnotherOne: has joined #RubyOnRails
[15:56:24] orbyt_: has joined #RubyOnRails
[15:56:54] schneider-: has joined #RubyOnRails
[16:04:47] SteenJobs: has joined #RubyOnRails
[16:11:21] one_zero: has joined #RubyOnRails
[16:17:25] [Butch]: has joined #RubyOnRails
[16:21:55] SteenJobs: has joined #RubyOnRails
[16:25:53] troys: has joined #RubyOnRails
[16:30:55] fcser__: has joined #RubyOnRails
[16:32:56] orbyt_: has joined #RubyOnRails
[16:34:21] jcarl43: has joined #RubyOnRails
[16:34:49] drale2k_: has joined #RubyOnRails
[16:40:03] chouhoulis: has joined #RubyOnRails
[16:40:16] conta: has joined #RubyOnRails
[16:55:11] jhill_: has joined #RubyOnRails
[17:01:42] Linuus`: has joined #RubyOnRails
[17:02:25] orbyt_: has joined #RubyOnRails
[17:07:52] mondongo: has joined #RubyOnRails
[17:08:27] eckhardt_: has joined #RubyOnRails
[17:35:02] DrYockel: has joined #RubyOnRails
[17:38:52] Saukk: has joined #RubyOnRails
[17:39:22] fcser_: has joined #RubyOnRails
[18:05:50] sameerynho: has joined #RubyOnRails
[18:08:11] Technodrome: has joined #RubyOnRails
[18:14:31] SteenJobs: has joined #RubyOnRails
[18:15:27] reber: has joined #RubyOnRails
[18:21:41] krawchyk: has joined #RubyOnRails
[18:23:32] chouhoulis: has joined #RubyOnRails
[18:27:38] dionysus69: has joined #RubyOnRails
[18:30:21] FrostCandy: has joined #RubyOnRails
[18:31:50] FrostCandy: is there a way to add an or to a .exist() ? Thing.exists(id: 10, action: nil || action: 0)
[18:31:58] FrostCandy: exists?() i mean
[18:35:54] blackmesa: has joined #RubyOnRails
[18:38:13] nzst: Does Thing.exists?(id: 10, action: [nil, 0]) work?
[18:46:34] FrostCandy: nzst: yup that did work. Elegant solution.
[19:05:36] RougeR: has joined #RubyOnRails
[19:12:24] mroutis_: has joined #RubyOnRails
[19:13:46] krawchyk: has joined #RubyOnRails
[19:28:24] Cavallari: has joined #RubyOnRails
[19:30:32] Cache_Money: has joined #RubyOnRails
[19:33:34] Cache_Money: I have a column (string) with unique values and I'd like to select those records if that column value is within an array of strings. Is there an easy way to do this within my controller?
[19:35:14] nzst: Thing.where(values: ['value1', 'value2', 'value3'])
[19:35:53] Cache_Money: nzst: Sweet, I'll give that a try. Thanks!
[19:37:27] jackhum: has joined #RubyOnRails
[19:37:44] orbyt_: has joined #RubyOnRails
[19:55:02] cagomez: has joined #RubyOnRails
[19:57:53] orbyt_: has joined #RubyOnRails
[20:14:29] alfiemax: has joined #RubyOnRails
[20:14:45] one_zero: has joined #RubyOnRails
[20:19:17] HemmE: has joined #RubyOnRails
[20:20:44] orbyt_: has joined #RubyOnRails
[20:26:35] FastJack: has joined #RubyOnRails
[20:31:01] jackhum: has joined #RubyOnRails
[20:31:20] srruby: has joined #RubyOnRails
[20:31:47] andrevan: has joined #RubyOnRails
[20:45:44] cagomez: I have many Users and a User controller. I'd like to make a POST request to create an Item for each user. Is it RESTful to define a route such as `users/items` so I can post a list of User ID's to create Items for?
[20:50:02] alfiemax: has joined #RubyOnRails
[20:54:34] muffiny: has joined #RubyOnRails
[21:07:24] _3dwardsharp: has joined #RubyOnRails
[21:19:30] rfoust: has joined #RubyOnRails
[21:21:00] nickjj: has joined #RubyOnRails
[21:34:41] timdotrb: has joined #RubyOnRails
[21:50:42] mroutis: has joined #RubyOnRails
[22:16:39] alfiemax: has joined #RubyOnRails
[22:27:09] srruby: has joined #RubyOnRails
[22:42:48] cschneid_: has joined #RubyOnRails
[22:43:02] orbyt_: has joined #RubyOnRails
[22:43:42] Technodrome: has joined #RubyOnRails
[22:59:42] eckhardt_: has joined #RubyOnRails
[23:12:46] workmad3: has joined #RubyOnRails
[23:21:46] cagomez: has joined #RubyOnRails
[23:28:21] alfiemax: has joined #RubyOnRails
[23:32:46] i4: has joined #RubyOnRails
[23:34:42] i4: Hi there! I'm trying to use some_script.coffee.erb and it's working when I use it trought $(document).on 'turbolinks:load', ->, but if i try to use javascript_include_tag "some_script.coffee.erb"... after page loaded I get the wrong file name javascript_include_tag "planet.coffee.erb.JS"... How to disable auto edding the .js to all scripts in javascript_include_tag?
[23:36:41] cagomez: has joined #RubyOnRails
[23:38:18] jnollette: has joined #RubyOnRails
[23:38:59] i4: This method is not working: = javascript_include_tag('planet.coffee.erb').gsub('.js', '')
[23:43:07] Yzguy: has joined #RubyOnRails
[23:45:20] Yzguy: Is there a good way to use query parameters as parts of the db query?
[23:45:46] Yzguy: eq like /devices?location=sfo&status=up
[23:46:26] Yzguy: but they are entirely optional, you could also just call /devices
[23:47:04] jnollette: has joined #RubyOnRails