« Back to channel list

#RubyOnRails - 06 March 2019

« Back 1 day Forward 1 day »
[00:10:20] ariedler: has joined #RubyOnRails
[00:10:48] ariedler: has joined #RubyOnRails
[00:23:16] Tempesta: has joined #RubyOnRails
[00:52:26] mangold: has joined #RubyOnRails
[01:08:02] agent_white: has joined #RubyOnRails
[01:35:48] ur5us: has joined #RubyOnRails
[01:38:41] sevenseacat: has joined #RubyOnRails
[02:06:21] conta: has joined #RubyOnRails
[02:11:51] mangold: has joined #RubyOnRails
[02:13:22] MrCrackPotBuilde: has joined #RubyOnRails
[02:24:03] ascarter: has joined #RubyOnRails
[02:54:27] agent_white: has joined #RubyOnRails
[03:01:37] [Butch]: has joined #RubyOnRails
[03:12:59] bambanx: has joined #RubyOnRails
[03:13:54] hahuang65: has joined #RubyOnRails
[03:20:08] blackmesa: has joined #RubyOnRails
[03:29:03] hahuang65: has joined #RubyOnRails
[03:31:11] gambl0r3: has joined #RubyOnRails
[03:56:38] dviola: has joined #RubyOnRails
[04:05:42] gambl0r3: has joined #RubyOnRails
[04:09:20] braincrash: has joined #RubyOnRails
[04:10:30] blackmesa: has joined #RubyOnRails
[04:11:07] ascarter: has joined #RubyOnRails
[04:12:31] sagax: has joined #RubyOnRails
[04:12:54] sagax: how to setup some attribute after fetch data from sql?
[04:13:04] sagax: question about activerecord
[04:13:27] sagax: i need setup some custom attribute
[04:13:58] hahuang65: sagax: you can maybe use the after_find callback.
[04:23:54] kapil____: has joined #RubyOnRails
[04:36:16] ascarter: has joined #RubyOnRails
[04:36:53] v01d4lph4: has joined #RubyOnRails
[04:39:43] JAay: has joined #RubyOnRails
[04:41:19] JAay: has left #RubyOnRails: ()
[04:48:22] MrCrackPotBuilde: has joined #RubyOnRails
[05:00:16] tdy: has joined #RubyOnRails
[05:12:27] bambanx: has joined #RubyOnRails
[05:52:01] bambanxx: has joined #RubyOnRails
[05:53:26] bambanxx: has joined #RubyOnRails
[05:54:04] oosehedaiphequag: has joined #RubyOnRails
[05:54:47] bambanxx: has joined #RubyOnRails
[06:18:39] conta: has joined #RubyOnRails
[06:41:06] reber: has joined #RubyOnRails
[06:55:45] srinidhi: has joined #RubyOnRails
[07:05:52] ariedler: has joined #RubyOnRails
[07:08:42] za1b1tsu: has joined #RubyOnRails
[07:38:44] Dbugger: has joined #RubyOnRails
[08:18:39] Sylario: has joined #RubyOnRails
[08:24:35] Ergo: has joined #RubyOnRails
[08:40:45] ellcs: has joined #RubyOnRails
[08:49:55] lxsameer: has joined #RubyOnRails
[08:59:00] ur5us: has joined #RubyOnRails
[09:03:34] szulak_: has joined #RubyOnRails
[09:33:12] blackmesa: has joined #RubyOnRails
[09:35:17] dionysus70: has joined #RubyOnRails
[09:36:57] dionysus69: I am generating this hex to assign one per user SecureRandom.hex(4) (generates 8 char string), the collision chance is quite low but still I want to handle it, does anyone have a DRY idea how do retry if it detects existing one?
[09:37:30] dionysus69: add a unique index to db column and rescue redo ?
[09:58:50] hightower2: has joined #RubyOnRails
[10:04:58] fox_mulder_cp: uniq index too
[10:20:07] kapil____: has joined #RubyOnRails
[10:37:26] DTZUZO: has joined #RubyOnRails
[10:43:15] srinidhi: has joined #RubyOnRails
[10:53:30] srinidhi: has joined #RubyOnRails
[10:58:19] MrCrackPotBuilde: has joined #RubyOnRails
[11:07:04] ariedler: has joined #RubyOnRails
[11:09:33] v01d4lph4: has joined #RubyOnRails
[11:14:09] mangold: has joined #RubyOnRails
[11:30:27] v01d4lph4: has joined #RubyOnRails
[11:36:50] ldnunes: has joined #RubyOnRails
[11:37:59] beingjohnm: moving from rails 4 to rails 5. Do I just junk all of my controller tests?
[11:40:06] beingjohnm: getting no route matches...missing required keys id for: get edit_task_url, params: { id: @task.id }
[11:47:05] lankanmon: has joined #RubyOnRails
[11:49:08] conta: has joined #RubyOnRails
[11:55:07] ariedler: has joined #RubyOnRails
[12:08:46] fox_mulder_cp: beingjohnm: sometimes my friens make a scaffolded rails 5th app and move code to it with tests adaptation - rspec have a major updates
[12:13:06] beingjohnm: These are minitests
[12:14:02] fox_mulder_cp: it updated to, anyway - all major versionshave a global changes and required to adopt code
[12:14:55] tbuehlmann: you're using an _url helper, so I assume this is a system test?
[12:16:30] tbuehlmann: either way, there's probably no route for that. you want edit_task_url(@task)
[12:16:39] beingjohnm: tbuehlmann: following a guide on transitioning to rails 5 so using IntegrationTest
[12:17:10] tbuehlmann: should be edit_task_path then
[12:19:48] beingjohnm: same error with: get edit_task_path, params: { id: @task.id }
[12:20:25] tbuehlmann: right, as said, there's no such route. try edit_task_path(@task)
[12:20:37] bvdw: has joined #RubyOnRails
[12:20:50] beingjohnm: elsewhere is sounds like I should be doing: get 'tasks/id/edit/ ubut don't know how to write that
[12:21:17] fox_mulder_cp: beingjohnm: in minitest?
[12:21:26] fox_mulder_cp: or in route list?
[12:21:32] tbuehlmann: edit_task_path(@task) will return that string
[12:21:50] beingjohnm: tbuehlmann: that worked. Thank you!
[12:22:13] tbuehlmann: you're welcome!
[12:23:27] beingjohnm: trying to combine bits from different guides...example code was working for the show test but not for the edit test.
[13:06:04] mauro1254: has joined #RubyOnRails
[13:32:35] guyzmo: beingjohnm - I use rspec for my tests, I upgraded last week, and they worked the same after the update :)
[13:33:15] guyzmo: though the strong_params stuff has been a really pain for me :-/
[14:04:23] beingjohnm: guyzmo: I never found a free day or two to check out rspec. Your comment makes me wish I had!
[14:15:41] duderonomy: has joined #RubyOnRails
[14:24:32] blackmesa: has joined #RubyOnRails
[14:24:37] MrCrackPotBuilde: has joined #RubyOnRails
[14:53:35] davidfetter: has joined #RubyOnRails
[14:56:07] MrCrackPotBuilde: has joined #RubyOnRails
[15:15:16] skryking: has joined #RubyOnRails
[15:15:46] tdy: has joined #RubyOnRails
[15:24:51] KeyJoo: has joined #RubyOnRails
[16:05:01] guyzmo: beingjohnm - I never tried the stock test framework, but rspec really does the job beautifully
[16:06:04] guyzmo: I guess it shouldn't be that hard to switch, it's basically behaviour driven, meaning you define your `describe`/`context` stuff and do `expect(<your predicates>)` within `it{}` blocks
[16:06:24] guyzmo: the whole idea being that using scopes, you create meaningful sentences
[16:09:13] guyzmo: I got a question about my switch to rails 5: I'm using STI with 3 classes, one mother class, and two children classes. They have a common scopes API, and I'm redefining some scopes in each child to match the differences
[16:09:48] guyzmo: but since I switched to rails 5, I get an annoying warning 'Creating scope :foobar. Overwriting existing method ChildA.foobar.'
[16:10:06] guyzmo: is there a way I could mark those scopes intended for being overriden as ok to be overriden ?
[16:13:47] pLaTo0n: has joined #RubyOnRails
[16:19:06] mangold: has joined #RubyOnRails
[16:26:30] ascarter: has joined #RubyOnRails
[16:31:45] anoob: has joined #RubyOnRails
[16:33:31] anoob: How do I mock a Numeric|Integer (not sure which class) method?: `allow_any_instance_of(Numeric).to receive(:day) { :somehting }` ... When I call `1.day` I receive: `TypeError: can't define singleton` ...
[16:56:15] conta: has joined #RubyOnRails
[16:57:21] beingjohnm: guyzmo: at some point I'm going to expand my testing (mostly a ton of model and unit tests) and start going integration testing. I'll probably look closer then.
[17:08:40] Saukk: has joined #RubyOnRails
[17:10:43] duderonomy: has joined #RubyOnRails
[17:20:55] istrasci: has joined #RubyOnRails
[17:33:21] ascarter: has joined #RubyOnRails
[17:39:31] v01d4lph4: has joined #RubyOnRails
[17:41:45] istrasci: I have a model M with a `belongs_to :event` association. I also have the following scope: `scope :for_event, -> (e) { where(event: e).first }`. If I call the scope and no record with that event exists, the call returns all records. But if I call M.where(event: e).first directly, it returns nil. Why does the scope behave this way by returning all records?
[17:52:03] Technodrome: has joined #RubyOnRails
[17:54:25] blackmesa: has joined #RubyOnRails
[17:58:17] gambl0r3: has joined #RubyOnRails
[17:59:47] v01d4lph4: has joined #RubyOnRails
[18:04:03] sameerynho: has joined #RubyOnRails
[18:07:30] istrasci: Perhaps because of this behaviour: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/scoping/named.rb#L197
[18:09:35] blackmesa: has joined #RubyOnRails
[18:12:48] cnsvc_: has joined #RubyOnRails
[18:16:35] mcr: has joined #RubyOnRails
[18:16:45] duderonomy: has joined #RubyOnRails
[18:17:39] mcr: "You have already activated bundler 1.17.3, but your Gemfile requires bundler 1.17.2. Prepending `bundle exec` to your command may solve this." <- yes, I know that I can bundle exec, and that's okay, but I'm just annoyed that I can't get my Gemfile to update to 1.17.3... I don't see 1.17.2 anywhere....
[18:19:25] mcr: Wondering if there are other people trying to deploy to kubernetes with the "distroless" ruby... I sure like not having compilers installed in production, but I would really like a way to further reduce crap. We install a few things from git, and the gemspec files like to call "git ls" to make a list of files, and there is no git in the target...
[18:22:57] blackmesa: has joined #RubyOnRails
[18:26:05] v01d4lph4: has joined #RubyOnRails
[18:43:03] orbyt_: has joined #RubyOnRails
[18:49:01] szulak_: has joined #RubyOnRails
[18:52:22] coffeejunk: has joined #RubyOnRails
[18:52:44] uksio: has joined #RubyOnRails
[18:55:05] agent_white: has joined #RubyOnRails
[18:56:59] elcontrastador: has joined #RubyOnRails
[19:07:58] Sylario: I have a multitenancy set up where the controller method current_shop return the shop
[19:08:32] Sylario: User has many category, but constraints to be sure there is one category per shop
[19:09:15] Sylario: The client ember app do not care about tenancy, and the rails controller always know to wich tenancy he speak
[19:10:57] Sylario: I cannot create a virtual attribute on the user with the ID of the group because the model has no access to the controller context, is the only way to create a controller just for the group_user_shop model?
[19:11:01] defsdoor: has joined #RubyOnRails
[19:12:54] conta: has joined #RubyOnRails
[19:15:16] Sylario: I could do something with params to add the current_shop but it feels hacky
[19:22:50] Net: sylario: what's a group?
[19:23:00] Sylario: sorry it's a model name
[19:24:34] Sylario: haaa i meant category
[19:24:54] Sylario: From the POV of hte tenant User belongs_to user_category
[19:25:42] Sylario: in reality User has_many User_Category, a rails controller always know the current tenant/shop
[19:28:01] Sylario: I'll just do a custom action
[19:37:58] ravenousmoose: has joined #RubyOnRails
[19:52:38] tdy: has joined #RubyOnRails
[19:55:01] makr8100: has joined #RubyOnRails
[19:55:25] makr8100: any recommendations on docs for a beginner on ROR deployments with apache? I'm new to ruby, not to programming in general
[19:56:03] Sylario: when I use apache i just follow passenger docs
[20:00:02] mcr: can I get gem to clean an installed gem of the .o files, but leave the .so file alone? I'd even like to just remove all the .c files and documentation from the installed gem. Or can I get the .so file installed somewhere else?
[20:12:55] havenwood: sylario: i use this newfangled apache called "nginx" :P
[20:13:16] havenwood: for some reason the config drives me slightly less nuts
[20:13:41] havenwood: makr8100: You should be able to find good reverse proxy setups with Puma/Apache or Puma/Nginx.
[20:13:47] Sylario: I never really looked into the pro and con, my choice usually stop to "someone want X", or the classic "it's already installed"
[20:19:29] havenwood: makr8100: Or just serve Puma up on port 443.
[20:19:41] havenwood: makr8100: Falcon is a bleeding edge option.
[20:20:06] havenwood: https://github.com/socketry/falcon
[20:20:19] ur5us: has joined #RubyOnRails
[20:23:42] makr8100: I'm talking more like tutorial, skipping the uber basic "hello world" stuff and going into db connections, compiling, and the like
[20:41:52] skryking: has joined #RubyOnRails
[20:46:19] ellcs: has joined #RubyOnRails
[21:00:33] v01d4lph4: has joined #RubyOnRails
[21:14:19] hightower3: has joined #RubyOnRails
[21:37:46] kevinburke: has joined #RubyOnRails
[21:40:52] tdy: has joined #RubyOnRails
[21:54:53] Tempesta: has joined #RubyOnRails
[22:09:57] defsdoor: has joined #RubyOnRails
[22:38:38] ellcs: has joined #RubyOnRails
[22:52:11] blackmesa: has joined #RubyOnRails
[23:01:28] v01d4lph4: has joined #RubyOnRails
[23:02:26] soule: has joined #RubyOnRails
[23:11:39] ellcs: has joined #RubyOnRails
[23:23:56] ivanskie: has joined #RubyOnRails
[23:32:12] gambl0r3: has joined #RubyOnRails
[23:58:18] angryrobot: has joined #RubyOnRails