« Back to channel list

#RubyOnRails - 30 November 2018

« Back 1 day Forward 1 day »
[00:03:24] LunarDinosaur: has joined #RubyOnRails
[00:08:55] krawchyk: has joined #RubyOnRails
[00:17:28] ArTiSTiX: has joined #RubyOnRails
[00:18:27] cschneid: has joined #RubyOnRails
[00:26:16] darkhanb: has joined #RubyOnRails
[00:28:56] gambl0re: has joined #RubyOnRails
[00:30:00] jaddison: has joined #RubyOnRails
[00:35:58] Dreamer3: has joined #RubyOnRails
[00:41:39] srruby: has joined #RubyOnRails
[00:44:41] srruby: I'm working on a fairly large Rails3.2 project with no tests... I'd like to upgrade to rails 5. The code is of poor quality... I'm thinking to write a moderately complete test suite for the current 3.2 codebase before starting the migration... Does that sound reasonable?
[00:49:47] sevenseacat: has joined #RubyOnRails
[00:56:48] cnk: It sounds difficult. One of the things that tends to change in the Rails ecosystem is the testing tools
[00:57:23] cnk: so even if you had a test suite on 3.2, it might be tough getting it to run on your initial 4.0 upgrade; much less all the way to 5
[00:57:54] cnk: Is the UI stable? (not to change in the upgrade)?
[00:58:21] cnk: if so, perhaps some characterization tests - testing in the browser
[01:08:47] srruby: capybara is the same, right ?
[01:09:00] srruby: cnk: Thanks.
[01:10:01] cnk: capybara is one of the tools in the tool chain. I don't think it is super tightly coupled to rails versions - unlike a lot of the rails test tools - or even rspec-rails
[01:11:08] cnk: So tool of choice - straight seleniium, capybara with something to run it - and testing only via the browser ... might work.
[01:11:41] cnk: The issue is that you lose all the "set up date, roll back transactions" coolness of testing from WITHIN rails
[01:11:55] srruby: I'm thinking capybara/rspec and test/unit will carry over well enough...
[01:13:46] cnk: Sounds good. Given your comment about code quality, thinking carefully about testing intention and not implementation would be helpful (often harder to do when testing after coding)
[01:17:30] gambl0re: has joined #RubyOnRails
[01:20:43] srruby: cnk: Or I can upgrade to 5.1 and then start writing tests.
[01:21:22] srruby: cnk: Hack away at it in 5.1
[01:23:19] cnk: Thing is I don't know how easy it is to move from 3 -> 4 -> 5. I had some stuff stuck in 2.3 and to get to 3 (and then 4), I couldn't get 'update gems and run this code' to work at all. Ended up making a new Rails 3 project and copying files into it, making needed changes as I went. It was doable because it was a relatively small project and I had written all of it so knew what it was supposed to do
[01:24:32] cnk: might be worth a quick spike to see how doable 'just hack it into 5.1 and then fix it' is
[01:24:43] srruby: cnk: This one is complex.
[01:25:13] cnk: ya. sigh
[01:26:10] cnk: I think making a fork and trying some upgrades would be my first step. Just to get an estimate of how hard this is going to b
[01:27:06] cnk: How many libraries does it use? When upgrading really old stuff, it's often hard to figure out a set of libA + libB + libC that works in rails 4.0 - and then repeat for each upgrade step
[01:35:40] srruby: cnk: Yep. Been there.
[01:38:47] Puffball: has joined #RubyOnRails
[01:43:31] gambl0re: has joined #RubyOnRails
[01:57:08] tdy: has joined #RubyOnRails
[02:31:38] glossybrown: has joined #RubyOnRails
[02:42:18] orbyt_: has joined #RubyOnRails
[03:13:42] kapil____: has joined #RubyOnRails
[03:18:55] Wixy: has joined #RubyOnRails
[03:20:29] Wixy: Hi all! I have a "has_one :foo, through: :bar" and a "belongs_to :bar, polimorphic: true". Buy when I run annotate I get that through is not a valid key (Unknown key: :through)
[03:20:30] Wixy: Any idea?
[03:21:42] Wixy: https://guides.rubyonrails.org/association_basics.html#the-has-one-through-association
[03:21:59] Wixy: I don't see any difference in my code
[03:22:10] Wixy: except bar is polymorphic
[03:29:46] Wixy: never mind, I was missing a ":"
[03:34:10] jaddison: has joined #RubyOnRails
[03:40:00] bambanx: has joined #RubyOnRails
[04:07:26] chouhoulis: has joined #RubyOnRails
[04:10:22] braincrash: has joined #RubyOnRails
[04:17:27] glossybrown: has joined #RubyOnRails
[04:24:02] sarink: has joined #RubyOnRails
[04:24:54] sarink: i have a custom module (well, just one method, really) that has some code which i need to access in both a controller and an initializer. where's the Right place to put this and how do i require it? i'm in a vanilla rails 5 api-only app.
[04:29:47] cschneid: has joined #RubyOnRails
[04:29:48] timdotrb: has joined #RubyOnRails
[04:40:41] sarink: has joined #RubyOnRails
[04:41:24] sarink: sorry, i got disconnected, did i miss an answer?
[04:41:34] havenwood: sarink: nope
[04:46:24] havenwood: sarink: When you say "an initializer" you mean like `/config/initializers`?
[04:49:52] havenwood: sarink: what does the method do?
[04:54:06] sarink: uh, it's kind of a long stupid story..... it copies a value from a request cookie to a request header
[04:58:25] jaddison: has joined #RubyOnRails
[04:59:49] sarink: and i need to do it in an initializer because that's where railsadmin has its before-authorize hook
[05:00:06] sarink: but also in my sessions controller bc, well, it's the sessions controller
[05:01:11] havenwood: sarink: are you then deciding between extracting a gem, lib/, a service object or tableless model?
[05:01:36] havenwood: sarink: does it pretty much never change?
[05:01:40] sarink: i'm just trying to not have to duplicate this code in 3 places, so i wanted to extract it and require/include it somewhere
[05:02:13] havenwood: sarink: sounds to me like lib/ might be a good option
[05:02:18] sarink: but i don't know where the right place is? it sounds like the type of thing that would do well as a controller concern, but how do i require that in an initilizer?
[05:02:48] havenwood: sarink: it's a cookie to header copier? heh
[05:03:12] lexileo: has joined #RubyOnRails
[05:03:16] sarink: lol...that's a long story :-P
[05:03:42] havenwood: sarink: i guess didn't make sense as middleware?
[05:04:12] havenwood: sarink: lib/ is kinda a half-measure to cutting a gem ;P
[05:04:12] sarink: havenwood: actually, i hadn't thought about that... that would probably be nicer
[05:17:07] sarink: havenwood: so, where should my middleware go?
[05:18:55] sarink: do you make an app/middleware folder? lib?
[05:21:56] uksio: has joined #RubyOnRails
[05:23:14] za1b1tsu: has joined #RubyOnRails
[05:42:36] cschneid: has joined #RubyOnRails
[05:45:42] gambl0r3: has joined #RubyOnRails
[06:02:49] reber: has joined #RubyOnRails
[06:05:32] sarink: i wrote app/middleware/whatever.rb, and then in application.rb i wrote config.middleware.use Whatever
[06:06:01] sarink: but i just get uninitialized constant MyApp::Application::AWhatever
[06:09:04] Tempesta: has joined #RubyOnRails
[06:16:37] za1b1tsu: has joined #RubyOnRails
[06:23:50] sarink: how in the hell do you require a middleware :exploding_head:
[06:30:35] srinidhi: has joined #RubyOnRails
[06:31:37] nixroot: has joined #RubyOnRails
[06:39:42] nixroot: has joined #RubyOnRails
[06:41:32] LunarDinosaur: has joined #RubyOnRails
[06:42:20] LunarDinosaur: has joined #RubyOnRails
[06:43:07] LunarDinosaur: has joined #RubyOnRails
[06:43:52] LunarDinosaur: has joined #RubyOnRails
[06:44:40] LunarDinosaur: has joined #RubyOnRails
[06:45:42] timdotrb: has joined #RubyOnRails
[06:46:15] timdotrb: has joined #RubyOnRails
[06:46:59] timdotrb: has joined #RubyOnRails
[06:47:46] timdotrb: has joined #RubyOnRails
[06:48:16] armyriad: has joined #RubyOnRails
[06:48:41] timdotrb: has joined #RubyOnRails
[06:56:10] tdy: has joined #RubyOnRails
[07:11:12] daemonwrangler: has joined #RubyOnRails
[07:13:07] cschneid: has joined #RubyOnRails
[07:16:05] LunarDinosaur: has joined #RubyOnRails
[07:17:36] za1b1tsu: has joined #RubyOnRails
[07:17:41] Wixy: has joined #RubyOnRails
[07:18:20] Wixy: Hey. Is there a known bug in Rails 5 regarding migrations add_index with order? My schema.rb is missing the order of my indexes for some reason
[07:18:44] buyfn: has joined #RubyOnRails
[07:19:02] za1b1tsu: has joined #RubyOnRails
[07:20:08] conta: has joined #RubyOnRails
[07:20:17] spectra: has joined #RubyOnRails
[07:20:33] Exuma: has joined #RubyOnRails
[07:24:01] kapil____: has joined #RubyOnRails
[07:31:50] Wixy: add_index :foos, :bar, order: {created_at: :desc}
[07:31:54] timdotrb: has joined #RubyOnRails
[07:32:05] Wixy: that line creates an index but the order is ignored
[07:32:36] timdotrb: has joined #RubyOnRails
[07:33:23] za1b1tsu: has joined #RubyOnRails
[07:33:24] timdotrb: has joined #RubyOnRails
[07:34:11] timdotrb: has joined #RubyOnRails
[07:34:59] timdotrb: has joined #RubyOnRails
[07:35:47] timdotrb: has joined #RubyOnRails
[07:39:46] za1b1tsu: has joined #RubyOnRails
[07:51:55] nixroot: has joined #RubyOnRails
[08:06:00] ariedler: has joined #RubyOnRails
[08:09:51] za1b1tsu: has joined #RubyOnRails
[08:15:09] sarink: Wixy: which database?
[08:15:31] Terens: has joined #RubyOnRails
[08:19:36] ams__: has joined #RubyOnRails
[08:27:17] srinidhi: has joined #RubyOnRails
[08:44:36] za1b1tsu: has joined #RubyOnRails
[08:49:16] ghormoon: has joined #RubyOnRails
[08:51:25] cschneid: has joined #RubyOnRails
[08:57:18] i4: has joined #RubyOnRails
[09:13:39] mikecmpbll: has joined #RubyOnRails
[09:17:22] x4ec7: has joined #RubyOnRails
[09:17:25] x4ec7: has left #RubyOnRails: ("ERC (IRC client for Emacs 26.1)")
[09:32:32] LunarDinosaur: has joined #RubyOnRails
[09:35:24] Cork: i'm a bit curious, why is change_table .remove mapped to remove_columns and not remove_colunn?
[09:35:37] Cork: the current mapping means you can't reversably remove a column in change_table
[09:40:37] Guest21835: has joined #RubyOnRails
[09:40:50] lunarkitty7: has joined #RubyOnRails
[09:47:19] sevenseacat: that sounds odd, I'm sure I've done that before
[09:47:48] sevenseacat: what version of rails are you looking at?
[09:47:56] DTZUZO: has joined #RubyOnRails
[09:48:24] cnsvc_: has joined #RubyOnRails
[09:48:35] jottr: has joined #RubyOnRails
[09:48:52] Cork: also https://github.com/rails/rails/blob/96dee0e7e5a8dd6ce42999b13d0bd0623073e229/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L607
[09:49:23] uks: has joined #RubyOnRails
[09:49:59] cschneid: has joined #RubyOnRails
[09:50:02] _aeris_: has joined #RubyOnRails
[09:50:37] sevenseacat: wait, shouldn't you be using remove_column in your migration?
[09:51:18] Cork: if you add and remove multiple columns on a table it is cleaner to use change_table then multiple add_column and remove_column
[09:51:29] apparition47: has joined #RubyOnRails
[09:53:51] sevenseacat: well you still need to use multiple t.remove then
[09:54:04] sevenseacat: because to make it reversible, you need to specify the column types
[09:54:07] Cork: yes, but you don't need to fedine the table multiple times
[09:54:55] Cork: i know how the none change_table commands work, i just wonder why explicitly t.remove* can't be (as all the other change_table can)
[10:06:49] ariedler: has joined #RubyOnRails
[10:13:59] roshanavand: has joined #RubyOnRails
[10:14:32] za1b1tsu: has joined #RubyOnRails
[10:28:36] brianpWins: sevenseacat!
[10:29:16] brianpWins: I have to choose between IRC and VPN appearently. So I haven’t been on here in months, but when I came on I looked for your name!
[10:29:39] brianpWins: The regulars you know
[10:29:43] brianpWins: feels like home again
[10:29:50] roshanavand: has joined #RubyOnRails
[10:45:41] roshanavand: has joined #RubyOnRails
[10:48:41] cnsvc_: has joined #RubyOnRails
[11:43:53] roshanavand: has joined #RubyOnRails
[11:46:47] cschneid: has joined #RubyOnRails
[11:54:11] segy: has joined #RubyOnRails
[11:55:53] mangold: has joined #RubyOnRails
[11:55:58] cnsvc_: has joined #RubyOnRails
[12:02:58] lankanmon: has joined #RubyOnRails
[12:13:29] cnsvc_: has joined #RubyOnRails
[12:15:45] _aeris: has joined #RubyOnRails
[12:31:53] lexileo: has joined #RubyOnRails
[12:44:20] roshanavand: has joined #RubyOnRails
[12:58:39] LunarDinosaur: has joined #RubyOnRails
[13:15:35] conta: has joined #RubyOnRails
[13:18:12] mondz: has joined #RubyOnRails
[13:20:23] cschneid: has joined #RubyOnRails
[13:25:39] cnsvc_: has joined #RubyOnRails
[13:44:42] roshanavand: has joined #RubyOnRails
[14:01:21] RiPuk: has joined #RubyOnRails
[14:01:44] cschneid: has joined #RubyOnRails
[14:02:58] jsc: has joined #RubyOnRails
[14:05:27] conta: has joined #RubyOnRails
[14:13:35] eclm: has joined #RubyOnRails
[14:18:37] gregf_: has joined #RubyOnRails
[14:26:00] cnsvc_: has joined #RubyOnRails
[14:34:35] mtkd: has joined #RubyOnRails
[14:45:48] dslegends: has joined #RubyOnRails
[14:51:31] crankharder: has joined #RubyOnRails
[14:56:20] Wixy: has joined #RubyOnRails
[15:07:16] Wixy: Hey. I have something similar to "add_index :foos, :bar, order: {created_at: :desc}" for Postgresql, but the ordering is completely ignored in schema.rb. Is it a bug on Rails 5?
[15:10:28] timdotrb: has joined #RubyOnRails
[15:10:39] borodin: has joined #RubyOnRails
[15:11:10] KeyJoo: has joined #RubyOnRails
[15:29:51] cnsvc_: has joined #RubyOnRails
[15:32:52] gavit: has joined #RubyOnRails
[15:38:15] chouhoulis: has joined #RubyOnRails
[15:44:30] gavit: has joined #RubyOnRails
[15:47:16] cschneid: has joined #RubyOnRails
[15:58:21] uks: has joined #RubyOnRails
[16:20:18] LunarDinosaur: has joined #RubyOnRails
[16:29:05] mondz: has joined #RubyOnRails
[16:32:24] gambl0r3: has joined #RubyOnRails
[16:36:47] cnsvc_: has joined #RubyOnRails
[16:37:13] buyfn: has joined #RubyOnRails
[16:41:45] jaddison: has joined #RubyOnRails
[16:57:57] nicolasb: has joined #RubyOnRails
[17:03:39] defsdoor: has joined #RubyOnRails
[17:04:35] Jervis_: has joined #RubyOnRails
[17:06:32] desperek: has joined #RubyOnRails
[17:07:29] reber: has joined #RubyOnRails
[17:24:44] crankharder: has joined #RubyOnRails
[17:31:29] buyfn: has joined #RubyOnRails
[17:33:01] OyoKooN: has joined #RubyOnRails
[17:42:45] cnsvc_: has joined #RubyOnRails
[17:44:18] OyoKooN: Hey ! I'm encountering with ActiveStorage (last version) when trying to upload on S3. I get an ArgumentError (unknown keyword: content_type) in active_storage/service/s3_service.rb. Can't find the source of the issue. Any input? Thanks!
[17:46:51] OyoKooN_: has joined #RubyOnRails
[17:50:22] westoque: has joined #RubyOnRails
[17:54:54] westoque: has left #RubyOnRails: ()
[17:59:19] mikecmpbll: has joined #RubyOnRails
[18:04:11] Dimik: has joined #RubyOnRails
[18:26:20] eckhardt_: has joined #RubyOnRails
[18:36:05] srinidhi: has joined #RubyOnRails
[18:41:53] cnsvc_: has joined #RubyOnRails
[18:54:35] orbyt_: has joined #RubyOnRails
[18:56:12] work_: has joined #RubyOnRails
[18:57:48] tdy: has joined #RubyOnRails
[19:05:11] za1b1tsu: has joined #RubyOnRails
[19:21:51] newton: is there a place I could learn more about the differences between using Rails.cache and the `cache` helper inside of a view?
[19:24:02] mlt-: has joined #RubyOnRails
[19:25:33] reber: has joined #RubyOnRails
[19:28:07] Exuma: has joined #RubyOnRails
[19:29:52] NivenHuH: has joined #RubyOnRails
[19:33:06] newton: (nvm read the context helper doc and learned more about the stuff it does)
[19:42:44] Fernando-Basso: has joined #RubyOnRails
[19:52:29] za1b1tsu: has joined #RubyOnRails
[19:54:31] za1b1tsu: has joined #RubyOnRails
[20:09:20] GodFather: has joined #RubyOnRails
[20:14:21] buyfn: has joined #RubyOnRails
[20:24:14] ur5us: has joined #RubyOnRails
[20:30:21] GodFather: has joined #RubyOnRails
[20:31:17] Guest21835: has joined #RubyOnRails
[20:45:10] LunarDinosaur: has joined #RubyOnRails
[20:47:50] LunarDinosaur: has joined #RubyOnRails
[20:57:13] Guest21835: has joined #RubyOnRails
[21:15:18] roshanavand: has joined #RubyOnRails
[21:17:57] orbyt_: has joined #RubyOnRails
[21:20:29] nickjj_: has joined #RubyOnRails
[21:21:42] lxsameer: has joined #RubyOnRails
[21:30:10] Puffball: has joined #RubyOnRails
[21:31:44] orbyt_: has joined #RubyOnRails
[21:38:52] GodFather: has joined #RubyOnRails
[21:49:19] cschneid: has joined #RubyOnRails
[22:01:37] jaddison: has joined #RubyOnRails
[22:11:44] LunarDinosaur: has joined #RubyOnRails
[22:18:09] NivenHuH: has joined #RubyOnRails
[22:23:19] FLeiXiuS: has joined #RubyOnRails
[22:24:04] FLeiXiuS: Using fields_for, how do I get question_1_answers[param]?
[22:24:22] FLeiXiuS: I want the <id> of question as a part of the parameter
[22:32:53] cnsvc_: has joined #RubyOnRails
[22:41:09] tdy: has joined #RubyOnRails
[22:53:43] agent_white: has joined #RubyOnRails
[22:57:09] cnsvc_: has joined #RubyOnRails
[23:11:15] dviola: has joined #RubyOnRails
[23:13:50] westoque: has joined #RubyOnRails
[23:15:47] tjmcginnis: has joined #RubyOnRails
[23:17:59] westoque: hi everyone. i’m migrating 2.0gb worth of data every 2 weeks, and running it through a worker in production.. but heroku does a daily restart which basically discards everything.. was wondering if people run into same issues (big data migrations) and what you have done as a solution? i’m thinking about going to aws to work around the daily restarts. thanks.
[23:20:09] tdy: has joined #RubyOnRails
[23:36:02] kapil____: has joined #RubyOnRails
[23:36:16] tweaks: westoque: you may want to reconsider your current approach (or further detail your problem), dyno restarts shouldn't affect much in a properly configured application
[23:38:36] westoque: tweaks: i understand that jobs should be idempotent. and it is, it’s just a lot of data.
[23:42:39] tdy: has joined #RubyOnRails
[23:52:13] emers2n: has joined #RubyOnRails
[23:52:18] jaddison: has joined #RubyOnRails