« Back to channel list

#RubyOnRails - 08 November 2017

« Back 1 day Forward 1 day »
[00:01:03] jphase: has joined #RubyOnRails
[00:02:14] jrabe: has joined #RubyOnRails
[00:07:24] waveprop: has joined #RubyOnRails
[00:07:45] waveprop: does rack 'use' instantiate each middleware class?
[00:26:02] Technodrome: has joined #RubyOnRails
[00:45:55] kus_ubuntui686: has joined #RubyOnRails
[00:47:20] chouhoulis: has joined #RubyOnRails
[00:57:23] tekk: has joined #RubyOnRails
[01:01:31] hndk: has joined #RubyOnRails
[01:01:37] sevenseacat: has joined #RubyOnRails
[01:05:44] fragamus: has joined #RubyOnRails
[01:12:54] knight33: has joined #RubyOnRails
[01:24:37] irishfromua: has joined #RubyOnRails
[01:29:21] mheld: has joined #RubyOnRails
[01:29:29] Exagone313: has joined #RubyOnRails
[01:30:41] tpendragon: has joined #RubyOnRails
[01:31:22] guardianx: has joined #RubyOnRails
[01:56:44] chouhoulis: has joined #RubyOnRails
[02:03:53] jphase: has joined #RubyOnRails
[02:05:31] baweaver: Well here's a bit of a fun one. How do I get Rails working under a subdirectory in "production" ?
[02:05:43] baweaver: https://github.com/baweaver/subdirectory-test - Complete sample application with instructions to set up
[02:06:03] baweaver: Only issue: text should be blue in production (meaning assets aren't working correctly)
[02:06:13] baweaver: well, "production"
[02:11:10] baweaver: Noted I'll need to update the Rails docs later to reflect that only adding the relative url isn't nearly enough to get that working
[02:21:09] orbyt_: has joined #RubyOnRails
[02:23:03] tcopeland: has joined #RubyOnRails
[02:31:27] jphase: has joined #RubyOnRails
[02:39:04] fragamus: has joined #RubyOnRails
[02:39:56] xall: has joined #RubyOnRails
[03:04:29] one_zero: has joined #RubyOnRails
[03:05:33] creature: has joined #RubyOnRails
[03:15:24] MrCrackPotBuilde: has joined #RubyOnRails
[03:22:10] ResidentBiscuit: has joined #RubyOnRails
[03:53:02] ResidentBiscuit: has joined #RubyOnRails
[04:07:47] jphase: has joined #RubyOnRails
[04:16:57] jphase: has joined #RubyOnRails
[04:17:22] Cyrus: HAML problem: '%table.table.table-bordered.table-hover.tablesorter#kittens' -- How can I make HAML interpolate this so that the '#kittens' part can be dynamic instead of me hardcoding it?
[04:18:02] sevenseacat: %table{id: whatever}
[04:18:26] Cyrus: Hrm, thanks.
[04:29:01] jarray52: has left #RubyOnRails: ()
[04:43:37] xall: has joined #RubyOnRails
[04:46:08] kies: has joined #RubyOnRails
[04:59:10] Dimik: has joined #RubyOnRails
[04:59:44] LateralOctober: has joined #RubyOnRails
[05:01:01] Rodya_: has joined #RubyOnRails
[05:26:14] iamarun: has joined #RubyOnRails
[05:36:47] bga57: has joined #RubyOnRails
[05:39:31] jphase: has joined #RubyOnRails
[05:53:17] jphase: has joined #RubyOnRails
[05:57:39] xall: has joined #RubyOnRails
[06:02:30] jphase: has joined #RubyOnRails
[06:06:06] Jameser: has joined #RubyOnRails
[06:10:40] Technodrome: has joined #RubyOnRails
[06:11:41] Saukk: has joined #RubyOnRails
[06:20:48] jphase: has joined #RubyOnRails
[06:22:08] dinoangelov: has joined #RubyOnRails
[06:27:58] dionysus69: has joined #RubyOnRails
[06:34:09] atrius: has joined #RubyOnRails
[06:43:43] sent-hil: has joined #RubyOnRails
[06:45:34] dionysus69: just came to my mind, why isn't staging environment by default included into the framework? any plans on including it in database.yml secrets.yml etc?
[06:46:13] sevenseacat: a lot of the time, staging should run in production mode
[06:46:48] sevenseacat: so a dedicated staging env isnt necessary
[06:46:52] alfiemax: has joined #RubyOnRails
[06:47:11] dionysus69: cap deploy production deploys to a specific vps right? dont know if this is possible, cap deploy production1(staging)
[06:47:36] sevenseacat: it deploys wherever you configure it to
[06:48:06] dionysus69: yes so how can I tell cap to deploy to staging instead of production, if both are production, is the problem I see :)
[06:48:40] sevenseacat: cap's environments arent your rails app's environments
[06:49:51] dionysus69: originally I actually did what you are suggesting, had same env for for staging as is on production
[06:50:08] dionysus69: but when I deployed to staging, the environment somehow was set to staging automatically
[06:50:21] dionysus69: so I was forced to copy configs for staging: in yml
[06:50:47] jarnalyrkar: has joined #RubyOnRails
[06:50:51] dionysus69: Rails.env returned staging I mean
[06:52:15] jarnalyrkar: has joined #RubyOnRails
[06:52:55] jphase: has joined #RubyOnRails
[07:00:38] Rodya_: has joined #RubyOnRails
[07:02:03] jphase: has joined #RubyOnRails
[07:02:43] ahrs: has joined #RubyOnRails
[07:10:48] fragamus: has joined #RubyOnRails
[07:31:34] waveprop: has joined #RubyOnRails
[07:31:42] waveprop: in Rack when i set @request['some_var'] = {'some' => 'data'} then @request['some_var'] is nil when i try to read it further down the middleware stack. how do i make this available to the next middleware down?
[07:38:11] conta: has joined #RubyOnRails
[07:38:17] arBmind: has joined #RubyOnRails
[07:49:19] kristofferR: has joined #RubyOnRails
[07:57:08] jphase: has joined #RubyOnRails
[08:01:30] Rodya_: has joined #RubyOnRails
[08:18:55] paranoicsan: has joined #RubyOnRails
[08:24:39] jphase: has joined #RubyOnRails
[08:31:08] srinidhi: has joined #RubyOnRails
[08:33:50] jphase: has joined #RubyOnRails
[08:34:07] fragamus: has joined #RubyOnRails
[08:35:21] TvL2386: hey guys, quick question: is there a list somewhere of attribute names that are not allowed for an ActiveRecord model?
[08:35:27] srinidhi: has joined #RubyOnRails
[08:35:59] TvL2386: I remember from the past (rails-3.2) that using "type" was not allowed
[08:36:05] sevenseacat: dont think so. the common one that trips people up most is 'type'
[08:37:05] TvL2386: found this http://reservedwords.herokuapp.com/
[08:37:36] sevenseacat: "Last Updated about 8 years ago"
[08:37:55] TvL2386: haha yeah :)
[08:39:31] tbuehlmann: and even "type" is okay if you know what to do next
[08:39:52] TvL2386: please explain tbuehlmann
[08:40:07] sevenseacat: you *can* use type but I'd argue you probably shouldnt
[08:40:37] tbuehlmann: you set inheritance_column to nil: http://api.rubyonrails.org/classes/ActiveRecord/ModelSchema/ClassMethods.html#method-i-inheritance_column
[08:41:07] tbuehlmann: I'd rather opt-in there instead of opting-out, but I don't care too much
[08:42:48] TvL2386: I'll just think of something else than "type" for the attribute
[08:52:09] jphase: has joined #RubyOnRails
[09:01:20] jphase: has joined #RubyOnRails
[09:01:31] marr: has joined #RubyOnRails
[09:24:18] jphase: has joined #RubyOnRails
[09:33:28] jphase: has joined #RubyOnRails
[09:44:51] jhill: has joined #RubyOnRails
[09:45:28] Meow-J: has joined #RubyOnRails
[09:49:07] pfg: has joined #RubyOnRails
[09:49:07] jxf: has joined #RubyOnRails
[09:49:07] craysiii: has joined #RubyOnRails
[09:49:07] mmun: has joined #RubyOnRails
[09:49:08] vayan: has joined #RubyOnRails
[09:49:08] tycoon177: has joined #RubyOnRails
[09:49:08] ephemer0l_: has joined #RubyOnRails
[09:49:08] clamstar: has joined #RubyOnRails
[09:49:08] lxkm: has joined #RubyOnRails
[09:49:08] mcr-credil: has joined #RubyOnRails
[09:49:08] sonOfRa: has joined #RubyOnRails
[09:49:08] blitz: has joined #RubyOnRails
[09:49:08] havenwood: has joined #RubyOnRails
[09:49:08] sunrunner20: has joined #RubyOnRails
[09:49:08] ectos: has joined #RubyOnRails
[09:49:08] JoshL: has joined #RubyOnRails
[09:49:08] Fenhl: has joined #RubyOnRails
[09:49:08] daemonwrangler: has joined #RubyOnRails
[09:49:08] Radar: has joined #RubyOnRails
[09:49:08] acosonic: has joined #RubyOnRails
[09:49:08] ghormoon: has joined #RubyOnRails
[09:49:08] Diabolik: has joined #RubyOnRails
[09:49:08] DylanJ: has joined #RubyOnRails
[09:49:08] jhass: has joined #RubyOnRails
[09:49:08] machty: has joined #RubyOnRails
[09:49:08] dmnd: has joined #RubyOnRails
[09:49:08] cardoni: has joined #RubyOnRails
[09:49:08] swgillespie: has joined #RubyOnRails
[09:50:27] ghormoon: has joined #RubyOnRails
[09:50:47] jxf: has joined #RubyOnRails
[09:50:53] swgillespie: has joined #RubyOnRails
[09:51:06] machty: has joined #RubyOnRails
[09:53:48] sunrunner20: has joined #RubyOnRails
[09:54:24] ahrs: has joined #RubyOnRails
[09:54:32] clamstar: has joined #RubyOnRails
[09:59:00] srinidhi: has joined #RubyOnRails
[10:03:24] stamina: has joined #RubyOnRails
[10:04:30] Rodya_: has joined #RubyOnRails
[10:05:12] ferr: has joined #RubyOnRails
[10:06:14] ferr: has left #RubyOnRails: ()
[10:07:58] mikecmpbll: has joined #RubyOnRails
[10:20:20] apeiros: has joined #RubyOnRails
[10:21:10] srinidhi: has joined #RubyOnRails
[10:22:21] Sigyn: has joined #RubyOnRails
[10:22:35] davic: has joined #RubyOnRails
[10:24:22] cgfbee: has joined #RubyOnRails
[10:28:30] jphase: has joined #RubyOnRails
[10:30:41] Jameser: has joined #RubyOnRails
[10:37:44] conta: has joined #RubyOnRails
[10:41:14] arup_r: has joined #RubyOnRails
[10:42:14] jphase: has joined #RubyOnRails
[10:44:52] Ergo: has joined #RubyOnRails
[10:51:11] workmad3: has joined #RubyOnRails
[11:03:19] drale2k_: has joined #RubyOnRails
[11:05:08] LateralO1: has joined #RubyOnRails
[11:10:17] rgr: has joined #RubyOnRails
[11:25:16] dminuoso: has joined #RubyOnRails
[11:35:46] oded: has joined #RubyOnRails
[11:36:33] oded: Is "ActionCable.server.connections" supposed to return all the connections to the Redis server? Or only to the current webserver worker?
[11:39:10] arup_r: has joined #RubyOnRails
[11:39:12] paranoicsan: has joined #RubyOnRails
[11:41:10] arup_r: I would like to write a migration for "CREATE INDEX ON videos USING gist ((array_to_string(tags, ', ')) gist_trgm_ops);" .. How can I fit this into add_index method? I came up like add_index(: videos, <what should I mention here??, using: 'gist')
[11:43:39] dminuoso: arup_r: execute "CREATE .... "
[11:44:01] oded: How am I supposed to get all ActionCable connections?
[11:44:14] arup_r: ok .. raw sql. cool. i thought i can use `add_index` mthod for this.
[11:44:53] dminuoso: arup_r: Perhaps you can, but it's extremely silly to translate from precise SQL statements you already have to a ruby DSL
[11:45:08] dminuoso: Unless you somehow need this to be portable across database adapters. In most cases you already are not.
[11:45:09] hfp_work: has joined #RubyOnRails
[11:45:31] dminuoso: I dont think its worth the time to figure out how.
[11:45:32] arup_r: dminuoso: ok I will do it in sql
[11:45:39] arup_r: I got you
[11:46:52] Jameser: has joined #RubyOnRails
[12:02:01] fschuindt: has joined #RubyOnRails
[12:27:28] truenito: has joined #RubyOnRails
[12:32:57] blackbaba: has joined #RubyOnRails
[12:34:51] Rodya_: has joined #RubyOnRails
[12:34:53] blackbaba: has left #RubyOnRails: ()
[12:35:37] rgr: has joined #RubyOnRails
[12:39:23] fumk: has joined #RubyOnRails
[12:41:42] mostlybadfly: has joined #RubyOnRails
[12:44:41] drale2k_: has joined #RubyOnRails
[12:46:18] arup_r: has joined #RubyOnRails
[12:46:22] hopsoft: has joined #RubyOnRails
[12:46:53] arup_r: What am I missing here https://gist.github.com/aruprakshit/d4518d0de45939bb5758cfca7d040c7b with find_by_sql method? I am getting error as "ArgumentError: unknown keyword: tag_name"
[12:56:02] Jameser: has joined #RubyOnRails
[13:00:47] ur5us: has joined #RubyOnRails
[13:06:03] ur5us: has joined #RubyOnRails
[13:09:52] conta: has joined #RubyOnRails
[13:10:03] Jameser: has joined #RubyOnRails
[13:17:45] Jameser: has joined #RubyOnRails
[13:18:10] arup_r: has joined #RubyOnRails
[13:24:46] GodFather_: has joined #RubyOnRails
[13:26:52] keegnotrub: has joined #RubyOnRails
[13:35:43] Rodya_: has joined #RubyOnRails
[13:49:50] fschuindt: has joined #RubyOnRails
[13:51:10] workmad3: arup_r: find_by_sql doesn't support that sort of parameter passing
[13:51:29] arup_r: workmad3: yes figured. I need to pass everything inside []
[13:52:24] arup_r: workmad3: it https://gist.github.com/aruprakshit/d4518d0de45939bb5758cfca7d040c7b worked
[14:01:25] srinidhi: has joined #RubyOnRails
[14:04:24] jphase: has joined #RubyOnRails
[14:04:51] jphase: has joined #RubyOnRails
[14:13:11] arup_r: the member count in this channel dropped to 267.. from 500+. Where all people are going from Rails? :D
[14:15:12] morfin: has joined #RubyOnRails
[14:16:31] morfin: i am trying to start Rails app using user systemd but not sure - WorkingDirectory does change dir so puma binstub run application or not
[14:25:14] dminuoso: workmad3: oi.
[14:25:17] dminuoso: Where have you been.
[14:36:17] Rodya_: has joined #RubyOnRails
[14:57:04] tcopeland: has joined #RubyOnRails
[15:11:52] AzaToth: has joined #RubyOnRails
[15:14:27] Rodya_: has joined #RubyOnRails
[15:19:29] FrostCandy: has joined #RubyOnRails
[15:20:24] cr3: has joined #RubyOnRails
[15:20:47] orbyt_: has joined #RubyOnRails
[15:21:13] alfiemax: has joined #RubyOnRails
[15:21:42] FrostCandy: Hi all, we use ActiveRecord:Migration, I need to change a string to a text field in the database. Do I change it in teh database, then run some sort of migration that builds the code for me, or do i change some code then it changes the database for me?
[15:27:44] dviola: has joined #RubyOnRails
[15:27:55] FrostCandy: when i do a search for my field to change from string to text i find 2 files that seem important: 20131005171742_create_emails.rb and schema.rb. Do I change the schema file or the other one?
[15:31:30] mustmodify: has joined #RubyOnRails
[15:32:01] hopsoft: has joined #RubyOnRails
[15:32:43] mustmodify: Our demo site requires that I add users and a bunch of other data. The factory with that data is 14583 lines long (auto-generated).
[15:34:40] mustmodify: Am I nuts for not wanting that in memory in production, where it would never be used? I'm thinking about just `./bin/rails runner script/provision_demo_user #{sanitized_id} #{sanitized_other_id}` ... it would be secure, but is it sensible?
[15:39:18] FrostCandy: 15k lines * 100 chars is only ~ 1.5mb right?
[15:40:55] dionysus69: has joined #RubyOnRails
[15:41:14] FrostCandy: For my issue it looks like I need to write a "rails g migration file_name" line then edit that. Assuming i'm getting good info on stackoverflow :D
[15:43:38] FrostCandy: mustmodify: even though it's only 1.5 mb(ish) if it's wasted space, then a better solution isn't wrong. So yes sensible to make it more efficient.
[15:45:42] apeiros_: has joined #RubyOnRails
[15:50:02] dgsan: I'm having a problem where when I broadcast_to a channel using stream_from the results come to the client as plain text (by the client), but when I use transmit it's getting interpreted as JSON (by the client). I'm sure there's something stupid I'm missing, just not sure what.
[15:55:49] alfiemax: has joined #RubyOnRails
[16:04:56] mrbubbles: has joined #RubyOnRails
[16:05:38] mrbubbles: Hey folks. Quick question about API responses. Where is the correct place to include "meta" about the results you're returning? I'm returning chart series and depending on the date range requested it returns daily, monthly, weekly readings. I want to include this in the response (for debugging) so would I just add a key, or a response header
[16:07:16] havenwood: mrbubbles: The JSON API spec suggests a meta key: http://jsonapi.org/format/#document-meta
[16:07:36] mrbubbles: Nice, thanks havenwood
[16:10:24] [Butch]: has joined #RubyOnRails
[16:11:51] iamarun: has joined #RubyOnRails
[16:12:25] alfiemax: has joined #RubyOnRails
[16:14:51] morfin: has left #RubyOnRails: ()
[16:16:26] apparition: has joined #RubyOnRails
[16:19:00] troys: has joined #RubyOnRails
[16:20:22] Technodrome: has joined #RubyOnRails
[16:23:19] mrbubbles: I'm having a bit of trouble with a problem. Basically data is arriving every 5 minutes. It's stored, then we have a number of views - which kind of cascade - but it's causing the queries to be super slow
[16:23:28] mrbubbles: This might be more of a postgres question actually :)
[16:29:52] mustmodify: has left #RubyOnRails: ()
[16:37:18] carl_array: has joined #RubyOnRails
[16:44:27] apeiros_: has joined #RubyOnRails
[16:56:01] mtkd: has joined #RubyOnRails
[17:01:16] guacamole: has joined #RubyOnRails
[17:01:42] Technodrome: has joined #RubyOnRails
[17:08:53] one_zero: has joined #RubyOnRails
[17:10:33] Cache_Money: has joined #RubyOnRails
[17:15:58] guacamole: has joined #RubyOnRails
[17:20:49] fschuindt: has joined #RubyOnRails
[17:28:53] alfiemax: has joined #RubyOnRails
[17:30:30] orbyt_: has joined #RubyOnRails
[17:34:08] guacamole: has joined #RubyOnRails
[17:40:09] seanthompson: has joined #RubyOnRails
[17:46:40] guacamole: has joined #RubyOnRails
[18:05:55] Cache_Money: has left #RubyOnRails: ()
[18:22:19] apeiros_: has joined #RubyOnRails
[18:41:04] uksio: has joined #RubyOnRails
[18:58:20] alfiemax: has joined #RubyOnRails
[18:59:31] Dimik: has joined #RubyOnRails
[18:59:34] apeiros_: has joined #RubyOnRails
[19:13:52] conta2: has joined #RubyOnRails
[19:19:23] ur5us: has joined #RubyOnRails
[19:20:36] orbyt_: has joined #RubyOnRails
[19:32:20] babykosh: has joined #RubyOnRails
[19:32:53] keegnotrub: has joined #RubyOnRails
[19:35:20] truenito: has joined #RubyOnRails
[19:37:16] tubbo: has joined #RubyOnRails
[19:42:00] keegnotrub: has joined #RubyOnRails
[19:52:57] Technodrome: has joined #RubyOnRails
[20:10:58] cnk: has joined #RubyOnRails
[20:11:58] seanthompson: has joined #RubyOnRails
[20:26:57] safetypin: has joined #RubyOnRails
[20:28:06] sagax: has joined #RubyOnRails
[20:29:40] KeyJoo: has joined #RubyOnRails
[20:30:10] Coldblackice: has joined #RubyOnRails
[20:33:54] truenito: has joined #RubyOnRails
[20:52:38] fragamus: has joined #RubyOnRails
[20:53:17] conta: has joined #RubyOnRails
[20:59:33] orbyt_: has joined #RubyOnRails
[21:00:25] tycoon177: is there a way to get capistrano to deploy with git submodules?
[21:03:32] marr: has joined #RubyOnRails
[21:03:38] dminuoso: tycoon177: http://capistranorb.com/documentation/advanced-features/custom-scm/
[21:03:42] dminuoso: Just provide your own strategy
[21:04:11] dminuoso: I gave up on capistrano after a while, since it felt like I was just working to please capistrano rather than solving problems.
[21:08:12] tycoon177: dminuoso: that's what i'm starting to think. they seem very against submodules from the conversations that i've seen in github issues
[21:09:23] cnk: That's sad to hear. I loved capistrano when it first came out. Haven't had occaision to use it recently
[21:09:34] dminuoso: cnk: It's fine if you have no real requirements, and just want something to "work"
[21:09:55] tycoon177: i'm toying with the idea of either switching to a docker based deployment strategy, which we recently did on another project, or just emulating capistrano's workflow with a script
[21:10:06] dminuoso: For most casual cases you have plugins like puma, sidekiq and what not. So it's fine for small setups.
[21:10:13] dminuoso: tycoon177: We switched to docker, never looked back.
[21:10:37] tycoon177: dminuoso: do you use something like kubernetes or docker swarm to manage deployments?
[21:16:10] Technodrome: has joined #RubyOnRails
[21:28:46] dminuoso: tycoon177: Nah we just do it straight from gitlab.
[21:29:54] tycoon177: gitlab does deployments now? O.o
[21:32:29] dminuoso: tycoon177: With gitlab ci sure
[21:33:18] dminuoso: tycoon177: https://docs.gitlab.com/ce/ci/environments.html this gives a rough gist of it.
[21:33:35] tycoon177: neato, i'll give it a look through soon
[21:33:51] dminuoso: Its nothing fancy, but we dont have a complex setup. Kubernetes would be complete overkill.
[21:34:18] tycoon177: oh it would be for us too...that's why we don't use it :p
[21:35:31] tycoon177: i'm trying to figure out why my docker volume isn't writeable right now :p THEN i'll look more into that
[21:50:34] tycoon177: dminuoso: i assume you use rails at work...what base docker image are you using? I'm currently using the passenger-ruby one, but the images are coming out a little bit over 1gb :/
[21:50:46] dminuoso: tycoon177: alpine
[21:50:56] dminuoso: Screw passenger, puma all the way,.
[21:51:10] dminuoso: Just works, no quirky native extension, and pure ruby.
[21:52:01] tycoon177: i ran into issues installing certain gems with alpine...i forget what it was, but it was a gem with native extensions
[21:52:36] tycoon177: dminuoso: would you mind sharing your dockerfile and i could give it another go?
[21:53:16] tycoon177: :/ it's not generic enough to share? drat
[21:53:39] SteenJobs: has joined #RubyOnRails
[21:57:13] dminuoso: tycoon177: From what I know the ruby images are fine.
[21:58:11] dminuoso: tycoon177: Most "native extension issues" are just missing libraries. And debugging is just a bit annoying because you have to pluck out the mkmf.log to see what went wrong.
[21:58:17] dminuoso: But its nothing major really.
[21:59:11] tycoon177: dminuoso: alright, i might take another crack at it if it'll save me a decent amount of space on the images
[21:59:20] tycoon177: boss doesn't mind the 1gb image, but it's annoying to me
[22:00:52] dminuoso: tycoon177: Thats why we picked alpine, it has a really small base size.
[22:01:14] dminuoso: So essentially any size in the image is what you throw into it.
[22:01:38] dminuoso: tycoon177: Just make sure you clean up on the same layer you introduce things.
[22:02:34] tycoon177: it kills me that alpine:3.5 is <4MB and ruby:2.1-alpine is 188MB...
[22:02:44] tycoon177: i wonder if i could install ruby for less than that
[22:03:22] atrius: has joined #RubyOnRails
[22:03:48] BloodyMer: has joined #RubyOnRails
[22:06:02] dminuoso: tycoon177: Do you have any JS code? yarn giving you a sizeable node_modules directory?
[22:06:53] tycoon177: we don't use any js tooling...my boss is very oldschool and i've been trying to pull him into the 21st century. i'm just happy he let me use docker and letsencrypt lol
[22:07:12] dminuoso: Oh I meant as a frontend
[22:07:23] tycoon177: yeah, we just use erb and rails assets
[22:07:31] tycoon177: no external tooling
[22:07:37] dminuoso: Here we use react, so we get 600MiB in just node_modules ;p
[22:07:47] dminuoso: (From the gazillion of different JS libraries)
[22:09:42] SteenJobs: hey all, so acc to the ruby docs, while the Date and Time classes inherit from Object, DateTime is a subclass of Date. acc to the rails docs, DateTime is actually a direct descendent of Object and not Date. acc to http://guides.rubyonrails.org/active_support_core_extensions.html#extensions-to-datetime however, DateTime DOES in fact inherit from Date — I was looking into converting a DateTime object to a unix timestamp, and while the core ruby
[22:09:43] SteenJobs: library requires converting the DateTime object to an object of type Time (`DateTime.to_time.to_i`), with ActiveSupport however, DateTime now responds to to_i (`DateTime.to_i`) and doesn’t need to be converted to a Time object - however in the rails guides link, to_i is not listed as an extension to DateTime. So my question: anyone have any insight into what the actual implementation is?
[22:11:17] dminuoso: SteenJobs: Check this out `DateTime.instance_method(:to_i).source_location`
[22:11:42] SteenJobs: dminuoso: with or without requiring ActiveSupport?
[22:12:26] dminuoso: SteenJobs: Whereever you have it available.
[22:15:05] alfiemax: has joined #RubyOnRails
[22:19:59] timdotrb: has joined #RubyOnRails
[22:22:15] tycoon177: SteenJobs: source_location will tell you where the method is defined so that you can read the implementation
[22:24:05] SteenJobs: yep, took a look - i gotta be afk for a few, but want to discuss when i get back if you’re still here
[22:27:32] happygilmoregent: has joined #RubyOnRails
[22:28:06] happygilmoregent: What is the procedure about going into production with any ror project
[22:30:17] happygilmoregent: Do you just set rails_env= production and rails s or foreman if you are using webpacker?
[22:32:24] fragamus: has joined #RubyOnRails
[22:34:03] tycoon177: happygilmoregent: rails s will use webrick and is not good for production. I would suggest looking into puma or passenger. puma is the standard nowadays, so prefer that over passenger
[22:34:07] dminuoso: happygilmoregent: It depends on how it is configured.
[22:34:13] dminuoso: tycoon177: Nope, since 5.0 it defaults to puma.
[22:34:51] tycoon177: ACTION is stuck supporting rails 3
[22:35:26] dminuoso: happygilmoregent: Assuming a default configuration, you will need to precompile assets, somehow provide static assets (either through rails itself or another webserver), and them just run the server
[22:35:55] dminuoso: happygilmoregent: But that's only the most basic setting. Usually you want some form of deployment, start/shutdown semantics, zero downtime deployment, rollback capabilities
[22:36:02] dminuoso: So it really depends on what you want.
[22:38:30] cincy_kal: has joined #RubyOnRails
[22:39:59] cincy_kal: Is anyone here familiar with the concept of returning status objects from services (like {success?: false, error: details..., result: value})
[22:40:22] happygilmoregent: Attempting to make a website with a shop backend so using yarn webpack and angularjs so I have sap vs the old way
[22:41:18] happygilmoregent: Using devise for authentication
[22:46:01] dminuoso: cincy_kal: "success" is not necessary, its implied by HTTP success status
[22:55:38] SteenJobs: dminuoso, tycoon177: love the source_location method, and while it immediately gave me the filepath for the ActiveSupport extension of DateTime, it returned nil when trying to get the location of the definition of DateTime in the ruby standard library (tangential to our discussion, but still curious why that’s the case) so i had to hunt it down in the github repo for the rubysl for Date
[22:55:44] SteenJobs: re my original question, the ActiveSupport extension of DateTime clearly defines to_i, but it seems like ActiveSupport is simply extending the DateTime class defined in the rubysl, which would mean that the rails “version” of DateTime in fact does subclass Date (at first i thought since ActiveSupport source just showed `class DateTime` that it was redefining it, since i’ve been in Swift land where you need to explicitly use the `extension`
[22:55:45] SteenJobs: keyword, e.g. extension String {}, but then remembered that’s how you extend classes in ruby)
[22:56:28] SteenJobs: so i guess my only remaining question is why the rails api docs show `DateTime < Object`
[22:56:40] dminuoso: SteenJobs: The reason about DateTime is that there is no source code.
[22:56:46] dminuoso: SteenJobs: Can you guess why?
[22:57:28] Technodrome: has joined #RubyOnRails
[22:58:23] hopsoft: has joined #RubyOnRails
[22:58:39] SteenJobs: quick digression - this is why i miss doing rails dev and hanging out in this channel, the pedagogical approach of guiding people rather than just spoon feeding them the answer is absolute gold - seriously, i attribute being able to truly learn how to write code when i was first starting out years ago to this channel and that method of teaching
[22:58:49] SteenJobs: ok digression over
[23:01:00] elomatreb: dminuoso: Yeah that case could really be made more clear, returning nil isn't exactly intuitive
[23:01:26] dminuoso: elomatreb: in all fairness it is documented.
[23:01:51] elomatreb: Of course, just like it's documented where the source of DateTime is. Doesn't help much though
[23:02:12] dminuoso: elomatreb: My point is, if you use a method blindly without checking its documentation, noone but you are to blame for not understanding the output.
[23:02:18] orbyt_: has joined #RubyOnRails
[23:03:00] elomatreb: I don't really like that attitude because if your method could be made more intuitive, it might save someone a trip to the docs and thus time. Esp. with a method like source_location, which you expect to just do what it says on the tin
[23:03:33] simmerz: has joined #RubyOnRails
[23:03:38] dminuoso: elomatreb: So what you are saying is we need derpy in here, so I can &ri
[23:03:50] SteenJobs: are you referring to the fact that source_location is an instance method on the Method class?
[23:04:27] dminuoso: https://ruby-doc.org/core-2.4.2/Method.html#method-i-source_location "Returns [...] nil if this method was not defined in Ruby (i.e. native)."
[23:04:38] simmerz: I’ve got a modal window with a form_with in it. Works fine in development, but in test mode, the entire form doesn’t render at all. save_and_open_page shows it not there at all in the page source.
[23:04:39] dminuoso: SteenJobs: DateTime is written in C
[23:04:51] jphase: has joined #RubyOnRails
[23:05:01] SteenJobs: ahh, i missed the native bit, first thing i did when you mentioned source_location was look it up in the docs
[23:05:11] elomatreb: I wonder if we couldn't make native modules/methods know about their location in the source files
[23:05:45] dminuoso: elomatreb: Or just throw a meaningful exception.
[23:06:23] dminuoso: I mean I do agree with you that `nil` to denote natively implemented methods is poor.
[23:06:37] elomatreb: Exception might be a bit much, I was thinking something like [:native, 0]
[23:06:52] dminuoso: You sir have done too much Elixir.
[23:07:02] elomatreb: I have not written one line of Elixir
[23:07:34] SteenJobs: if the implementation is in C, then what exactly is https://github.com/rubysl/rubysl-date/blob/2.0/lib/rubysl/date/date.rb#L1559
[23:07:47] dminuoso: elomatreb: method(:foo).source_location =3> ["(pry)", 1]
[23:08:04] dminuoso: method(:foo).source_location #=> ["(irb)", 1]
[23:08:19] dminuoso: elomatreb: ["(native)", 1] is what seems most consistent
[23:08:42] elomatreb: I was thinking the 0 (or even -1?) to clearly indicate an "unknown" value
[23:09:33] dminuoso: elomatreb: oh that number relates to the nth statement where the emthod was defined in.
[23:09:38] dminuoso: Yeah, -1 sounds fine
[23:10:40] dminuoso: SteenJobs: Either a separate class, or they just reopen ruby's DateTime
[23:10:43] jphase: has joined #RubyOnRails
[23:12:27] elomatreb: This convenient littly file is where DateTime comes from according to the docs: https://github.com/ruby/ruby/blob/trunk/ext/date/date_core.c
[23:12:45] SteenJobs: but why should the fact that the base implementation is in C make a difference, the code must live somewhere locally…is it because ruby is loading the class from the compiled C binary (and therefore it’s not really parseable)?
[23:12:58] dminuoso: It also exists just to make you really confused why there's two almost identical classes doing the same thing.
[23:13:46] dminuoso: SteenJobs: Must it? A) you may have a precompiled binary. B) Ruby cant know where the source code lies.
[23:14:31] SteenJobs: if they were reopening in the std lib, wouldn’t the DateTime extension just be `class DateTime` rather than `class DateTime < Date`?
[23:14:45] SteenJobs: dminuoso: haha yea, that was the second part of my message
[23:14:49] dminuoso: SteenJobs: Good point. Then they are rolling their own.
[23:15:20] dminuoso: SteenJobs: The class does not even exist in binary form.
[23:15:42] dminuoso: SteenJobs: It is created out of thin air when you require the library.
[23:15:42] SteenJobs: ya ya, i meant exactly as you said, “precompiled binary"
[23:16:09] dminuoso: So there quite literally exists no source.
[23:16:20] SteenJobs: yea makes sense
[23:16:38] SteenJobs: but does their (ruby std lib) rolling their own DateTime re-raise the question as to why source_location returned nil?
[23:17:36] Radar: source_location would return nil if the code is written in C.
[23:17:44] Radar: source_location only shows locations for Ruby code
[23:17:50] Radar: ACTION feels like he's jumping in late
[23:18:53] duderonomy: has joined #RubyOnRails
[23:20:38] Coldbla9: has joined #RubyOnRails
[23:21:39] jphase: has joined #RubyOnRails
[23:22:56] SteenJobs: Radar: long time brother
[23:23:07] Radar: indeed :)
[23:24:17] Cache_Money: has joined #RubyOnRails
[23:24:55] SteenJobs: love the nostalgia though, every time i’m here the memories of first even learning what code was start flooding back so i get to look back and appreciate the journey
[23:25:48] SteenJobs: Radar: it seems like the DateTime class is redefined in https://github.com/rubysl/rubysl-date/blob/2.0/lib/rubysl/date/date.rb#L1559 - it makes sense for `source_location` to return nil when referencing the C implementation, but then what is that class defined in the ruby std lib?
[23:26:03] SteenJobs: also - why do the rails api docs show `DateTime < Object`?
[23:26:18] Radar: SteenJobs: link me to that page please
[23:26:21] Radar: the api docs
[23:27:04] Radar: SteenJobs: and what lead you to rubysl-date? I think those are only for Rubinius
[23:27:04] SteenJobs: http://api.rubyonrails.org/v5.1/classes/DateTime.html
[23:27:46] Radar: Dunno why the API documentation shows that. It should be inheriting from Date.
[23:27:47] SteenJobs: ah ok - was investigating why source_location was returning nil and trying to find the ruby definition of DateTime before dminuoso pointed out that it’s a C implementation
[23:27:49] Radar: irb(main):001:0> DateTime.ancestors
[23:27:50] Radar: => [DateTime, DateAndTime::Compatibility, Date, DateAndTime::Calculations, DateAndTime::Zones, Comparable, ActiveSupport::ToJsonWithActiveSupportEncoder, Object, ActiveSupport::Dependencies::Loadable, PP::ObjectMixin, JSON::Ext::Generator::GeneratorMethods::Object, ActiveSupport::Tryable, Kernel, BasicObject]
[23:29:38] SteenJobs: yea i checked the same - this all started bec i was curious why with core ruby DateTime first needs to be converted to a Time object before using `to_i` to convert to a unix timestamp, yet with ActiveSupport DateTime objects handle `to_i` directly - so i found the ActiveSupport extension of DateTime, but then was left with the question of why the rails api docs seemed to indicate that the rails “version” of DateTime is a totally different class,
[23:29:38] SteenJobs: because of the `DateTime < Object` bit
[23:30:38] Radar: irb(main):002:0> DateTime.now.method(:to_i).source_location
[23:30:38] Radar: => ["/Users/ryanbigg/.gem/ruby/2.4.2/gems/activesupport-5.1.2/lib/active_support/core_ext/date_time/conversions.rb", 82]
[23:31:01] Radar: AS has defined to_i there in my 5.1.2 app
[23:31:06] SteenJobs: yep, that’s where i found my first answer (i.e. why DateTime w ActiveSupport handles a direct conversion)
[23:31:27] dminuoso: It's good that you are here.
[23:31:28] Radar: https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/date_time/conversions.rb#L84-L86
[23:31:30] Radar: dminuoso: so good
[23:31:36] dminuoso: Need someone to tuck me in.
[23:31:46] Radar: ACTION tucks in dminuoso 
[23:31:52] dminuoso: Good night.
[23:32:09] SteenJobs: this all started bec the other dude on the iOS team asked me a rails question bec of my background, and then i fell down this rabbit hole
[23:32:16] Radar: SteenJobs: I don't know how RDoc determines the class there. I can tell you that DateTime in Rails is definitely the same class.
[23:32:21] Radar: the same class as from the stdlib
[23:32:32] Radar: SteenJobs: and why use DateTime instead of just Time?
[23:34:31] Radar: [10:12:27] <elomatreb> This convenient littly file is where DateTime comes from according to the docs: https://github.com/ruby/ruby/blob/trunk/ext/date/date_core.c <- this is correct
[23:34:52] jphase: has joined #RubyOnRails
[23:35:42] Radar: If you don't feel like reading all 9000+ lines of the file... https://github.com/ruby/ruby/blob/trunk/ext/date/date_core.c#L9577 <- that is the line where the class is defined.
[23:36:26] orbyt_: has joined #RubyOnRails
[23:37:43] SteenJobs: Radar: Datetime because it’s an AR object, so our backend was serializing object.created_at, yet the json received by the client has a unix timestamp for created_at, so we finally tracked down where in the backend code the conversion takes place, and it was DateTime.to_i (no conversion to type Time), so i started getting curious
[23:38:16] SteenJobs: yea all makes sense - but when you said “the same class as from the stdlib”, you mean the C implementation and not that rubysl link i sent, right?
[23:38:27] Radar: yes, rubysl is strictly for rubinius instead.
[23:38:30] DTZUZO: has joined #RubyOnRails
[23:38:40] SteenJobs: awesome, i feel quite satisfied haha
[23:39:28] SteenJobs: besides for the rails docs thing, but oh well 🙃
[23:41:30] SteenJobs: Radar: has there ever been discussion around some sort of keyword in ruby for extending a class? like if i see `Class Foo`, it seems like there’s no obvious way to discern if it’s a base definition, or if Foo was defined elsewhere and this is just an extension
[23:42:25] Technodrome: has joined #RubyOnRails
[23:42:52] jphase: has joined #RubyOnRails
[23:42:57] elomatreb: You can freeze classes, which will then throw an error if try to extend it afterwards, but it's not commonly done AFAIK
[23:43:35] elomatreb: *if you try to modify it, not extend
[23:43:48] elomatreb: (Extending being A < B)
[23:46:43] jphase_: has joined #RubyOnRails
[23:46:53] Radar: SteenJobs: not that I am aware of.
[23:55:49] jphase: has joined #RubyOnRails
[23:57:42] atrius: has joined #RubyOnRails