« Back to channel list

#RubyOnRails - 15 December 2017

« Back 1 day Forward 1 day »
[00:00:35] cagomez: has joined #RubyOnRails
[00:08:58] cagomez: has joined #RubyOnRails
[00:10:08] funburn: has joined #RubyOnRails
[00:11:22] arBmind: has joined #RubyOnRails
[00:12:29] xlymian: has joined #RubyOnRails
[00:14:17] ur5us: has joined #RubyOnRails
[00:14:24] alfiemax: has joined #RubyOnRails
[00:14:27] xlymian: has left #RubyOnRails: ("WeeChat 2.0")
[00:16:04] ResidentBiscuit: has joined #RubyOnRails
[00:19:34] ur5us: has joined #RubyOnRails
[00:21:35] Iarfen: has joined #RubyOnRails
[00:22:02] Iarfen: when I run 'ruby bin/rails server' mariadb should start by default, or that command only starts puma?
[00:31:02] cagomez: has joined #RubyOnRails
[00:36:01] havenwood: Iarfen: It only starts Puma, not any DBs.
[00:36:52] greengriminal: has joined #RubyOnRails
[00:48:45] Iarfen: havenwood: ok, DB have to be started apart then
[00:53:33] Puffball: has joined #RubyOnRails
[00:54:58] alfiemax: has joined #RubyOnRails
[01:10:01] bonhoeffer: has joined #RubyOnRails
[01:10:49] bonhoeffer: do folks use selenium?
[01:13:17] cagomez: has joined #RubyOnRails
[01:28:24] cagomez: has joined #RubyOnRails
[01:48:04] alexertech: has joined #RubyOnRails
[01:53:29] mikecmpbll: has joined #RubyOnRails
[01:53:30] mtkd: has joined #RubyOnRails
[01:55:48] orbyt_: has joined #RubyOnRails
[01:59:44] Iarfen: bonhoeffer: selenium IDE?
[02:01:12] funburn: has joined #RubyOnRails
[02:11:07] jnollette: has joined #RubyOnRails
[02:13:12] truenito: has joined #RubyOnRails
[02:16:23] bonhoeffer: no, web automation
[02:16:55] mikecmpb_: has joined #RubyOnRails
[02:18:37] Iarfen: bonhoeffer: what do you win?
[02:18:41] Iarfen: it's not like gulp right?
[02:19:00] bonhoeffer: not sure -- it loads a headless browser that you can automate
[02:20:02] Iarfen: bonhoeffer: what means to automate the browser?
[02:25:58] mikecmpbll: has joined #RubyOnRails
[02:28:07] hervie: has joined #RubyOnRails
[02:30:01] mikecmpbll: has joined #RubyOnRails
[02:49:28] mikecmpb_: has joined #RubyOnRails
[02:59:15] mikecmpbll: has joined #RubyOnRails
[03:19:31] ornerymoose: has joined #RubyOnRails
[03:24:42] mikecmpb_: has joined #RubyOnRails
[03:55:34] kies: has joined #RubyOnRails
[03:56:43] mikecmpbll: has joined #RubyOnRails
[03:57:20] srinidhi: has joined #RubyOnRails
[04:05:31] hahuang65: has joined #RubyOnRails
[04:08:18] Saukk: has joined #RubyOnRails
[04:16:59] alfiemax: has joined #RubyOnRails
[04:17:29] ur5us: has joined #RubyOnRails
[04:18:20] cjohnson: Iarfen: good for writing end to end tests
[04:18:38] cjohnson: Use code to open a browser, navigate to a page, click a link, wait for it to load, fill in some form data, ensure it does what was expected, etc
[04:19:04] cjohnson: Hitting an API or doing a unit test on a model only gives you a piece of the puzzle
[04:21:12] mikecmpb_: has joined #RubyOnRails
[04:28:54] jnollette: has joined #RubyOnRails
[04:30:49] mikecmpbll: has joined #RubyOnRails
[04:51:26] mikecmpb_: has joined #RubyOnRails
[04:51:50] s2013: has joined #RubyOnRails
[05:01:42] mikecmpbll: has joined #RubyOnRails
[05:04:53] dionysus69: has joined #RubyOnRails
[05:15:38] alfiemax: has joined #RubyOnRails
[05:17:37] orbyt_: has joined #RubyOnRails
[05:17:48] mtkd: has joined #RubyOnRails
[05:34:17] armyriad: has joined #RubyOnRails
[05:46:50] iamarun: has joined #RubyOnRails
[05:48:30] mikecmpb_: has joined #RubyOnRails
[05:54:11] alfiemax: has joined #RubyOnRails
[05:57:01] pLaTo0n: has joined #RubyOnRails
[05:57:30] sevenseacat: has joined #RubyOnRails
[06:02:29] _aeris_: has joined #RubyOnRails
[06:09:01] Exhiled: has joined #RubyOnRails
[06:15:09] Exhiled: has joined #RubyOnRails
[06:28:16] dionysus69: has joined #RubyOnRails
[06:29:13] drale2k_: has joined #RubyOnRails
[06:29:40] _ritchie_: has joined #RubyOnRails
[06:30:33] ma5ter: has joined #RubyOnRails
[07:13:51] KeyJoo: has joined #RubyOnRails
[07:35:38] apeiros: has joined #RubyOnRails
[07:38:06] pikislabis: has joined #RubyOnRails
[07:46:16] kapil___: has joined #RubyOnRails
[07:48:37] za1b1tsu: has joined #RubyOnRails
[07:53:28] za1b1tsu: Hello, does someone uses cucumber? I see in all tutorials that a pending step is outputed like Given /^Blalbllbalblabl$, but when I try the steps are not pending, they are called undefined and are outputed like Given("Blalbalblbaba"). In all tutorials they star with fresh project and so do I, so I dont undestand. Did they change this in later versions?
[08:06:08] sandstrom: has joined #RubyOnRails
[08:12:22] lessless: has joined #RubyOnRails
[08:14:12] kapil___: has joined #RubyOnRails
[08:16:31] lessless: Hi people! Why this scope "joins(:parent).where(parents: { grand_parent_id: grand_parent_id }, location_id: location_id).limit" ignores "location_id" condition?
[08:16:50] lessless: Sorry, "joins(:parent).where(parents: { grand_parent_id: grand_parent_id }, location_id: location_id).first". W/o "first" it works right
[08:21:20] kapil___: has joined #RubyOnRails
[08:34:10] mikecmpbll: has joined #RubyOnRails
[08:34:36] conta: has joined #RubyOnRails
[08:35:56] _ritchie_: has joined #RubyOnRails
[08:43:55] LateralOctober: has joined #RubyOnRails
[08:49:02] fox_mulder_cp: has joined #RubyOnRails
[08:49:32] mikecmpb_: has joined #RubyOnRails
[08:50:04] iamarun: has joined #RubyOnRails
[08:54:54] _ritchie_: has joined #RubyOnRails
[08:55:17] DrYockel: has joined #RubyOnRails
[08:56:42] Ergo: has joined #RubyOnRails
[09:02:59] defsdoor: has joined #RubyOnRails
[09:03:51] marr: has joined #RubyOnRails
[09:08:33] mikecmpbll: has joined #RubyOnRails
[09:15:07] hive-mind: has joined #RubyOnRails
[09:17:27] pikislabis: has joined #RubyOnRails
[09:27:33] srinidhi: has joined #RubyOnRails
[09:35:23] simmerz: has joined #RubyOnRails
[09:41:20] arBmind: has joined #RubyOnRails
[09:47:56] _ritchie_: has joined #RubyOnRails
[09:56:05] Technodrome: has joined #RubyOnRails
[10:01:19] jnollette: has joined #RubyOnRails
[10:02:41] _ritchie_: has joined #RubyOnRails
[10:20:32] workmad3: has joined #RubyOnRails
[10:22:59] mtkd: has joined #RubyOnRails
[10:24:29] acosonic: has joined #RubyOnRails
[10:27:33] Torrone: has joined #RubyOnRails
[10:27:52] moei: has joined #RubyOnRails
[10:28:33] Torrone: Hello guys, asking for advice: how do I go about writing tests for a medium-sized legacy application without it being a pain?
[10:28:48] quazimodo: has joined #RubyOnRails
[10:31:46] Torrone: that's if anyone that's online has any experience on that
[10:31:49] dminuoso: Torrone: The ease of writing tests is a good measure of code quality.
[10:32:08] dminuoso: Torrone: It's best to always write tests. After a while you will get an idea how to write easily testable code.
[10:32:23] dminuoso: When you have written a new class/method, also write a test. :-)
[10:32:33] dminuoso: Retroactively adding tests is cumbersome.
[10:33:54] Torrone: dminuoso, I know that's cumbersome, I've started working on this app for which no one has ever written tests for
[10:34:19] Torrone: it has at least 50 models and it's fairly complex
[10:35:01] dminuoso: Torrone: Add n tests (by `test` I mean some `it` block) each day.
[10:35:21] Cavallari: has joined #RubyOnRails
[10:35:40] dminuoso: Until you have the desired coverage.
[10:36:17] Torrone: dminuoso, the job I've been tasked with is just to write those tests, I'm having nightmares about spending a month doing tests alone
[10:36:27] Torrone: that's if a month is even enough
[10:36:44] dminuoso: What tests are you supposed to write?
[10:36:50] dminuoso: Acceptance tests? Unit tests?
[10:37:17] Torrone: basically I need to check that none of the views fails
[10:37:53] Torrone: plus a few tests on user interactions
[10:38:45] srinidhi: has joined #RubyOnRails
[10:39:48] Torrone: I was thinking that it might be easier to write a gem that generates those automatically, since there is none around as far as I know
[10:40:21] Torrone: I was looking into https://github.com/jedld/pretentious but it doesn't look like it does what I need
[10:41:20] Exhiled: has joined #RubyOnRails
[10:41:56] Torrone: I'm afraid that I cannot bring myself to go through every single function in the code and write tests for each one without losing my mind midway :D
[10:43:10] dminuoso: Torrone: Testing does not have to be about covering every single path of code.
[10:48:25] Torrone: dminuoso, the requirement is to check that 'everything works'
[10:51:16] dminuoso: Torrone: Then check what "everything" means.
[10:51:36] workmad3: has joined #RubyOnRails
[10:51:55] Torrone: dminuoso, basically that none of the supported views returns a server error under any circumstance
[10:52:34] dminuoso: You only care about views and not controllers or models?
[10:53:07] Torrone: dminuoso, the idea is that if the views work, the controllers under those views work
[10:53:21] Torrone: for most of the writes, we can check bugs as they present
[10:56:16] arBmind: has joined #RubyOnRails
[10:56:41] Exhiled: has joined #RubyOnRails
[11:03:43] arBmind: has joined #RubyOnRails
[11:03:58] Exhiled: has joined #RubyOnRails
[11:33:59] hfp_work: has joined #RubyOnRails
[11:35:16] pikislabis: has joined #RubyOnRails
[11:37:23] arBmind: has joined #RubyOnRails
[11:44:50] AzaToth: has joined #RubyOnRails
[11:46:04] platoon23: has joined #RubyOnRails
[11:46:37] sandstrom: has joined #RubyOnRails
[11:50:18] jnollette: has joined #RubyOnRails
[11:53:38] _ritchie_: has joined #RubyOnRails
[12:01:19] s2013: has joined #RubyOnRails
[12:08:59] workmad3: has joined #RubyOnRails
[12:16:17] jnollette: has joined #RubyOnRails
[12:27:19] workmad3: has joined #RubyOnRails
[12:28:34] fschuindt: has joined #RubyOnRails
[12:32:34] KeyJoo: has joined #RubyOnRails
[12:42:21] _ritchie_: has joined #RubyOnRails
[12:42:26] wethu: has joined #RubyOnRails
[12:49:15] truenito: has joined #RubyOnRails
[12:54:38] truenito: has joined #RubyOnRails
[13:02:10] pikislabis: has left #RubyOnRails: ()
[13:08:45] sameerynho: has joined #RubyOnRails
[13:25:36] endemic: has joined #RubyOnRails
[13:26:54] DrYockel1: has joined #RubyOnRails
[13:27:15] funburn: has joined #RubyOnRails
[13:32:41] tcopeland: has joined #RubyOnRails
[13:37:09] mtkd: has joined #RubyOnRails
[13:37:37] sandstrom: has joined #RubyOnRails
[13:42:51] mostlybadfly: has joined #RubyOnRails
[13:55:36] funburn: has joined #RubyOnRails
[13:56:29] KeyJoo: has joined #RubyOnRails
[14:00:28] my123: has joined #RubyOnRails
[14:07:15] Aherin: has joined #RubyOnRails
[14:57:30] funburn: has joined #RubyOnRails
[15:00:19] safetypin: has joined #RubyOnRails
[15:04:43] za1b1tsu: has joined #RubyOnRails
[15:05:18] za1b1tsu: Hello, can someone tells me what is the best way to handle interactions between multiple object in ruby on rails?
[15:05:39] _ritchie_: has joined #RubyOnRails
[15:05:52] fryguy: za1b1tsu: ?? need to be a bit more specific than that
[15:06:04] fryguy: your question boils down to "how do I do object-oriented programming" ?
[15:07:56] za1b1tsu: fryguy: for example I need to make an application with feedback sessions(a model), with multiple ratings etc. Ive read a lot the past week, but I've only seen how to manage model with their own unique controller and that's it
[15:08:01] za1b1tsu: like no proper interaction
[15:08:51] za1b1tsu: I saw something about service objects, but no real documentation out there, little info in books
[15:09:17] fryguy: za1b1tsu: read this book and then come back with specific questions: http://www.poodr.com/
[15:10:09] za1b1tsu: I will, thank you
[15:11:54] _ritchie_: has joined #RubyOnRails
[15:12:21] za1b1tsu: I thought that since rugby has such a rigorous system, convetion over configuration, there is something I was missing
[15:12:31] za1b1tsu: *ruby on rails lol
[15:30:05] NoGodDamnIdea: has joined #RubyOnRails
[15:39:40] jnollette: has joined #RubyOnRails
[15:42:29] NL3limin4t0r: has joined #RubyOnRails
[15:45:40] the_collective_: has joined #RubyOnRails
[15:49:49] ebsen: has joined #RubyOnRails
[15:54:13] sameerynho: has joined #RubyOnRails
[15:58:52] apeiros: has joined #RubyOnRails
[16:11:59] troys: has joined #RubyOnRails
[16:15:20] dviola: has joined #RubyOnRails
[16:16:21] Saukk: has joined #RubyOnRails
[16:18:45] nogic: has joined #RubyOnRails
[16:19:19] brandononrails: has joined #RubyOnRails
[16:20:16] brandononrails: I've got webpacker with vue installed. No matter what I do, I can't get the vue file to add the template to the target element. It's running no errors, I'm able to compile it just fine, but no output
[16:20:38] orbyt_: has joined #RubyOnRails
[16:21:25] ebsen: has joined #RubyOnRails
[16:21:42] brandononrails: If I go back to the default hello_vue, where it's used the compiled version and actually adding the element to the page itself, it works just fine.
[16:22:57] brandononrails: All I've done so far is copy that file, copy the vue file, and changed it to use vue-turbolinks (turbolinks:load callback is working properly), vue esm, and targeting my wrapper element directly (which in the callback I can query the DOM and find just fine)
[16:26:08] ebsen: has joined #RubyOnRails
[16:33:52] tycoon177: dminuoso: ty for all of your docker help over the last few weeks/months :D i finally deployed it to production this morning and the transition was seamless
[16:35:17] tycoon177: also the transition from using passenger to using puma helped page load times greatly :)
[16:35:21] ebsen: has joined #RubyOnRails
[16:37:14] za1b1tsu: has joined #RubyOnRails
[16:37:44] za1b1tsu: Hello, how come service objects are a thing in ruby on rails, when they are not even mention in the documentation, there is no generator for them etc
[16:38:23] mtkd: has joined #RubyOnRails
[16:41:20] cagomez: has joined #RubyOnRails
[16:56:16] cagomez: has joined #RubyOnRails
[16:57:11] brandononrails: za1b1tsu: Service Objects aren't a Rails default. They're just an enhancement some people use and love (other don't like them). They help clean up the codebase and modularize your logic.
[17:10:13] conta1: has joined #RubyOnRails
[17:14:14] za1b1tsu: brandononrails: besides concerns, what are some clean alternatives to service objects?
[17:14:25] one_zero: has joined #RubyOnRails
[17:15:18] brandononrails: Avdi says Procedures: https://avdi.codes/service-objects/
[17:16:52] brandononrails: If you want to go crazy or if you have some ridiculously complex logic you can checkout Trailblazer: https://github.com/trailblazer/trailblazer
[17:17:09] brandononrails: I've never had a need to go all in on Trailblazer, but most of it's core tenet components are available in their own gems
[17:17:48] brandononrails: Operations has it's own gem, Reform (which is like form objects and validation) has it's own gem, etc
[17:18:25] cagomez: has joined #RubyOnRails
[17:18:46] kapil___: has joined #RubyOnRails
[17:19:16] orbyt_: has joined #RubyOnRails
[17:20:28] brandononrails: Service Objects are just POROs
[17:20:32] one_zero: has joined #RubyOnRails
[17:24:11] za1b1tsu: too bad, tutorials for beginners on service objects are scarce
[17:24:15] hive-mind: has joined #RubyOnRails
[17:24:53] FastJack: has joined #RubyOnRails
[17:25:18] _aeris_: has joined #RubyOnRails
[17:25:59] jnollette: has joined #RubyOnRails
[17:26:01] brandononrails: Here are a couple that have helped me in the past
[17:26:11] brandononrails: https://hackernoon.com/service-objects-in-ruby-on-rails-and-you-79ca8a1c946e
[17:26:13] brandononrails: https://hackernoon.com/the-3-tenets-of-service-objects-c936b891b3c2
[17:26:15] brandononrails: https://www.engineyard.com/blog/keeping-your-rails-controllers-dry-with-services
[17:26:17] brandononrails: https://medium.com/selleo/essential-rubyonrails-patterns-part-1-service-objects-1af9f9573ca1
[17:26:38] cschneid_: has joined #RubyOnRails
[17:27:34] Exhiled: has joined #RubyOnRails
[17:28:41] arBmind: has joined #RubyOnRails
[17:29:10] brandononrails: Form Objects are another way you can keep logic out of the controllers (for example, creating multiple records across models, etc) https://robots.thoughtbot.com/activemodel-form-objects
[17:29:42] brandononrails: https://ducktypelabs.com/how-to-keep-your-controllers-thin-with-form-objects/
[17:30:18] Technodrome: has joined #RubyOnRails
[17:30:35] cagomez: has joined #RubyOnRails
[17:33:26] FrostCandy: has joined #RubyOnRails
[17:37:13] uks: has joined #RubyOnRails
[17:45:58] funburn: has joined #RubyOnRails
[17:46:20] Technodrome: has joined #RubyOnRails
[17:49:36] pikislabis: has joined #RubyOnRails
[17:51:09] brent__: has joined #RubyOnRails
[17:53:48] drale2k_: has joined #RubyOnRails
[17:53:50] desperek: has joined #RubyOnRails
[17:56:10] cagomez: has joined #RubyOnRails
[17:57:01] pikislabis: has joined #RubyOnRails
[18:06:16] cagomez: has joined #RubyOnRails
[18:15:10] pikislabis: has joined #RubyOnRails
[18:17:31] srinidhi: has joined #RubyOnRails
[18:20:25] dminuoso: brandononrails: Im strongly moving into trailblazer.
[18:20:40] dminuoso: Its not just for "complex apps", even simple apps are neatly done with their way
[18:20:50] brandononrails: How do you like it?
[18:20:57] brandononrails: That's fair, I should have stated that was my opinion of it
[18:21:32] dminuoso: brandononrails: I love it.
[18:22:03] dminuoso: tycoon177: That's nice to hear by the way. There really isn't much about Docker except that you need to demystify things.
[18:22:34] dminuoso: A lot of the common "how do you do XYZ in rails" is just a result of not having crossed the magic curtain of "how does rails work really?"
[18:22:36] tycoon177: now i'm trying to figure out a 0 downtime deployment without swarm with docker-compose
[18:23:28] dminuoso: tycoon177: Id be interested in your findings. We've never needed 0 downtime deployment, since my apps are internal company tools. So we can live with momentary outage.
[18:23:45] dminuoso: (Though we incidentally had it when we were using capistrano with puma for free)
[18:24:14] tycoon177: we don't *need* it, but it'd be nice
[18:24:34] funburn: has joined #RubyOnRails
[18:25:34] brent__: Whats suppose to be the benefit of trailblazer?
[18:27:17] krawchyk: has joined #RubyOnRails
[18:30:35] istrasci: has joined #RubyOnRails
[18:30:41] istrasci: How can I add a database comment to a table/column in a migration without dropping and re-adding it?
[18:30:52] blackcross: has joined #RubyOnRails
[18:31:41] Technodrome: has joined #RubyOnRails
[18:31:52] blackcross: What webapp daemon and/or website daemon is recommended for ruby on rails deployment to production?
[18:31:52] mikecmpbll: has joined #RubyOnRails
[18:38:16] mikecmpbll: has joined #RubyOnRails
[18:40:50] pikislabis: has joined #RubyOnRails
[18:43:17] hive-mind: has joined #RubyOnRails
[18:44:12] kies: has joined #RubyOnRails
[18:52:17] havenwood: blackcross: http://www.mikeperham.com/2014/09/22/dont-daemonize-your-daemons/
[18:59:01] Axsuul: has joined #RubyOnRails
[19:02:27] tweaks: has joined #RubyOnRails
[19:03:02] tweaks: has left #RubyOnRails: ()
[19:09:13] alfiemax: has joined #RubyOnRails
[19:12:22] pikislabis: has joined #RubyOnRails
[19:12:40] tanuki: has joined #RubyOnRails
[19:17:44] tanuki: has joined #RubyOnRails
[19:17:45] dionysus69: has joined #RubyOnRails
[19:24:05] apeiros: has joined #RubyOnRails
[19:27:39] pikislabis: has joined #RubyOnRails
[19:33:36] mikecmpbll: has joined #RubyOnRails
[19:34:32] xlymian: has joined #RubyOnRails
[19:35:19] xlymian: has left #RubyOnRails: ()
[19:36:05] dionysus69: has joined #RubyOnRails
[19:37:08] Dimik: has joined #RubyOnRails
[19:37:47] tycoon177: dminuoso: i think i've settled on the following for 0 downtime deployments with docker-compose and the jwilder/nginx-proxy: have 2 container types `web` and `web_temp`. when i deploy, run `docker-compose build...` and then run `docker-compose up -d --no-deps web_temp` then wait for it to become responsive. Next, run `docker-compose up -d --no-deps web` and then wait for it to become responsive and then finally shut down
[19:39:09] tycoon177: it's complex, but it SHOULD result in 0 downtime
[19:54:02] kapil___: dminuoso: How do i start with trailblazer?
[19:54:12] kapil___: I have api only app
[20:01:38] kapil___: I want to put models relationships in module. is it possible?
[20:17:12] ur5us: has joined #RubyOnRails
[20:32:14] srinidhi: has joined #RubyOnRails
[20:36:08] alexertech: has joined #RubyOnRails
[20:36:24] baweaver: kapil___: start with Rails.
[20:36:42] baweaver: best not to make things too much more complicated until you know why you'd need them
[20:41:27] DTZUZO: has joined #RubyOnRails
[20:44:02] mtkd: has joined #RubyOnRails
[20:45:22] orbyt_: has joined #RubyOnRails
[20:48:39] baweaver: Which includes adding React on top of it before you really understand Rails yet
[20:48:54] baweaver: Too many newbies make the mistake of trying to learn everything at once and instead learn nothing
[20:52:07] Ergo: has joined #RubyOnRails
[21:05:23] kapil___: baweaver: I am using react on top of rails
[21:10:51] kapil___: I have api only rails app. and react front end. i have question: where should i generate reports for my application?
[21:13:49] alexertech: has joined #RubyOnRails
[21:29:13] Ergo: has joined #RubyOnRails
[21:36:07] roshanavand: has joined #RubyOnRails
[21:37:52] nogic: has joined #RubyOnRails
[21:39:10] cagomez: has joined #RubyOnRails
[21:51:32] sarink: has joined #RubyOnRails
[21:53:30] alfiemax: has joined #RubyOnRails
[22:01:30] Exhiled: has joined #RubyOnRails
[22:02:53] mikecmpbll: has joined #RubyOnRails
[22:04:56] alfiemax: has joined #RubyOnRails
[22:05:33] ebsen: has joined #RubyOnRails
[22:07:16] sarink: when my user creates/updates a "product" model, i allow them to set the "store" foreign key. but i need some check to ensure that the current_user is actually the owner of that "store" - what's the best way to go about this?
[22:14:11] drale2k_: has joined #RubyOnRails
[22:18:47] tycoon177: sarink: i'd suggest 1) providing a dropdown of the legal options for the client side and then 2) get the ID of the "store" object, use the find method on that model, and ensure in your code that it belongs to that user on the server side
[22:19:12] mikecmpb_: has joined #RubyOnRails
[22:19:50] sarink: tycoon177: oh, yeah, i know i could do it manually by like, if Store.find(params[id]).user == current_user ...
[22:20:00] sarink: i was wondering if there was a "railsy" way
[22:20:21] sarink: params[:store_id]** of course
[22:20:40] tycoon177: there might be gems to indicate ownership, but in the end, it'd likely end up boiling down to that
[22:20:57] istrasci: has left #RubyOnRails: ("PONG :hitchcock.freenode.net")
[22:21:43] sarink: like in the scaffolded update method of a controller you get if @model.update(model_params) @model.save else @model.errors - how would i set an appropriate/consistent error for this custom case i'm writing?
[22:24:04] sarink: ideally i'd do this not just in the controller method, but somewhere more universal
[22:24:31] ebsen: has joined #RubyOnRails
[22:24:35] tycoon177: sarink: i'm not the person to ask unfortunately :( i know rails to a point, but i'm no expert like some of the others here
[22:24:37] sarink: i'm not really a rails-pro so i'm not sure where the most appropriate place is? but basically anywhere i'm setting attributes on the Product modek, i guess
[22:25:07] sarink: you should obviously never be able to assign a product to a different user's store
[22:26:17] mikecmpbll: has joined #RubyOnRails
[22:29:05] _aeris_: has joined #RubyOnRails
[22:31:30] baweaver: kapil___: you do this thing where you use 4-5 different pieces of tech without really understanding them. Slow down, one at a time.
[22:32:05] baweaver: sarink: validations
[22:32:16] alfiemax: has joined #RubyOnRails
[22:32:38] baweaver: A validation can set custom errors for scenarios like that
[22:32:49] baweaver: which will stop people from setting invalid attributes
[22:35:06] baweaver: kapil___: that's also an exceptionally vague question
[22:35:24] baweaver: you need to qualify what you mean, and abstract concepts like a report aren't going to get you answers.
[22:35:36] sarink: baweaver: thanks! reading the docs now, exactly what i was looking for
[22:35:40] mikecmpb_: has joined #RubyOnRails
[22:37:09] amperry: has joined #RubyOnRails
[22:37:27] sarink: baweaver: what about serialization? i'd like to blacklist (or whitelist) certain keys from the client (outgoing). right now i just do a .slice or .select in the controller but it feels fragile and not DRY
[22:37:54] baweaver: think of it as an API "view" for JSON.
[22:39:14] sarink: i find the jbuilder syntax really inconvenient, i'm way better/faster at writing Just Ruby and building a hash. is it considered "bad practice" to have a `serialize` or `to_json` method on the model? or maybe just in the controller?
[22:39:49] baweaver: considering AR has those methods already, might be
[22:39:55] baweaver: you could whitelist with super
[22:40:02] amperry: anyone know of a good (i.e., thorough) introductory (i.e., containing minimal, but functional, examples) resource for capybara?
[22:49:01] arBmind: has joined #RubyOnRails
[22:53:01] conta2: has joined #RubyOnRails
[23:13:46] tcopeland: has joined #RubyOnRails
[23:23:01] cagomez: has joined #RubyOnRails
[23:39:30] amperry: when capybara expect(page).to have_content, I'm noticing that a message in a flash alert isn't included. Is this to be expected?
[23:49:30] alfiemax: has joined #RubyOnRails