« Back to channel list

#RubyOnRails - 21 January 2019

« Back 1 day Forward 1 day »
[00:00:02] dozzed: good news
[00:05:15] ur5us: has joined #RubyOnRails
[00:10:12] quazimodo: has joined #RubyOnRails
[00:16:24] blackmesa: havenwood: i created symbolic links for ruby and gem. now gem install works without sudo
[00:25:53] Technodrome: has joined #RubyOnRails
[00:38:00] RiPuk: has joined #RubyOnRails
[00:39:37] lexileo: has joined #RubyOnRails
[00:46:30] gambl0r3: has joined #RubyOnRails
[00:58:37] sevenseacat: has joined #RubyOnRails
[00:58:55] EXCHGR: has joined #RubyOnRails
[01:56:39] LunarDinosaur: has joined #RubyOnRails
[02:26:03] mangold: has joined #RubyOnRails
[02:53:19] mr_roybot: has joined #RubyOnRails
[03:02:04] NeXTSUN: has joined #RubyOnRails
[03:02:39] quazimodo: has joined #RubyOnRails
[03:10:50] griest: has joined #RubyOnRails
[03:14:29] griest: Can someone explain why the foreign key is stored in the table with the `belongs_to` association? It seems to me that the "parent" model that `has_one` or `has_many` associations defined should store the references.
[03:15:32] sevenseacat: possibly because when that paradigm was decided, there wasn't a lot of support for arrays in databases so storing an array of references wouldn't work
[03:15:48] griest: Ah legacy
[03:16:34] sevenseacat: (guessing. i've never really thought about it, it seems fine to me)
[03:16:44] griest: well when consuming the API, I'm going to want the parent models to store the references, what is the idiomatic way to accomplish this?
[03:18:23] griest: if I were to use Grape, I think I would use entities, what about with Rails API mode?
[03:18:46] andrewray: because it's correct normalization to put the fk on the "child"
[03:24:04] mr_roybot: has joined #RubyOnRails
[03:34:51] griest: What is the correct way to present the parent model the child fks?
[03:35:29] griest: So that getting the parent model JSON through the API would be
[03:35:34] griest: So that getting the parent model JSON through the API would be: ```
[03:36:08] griest: So that getting the parent model JSON through the API would be: `{id: "parent_id", children: ["1", "2", ...]}`
[03:36:15] griest: sorry, not used to IRC
[03:40:25] mr_roybot: has joined #RubyOnRails
[04:06:11] quazimodo: has joined #RubyOnRails
[04:09:27] braincrash: has joined #RubyOnRails
[04:19:10] Saukk: has joined #RubyOnRails
[04:32:16] quazimodo: has joined #RubyOnRails
[05:02:21] dmj1777: has joined #RubyOnRails
[05:06:53] KazeFX: has joined #RubyOnRails
[05:10:26] griest: can I modify the `primary_key` in `ApplicationRecord` to change it from id to slug? Does it have to be an integer or is there a quick way to make it a string for the whole app?
[05:16:31] dmj1777: yes . I suggest you google 'rails use slug instead of id hackernoon' - there is a good how to there.
[05:27:09] tdy: has joined #RubyOnRails
[05:46:24] Milos: has joined #RubyOnRails
[05:48:54] uksio: has joined #RubyOnRails
[06:02:56] Avinash: has joined #RubyOnRails
[06:03:28] griest: ah yeah I saw that, but does that mean you have to manually add those columns to the table?
[06:04:30] griest: Is there no way to tell rails to treat the slug exactly the way as `id` is? Not in the URL params, but in the DB. I'm only using active record anyway, so routing is handled by something else
[06:12:10] reber: has joined #RubyOnRails
[06:23:53] tdy: has joined #RubyOnRails
[06:42:18] Caerus: has joined #RubyOnRails
[06:42:27] sung: has joined #RubyOnRails
[06:42:35] Psy-Q: has joined #RubyOnRails
[06:42:56] FooBarWidget: has joined #RubyOnRails
[06:55:31] srinidhi: has joined #RubyOnRails
[06:56:07] Avinash: has joined #RubyOnRails
[07:07:33] defsdoor: has joined #RubyOnRails
[07:17:52] ur5us: has joined #RubyOnRails
[07:22:28] RedNifre: has joined #RubyOnRails
[07:25:11] dmj1777: griest I am not aware of a way to just switch it across.
[07:29:22] srinidhi: has joined #RubyOnRails
[07:33:28] mangold: has joined #RubyOnRails
[07:49:17] Cork: is there anywhere one can find max/min ruby requirements for core rails?
[07:49:55] sevenseacat: https://rubygems.org/gems/rails lists min, not sure about max
[07:50:38] Cork: sevenseacat: thx, you know about max?
[07:50:55] sevenseacat: (those numbers are likely taken directly from the gem config)
[07:51:04] sevenseacat: I just said not sure about max
[07:52:24] za1b1tsu: has joined #RubyOnRails
[08:00:34] za1b1tsu: has joined #RubyOnRails
[08:02:01] srinidhi: has joined #RubyOnRails
[08:08:46] conta: has joined #RubyOnRails
[08:13:08] exchgr`: has joined #RubyOnRails
[08:14:01] Avinash: has joined #RubyOnRails
[08:30:24] Avinash: has joined #RubyOnRails
[08:49:38] tuor: has joined #RubyOnRails
[08:54:51] Technodrome: has joined #RubyOnRails
[08:56:51] DTZUZO_: has joined #RubyOnRails
[09:00:35] SteenJobs: has joined #RubyOnRails
[09:09:32] mikecmpbll: has joined #RubyOnRails
[09:15:25] duderonomy: has joined #RubyOnRails
[09:32:50] fox_mulder_cp: Cork: last release and last raikls )
[09:33:32] Cork: fox_mulder_cp: as far as i can tell you can't use latest ruby
[09:33:54] Cork: ruby 2.6 breaks quite badly
[09:34:04] fox_mulder_cp: Cork: compile from rubyenv?
[09:34:32] Cork: fox_mulder_cp: the problem is that ruby 2.6 smeams to have fiddled with irb so rails c fails
[09:35:22] fox_mulder_cp: Cork: hm. i compile 2.6 ruby with 5.2.2 rails but use not irb last 4 years for console, i use pry. and no problems
[09:36:29] Cork: hmm i use pry too but i get "`require': cannot load such file -- irb" with 2.6
[09:36:36] fox_mulder_cp: what i can execute in irb for verify your errors?
[09:36:58] Cork: fox_mulder_cp: i can't even start it
[09:37:03] fox_mulder_cp: irb 1.0.0 (2018-12-18)
[09:37:14] Cork: meaning i can start irb, but not rails c
[09:37:20] fox_mulder_cp: uby 2.6.0p0 (2018-12-25 revision 66547)
[09:37:23] Cork: also i can start pry directly
[09:37:35] fox_mulder_cp: Pry version 0.12.2 on Ruby 2.6.0
[09:37:56] Guest55233: has joined #RubyOnRails
[09:37:57] fox_mulder_cp: Cork: hm. may be u must reinstall irb/pry gems?
[09:38:12] fox_mulder_cp: or update config via release requirements?
[09:38:26] fox_mulder_cp: or %path% environment failed?
[09:38:28] Cork: fox_mulder_cp: i rm -Rf vendor/bundle bundle install --path=vendor/bundle
[09:38:43] Cork: so i don't think that should be the problem
[09:39:33] fox_mulder_cp: hm. i use rbenv with it's manual for my rails env, no problem from start since 2014.
[09:40:02] fox_mulder_cp: do u se your linux distro ruby or use it from rbenv or it's analogue?
[09:40:24] Cork: mixed a bit depending on system, but on this maching it is the archlinux package
[09:43:08] fox_mulder_cp: oh, all my dev's says that use it from distro bad idea - it's really older than current. inu ubuntu it 2.5.1 and rails 2.3 than last 5.2.2
[09:43:28] Cork: uh, no i don't use rails from repo
[09:43:30] Cork: only ruby
[09:44:00] Cork: and it is 2.6.0 so my problem is actually normally that it is a bit too new :)
[09:44:37] Cork: for rails and all other gems i use builder
[09:44:59] fox_mulder_cp: try to use rbenv or its alternative. )
[09:46:55] quazimodo: has joined #RubyOnRails
[09:47:24] Cork: ya, will have to wait though haven't ever used rbenv
[09:49:51] fox_mulder_cp: Cork some years ago i write my own quick rbenv manual for quick restore it in ubuntu/deb-based
[09:50:06] Cork: fox_mulder_cp: cool
[09:51:44] lubekpl: has joined #RubyOnRails
[09:51:46] blackmesa: has joined #RubyOnRails
[10:15:12] jacksop: has joined #RubyOnRails
[10:26:42] jacksop: has joined #RubyOnRails
[10:33:28] blackmesa1: has joined #RubyOnRails
[10:33:44] lxsameer: has joined #RubyOnRails
[10:35:53] mangold: has joined #RubyOnRails
[11:03:10] tjbp: has joined #RubyOnRails
[11:28:47] Ergo: has joined #RubyOnRails
[11:38:56] za1b1tsu: has joined #RubyOnRails
[11:39:10] Avinash: has joined #RubyOnRails
[11:55:27] ariedler: has joined #RubyOnRails
[11:56:12] Avinash: has joined #RubyOnRails
[12:09:30] tjbp: has joined #RubyOnRails
[12:13:38] Triskelion: has joined #RubyOnRails
[12:22:14] Triskelion: has joined #RubyOnRails
[12:32:45] Triskelion: Hello, is there anyone who has played with stimulusjs? I'm in search of a bit of feedback or is this the wrong channel?
[12:39:06] nopolitica: has joined #RubyOnRails
[12:40:05] Jervis_: has joined #RubyOnRails
[12:43:14] Avinash: has joined #RubyOnRails
[12:53:31] beholders_eye: has joined #RubyOnRails
[12:54:51] mr-spoon: has joined #RubyOnRails
[13:02:34] LunarDinosaur: has joined #RubyOnRails
[13:21:18] beholders_eye: has joined #RubyOnRails
[13:22:23] lxsameer: has joined #RubyOnRails
[13:29:52] tycoon177: has left #RubyOnRails: ()
[13:34:15] Avinash: has joined #RubyOnRails
[14:07:12] alan_w: has joined #RubyOnRails
[14:10:31] conta: has joined #RubyOnRails
[14:10:49] status402: has joined #RubyOnRails
[14:14:41] hellekin: has joined #RubyOnRails
[14:19:47] RedNifre: has joined #RubyOnRails
[14:19:58] Technodrome: has joined #RubyOnRails
[14:22:52] hellekin: has joined #RubyOnRails
[14:38:42] Avinash: has joined #RubyOnRails
[14:54:16] chouhoulis: has joined #RubyOnRails
[14:57:30] ghormoon: has joined #RubyOnRails
[15:03:11] blackmesa1: Hi all. is it good practice to create a new system user for every app? e.g. 'adduser my-app-user'
[15:07:20] beholders_eye: has joined #RubyOnRails
[15:08:27] fox_mulder_cp: blackmesa1: hm. nginx can secure apps from another
[15:08:55] blackmesa1: ive been using nginx for ruby apps so far. rails and sinatra
[15:09:22] blackmesa1: my app folders are all owned by user 'deploy'.
[15:09:50] fox_mulder_cp: i have ten's of apps and no problems when use different virtual hosts for it
[15:10:34] fox_mulder_cp: passenger home path setting
[15:10:57] blackmesa1: Yes I use this too. I was asking about the folder permissions for the apps
[15:11:33] fox_mulder_cp: if is your own apps and no security questions, seems that is no problem :)
[15:11:41] blackmesa1: I have different owner for the databases. Just wondering if it makes sense to have different users for the folder permission for the apps
[15:12:00] fox_mulder_cp: no sense, i think
[15:12:29] fox_mulder_cp: passenger and home root path settings can secure your appf from another
[15:13:38] blackmesa1: ok. so do your apps folder permissions all have the same user:group?
[15:14:53] NeXTSUN: has joined #RubyOnRails
[15:15:03] chouhoulis: has joined #RubyOnRails
[15:15:57] cagomez: has joined #RubyOnRails
[15:16:00] fox_mulder_cp: yes, it's not a problem
[15:17:31] mr_roybot: has joined #RubyOnRails
[15:18:15] lxsameer: has joined #RubyOnRails
[15:35:59] Andr3as: hi all.. i have a text field where users should set a timecode in the format of MM:SS.. that timecode should be converted into seconds before i save it to the database as there is an integer field to hold it..
[15:36:30] Andr3as: in order to set that field correct i had to write a setter message timecode= with write_attribute :timecode, time.split(':').inject(0){|m, s| m = m * 60 + s.to_i}
[15:37:02] Andr3as: so far so good, i am now stuck with a validation coz i wnat that the user input will be validated if the format is correct..
[15:37:29] Andr3as: but as it gets converted when set, i cant validate, can i?
[15:38:06] Andr3as: if i dont do that setter method, user inputs of like "01:08" will be set to 1 when i do the Topic.new(topic_params) thing..
[15:38:13] Andr3as: any hint is highly welcome
[15:38:56] srinidhi: has joined #RubyOnRails
[15:39:20] lxsameer: has joined #RubyOnRails
[15:47:58] mr_roybot: has joined #RubyOnRails
[15:58:16] Avinash: has joined #RubyOnRails
[15:59:47] lxsameer: has joined #RubyOnRails
[16:01:53] SteenJobs: has joined #RubyOnRails
[16:10:41] mr_roybot: has joined #RubyOnRails
[16:16:22] eclm: has joined #RubyOnRails
[16:20:46] eclm: has joined #RubyOnRails
[16:26:58] theRoUS: is there an API exploration mechanism for rails similar to django's? for instance, if you send the following GET (at least to a particular app), you get something pretty, readable, and explorable:
[16:27:06] theRoUS: GET /api/v2/teams/53/users/
[16:27:13] theRoUS: HTTP 200 OK
[16:27:26] theRoUS: Allow: GET, POST, HEAD, OPTIONS
[16:27:34] theRoUS: Content-Type: application/json
[16:28:16] theRoUS: gives you pretty-printed JSON with live links to further explore the api
[16:28:39] theRoUS: failing that, has anyone ever implemented a WADL plugin for rails?
[16:32:07] mr_roybot: has joined #RubyOnRails
[16:36:28] rikkipitt: has joined #RubyOnRails
[16:44:51] rikkipitt: has joined #RubyOnRails
[16:45:39] gambl0r3: has joined #RubyOnRails
[16:46:11] srinidhi: has joined #RubyOnRails
[16:59:22] mr_roybot: has joined #RubyOnRails
[17:13:26] SteenJobs: has joined #RubyOnRails
[17:22:09] conta: has joined #RubyOnRails
[17:22:53] mr_roybot: has joined #RubyOnRails
[17:24:38] alan_w: has joined #RubyOnRails
[17:30:02] Puffball: has joined #RubyOnRails
[17:35:35] mr_roybot: has joined #RubyOnRails
[17:39:39] rikkipitt: has joined #RubyOnRails
[17:46:28] Avinash: has joined #RubyOnRails
[17:54:34] orbyt_: has joined #RubyOnRails
[17:55:37] chouhoulis: has joined #RubyOnRails
[17:56:47] defsdoor: has joined #RubyOnRails
[17:58:19] gambl0r3: has joined #RubyOnRails
[18:05:04] hive-mind: has joined #RubyOnRails
[18:21:30] srinidhi: has joined #RubyOnRails
[18:25:46] mr_roybot: has joined #RubyOnRails
[18:32:07] lunarkitty7: has joined #RubyOnRails
[18:32:22] duderonomy: has joined #RubyOnRails
[18:33:19] orbyt_: has joined #RubyOnRails
[18:35:00] reber: has joined #RubyOnRails
[18:35:04] conta: has joined #RubyOnRails
[18:39:15] Dbugger: has joined #RubyOnRails
[18:40:50] mikecmpbll: has joined #RubyOnRails
[18:41:18] mr_roybot: has joined #RubyOnRails
[18:45:09] mr_roybot: has joined #RubyOnRails
[18:51:28] mikecmpbll: has joined #RubyOnRails
[18:53:53] ravenousmoose: has joined #RubyOnRails
[19:04:03] andrewray: has joined #RubyOnRails
[19:04:25] Technodrome: has joined #RubyOnRails
[19:38:05] lxsameer: has joined #RubyOnRails
[20:03:50] tdy: has joined #RubyOnRails
[20:06:24] orbyt_: has joined #RubyOnRails
[20:19:35] alan_w: has joined #RubyOnRails
[20:29:08] za1b1tsu: has joined #RubyOnRails
[20:35:28] ellcs: has joined #RubyOnRails
[21:15:51] alan_w: has joined #RubyOnRails
[21:20:17] gambl0r3: has joined #RubyOnRails
[21:27:38] Scriptonaut: has joined #RubyOnRails
[21:32:41] Scriptonaut: hey guys, I'm working on a rails 5 project, and it's filtering my sensitive params in the rails server log, authenticity_token, password, and token. The only part of my config that explicitly tells it to filter is an initializer called filter_parameter_logging.rb, with the line Rails.application.config.filter_parameters += [:password]. Why is it filtering the token ones as well? I don't want it to
[21:32:47] Scriptonaut: filter in development, how can I disable that filtering?
[21:33:38] Technodrome: has joined #RubyOnRails
[21:36:20] gambl0r3: has joined #RubyOnRails
[21:42:24] cpruitt: has joined #RubyOnRails
[21:43:45] andrewray: when writing a gem, why use autoload instead of explicitly requiring a sub module/class ?
[21:47:04] andrewray: wait, autoload is being deprecated?!?!? oh thank god
[21:47:15] andrewray: I thought ruby was unsalvagable
[22:00:44] lunarkitty7: has joined #RubyOnRails
[22:11:22] gambl0r3: has joined #RubyOnRails
[22:14:57] Xiti: has joined #RubyOnRails
[22:17:57] tdy: has joined #RubyOnRails
[22:30:11] lunarkitty7: has joined #RubyOnRails
[22:44:48] mfoxtrot: has joined #RubyOnRails
[22:53:41] RedNifre: has joined #RubyOnRails
[22:57:12] Xiti: has joined #RubyOnRails
[23:01:07] Dykam: has joined #RubyOnRails
[23:27:57] nacsurte: has joined #RubyOnRails
[23:31:58] EXCHGR: has joined #RubyOnRails