« Back to channel list

#RubyOnRails - 26 January 2016

« Back 1 day Forward 1 day »
[00:00:15] Synthead: rhizome: kinda like named capturing groups in regex
[00:00:58] Jasaka: has joined #RubyOnRails
[00:01:10] StaticVoid: Hi All. If I want to switch from rvm to chruby per Radar's blog post. If I run 'rvm implode' and remove all ruby rpms,should the system be clean enough for a re-install using chruby ?
[00:01:25] hannelita: has joined #RubyOnRails
[00:04:02] twilling: has joined #RubyOnRails
[00:06:23] hobodave: has joined #RubyOnRails
[00:09:31] wethu: has joined #RubyOnRails
[00:09:33] fschuindt: has joined #RubyOnRails
[00:11:52] herbst: has joined #RubyOnRails
[00:14:49] ZerGabriel: has joined #RubyOnRails
[00:15:19] aloneintheworld: has joined #RubyOnRails
[00:15:58] atomical: has joined #RubyOnRails
[00:16:19] jklass: has joined #RubyOnRails
[00:16:29] jottr: has joined #RubyOnRails
[00:16:46] lethjakman-l: has joined #RubyOnRails
[00:25:42] ferr: Hey, anyone could help me with routes? https://gist.github.com/Fercell/81d69137bef84c0db345
[00:26:50] jklass: has joined #RubyOnRails
[00:29:02] fryguy: what's wrong
[00:29:59] kirillzh: has joined #RubyOnRails
[00:30:51] ferr: When I navigate to /dashboard/something it does not render dashboard template
[00:31:28] Toledo|gone: has joined #RubyOnRails
[00:31:34] NBarnes: Should render the index view under the dashboard folder, yes?
[00:31:59] safety_cut: has joined #RubyOnRails
[00:33:28] ferr: nbarnes: yes
[00:33:50] NBarnes: And it's hitting the index action on the dashboard_controller correctly?
[00:33:54] FCser: has joined #RubyOnRails
[00:35:22] jklass: has joined #RubyOnRails
[00:35:23] Toledo|gone: has left #RubyOnRails: ()
[00:35:54] croberts: has joined #RubyOnRails
[00:36:03] ferr: Processing by ApplicationController#index as HTML
[00:36:06] ferr: Parameters: {"path"=>"dashboard/asd"}
[00:37:14] bronson: has joined #RubyOnRails
[00:39:22] zpe: has joined #RubyOnRails
[00:39:25] kies^: has joined #RubyOnRails
[00:44:12] chipotle: has joined #RubyOnRails
[00:44:26] devlitzi: has joined #RubyOnRails
[00:44:52] herbst: has joined #RubyOnRails
[00:45:48] baweaver: has joined #RubyOnRails
[00:45:48] iateadonut: has joined #RubyOnRails
[00:46:30] safety_cut: has joined #RubyOnRails
[00:47:07] ebbflowgo: has joined #RubyOnRails
[00:47:16] hannelita: has joined #RubyOnRails
[00:47:55] workmad3: has joined #RubyOnRails
[00:48:10] lethjakman-l: has joined #RubyOnRails
[00:49:34] kirillzh: What's the best practice for API versioning?
[00:49:36] yfeldblum: has joined #RubyOnRails
[00:50:21] shibabu: has joined #RubyOnRails
[00:52:58] workmad3_: has joined #RubyOnRails
[00:55:20] rhizome: Synthead: hm, not sure i get it
[00:55:54] Synthead: rhizome: looks like the "constraints" option will do what I want
[00:56:06] Radar: StaticVoid: Yes that should be fine.
[00:56:22] safety_cut: has joined #RubyOnRails
[00:57:51] chouhoulis: has joined #RubyOnRails
[01:01:06] StaticVoid: Radar: thx - went down that route already :) so far so good
[01:03:16] atomical_: has joined #RubyOnRails
[01:03:41] musicnode: has joined #RubyOnRails
[01:03:56] jottr_: has joined #RubyOnRails
[01:04:25] atomical_: has joined #RubyOnRails
[01:06:03] guacamole: has joined #RubyOnRails
[01:10:02] guacamole: has joined #RubyOnRails
[01:12:22] tkrajcar: has left #RubyOnRails: ()
[01:13:00] AnomalousBit: has joined #RubyOnRails
[01:14:26] messine: has joined #RubyOnRails
[01:14:47] herbst: has joined #RubyOnRails
[01:14:54] JusticeFries: has left #RubyOnRails: ()
[01:16:49] jguthrie100: has joined #RubyOnRails
[01:17:26] baweaver: has joined #RubyOnRails
[01:18:59] Scriptonaut: does any one know how I can uninstall ruby-build?
[01:19:15] Scriptonaut: thought I'd go the chruby route, and decided I'm going back to rbenv once I realized I have to use 2 tools to manage my rubies
[01:19:21] Scriptonaut: there is no uninstall script
[01:19:30] Scriptonaut: I just got it from github and then ran the install shell script
[01:20:23] AnomalousBit: Scriptonaut: link to github repo please
[01:20:32] AnomalousBit: did it use rake or make? there could very well be a build task that uninstalls
[01:20:53] Scriptonaut: AnomalousBit: https://github.com/rbenv/ruby-build#readme
[01:21:04] Scriptonaut: no, it just used install.sh
[01:21:36] Scriptonaut: I think it just copied some stuff into /usr/local/bin
[01:21:41] Scriptonaut: so I could remove it
[01:21:55] Scriptonaut: or use/local/share/bin*
[01:22:45] eljimmy: has joined #RubyOnRails
[01:23:00] Scriptonaut: I just removed those files
[01:23:01] Scriptonaut: I think it's fine
[01:23:44] AnomalousBit: looks like the install script just copies stuff over to /usr/local/bin and /usr/local/share/ruby-build
[01:23:55] Scriptonaut: cool, ok ya I just removed it
[01:24:09] Scriptonaut: I got cold feet halfway through chruby install hehe
[01:24:54] AnomalousBit: haha I understand, when I moved away from the package repo's ruby I was overwhelmed by the variety of ways to install ruby
[01:25:25] Scriptonaut: I started iwth rbenv, then used rvm for a few months, but had issues on my new machine today, so am going back to rbenv
[01:25:28] AnomalousBit: Especially when I went to compile ruby from github and it needed a ruby binary to compile ruby O_O
[01:25:50] AnomalousBit: yeah RVM is my go to at the moment
[01:25:57] helpa: Remove RVM (with 'rvm implode --force') and use chruby + ruby-install. Ubuntu guide: http://bit.ly/1mvdEuH Mac guide: http://bit.ly/1QA85bc
[01:26:04] Radar: official channel opinion on RVM ^
[01:26:16] Scriptonaut: why do you guys like chruby?
[01:26:20] atomical: has joined #RubyOnRails
[01:26:22] AnomalousBit: hahah when it gives me trouble you guys can say "told ya so"
[01:26:26] Scriptonaut: also, doesn't ruby-install just install ruby for you without compiling it?
[01:26:28] Radar: Scriptonaut: because it Just Works(tm)
[01:26:36] Radar: ruby-install downloads it and compiles it.
[01:26:48] Radar: RVM is like "Welp it's a Tuesday and the moon is 3/4 full so I'm not going to work."
[01:27:06] Scriptonaut: I was going to say, I'm running gentoo, to not compile is sacrilege
[01:27:18] Scriptonaut: that's what happened to me this morning
[01:27:29] Scriptonaut: no problems, and then suddenly it insisted on using my system's ruby no matter what
[01:28:09] Scriptonaut: well damn now I want to use chruby again
[01:28:17] Scriptonaut: where do most people tend to keep their rubies
[01:30:17] atomical_: has joined #RubyOnRails
[01:31:38] Radar: at /Users/ryanbigg/.rubies/
[01:31:51] Scriptonaut: bleh, ok I WILL TRY
[01:32:35] Scriptonaut: Radar: so you like ruby-install better than ruby-build?
[01:33:08] Radar: HELPA HAS SPOKEN
[01:33:21] Radar: yes I like ruby-install because it also just works
[01:33:25] Radar: chruby just works
[01:33:33] Scriptonaut: ok, I like stuff that Justworks
[01:33:37] Radar: It's like RVM == Windows, rbenv == linux and chruby == Mac
[01:33:42] ebbflowgo: has joined #RubyOnRails
[01:33:51] Scriptonaut: oh, well I like linux, hopefully I like chruby
[01:36:10] AnomalousBit: I think this is more about preference, but how do you guys handle complex SQL queries & ActiveRecord? I've been torturing myself with 3 different ways all day, none of which have prevailed
[01:36:16] AnomalousBit: 1. Using Arel to create complex queries (basically create an object with various methods that generate the query)
[01:36:28] Radar: AnomalousBit: I don't write complex SQL queries.
[01:36:29] AnomalousBit: 2. Creating a migration that creates 3 SQL Views that I then create basic ActiveRecord Models
[01:36:37] AnomalousBit: 3. Writing SQL Queries straight into my ActiveRecord Models
[01:37:09] musicnode: has joined #RubyOnRails
[01:37:16] AnomalousBit: How do you deal with a has_one: relationship through: a has_many association? which AR doesn't support
[01:38:15] AnomalousBit: I love activerecord, and it does great 99% of the time for me, but there is this one percent that it doesn't seem to handle at all
[01:38:31] atomical: has joined #RubyOnRails
[01:38:42] Scriptonaut: cool, ruby-install defaults to ruby-2.3
[01:38:42] AnomalousBit: and everything I've read on google describes the three ways I mentioned
[01:38:48] Radar: Have you stopped to consider that if you're battling the framework that you might be Doing It Wrong?
[01:39:02] Radar: I'd like to see this relationship in code if you could
[01:39:05] Radar: Scriptonaut: as it should
[01:39:21] Scriptonaut: isn't 2.3 in beta still?
[01:40:01] Radar: Scriptonaut: It was released on Christmas Day.
[01:40:03] AnomalousBit: I'll see if I can't whip up a gist with the relationships
[01:40:15] Scriptonaut: Radar: are you seroius?
[01:40:25] Scriptonaut: so we can use the lonely operator in stable ruby now :)
[01:40:30] Radar: Scriptonaut: https://www.ruby-lang.org/en/news/2015/12/25/ruby-2-3-0-released/
[01:40:32] rclanan: has joined #RubyOnRails
[01:40:36] unreal: has joined #RubyOnRails
[01:40:47] herbst: has joined #RubyOnRails
[01:41:34] nbdy: has joined #RubyOnRails
[01:42:04] AnomalousBit: pretty excited for the safe &. operator
[01:42:15] Scriptonaut: isn't that called the lonely operator?
[01:42:18] Scriptonaut: or maybe I'm mistaken
[01:42:35] AnomalousBit: It may be, I just hadn't heard it called that
[01:42:39] alxm: has joined #RubyOnRails
[01:51:35] corioliss: has joined #RubyOnRails
[01:54:12] yfeldblum: has joined #RubyOnRails
[01:54:13] eljimmy: has joined #RubyOnRails
[01:54:49] kirillzh: has joined #RubyOnRails
[01:54:50] akshat: has joined #RubyOnRails
[01:55:23] rhizome: https://www.reddit.com/r/ruby/comments/3wel47/ruby_gets_lonely_operator/?
[01:55:52] kirillzh: has joined #RubyOnRails
[01:57:42] pawnbox: has joined #RubyOnRails
[01:57:44] ebbflowgo: has joined #RubyOnRails
[02:05:27] guacamole: has joined #RubyOnRails
[02:08:08] herbst: has joined #RubyOnRails
[02:08:53] lethjakman-l: has joined #RubyOnRails
[02:09:56] alxm: has left #RubyOnRails: ()
[02:10:05] jguthrie100: has joined #RubyOnRails
[02:16:08] moeabdol: has joined #RubyOnRails
[02:24:25] C0L0R: has joined #RubyOnRails
[02:27:18] hannelita: has joined #RubyOnRails
[02:28:42] chouhoulis: has joined #RubyOnRails
[02:30:27] treaki_: has joined #RubyOnRails
[02:33:26] mary5030: has joined #RubyOnRails
[02:34:42] Pathfinder_: has joined #RubyOnRails
[02:39:01] bronson: has joined #RubyOnRails
[02:39:05] herbst: has joined #RubyOnRails
[02:44:13] Bloomer: has joined #RubyOnRails
[02:44:18] jaequery: has joined #RubyOnRails
[02:48:13] chipotle: has joined #RubyOnRails
[02:48:49] C0L0R: has joined #RubyOnRails
[02:48:59] lethjakman-l: has joined #RubyOnRails
[02:49:42] craigp: has joined #RubyOnRails
[02:50:01] jaequery: has joined #RubyOnRails
[02:55:10] guacamole: has joined #RubyOnRails
[02:55:46] atomical_: has joined #RubyOnRails
[02:58:16] jaequery: has joined #RubyOnRails
[03:00:35] pulgalip1: has joined #RubyOnRails
[03:02:04] sneakerhax: has joined #RubyOnRails
[03:02:28] pulgalip1: has joined #RubyOnRails
[03:02:37] Scriptonaut: hey guys, I am using ruby-build, and when I first installed it and ran setup.sh, it installed ruby 2.3.0 into /opt/rubies/
[03:02:46] Scriptonaut: that is fine with me, but then I installed 2.2.4, and it installed it in ~/.rubies
[03:02:51] Scriptonaut: why the two different places?
[03:03:07] Scriptonaut: then I moved the one in /opts to ~/rubies, and it gave a weird error when I tried changing to that ruby version
[03:03:52] truenito: has joined #RubyOnRails
[03:04:18] guacamole: has joined #RubyOnRails
[03:04:59] bungoman: has joined #RubyOnRails
[03:05:35] jottr_: has joined #RubyOnRails
[03:07:05] adamscott: has joined #RubyOnRails
[03:11:52] herbst: has joined #RubyOnRails
[03:18:57] macarthy: has joined #RubyOnRails
[03:20:53] truenito_: has joined #RubyOnRails
[03:23:19] jguthrie100: has joined #RubyOnRails
[03:23:26] jaequery: has joined #RubyOnRails
[03:24:24] truenito_: has joined #RubyOnRails
[03:25:09] littleR: has joined #RubyOnRails
[03:26:07] truenito: has joined #RubyOnRails
[03:35:40] AnomalousBit: Radar, are you still around by chance?
[03:41:26] herbst: has joined #RubyOnRails
[03:41:58] rclanan: has joined #RubyOnRails
[03:42:35] sevenseacat: has joined #RubyOnRails
[03:46:00] AnomalousBit: Hey guys, I've got a problem with my ActiveRecord-kung-fu. I've read far too much on complex queries, looking at using arel, Model.find_by_sql, etc. but I'm curious if there is a way to do this just using AR (so I can eager load)
[03:46:06] truenito: has joined #RubyOnRails
[03:46:07] AnomalousBit: gist: https://gist.github.com/AnomalousBit/b9360a19d7ea1980d027
[03:47:30] _djbkd: has joined #RubyOnRails
[03:49:45] devlitzi: has joined #RubyOnRails
[03:49:49] crdpink2: has joined #RubyOnRails
[03:54:42] shibabu: has joined #RubyOnRails
[03:56:16] AntiSpamMeta: has joined #RubyOnRails
[03:56:37] truenito: has joined #RubyOnRails
[03:56:41] AntiSpamMeta: has joined #RubyOnRails
[03:59:43] shibabu: has joined #RubyOnRails
[04:03:06] petersaints: has joined #RubyOnRails
[04:06:15] Pathfinder_: has joined #RubyOnRails
[04:08:09] Pathfinder_: Hi Guys, So I have a model company that has many members and members has many cars. The car model has a price attribute. I would like to find out the total amount of money spend my a company on cars for their employees
[04:09:30] Pathfinder_: My solution was to pluck all member_id values in the members table to obtain the member ids belonging to each company but after that it gets very messy because an employee can have many cars and others none of course
[04:09:32] truenito: has joined #RubyOnRails
[04:13:11] treaki: has joined #RubyOnRails
[04:13:44] truenito: has joined #RubyOnRails
[04:15:18] truenito: has joined #RubyOnRails
[04:15:46] herbst: has joined #RubyOnRails
[04:16:35] braincrash: has joined #RubyOnRails
[04:18:19] truenito: has joined #RubyOnRails
[04:19:55] truenito: has joined #RubyOnRails
[04:22:28] truenito_: has joined #RubyOnRails
[04:23:42] truenito: has joined #RubyOnRails
[04:28:32] truenito: has joined #RubyOnRails
[04:28:33] hobodave: has joined #RubyOnRails
[04:28:59] tyrbo: has joined #RubyOnRails
[04:29:01] tildes: has joined #RubyOnRails
[04:36:21] macarthy: has joined #RubyOnRails
[04:38:26] C0L0R: has joined #RubyOnRails
[04:41:26] yfeldblum: has joined #RubyOnRails
[04:41:29] bronson: has joined #RubyOnRails
[04:42:25] arBmind1: has joined #RubyOnRails
[04:44:30] rclanan: has joined #RubyOnRails
[04:50:15] uris: has joined #RubyOnRails
[04:52:11] herbst: has joined #RubyOnRails
[04:52:42] pulgalipe: has joined #RubyOnRails
[04:53:49] alex88: has joined #RubyOnRails
[04:55:30] eljimmy: has joined #RubyOnRails
[04:55:31] bungoman: has joined #RubyOnRails
[05:01:05] malkav: has joined #RubyOnRails
[05:02:06] krz: has joined #RubyOnRails
[05:06:19] jottr_: has joined #RubyOnRails
[05:06:21] craigp: has joined #RubyOnRails
[05:09:28] PedramT: has joined #RubyOnRails
[05:13:24] ayonkhan: has joined #RubyOnRails
[05:14:29] shmilan: has joined #RubyOnRails
[05:15:38] workmad3: has joined #RubyOnRails
[05:15:54] pawnbox: has joined #RubyOnRails
[05:18:02] alexhartley: has joined #RubyOnRails
[05:24:02] herbst: has joined #RubyOnRails
[05:26:46] baweaver: has joined #RubyOnRails
[05:27:11] chipotle: has joined #RubyOnRails
[05:28:23] qurve: has joined #RubyOnRails
[05:28:47] blackhuey: has joined #RubyOnRails
[05:28:49] qurve: Anyone here running a production rails app in docker containers? I'm evaluating it and have some questions.
[05:29:25] qurve: Namely: Do you put a web server like nginx in front of the app server, and do you to it in the same container, or a different container?
[05:36:33] chipotle: has joined #RubyOnRails
[05:42:19] lxsameer: has joined #RubyOnRails
[05:43:01] PedramT: has joined #RubyOnRails
[05:45:24] rclanan: has joined #RubyOnRails
[05:45:53] darutoko: has joined #RubyOnRails
[05:49:46] rhizome: Pathfinder_: do a SUM in the query
[05:51:54] Pathfinder_: rhizome: I already know that. The issue is how do I know which cars belong to the company. I have done a very ugly workaround
[05:54:21] PedramT: has joined #RubyOnRails
[05:55:27] Pathfinder_: rhizome: Here is my dirty solution http://pastebin.com/iUcvxFwj
[05:57:05] _djbkd: has joined #RubyOnRails
[06:00:59] apotry: has joined #RubyOnRails
[06:01:58] herbst: has joined #RubyOnRails
[06:08:33] w0rd-driven: has joined #RubyOnRails
[06:08:34] bePolite: has joined #RubyOnRails
[06:08:34] bePolite: has joined #RubyOnRails
[06:08:57] droptone: Question: I need to alter the schema_migrations table so I no longer throw a PendingMigrationError.
[06:09:00] droptone: What's the process here?
[06:09:11] droptone: I"m having trouble finding documentation online, my project is rails 4.2.5.
[06:09:30] droptone: What's the exact process for telling Rails I have no migrations pending?
[06:09:33] rhizome: you have to use the client of whatever DBMS you're using
[06:09:40] rhizome: rails dbconsole
[06:11:44] droptone: Disregard, I hosed the migration file.
[06:13:58] PedramT: has joined #RubyOnRails
[06:17:17] greengriminal: has joined #RubyOnRails
[06:17:54] pulgalip1: has joined #RubyOnRails
[06:18:41] ur5us: has joined #RubyOnRails
[06:20:17] lethjakman-l: has joined #RubyOnRails
[06:25:36] ur5us: has joined #RubyOnRails
[06:26:08] srinidhi: has joined #RubyOnRails
[06:30:25] devlitzi: has joined #RubyOnRails
[06:31:09] arup_r: has joined #RubyOnRails
[06:34:05] herbst: has joined #RubyOnRails
[06:36:27] rvanlieshout: has joined #RubyOnRails
[06:37:23] aganov: has joined #RubyOnRails
[06:39:17] PedramT: has joined #RubyOnRails
[06:39:31] macarthy: has joined #RubyOnRails
[06:42:36] ur5us: has joined #RubyOnRails
[06:42:51] nbdy: has joined #RubyOnRails
[06:43:48] bronson: has joined #RubyOnRails
[06:44:11] jgpawletko: has joined #RubyOnRails
[06:46:30] musicnode: has joined #RubyOnRails
[06:46:34] rclanan: has joined #RubyOnRails
[06:49:28] solars: has joined #RubyOnRails
[06:49:52] sevenseacat: what can possibly go wrong
[06:50:28] rhizome: i've had to do it before
[06:50:50] jfqd: has joined #RubyOnRails
[06:51:11] noyb: has joined #RubyOnRails
[06:52:41] PedramT: has joined #RubyOnRails
[06:53:43] hannelita: has joined #RubyOnRails
[06:55:14] noyb: has joined #RubyOnRails
[06:55:50] noyb: has joined #RubyOnRails
[06:56:30] bePolite: has joined #RubyOnRails
[06:56:30] bePolite: has joined #RubyOnRails
[06:57:07] ferr: Why bootstrap glyph icons are seen in development mode and not in production?
[06:57:49] rvanlieshout: ferr: tons of reasons
[06:58:33] ferr: rvanlieshout: do you need any code to see it
[06:58:39] ferr: I'm struggling with this more than 4 hours lol
[06:59:24] rvanlieshout: what css is applied? and what font is used? do you see that font being loaded in the browser debugging bar network stuff?
[06:59:42] ferr: rvanlieshout: I don't see it there
[06:59:45] ferr: bootstrap sass
[07:00:01] rvanlieshout: it should load a font
[07:00:03] rvanlieshout: or at least try
[07:00:06] rvanlieshout: as it does in development
[07:00:09] nah: has joined #RubyOnRails
[07:00:12] rvanlieshout: what files are loaded?
[07:01:13] ferr: You may check it there: https://pacific-spire-32981.herokuapp.com/
[07:01:22] ferr: Everything except fonts
[07:05:49] herbst: has joined #RubyOnRails
[07:07:05] nah: has joined #RubyOnRails
[07:07:06] jottr_: has joined #RubyOnRails
[07:11:28] konsolebox: has joined #RubyOnRails
[07:12:20] rvanlieshout: ferr: where should i see an icon?
[07:13:03] ferr: rvanlieshout: thanks for your help, I resolved it
[07:15:21] craysiii: has joined #RubyOnRails
[07:16:38] craysiii: has joined #RubyOnRails
[07:17:11] jfelchner: has joined #RubyOnRails
[07:17:55] craysiii: has joined #RubyOnRails
[07:18:36] PedramT: has joined #RubyOnRails
[07:19:31] yardenbar: has joined #RubyOnRails
[07:22:06] lexiMon: has joined #RubyOnRails
[07:22:49] tyrbo: has joined #RubyOnRails
[07:24:18] mdw: has joined #RubyOnRails
[07:29:13] craysiii: has joined #RubyOnRails
[07:31:22] malkav: has joined #RubyOnRails
[07:31:22] Nah^^: has joined #RubyOnRails
[07:31:29] craysiii: has joined #RubyOnRails
[07:34:15] sandstrom: has joined #RubyOnRails
[07:34:54] Nah^^: has joined #RubyOnRails
[07:37:39] herbst: has joined #RubyOnRails
[07:39:32] tetraktys: has joined #RubyOnRails
[07:43:59] mdw7: has joined #RubyOnRails
[07:45:11] arup_r: i also don't know
[07:45:15] comrad: has joined #RubyOnRails
[07:47:03] tetraktys: has joined #RubyOnRails
[07:47:17] rclanan: has joined #RubyOnRails
[07:48:19] craigp_: has joined #RubyOnRails
[07:48:25] alexhartley: has joined #RubyOnRails
[07:50:19] bratsche: has joined #RubyOnRails
[07:51:03] artto: has joined #RubyOnRails
[07:51:57] herbst: has joined #RubyOnRails
[07:52:15] dragonkh: has joined #RubyOnRails
[07:53:03] craigp_: has left #RubyOnRails: ()
[07:53:29] AzaToth: has joined #RubyOnRails
[07:55:17] hannelita: has joined #RubyOnRails
[07:55:27] Scripore: has joined #RubyOnRails
[07:56:42] ascarter: has joined #RubyOnRails
[07:56:57] yardenbar: has joined #RubyOnRails
[07:58:25] pulgalipe: has joined #RubyOnRails
[07:58:52] dionysus69: has joined #RubyOnRails
[07:58:59] arup_r: has joined #RubyOnRails
[08:00:39] AimlessRAven: has joined #RubyOnRails
[08:01:28] AimlessRAven: hi all, i have problem. i have engine rails project.. and create reference model to another. but when i run rake:db:migrate in dummy.. this doesent create migration in project\
[08:02:41] penguinp1wernz: has joined #RubyOnRails
[08:03:14] bartj3: has joined #RubyOnRails
[08:03:20] Palsson: has joined #RubyOnRails
[08:04:17] AimlessRAven: rails tell me PG::UndefinedTable: ERROR: relation "sellor_option_values" does not exist
[08:05:57] AimlessRAven: no.. migration doesnt exist
[08:06:07] AimlessRAven: and relation cant work..
[08:07:02] AimlessRAven: but i have relation in rake routes..
[08:07:14] AimlessRAven: there are all path in association
[08:07:19] rvanlieshout: but is it in the db?
[08:07:19] AimlessRAven: i have nested resource..
[08:07:34] rvanlieshout: so the error is valid
[08:07:48] rvanlieshout: then create it?
[08:08:15] AimlessRAven: yea i create it but doesnt exist after that
[08:08:36] rvanlieshout: how did you create it?
[08:08:39] PedramT: has joined #RubyOnRails
[08:09:02] mark2: has joined #RubyOnRails
[08:09:32] AimlessRAven: rake:db:migrate rake db:test:prepare
[08:10:50] rvanlieshout: and did that run any migration?
[08:11:03] rvanlieshout: did you create a new migration for it? or edited an existing one
[08:11:47] AimlessRAven: when i create model with reference to another
[08:12:23] AimlessRAven: then i need to add migration simple like rails g migration Add..IdToModel nested model id
[08:12:57] tetraktys: has joined #RubyOnRails
[08:18:09] agit0: has joined #RubyOnRails
[08:19:18] DoubleMalt: has joined #RubyOnRails
[08:21:01] herbst: has joined #RubyOnRails
[08:23:47] artto: has joined #RubyOnRails
[08:24:25] pawnbox: has joined #RubyOnRails
[08:24:28] jfqd: has joined #RubyOnRails
[08:27:06] zpe: has joined #RubyOnRails
[08:28:01] mdw: has joined #RubyOnRails
[08:28:04] Axilla: has joined #RubyOnRails
[08:28:25] antgel: has joined #RubyOnRails
[08:29:17] solars: has joined #RubyOnRails
[08:32:51] bePolite: has joined #RubyOnRails
[08:32:51] bePolite: has joined #RubyOnRails
[08:33:30] tvw: has joined #RubyOnRails
[08:36:14] Palsson: has joined #RubyOnRails
[08:40:39] rodfersou: has joined #RubyOnRails
[08:41:05] sandstrom: has joined #RubyOnRails
[08:42:55] _3by8: has joined #RubyOnRails
[08:43:10] herbst: has joined #RubyOnRails
[08:43:10] herbst: has joined #RubyOnRails
[08:48:08] rclanan: has joined #RubyOnRails
[08:51:17] _3by8: So a helper is available to its corresponding view but under what conditions is it also included in another view? Is it when the helper is named after a model and then that model is given an instance for display in a view?
[08:52:44] andrew9184: has joined #RubyOnRails
[08:53:40] pawnbox: has joined #RubyOnRails
[08:54:16] chipotle: has joined #RubyOnRails
[08:54:38] PedramT: has joined #RubyOnRails
[08:56:03] hannelita: has joined #RubyOnRails
[08:59:28] astrofog: has joined #RubyOnRails
[09:00:19] mdw: has joined #RubyOnRails
[09:01:32] sandstrom: has joined #RubyOnRails
[09:02:30] drptbl: has joined #RubyOnRails
[09:02:49] artto: has joined #RubyOnRails
[09:05:10] zpe_: has joined #RubyOnRails
[09:07:16] rvanlieshout: _3by8: you might want to use decorators or presenters
[09:07:22] rvanlieshout: if you want to relate it to models
[09:07:51] JDeen: has joined #RubyOnRails
[09:08:32] _3by8: rvanlieshout: that's not what I want at all, I'm just wondering why I had functions that were overwriting themselves in different helper files.
[09:09:05] rvanlieshout: _3by8: ah right. yeah. than you'll find that all are included
[09:09:06] jottr_: has joined #RubyOnRails
[09:09:33] jsrn_: has joined #RubyOnRails
[09:09:53] _3by8: I don't particularly like that.
[09:10:33] Thouren: has joined #RubyOnRails
[09:11:04] rvanlieshout: but then again i barly use helpers these days
[09:11:33] krz: what is going on here: https://gist.github.com/bc0f76ed31b1af7f84da
[09:11:42] JDeen: Hi guys, I got a question on CanCan. I am wondering if there is a way we can load resources based on abiltiy. for example some thing like `load_resource current_user, :users, :manage` which will load 'User's which the current user can manage. Is there similar feature?
[09:11:54] relix: has joined #RubyOnRails
[09:12:07] pulgalip1: has joined #RubyOnRails
[09:12:30] baweaver: has joined #RubyOnRails
[09:12:43] rvanlieshout: jdeen: you load_resources for an action
[09:12:45] rvanlieshout: not for a role
[09:12:57] bePolite: has joined #RubyOnRails
[09:14:17] relix: Hey guys - I'm trying to set up a controller test to check if a flash message is set correctly
[09:14:39] relix: However the test should check whether the flash message is for now or for the next request - I can't find a way to do that, any tips?
[09:15:21] relix: I have a bug where the flash.now[:alert] is set but the action does a redirect, so the flash is never seen. I'd like a test that makes sure flash.keep is called so the flash is seen in the next request
[09:15:31] JDeen: rvanlieshout: Thanks. What i amwondering is if there is some thing alike, that we can manually use (for example: populate in a select list to filter) using the abilities already defined
[09:15:36] jas02: has joined #RubyOnRails
[09:15:41] herbst: has joined #RubyOnRails
[09:15:46] mauro1254: has joined #RubyOnRails
[09:16:53] rvanlieshout: jdeen: yeah. we use pundit for this all
[09:17:01] relix: I could do something like `assert(flash.instance_variable_get(:@discard).empty?)` but that's really messy
[09:17:01] rvanlieshout: but there might just be something to get a list of users somebody has access to
[09:17:48] mrbubbles: has joined #RubyOnRails
[09:18:39] mrbubbles: has joined #RubyOnRails
[09:18:52] defsdoor: has joined #RubyOnRails
[09:19:17] alexhart_: has joined #RubyOnRails
[09:20:09] Scripore: has joined #RubyOnRails
[09:20:39] pulgalipe: has joined #RubyOnRails
[09:20:45] JDeen: rvanlieshout: I guess you meant, https://github.com/elabs/pundit, checking it, initial impression was that it is like pundit vs cancancan, checking if they can work to gather. Thanks for the hint.
[09:21:44] macarthy_: has joined #RubyOnRails
[09:23:29] jaequery: has joined #RubyOnRails
[09:25:51] rvanlieshout: the approach of pundit is totally different
[09:26:24] JDeen: rvanlieshout: true, reading about it, sounds better than cancnacan
[09:28:43] mauro1254: Hi guys, what happen when max value for id field (primery key) is reached? Are free ids going to be reused?
[09:29:12] rvanlieshout: mauro1254: that's something for your db engine to solve
[09:29:25] chouhoulis: has joined #RubyOnRails
[09:30:14] k13nox: has joined #RubyOnRails
[09:30:40] snowy: has joined #RubyOnRails
[09:31:07] k13nox: has joined #RubyOnRails
[09:32:42] Scripore: has joined #RubyOnRails
[09:32:57] defsdoor: mauro1254, that causes a singularity, and eventually a black hole will form
[09:33:41] alexhartley: has joined #RubyOnRails
[09:34:14] bePolite: has joined #RubyOnRails
[09:35:49] Pumukel: has joined #RubyOnRails
[09:40:09] matthias_: has joined #RubyOnRails
[09:41:18] blackmesa: has joined #RubyOnRails
[09:42:52] lipoqil: has joined #RubyOnRails
[09:44:15] chipotle: has joined #RubyOnRails
[09:44:37] mauro1254: I have a table with 50k records. Every week I need to import new 50k records and only after that I can delete old ones.
[09:45:22] artto: has joined #RubyOnRails
[09:45:24] herbst: has joined #RubyOnRails
[09:45:25] k13nox: Hello, i search a good way to put RAils 5 WebSocket ActionCable under HTTPS/SSL. I have try with Puma and Thin, with in-app and standalone. But not working :s Suggestion ?
[09:45:45] defsdoor: mauro1254, your serials should lasat quite some time then
[09:48:07] mauro1254: defsdoor: yes, but what happen when the limit is reached? Will an exception be thrown?
[09:48:30] defsdoor: no - the serial incrementing is nothing to do with rails
[09:48:43] defsdoor: rails tells the db to insert and the db gives it an id back
[09:48:47] rclanan: has joined #RubyOnRails
[09:48:58] defsdoor: if the db connector raise an exception then yes
[09:49:05] ddv: mauro1254: thats nothing
[09:49:09] defsdoor: but like rvanlieshout said - its down do the db you use
[09:49:29] mauro1254: Hehe ok, thx
[09:50:17] mikecmpbll: has joined #RubyOnRails
[09:51:03] defsdoor: mauro1254, http://stackoverflow.com/questions/13132939/what-happens-when-i-exhaust-a-bigint-generated-key-how-to-handle-it
[09:51:54] defsdoor: so mysql will error with ERROR 1467 (HY000): Failed to read auto-increment value from storage engine
[09:52:15] defsdoor: in a few million years time ;)
[09:53:04] bratsche: has joined #RubyOnRails
[09:53:24] silverdust: I'm trying to make a DELETE request through postman but I get invalid authenticity token even after copying one of the csrf_token from a page into the request params. How can I bypass the authenticity token to test
[09:53:58] DirtyFInn: has joined #RubyOnRails
[09:56:49] hannelita: has joined #RubyOnRails
[10:00:39] ql6wlld: has joined #RubyOnRails
[10:01:24] rvanlieshout: silverdust: remove the check from your app controller
[10:05:12] solars: has joined #RubyOnRails
[10:05:28] bratsche: has joined #RubyOnRails
[10:05:31] chipotle: has joined #RubyOnRails
[10:08:23] silverdust: rvanlieshout: application controller has nothing like request handler
[10:08:58] srinidhi: has joined #RubyOnRails
[10:09:14] silverdust: oh it's the protect from forgery
[10:13:40] zpe: has joined #RubyOnRails
[10:16:15] Pumukel: has joined #RubyOnRails
[10:17:09] hnanon: has joined #RubyOnRails
[10:17:10] herbst: has joined #RubyOnRails
[10:19:01] hnanon: I have /users/1/subscriptions/1/orders
[10:19:04] hnanon: and /orders
[10:19:19] hnanon: Both are the index action for the orders controller.
[10:19:54] hnanon: For /orders, I want to authorize only the admin.
[10:20:03] hnanon: I have this code: https://gist.github.com/anonymous/0ab05672818a4cc4be92
[10:21:09] hnanon: The problem is that if the user, who is an admin, also has a subscription with orders, he'll see all orders at /users/1/subscriptions/1/orders instead of just his orders.
[10:21:20] hnanon: I want him to only see all orders at /orders.
[10:21:36] jamo: has joined #RubyOnRails
[10:22:03] hnanon: I'm using Pundit.
[10:22:46] hnanon: In my order policy, for my index action, I have: @user == @record or @user.role == "admin"
[10:23:52] rvanlieshout: hnanon: got a really busy day, but you'll need to end up with something like policy_scope(@subscription ? @subscription.orders : Order)
[10:26:51] chipotle: has joined #RubyOnRails
[10:27:04] mauro1254: defsdoor: in a few million years time is not correct, I'm using mysql with INT
[10:27:08] masta``: has joined #RubyOnRails
[10:27:25] FooMunki: has joined #RubyOnRails
[10:27:36] tbuehlmann: hnanon, what about having two different controllers, one for users, one for admins?
[10:28:02] marr: has joined #RubyOnRails
[10:28:10] defsdoor: mauro1254, what size int ?
[10:28:12] tsatsu: has joined #RubyOnRails
[10:28:35] futilegames: has joined #RubyOnRails
[10:28:48] ddv: mauro1254: if you're writing millions of records each day I would worry
[10:28:51] ddv: but not now
[10:29:01] defsdoor: 4294967295 is limit for mysql int
[10:29:01] mauro1254: defsdoor: int 4 byte => 2 mia => 2000 years
[10:29:13] mauro1254: defsdoor: only if usigned
[10:29:28] defsdoor: why would you want a signed serial ?
[10:30:03] mauro1254: defsdoor: you are right, for primary key is better to have an unsigned int
[10:30:10] masta``: has left #RubyOnRails: ()
[10:30:24] defsdoor: mauro1254, add a support ticket for checking your limits in 1900 years time ?
[10:30:40] mauro1254: defsdoor: hahahaha
[10:31:00] FooMunki: has joined #RubyOnRails
[10:32:16] hnanon: rvanlieshout: I don't really understand that, so I'm worried about using something when I'm not sure how it works.
[10:32:18] masta``: has joined #RubyOnRails
[10:32:57] hnanon: tbuehlmann: What would I name the second controller pundit policy?
[10:33:42] masta``: hello, can somebody recommend a good hoster with rails support?
[10:33:51] bePolite: has joined #RubyOnRails
[10:33:56] ldnunes: has joined #RubyOnRails
[10:34:14] arBmind: has joined #RubyOnRails
[10:35:35] ddv: masta``: bluerails.nl :p @rvanlieshout
[10:36:53] masta``: is that your company?=)
[10:36:55] tyrbo: has joined #RubyOnRails
[10:38:10] CornishPasty: It's a train operator iirc
[10:38:21] masta``: cant reach their website :/
[10:38:22] rromanch_: has joined #RubyOnRails
[10:38:26] CornishPasty: Ah no, because it's https://www.bluerail.nl/
[10:38:38] ddv: oh yeah lol
[10:39:03] CornishPasty: Some reason I thought ddv was being a troll :P
[10:39:14] ddv: thanks :|
[10:39:19] CornishPasty: like "yeah, nationalrail.co.uk"
[10:39:36] ddv: no problem
[10:40:27] ddv: masta``: anyway get a vps from digitalocean or one of the many other hosters
[10:42:06] herbst: has joined #RubyOnRails
[10:42:20] pawnbox_: has joined #RubyOnRails
[10:42:39] ddv: many: how does it feel to get highlighted so much?
[10:43:16] Pumukel: has joined #RubyOnRails
[10:44:53] tbuehlmann: hnanon, what about Admin::OrdersController?
[10:48:04] AlexJakeGreen: has joined #RubyOnRails
[10:48:11] bronson: has joined #RubyOnRails
[10:48:26] keerthana: has joined #RubyOnRails
[10:48:58] pawnbox: has joined #RubyOnRails
[10:57:35] hannelita: has joined #RubyOnRails
[10:59:54] tvw: has joined #RubyOnRails
[11:00:47] hnanon: tbuehlmann: Pundit requires that the name of the policy be the name of the controller. I wonder how it works when it's namespaced like that.
[11:01:56] tbuehlmann: you can manually instantiate the policy
[11:02:11] nettoweb: has joined #RubyOnRails
[11:04:06] tvw: has joined #RubyOnRails
[11:04:22] sevenseacat: pundit requires no such thing
[11:04:25] keerthana: has joined #RubyOnRails
[11:04:33] sevenseacat: pundit works on the class of the object you give it
[11:04:55] hannelita: has joined #RubyOnRails
[11:05:12] sevenseacat: even that can be customized inside your models
[11:05:47] CornishPasty: ACTION puts six seacats in a box
[11:06:21] sevenseacat: ACTION obvs the seventh and smartest one
[11:07:18] CornishPasty: The one that escaped the box
[11:09:04] sevenseacat: your human cages are no match for me!
[11:09:42] jamo: has joined #RubyOnRails
[11:09:53] jottr_: has joined #RubyOnRails
[11:12:53] herbst: has joined #RubyOnRails
[11:12:53] herbst: has joined #RubyOnRails
[11:16:14] jottr: has joined #RubyOnRails
[11:16:16] Philip: has joined #RubyOnRails
[11:17:06] drptbl: has joined #RubyOnRails
[11:18:23] Philip: has left #RubyOnRails: ()
[11:20:16] mark2: has joined #RubyOnRails
[11:21:14] silverdust: Where else can database config be stored? I'm working on an app and the config/database.yml still shows sqlite when it really uses postgres. I see it tries some random values to authenticate when I run rake db:create but I can't tell where they're from
[11:22:21] silverdust: uhm oh no. The dev just told me he uses sqlite on development and postgres on production. nvm
[11:23:18] par[a]digm: has joined #RubyOnRails
[11:24:42] Philip: has joined #RubyOnRails
[11:25:11] pawnbox: has joined #RubyOnRails
[11:25:24] Philip: has left #RubyOnRails: ()
[11:25:34] tyrbo: has joined #RubyOnRails
[11:27:08] PedramT: has joined #RubyOnRails
[11:27:30] pawnbox: has joined #RubyOnRails
[11:30:38] ddv: silverdust: tell him to use postgres in development too
[11:31:04] par[a]digm: has joined #RubyOnRails
[11:31:11] par[a]digm: has left #RubyOnRails: ()
[11:31:18] par[a]digm: has joined #RubyOnRails
[11:32:53] jottr_: has joined #RubyOnRails
[11:37:12] ebbflowgo: has joined #RubyOnRails
[11:38:07] arup_r: has joined #RubyOnRails
[11:40:46] dionysus69: "There are a lot of ways to make that happen, but my personal preference is ActiveModel Serializers. It???s a gem you can add to your project, and it makes outputting to JSON wicked easy." this is at least an year old post saying it needs some gem to output json but I have encountered the jbuilder that comes with rails scaffold generator can output json without any extra configuration
[11:41:32] dionysus69: does quote mean anything else other than what I said?
[11:41:50] doodlehaus: has joined #RubyOnRails
[11:41:53] herbst: has joined #RubyOnRails
[11:41:53] herbst: has joined #RubyOnRails
[11:46:01] kitsuneyo: has joined #RubyOnRails
[11:48:13] diegoviola: has joined #RubyOnRails
[11:48:56] jeanre: has joined #RubyOnRails
[11:49:25] jeanre: hi all, trying to stub / skip after_create callback, the after_create calls a method in a concern
[11:49:36] jeanre: I don't want to have it execute when creating the factory
[11:50:17] puria: has joined #RubyOnRails
[11:50:29] rclanan: has joined #RubyOnRails
[11:50:47] rvanlieshout: jeanre: because?
[11:50:50] jeanre: in the factory I am calling after(:build) { |object| object.class.skip_callbacks(:create, :after)
[11:50:51] jamo: has joined #RubyOnRails
[11:50:55] rvanlieshout: your tests should mimic the real deal
[11:51:00] jeanre: rvanlieshout because it connects to a 3rd party service
[11:51:06] rvanlieshout: then stub that request
[11:51:09] jeanre: that might not be available
[11:51:43] jeanre: rvanlieshout do I stub the concerns method? or the method on the model?
[11:52:15] rvanlieshout: something like webmoch
[11:52:25] Jameser: has joined #RubyOnRails
[11:53:04] jeanre: its not a request per say
[11:53:23] rvanlieshout: requests to the 3rd pary service
[11:53:50] jeanre: Concerns::PusherEvents.class.any_instance.stub(:emit_create_event)
[11:54:00] jeanre: it uses the pusher gem to send a socket event
[11:54:10] jeanre: I need to stub the emit_create_event
[11:54:21] jeanre: but NoMethodError: undefined method `any_instance' for Module:Class
[11:54:28] jeanre: on the above code snippet
[11:54:51] keerthana: has joined #RubyOnRails
[11:55:08] rvanlieshout: that could use webmoch iirc
[11:55:12] jeanre: it should never call the emit_create_event method on the PusherEvents concern
[11:55:25] jeanre: rvanlieshout but why wount I be able to call any_instance?
[11:55:38] rvanlieshout: i don't know. surely something really simple
[11:55:42] rvanlieshout: but imo it's wrong
[11:55:44] rvanlieshout: to stup methods
[11:56:02] jeanre: it literally sends data to a service
[11:56:28] rvanlieshout: and parses some data before it uses that service
[11:56:29] jeanre: I dont really care about the return as I have tests that actually test the concern
[11:56:44] jeanre: currently I am testing a model that uses the concern
[11:56:59] rvanlieshout: ok. in that case i would expect that stub to work
[11:57:12] rvanlieshout: it's not an instance of Concerns::PusherEvents
[11:57:21] rvanlieshout: that stuff is included
[11:57:26] rvanlieshout: stub it on an instance on the thing that includes it
[11:58:13] jeanre: the Asset model includes the concern
[11:58:21] Jameser`: has joined #RubyOnRails
[11:58:41] jeanre: so I stub on that
[11:58:51] jeanre: asset.class.any_instance.stub(:emit_create_event)
[11:58:57] jeanre: but then it still looks for keys and shit
[11:59:08] jeanre: that I dont want to include in the test environment
[11:59:14] jeanre: keys being access keys
[11:59:31] arup_r: you need allow_any_instance_of(Asset).to receive(..)
[11:59:43] arup_r: try this..
[12:01:30] herbst: has joined #RubyOnRails
[12:02:37] arup_r: I don't know the .stub() .. In latest Rspec stub, mock can be done, using the above syntax, or there are some other ways also.. I am not familiar with .stub()
[12:02:49] joshkovach: has joined #RubyOnRails
[12:03:34] yfeldblum: has joined #RubyOnRails
[12:04:26] arup_r: ok, it is facory girls .stub().. I thought in Rspec.
[12:04:50] codedmart: has joined #RubyOnRails
[12:05:53] Palsson: has joined #RubyOnRails
[12:10:39] chipotle: has joined #RubyOnRails
[12:10:59] gbgdev: has joined #RubyOnRails
[12:12:03] artto: has joined #RubyOnRails
[12:12:26] gbgdev_: has joined #RubyOnRails
[12:12:49] ZerGabriel: has joined #RubyOnRails
[12:16:14] keerthana: has joined #RubyOnRails
[12:18:17] PedramT: has joined #RubyOnRails
[12:21:33] kitsuneyo: what's a good general for when to use ajax, or just the usual html?
[12:21:54] kitsuneyo: cos sometimes ajax seems like more trouble than its worth
[12:22:10] keerthana_: has joined #RubyOnRails
[12:24:24] Elion: has joined #RubyOnRails
[12:24:24] Elion: has joined #RubyOnRails
[12:26:58] c355E3B: has joined #RubyOnRails
[12:27:29] herbst: has joined #RubyOnRails
[12:31:41] ZerGabriel: has joined #RubyOnRails
[12:31:57] kerunaru: has joined #RubyOnRails
[12:34:12] quazimodo: has joined #RubyOnRails
[12:34:21] tetraktys: has joined #RubyOnRails
[12:35:00] hannelita: has joined #RubyOnRails
[12:35:35] Thouren: has joined #RubyOnRails
[12:36:10] jeanre: has joined #RubyOnRails
[12:36:54] defsdoor_: has joined #RubyOnRails
[12:37:49] lacrymology: has joined #RubyOnRails
[12:39:21] workmad3: has joined #RubyOnRails
[12:39:32] Axilla: has joined #RubyOnRails
[12:44:53] Cork: a little weird question
[12:45:13] Cork: anyone know of a way to detect in code if a command has been called from rails console?
[12:45:39] pwnd_nsfw: may I ask why you'd need that?
[12:46:11] Cork: to log if the command has been executed from a console of through a normal controller
[12:46:46] jeanre: has joined #RubyOnRails
[12:48:24] jeanre: has joined #RubyOnRails
[12:48:28] drptbl: has joined #RubyOnRails
[12:48:59] pwnd_nsfw: Cork, you could maybe make a new environment
[12:49:00] Scripore: has joined #RubyOnRails
[12:49:12] Cork: preferably not
[12:49:27] pwnd_nsfw: ACTION shrugs.
[12:49:55] pwnd_nsfw: Like, what difference in functionality will something have being run from console and how often would you even need it?
[12:51:14] Cork: pwnd_nsfw: when something is done in the console it is done by hand
[12:51:22] joshkovach: has joined #RubyOnRails
[12:51:24] rclanan: has joined #RubyOnRails
[12:51:35] matthias_: has joined #RubyOnRails
[12:51:41] Cork: while things not in a console is automated
[12:51:46] Cork: (the web site)
[12:52:15] herbst: has joined #RubyOnRails
[12:52:53] iateadonut: has joined #RubyOnRails
[12:53:24] doodlehaus: has joined #RubyOnRails
[12:53:31] k13nox: has joined #RubyOnRails
[12:53:58] tbuehlmann: sounds like a service object with logging functionality to me
[12:54:21] tbuehlmann: as in, you can inject a logger object that is used if present. and the controller would inject it
[12:56:39] Bloomer: has joined #RubyOnRails
[12:57:04] jeanre: has joined #RubyOnRails
[12:57:25] legohead: has joined #RubyOnRails
[12:57:32] kerunaru_: has joined #RubyOnRails
[13:01:01] ebbflowgo: has joined #RubyOnRails
[13:01:55] legohead: has left #RubyOnRails: ()
[13:03:14] blackmesa: has joined #RubyOnRails
[13:03:55] Cork: Rails.constants.include?(:ConsoleMethods) could work
[13:04:03] shanemcd: has joined #RubyOnRails
[13:04:19] blackmesa: has joined #RubyOnRails
[13:04:20] legohead_: has joined #RubyOnRails
[13:04:40] legohead_: Hey, what's the best way to have multiple inputs for a single string attribute? I can see that for datetime that multiparameter attributes is used but this is only for class type fields?
[13:05:15] tbuehlmann: legohead_, having several setter methods is an option, that's how it's done with datetimes
[13:06:12] pulgalip1: has joined #RubyOnRails
[13:07:19] krz: has joined #RubyOnRails
[13:09:02] quazimodo: has joined #RubyOnRails
[13:09:11] par[a]digm: has joined #RubyOnRails
[13:09:12] steharro: has joined #RubyOnRails
[13:12:34] steharro: Possibly found a bug in Rails 5, anyone know of any changes dealing with nested attributes?
[13:14:34] svkurowski: has joined #RubyOnRails
[13:14:39] tetraktys: has joined #RubyOnRails
[13:14:42] alexhart_: has joined #RubyOnRails
[13:15:45] doodlehaus: has joined #RubyOnRails
[13:17:40] herbst: has joined #RubyOnRails
[13:18:10] PedramT: has joined #RubyOnRails
[13:18:21] tbuehlmann: steharro, this? https://groups.google.com/forum/#!msg/rubyonrails-security/cawsWcQ6c8g/tegZtYdbFQAJ
[13:19:10] mdw: has joined #RubyOnRails
[13:19:49] kitsuneyo: has joined #RubyOnRails
[13:20:29] sandstrom: has joined #RubyOnRails
[13:20:42] legohead_: tbuehlmann thanks for that, I'll probably go with that
[13:21:31] workmad3: has joined #RubyOnRails
[13:22:03] par[a]digm: has joined #RubyOnRails
[13:22:54] jkamenik: has joined #RubyOnRails
[13:23:52] sevenseacat: has joined #RubyOnRails
[13:24:23] Or1on: has joined #RubyOnRails
[13:25:42] ewnd9_: has joined #RubyOnRails
[13:28:51] PedramT: has joined #RubyOnRails
[13:30:10] steharro: tbuehlmann: no, ActiveRecord is throwing an RecordInvalid exception when trying to create a resource with nested attributes, complaing that the parent record must exist, the same code under Rails 4 works as expect, https://gist.github.com/anonymous/24ea2b645c7a177b3c04
[13:31:29] tbuehlmann: there's an implicit presence validation when using belongs_to in rails 5, iirc
[13:31:39] tbuehlmann: might have to do with that (but why?)?
[13:31:48] tyrbo: has joined #RubyOnRails
[13:32:23] jeanre: has joined #RubyOnRails
[13:32:25] jeanre: has joined #RubyOnRails
[13:32:32] jeanre: https://gist.github.com/jeanres/4c2f26116449905bddbe
[13:32:43] jeanre: why would I still see it execute the emit_create_event
[13:35:23] jeanre: rvanlieshout this should work fine if I understand the docs correctly
[13:35:31] herbst: has joined #RubyOnRails
[13:39:37] jeanre: testing is a pain in the ass
[13:41:05] PedramT: has joined #RubyOnRails
[13:41:07] steharro: tbuehlmann: Thanks, if I set belongs_to :user, optional: true, then it works. Seems like this is a bug rather than an intended change?
[13:41:24] nfk|laptop: has joined #RubyOnRails
[13:42:58] artto: has joined #RubyOnRails
[13:43:49] tbuehlmann: steharro, I'd think it's a bug
[13:43:50] naavinm: has joined #RubyOnRails
[13:45:57] Axilla: has joined #RubyOnRails
[13:45:57] ldnunes_: has joined #RubyOnRails
[13:46:16] joy4u: has joined #RubyOnRails
[13:46:20] joy4u: has left #RubyOnRails: ()
[13:46:21] Craigimus: has joined #RubyOnRails
[13:48:21] steharro: has joined #RubyOnRails
[13:48:47] rickmasta: has joined #RubyOnRails
[13:48:54] srinidhi: has joined #RubyOnRails
[13:49:32] ql6wlld: has joined #RubyOnRails
[13:50:58] jottr: has joined #RubyOnRails
[13:51:17] bronson: has joined #RubyOnRails
[13:55:34] kerunaru: has joined #RubyOnRails
[13:55:58] jeanre: is there a way to ignore model callbacks when creating a factory?
[13:56:01] pulgalipe: has joined #RubyOnRails
[13:59:32] herbst: has joined #RubyOnRails
[14:02:09] ramortegui: has joined #RubyOnRails
[14:02:10] rclanan: has joined #RubyOnRails
[14:04:08] VeryBewitching: has joined #RubyOnRails
[14:04:20] krz: has joined #RubyOnRails
[14:04:49] shanemcd: has joined #RubyOnRails
[14:05:14] shanemcd: has joined #RubyOnRails
[14:06:43] jeanre: has joined #RubyOnRails
[14:06:43] jeanre: has joined #RubyOnRails
[14:06:53] jeanre: sevenseacat no I cannot skip the callbacks?
[14:07:03] jeanre: how would I then not execute a method
[14:07:05] sevenseacat: no, you cannot skip the callbacks.
[14:07:13] jeanre: for some reason I cannot even stub it
[14:07:26] sevenseacat: if you dont want them to be called all the time, perhaps they shouldn't be callbacks.
[14:07:32] NBarnes: has joined #RubyOnRails
[14:07:39] ddv: jeanre: nothing special about it, it's just ruby
[14:07:46] ddv: investigate
[14:07:53] jeanre: ddv lolwut?
[14:08:18] jeanre: @sevenseacat it has to be a callback in the real running of the application
[14:08:41] ddv: jeanre: lol? this is a serious channel....
[14:09:37] ddv: you can also just talk to me in this channel without pm'ing me
[14:09:55] herbst: has joined #RubyOnRails
[14:10:23] jeanre: ddv I am aware of that, but it was not related to this, it was related to your idiotic comments
[14:11:19] n1lo: has joined #RubyOnRails
[14:11:24] mary5030: has joined #RubyOnRails
[14:11:31] B1n4r10: has joined #RubyOnRails
[14:11:33] jeanre: but anyway I have better things to do then speak to you at this point in time
[14:11:35] sevenseacat: hey let's chill
[14:11:59] ddv: jeanre: if this is your attitude we have better things to do then to help you
[14:12:13] nettoweb: has joined #RubyOnRails
[14:12:21] jeanre: ddv sure go do something else
[14:13:22] learnme_: has joined #RubyOnRails
[14:13:26] jeanre: sevenseacat its all good :)
[14:14:24] jeanre: I should however be able to stub the Pusher gem's trigger method
[14:14:44] learnme_: Quick debugging question, is there a better way to view the output of a variable other than abort(var)?
[14:15:21] jguthrie100: has joined #RubyOnRails
[14:16:33] StaticVoid: learnme_: use debugger?
[14:17:00] ddv: learnme_: pry, byebug?
[14:17:16] tetraktys: has joined #RubyOnRails
[14:17:20] learnme_: I'm just using logger.debug()
[14:17:31] jeanre: @learnme_ binding.pry (pry rails gem)
[14:17:41] StaticVoid: standard? ruby debugger, breaks in your server window and allows you to see what variables are
[14:17:56] tfitts: pry is great
[14:17:57] StaticVoid: assuming you have a local dev env that is
[14:18:01] arup_r: has joined #RubyOnRails
[14:18:02] learnme_: I come php land..I'm used to var_dump() and die;
[14:18:07] ddv: you should always have a local dev env
[14:18:08] learnme_: yeah, I have a local dev
[14:18:17] learnme_: setup a vbox
[14:18:53] learnme_: I'm just getting used to RoR, so I don't know a lot of the language/commands :P
[14:18:55] codefo: has joined #RubyOnRails
[14:19:13] StaticVoid: learnme_: debugger is super easy, require it in your class and just put 'debugger' where you want it to break
[14:19:35] tfitts: learnme_: or stick with pry, I've never seen anyone recommend debugger over pry if they have used both.
[14:19:40] shanemcd: has joined #RubyOnRails
[14:19:50] learnme_: StaticVoid: what's debugger? Is logger.debug() the same thing?
[14:20:38] StaticVoid: learnme_: No, it's the default ruby debugger (I think, I'm super new too) - just do a quick google search and It'll pop up
[14:21:18] tfitts: StaticVoid: if you're new you should probably switch to pry too, you'll find it's much better
[14:21:26] mmccarty: has joined #RubyOnRails
[14:21:37] shanemcd: has joined #RubyOnRails
[14:22:07] StaticVoid: tfitts: thanks for the tip, will definitely look into that
[14:23:49] jeanre: sevenseacat what else would you suggest, I need to send data to pusher after the object has been committed to the database, so the logical place is to do it in the after_commit model callback...
[14:24:15] jeanre: but now in my tests, I do not want to actually send real data to pusher
[14:24:20] joshkovach: has joined #RubyOnRails
[14:24:33] sevenseacat: I would suggest using service objects to couple unrelated behaviour like model creation and push notification sending
[14:24:47] sevenseacat: failing that, your pusher gem likely has a test mode that acts as a no-op
[14:25:10] jeanre: sevenseacat I need to use service object yes
[14:25:17] jeanre: been avoiding that refactor
[14:27:14] AimlessRAven: has joined #RubyOnRails
[14:29:25] AimlessRAven: hi all, if i have 2 exist models how to make migrate between them for example i have product and option_type models .. and i wanna my table look like table product_option_types
[14:29:38] herbst: has joined #RubyOnRails
[14:29:58] AimlessRAven: i cant add reference when create product model.. because he create after option_type
[14:30:16] aegis3121: has joined #RubyOnRails
[14:30:27] doodlehaus: has joined #RubyOnRails
[14:31:03] alexhartley: has joined #RubyOnRails
[14:31:18] nettoweb: has joined #RubyOnRails
[14:32:50] tfitts: AimlessRaven: migrations can add fields to already existing tables
[14:33:00] tfitts: then you just add the has_many and belongs_to to each model.
[14:33:45] legohead: has joined #RubyOnRails
[14:34:02] legohead: has left #RubyOnRails: ()
[14:34:38] AimlessRAven: tfitts: what do you mean.. for example i need to add migration addnewfieldtoproduct.. koito shte e option_type_id ?
[14:34:42] ryanRT: has joined #RubyOnRails
[14:35:08] corioliss__: has joined #RubyOnRails
[14:35:28] tfitts: so run rails g migration AddOptionTypeToProducts
[14:35:45] AimlessRAven: without any other parameter?
[14:35:52] tfitts: that generates a migraitons file fore you, then go into the file and add whatever migration data you need, you can reference a previous migration or google for what goes in the file
[14:35:55] devlitzi: has joined #RubyOnRails
[14:36:01] c355E3B: has joined #RubyOnRails
[14:36:06] learnme_: Are there ways to do view composers in RoR? Like reusuable view pieces like a navbar or something? I don't want to have to keep calling the necessary variables in my controller
[14:36:35] tfitts: learnme_: they're called partials in rails
[14:37:02] learnme_: Ok. How do I pass variables into those partials?
[14:37:14] learnme_: I don't want to keep calling them in my controllers
[14:37:20] tfitts: learnme: look up rails partials, they have quite a bit to them.
[14:37:29] learnme_: Thanks tfitts
[14:37:36] tfitts: learnme_: you should look up yield too
[14:38:10] tfitts: you should have one application layout that has everything that all of your pages share and then in that application layout you'll have a yield which will just put the view from that controller action within that page
[14:38:53] tfitts: you shouldn't have to reference your navbar within any of your controllers except maybe your application controller. all of that should be kind of automatic from the context of your other controllers/views
[14:40:06] tfitts: learnme_: does that make sense? You shouldn't be reusing the navbar pieces in your other views
[14:40:29] learnme_: makes sense
[14:40:34] learnme_: I do the same in Laravel
[14:40:42] learnme_: just have to learn the same for rails
[14:40:51] arup_r: has joined #RubyOnRails
[14:43:27] nettoweb: has joined #RubyOnRails
[14:46:47] gbgdev: has joined #RubyOnRails
[14:48:13] defsdoor_: has joined #RubyOnRails
[14:49:38] flashpoint9: has joined #RubyOnRails
[14:51:05] solars: has joined #RubyOnRails
[14:51:12] herbst: has joined #RubyOnRails
[14:51:37] devlitzi: has joined #RubyOnRails
[14:52:14] pwnd_nsfw: has joined #RubyOnRails
[14:53:32] jeanre: has joined #RubyOnRails
[14:53:38] learnme_: If I call MyModel.search(params[:search]).limit(40) I always get back an object of type ActiveRecord::Relation...how do I get the actual data output from my model?
[14:54:23] sevenseacat: that is the data
[14:54:43] sevenseacat: what problem are you having?
[14:54:59] gabeodess: has joined #RubyOnRails
[14:55:17] tyrbo: has joined #RubyOnRails
[14:55:18] learnme_: Like...I was expecting to get back a hash or an array of the data from the db?
[14:55:34] learnme_: Instead I got back an object relation? Maybe I was even expecting a collection
[14:56:36] sevenseacat: it is a collection
[14:57:07] sevenseacat: so again, what exact problem are you having?
[14:57:25] learnme_: idk...I guess I was expecting it to be called Collection
[14:59:32] jguthrie100: Whats the .search method?
[15:00:04] jguthrie100: Doesn't work for me : undefined method `search' for #<Class:0x00000004608f70>
[15:00:31] learnme_: I'm debugging old code from another dev
[15:00:50] learnme_: it applies a where clause based on input params
[15:01:58] sssssssss: has joined #RubyOnRails
[15:04:46] jguthrie100: You can basically treat the Relation like a collection
[15:05:05] jguthrie100: rel_obj[0].date for example
[15:05:05] mordof_work: has joined #RubyOnRails
[15:05:19] dragonkh: has joined #RubyOnRails
[15:05:21] fsteim: has joined #RubyOnRails
[15:05:53] learnme_: also very useful
[15:05:55] sevenseacat: you dont need to do that
[15:06:01] sevenseacat: you can iterate over it as is
[15:06:14] learnme_: I understand...but trying to debug the output
[15:06:24] learnme_: abort(variable) just gives me the type
[15:06:26] sevenseacat: grr you didnt ask that
[15:06:30] learnme_: doesn't help much in debugging :P
[15:06:41] learnme_: Lol. sorry :P
[15:06:57] learnme_: thanks for the help
[15:07:37] stannard: has joined #RubyOnRails
[15:10:54] jguthrie100: Are you saving that Relation object to a variable?
[15:11:10] jguthrie100: rel_obj.each do |rel|
[15:11:25] jguthrie100: puts rel.name
[15:11:37] jguthrie100: or rel.id or rel.date or whatever
[15:12:15] lacrymology: has joined #RubyOnRails
[15:12:28] jguthrie100: Should give you the relevant bits of the model records that you searched for
[15:15:16] nertzy2: has joined #RubyOnRails
[15:15:22] herbst: has joined #RubyOnRails
[15:17:12] polishdub: has joined #RubyOnRails
[15:21:27] kitsuneyo: has joined #RubyOnRails
[15:22:19] aadam21: has joined #RubyOnRails
[15:22:40] mag42c: has joined #RubyOnRails
[15:24:27] alexhart_: has joined #RubyOnRails
[15:29:34] doodlehaus: has joined #RubyOnRails
[15:29:41] par[a]digm: has joined #RubyOnRails
[15:30:15] chouhoulis: has joined #RubyOnRails
[15:31:30] FLeiXiuS: has joined #RubyOnRails
[15:31:30] FLeiXiuS: has joined #RubyOnRails
[15:31:37] safetypin: has joined #RubyOnRails
[15:32:03] eljimmy: has joined #RubyOnRails
[15:32:23] droptheplot: has joined #RubyOnRails
[15:33:24] kmckelvin: has joined #RubyOnRails
[15:34:03] andrmrtmr: has joined #RubyOnRails
[15:37:19] amortimer: has joined #RubyOnRails
[15:39:18] mordof_work: has joined #RubyOnRails
[15:39:23] herbst: has joined #RubyOnRails
[15:40:04] doodlehaus: has joined #RubyOnRails
[15:41:28] kmckelvi1: has joined #RubyOnRails
[15:41:41] shinnya: has joined #RubyOnRails
[15:42:50] russt: has joined #RubyOnRails
[15:44:40] darkxploit: has joined #RubyOnRails
[15:46:08] B1n4r10: has joined #RubyOnRails
[15:46:14] aloneintheworld: has joined #RubyOnRails
[15:46:22] PedramT: has joined #RubyOnRails
[15:47:56] darkxploit: has joined #RubyOnRails
[15:49:27] Axilla: has joined #RubyOnRails
[15:50:33] PedramT_: has joined #RubyOnRails
[15:53:16] C0L0R: has joined #RubyOnRails
[15:53:36] bronson: has joined #RubyOnRails
[15:54:16] alxm: has joined #RubyOnRails
[15:55:39] alxm: when testing with rspec, I do this `let(:items_text) { item.id.to_s }` and it writes to STDOUT, how can I suppress that or do it in a way that doesn't dump to stdout?
[15:56:55] tubbo: alxm: you lie.
[15:57:07] tubbo: alxm: that line alone will not write anything to STDOUT.
[15:58:16] PedramT: has joined #RubyOnRails
[15:58:17] alxm: tubbo: I am not lying. it is seriously doing that
[15:58:24] kies^: has joined #RubyOnRails
[15:58:49] alxm: tubbo, I didn't expect it to write to stdout either, but for some reason it is
[15:58:57] tubbo: alxm: hmm, well a `let` isn't going to do that. so something else is up. can you gist the code for whatever item is in this case, the rspec test that is causing your problem, and the text that it outputted to STDOUT?
[15:59:10] tubbo: alxm: that is, the source to the class definition for `item`.
[15:59:23] shanemcd: has joined #RubyOnRails
[15:59:32] mrbubbles: has joined #RubyOnRails
[15:59:45] Palsson: has joined #RubyOnRails
[16:00:02] alxm: tubbo, sure, it is just a factory girl instance of a model...one sec
[16:01:00] adre: has joined #RubyOnRails
[16:01:13] solars: has joined #RubyOnRails
[16:02:25] alxm: tubbo, ugh - busted - you were right - totes lying...found it...sorry python is my day job, just getting accustomed to ruby
[16:03:12] herbst: has joined #RubyOnRails
[16:04:03] alxm: tubbo: any suggestions for a debugger to use?
[16:06:15] fryguy: everybody having fun patching the CVEs from yesterday?
[16:10:02] rashkov: has joined #RubyOnRails
[16:10:47] amortimer: has left #RubyOnRails: ()
[16:10:48] adre: has joined #RubyOnRails
[16:11:56] rashkov: Could anyone point out some patterns to updating related models? I'd like to avoid accepts_nested_attributes_for. One of my concerns is doing it atomically, to avoid partial updates.
[16:12:29] fryguy: rashkov: transactions are pretty great
[16:12:49] codepete: has joined #RubyOnRails
[16:13:33] rashkov: fryguy: oh yeah, thanks! I've neglected to fully read up on them but that sounds like exactly what I shoulid be using
[16:14:46] noodman: has joined #RubyOnRails
[16:16:00] nettoweb: has joined #RubyOnRails
[16:16:33] jamo: I just upgraded from 4.1 to 4.2 and in view I have : stylesheet_link_tag params[:controller] if Rails.application.assets.find_asset("#{params[:controller]}.css") %> and now it's causing undefined method `find_asset' for nil:NilClass
[16:16:54] jamo: but when checking from rails c that method seems to exists and be working
[16:17:10] Scient: you are just asking to be abused, arent you
[16:17:22] workmad3: has joined #RubyOnRails
[16:17:27] Scient: that seems like a damn horrible idea, dynamically including stylesheets based on params directly
[16:17:35] Scient: almost as bad as dynamic template rendering perhaps
[16:17:56] Scient: https://nvisium.com/blog/2016/01/26/rails-dynamic-render-to-rce-cve-2016-0752/ ironically I was just readind this
[16:19:14] Papierkorb: Scient: I didn't even get 1) why you'd do that 2) why anything would think this being a good idea 3) and how rails is supposed to protect you by doing it
[16:19:38] Papierkorb: It's like aiming a loaded shotgun at your foot, then shake it and complain when your foot is now gone
[16:19:57] Scient: sadly im pretty sure that nvisium post is based on an app they audited and that audit was ordered by me/us
[16:20:09] Scient: so I know an app where this actually was in production code
[16:20:25] Scient: seeing that tidbit triggered the full audit methinks
[16:20:28] shibabu: has joined #RubyOnRails
[16:20:32] fryguy: Jamo: the upgrade from sprockets 2 to sprockets 3 that you just did removes rails.application.assets when you have assets.compile set to false in your configuration. google it and you'll see a bunch of references to it and fixes in sprockets-rails github rpo
[16:25:20] chouhoulis: has joined #RubyOnRails
[16:25:38] smathy: has joined #RubyOnRails
[16:26:31] defsdoor_: has joined #RubyOnRails
[16:27:45] MarkAValdez: has joined #RubyOnRails
[16:34:20] herbst: has joined #RubyOnRails
[16:34:37] [Butch]: has joined #RubyOnRails
[16:34:43] benoror: has joined #RubyOnRails
[16:34:54] EdwardIII: has joined #RubyOnRails
[16:35:04] EdwardIII: i'm sure we used to install apache2-threaded-dev on ubuntu to run passenger on, but now they're saying Package 'apache2-threaded-dev' has no installation candidate? anyone else seeing this on their ruby test machines?
[16:38:10] dstarh: has joined #RubyOnRails
[16:38:27] bePolite: has joined #RubyOnRails
[16:39:26] lacrymology: has joined #RubyOnRails
[16:39:56] lacrymology: has joined #RubyOnRails
[16:41:08] mag42c: does anyone have experience with authenticating requests coming in using the rails method authenticate_or_request_with_http_token ? here is a gist of my request and the controller with the authenicate method. I can???t seem to get this right. Can???t authorize even though I can call request.authorization and get the ???token token: apisecretkey??? https://gist.github.com/michaelginalick/68f694a723ad8c2c701b
[16:41:31] iateadonut: has left #RubyOnRails: ()
[16:41:32] tubbo: EdwardIII: package name might have changed?
[16:41:42] EdwardIII: hrm don't see anything similar
[16:41:49] EdwardIII: i'll just try it with apache-dev
[16:42:08] dopamean_: has joined #RubyOnRails
[16:42:31] sonofdirt: has joined #RubyOnRails
[16:43:01] matthewd: mag42c: 'Authorization:Token' => ENV["MDM_Key"] <-- is wrong
[16:43:32] AlexJakeGreen: has joined #RubyOnRails
[16:44:10] mag42c: matthewd: I can call ENV["MDM_Key"] in the console and it???ll give back the key
[16:44:34] mag42c: matthewd: do you know what it should look like?
[16:44:38] matthewd: mag42c: 'Authorization:Token' is not a header
[16:45:15] matthewd: mag42c: 'Authorization' => "something something=#{ENV['MDM_Key']}", I think?
[16:45:41] matthewd: At least one of those somethings will be in the vicinity of "token"
[16:50:06] mag42c: matthewd: thanks so much!! I was spinning my wheels for hours
[16:50:19] herbst: has joined #RubyOnRails
[16:52:18] atomical: has joined #RubyOnRails
[16:53:41] dragonkh: has joined #RubyOnRails
[16:54:44] momomomomo: has joined #RubyOnRails
[16:55:03] EdwardIII: hrm the passenger setup seems to not work but doesn't error
[16:55:41] EdwardIII: maybe i could use something like this instead: https://github.com/radar/ansible-rails-app
[16:57:40] hannelita: has joined #RubyOnRails
[16:58:29] centrx: has joined #RubyOnRails
[16:59:41] arup_r: has joined #RubyOnRails
[17:00:56] agit0: has joined #RubyOnRails
[17:03:48] herbst: has joined #RubyOnRails
[17:03:53] yaewa: has joined #RubyOnRails
[17:04:09] FLeiXiuS`: has joined #RubyOnRails
[17:04:11] adre: has joined #RubyOnRails
[17:04:16] marr: has joined #RubyOnRails
[17:04:31] valetudo: has joined #RubyOnRails
[17:05:50] learnme_: has joined #RubyOnRails
[17:06:34] learnme_: Whats the best way in rails to test is a relationship exists? Like I only want customers who have orders.
[17:06:34] aegis3121: has joined #RubyOnRails
[17:06:51] learnme_: I want to eager load the relation, but only load the relevant ones
[17:06:57] Or1on_: has joined #RubyOnRails
[17:07:08] PedramT: has joined #RubyOnRails
[17:07:09] Jamo_: has joined #RubyOnRails
[17:07:13] centrx: learnme_, You can do a join, an inner join only returns records that have a corresponding record in the joined table
[17:07:28] learnme_: centrx: would that give me duplicate items in the resulting collection/
[17:07:39] learnme_: multiple copies of the same custoemr
[17:07:39] hobodave: has joined #RubyOnRails
[17:07:42] learnme_: if they multiple orders
[17:07:52] learnme_: Because that'd be what the raw sql returns
[17:08:00] learnme_: Does the collection handle that?
[17:08:13] centrx: good point
[17:08:17] treehug88: has joined #RubyOnRails
[17:08:24] zworks: has joined #RubyOnRails
[17:08:30] learnme_: I'm not sure. I can give it a try.
[17:08:32] matthewd: learnme_: Parent.includes(:children).where.not(children: { parent_id: nil })
[17:08:40] learnme_: there we go
[17:08:42] learnme_: thanks matthewd
[17:09:40] matthewd: tbh, I'm not certain what a straight .joins would do... I hardly ever use it. So that might do the thing you want too?
[17:09:51] rakm: has joined #RubyOnRails
[17:09:54] zotherstupidguy: has joined #RubyOnRails
[17:10:04] zworks: any one know how to customize the devise unconfirmed email error message ?
[17:10:31] zotherstupidguy: is it recommended for a rails application to be packaged into a gem in a production enviroment?
[17:10:34] theslow1: has joined #RubyOnRails
[17:11:07] hobodave: has joined #RubyOnRails
[17:11:10] matthewd: learnme_: Oh, and `id: nil` may be clearer than `parent_id: nil`, actually
[17:11:39] matthewd: zotherstupidguy: Where did you get that impression?
[17:12:00] PedramT: has joined #RubyOnRails
[17:12:07] theslow1: Hey everyone, trying to deploy an spree project, but each time I run `rake db:migrate` I get the following error: `NameError: uninitialized constant DataShift::Logging` Can somene give me some bebug steps
[17:12:59] devlitzi: has joined #RubyOnRails
[17:15:02] rubyonrails907: has joined #RubyOnRails
[17:15:48] axilla_: has joined #RubyOnRails
[17:17:14] baweaver: has joined #RubyOnRails
[17:17:14] theslow1: these are the gems I have installed on my system, and their versions and the stacktrace: https://dpaste.de/EgVv#L
[17:17:37] jtong: has joined #RubyOnRails
[17:18:44] hobodave_: has joined #RubyOnRails
[17:19:40] herbst: has joined #RubyOnRails
[17:23:34] chubijs: has joined #RubyOnRails
[17:24:24] matthewd: theslow1: Sounds like you start at datashift-0.15.0/lib/datashift/method_dictionary.rb:12, then
[17:24:46] zotherstupidguy: matthewd i thought maybe someone likes to do it this way :)
[17:25:05] Maletor: has joined #RubyOnRails
[17:25:07] kitsuneyo: has joined #RubyOnRails
[17:25:33] theslow1: matthewd, I don't want to modify the code of Datashift itself
[17:25:52] zworks: any one know how to customize the devise unconfirmed email error message ?
[17:25:58] matthewd: theslow1: You asked how to debug it, not how to fix it
[17:26:20] theslow1: matthewd, :) I did. But I meant fix
[17:26:50] matthewd: If you're not prepared to *look* at the code of Datashift, then you'll need more help than I can offer
[17:26:57] matthewd: theslow1: !consultant
[17:26:57] helpa: theslow1: Your question, problem, and/or attitude requires more than free internet advice from an irc channel. May I suggest hiring a consultant or life coach?
[17:27:15] rhizome: theslow1: do you need to bundle install?
[17:27:17] edgarlepe: has joined #RubyOnRails
[17:27:48] solars: has joined #RubyOnRails
[17:27:53] greenhat: I'm using standard transactional minitest tests on this rails project. Is there any callback or method I can override to write some stuff to the DB before the transaction is opened when a test runs?
[17:28:00] theslow1: rhizome, I did
[17:28:14] theslow1: bundle install succeeded without any problems
[17:29:04] edgarlepe: has joined #RubyOnRails
[17:29:05] baweaver: has joined #RubyOnRails
[17:29:24] greenhat: I know that's basically what fixtures are, but this project is using factories, and I don't really want to use a fixture just for this case.
[17:29:44] djellemah: has joined #RubyOnRails
[17:29:49] theslow1: matthewd, Datashift is used with thousands of projects, I doubt the problem is in Datashift, but rather a configuration mistake I have made somewhere else
[17:31:11] BaNzounet: has joined #RubyOnRails
[17:31:14] matthewd: theslow1: Well, given the error, someone's going to have to look at that line to find out what it's expecting, in order to work out what you need to do differently
[17:31:23] jcm: has joined #RubyOnRails
[17:31:24] PaulePanter: has joined #RubyOnRails
[17:31:30] matthewd: theslow1: If you're not prepared to open the file, you'll need to find someone who is
[17:31:32] rhizome: greenhat: just set up your data however you need it within the test
[17:32:12] srinidhi: has joined #RubyOnRails
[17:32:17] greenhat: Yeah. I know. The tests would run 16x faster if I only need to setup the data once.
[17:32:22] rhizome: theslow1: is it listed in Gemfile.lock?
[17:32:30] marr: has joined #RubyOnRails
[17:32:45] reckoner: has joined #RubyOnRails
[17:33:15] reckoner: anyone use Pundit here?
[17:33:30] greenhat: I use pundit.
[17:33:41] reckoner: greenhat, with interactors?
[17:33:47] theslow1: rhizome, it is: https://dpaste.de/ebMj
[17:34:02] herbst: has joined #RubyOnRails
[17:34:09] theslow1: matthewd, I'll follow your suggestion
[17:34:13] greenhat: reckoner, nope. Don't really know what those are.
[17:34:28] reckoner: ah, okay. thanks. https://github.com/collectiveidea/interactor
[17:34:31] Gizmokid2005: has joined #RubyOnRails
[17:34:51] defsdoor_: has joined #RubyOnRails
[17:34:54] greenhat: reckoner, Are you wondering about using pundit outside of controllers?
[17:35:25] reckoner: greenhat, yes. we need to integrate our policies into our interactor classes, but it's not working at the moment
[17:35:44] reckoner: i assume i can get this done with a concern, but looking into a bit more.
[17:35:59] Pumukel: has joined #RubyOnRails
[17:36:11] greenhat: reckoner, You should be able to just include Pundit in any object you want, and you get the helper methods.
[17:36:25] reckoner: oh really. huh.
[17:36:32] reckoner: ACTION scratches head
[17:36:51] jeanre: has joined #RubyOnRails
[17:36:53] reckoner: that's encouraging. maybe i messed something up on my end. checking.
[17:36:58] greenhat: reckoner, Or you can just new up the policy you want - PostPolicy.new(user, post).destroy? - for example.
[17:37:19] reckoner: right, i was looking at that option too.
[17:37:22] dionysus69: has joined #RubyOnRails
[17:38:08] jeanre: has joined #RubyOnRails
[17:39:47] safety_cut: has joined #RubyOnRails
[17:40:38] mdw: has joined #RubyOnRails
[17:40:53] musicnode: has joined #RubyOnRails
[17:41:02] dionysus69: has joined #RubyOnRails
[17:41:07] reckoner: i get this weird current_user error from pundit.
[17:41:26] fox_mulder_cp: has joined #RubyOnRails
[17:41:54] antgel: has joined #RubyOnRails
[17:42:05] jtong: has joined #RubyOnRails
[17:44:26] matthewd: theslow1: Did you find the problem?
[17:44:27] greenhat: The pundit helper methods (#authorize, #policy) expect there to be a #current_user method available to know what user to authorize the action against.
[17:45:16] reckoner: yeah, there is a user in my interactor context which is why this gets a little messy.
[17:45:31] Lewix: What am I doing wrong https://gist.github.com/6ewis/9f48c519fd35fa4a255c
[17:45:33] theslow1: matthewd, not yet, 'method_dictionary.rb' wants to include include `DataShift::Logging`
[17:45:37] AnomalousBit: has joined #RubyOnRails
[17:45:41] reckoner: with interactors, you access object like context.foo_bar_user
[17:46:07] smathy: Lewix, well this is definitely wrong: https://gist.github.com/6ewis/9f48c519fd35fa4a255c#file-application-js-L5
[17:46:19] matthewd: theslow1: Yeah.. it is actually a bug in the gem
[17:46:20] theslow1: but its undefined.. however, when I run `gem list` I have datashift 0.15.0 installed.
[17:46:22] safety_cut: has joined #RubyOnRails
[17:46:41] Lewix: smathy: lol i put it for you guys.
[17:46:56] Lewix: dopie: hey
[17:47:12] theslow1: and datashift does a Logging module defined under logging.rb
[17:47:24] smathy: Lewix, don't do that, show actual code.
[17:47:26] Lewix: smathy: basically React is unavailable
[17:47:35] matthewd: theslow1: Right, but that file hasn't been required yet
[17:47:45] Lewix: smathy: well I show actual code + line of file - it won't kill you
[17:48:12] B1n4r10: has joined #RubyOnRails
[17:48:52] AnomalousBit: Hey fellow railers, could I get some advice on how to accomplish a has_one through has_many relationship? I've got lots of ways of handling it... without ActiveRecord unfortunately. -> https://gist.github.com/AnomalousBit/b9360a19d7ea1980d027
[17:49:19] greenhat: reckoner, you can implement a `pundit_user` method that does the right thing. By default `pundit_user` just delegates to `current_user`
[17:49:36] reckoner: greenhat, yes.
[17:49:41] reckoner: that's they answer i was looking for.
[17:49:50] matthewd: AnomalousBit: def latest_answer; answers.latest.first; end
[17:50:01] fmcgeough: has joined #RubyOnRails
[17:50:32] AnomalousBit: matthewd: that won't permit includes / eager loading, which is the point, sorry
[17:50:35] AnomalousBit: thanks though
[17:50:42] herbst: has joined #RubyOnRails
[17:50:44] greenhat: reckoner, No problem. I suggest reading the pundit code too. It is really lightweight and pretty easy to understand.
[17:50:59] reckoner: that's good call.
[17:52:52] matthewd: AnomalousBit: Ah, yeah.. you're not going to be able to do that. The queries needed are specific enough that AR would have to be going measurably out of its way to support it.
[17:54:35] AnomalousBit: matthewd: thanks again for looking at it. I have the query working using Arel::arel_table, but I haven't seen a way to massage arel_table back into ActiveRecord::Relation for the scope.
[17:55:40] AnomalousBit: Is the query really that bad? A double join with a group by and select max(created_at)? (or distinct on() order by, in Postgres)
[17:55:46] bronson: has joined #RubyOnRails
[17:55:50] kies^: has joined #RubyOnRails
[17:56:30] bePolite: has joined #RubyOnRails
[17:56:52] hahuang65: has joined #RubyOnRails
[17:57:10] bePolite: has joined #RubyOnRails
[17:57:25] solars: has joined #RubyOnRails
[17:57:31] sleungcy: has joined #RubyOnRails
[17:58:56] AnomalousBit: so, if matthewd is correct and AR won't do it, what do you all prefer to see? an Arel class building a query? sql views with associated models? inline sql in the model?
[17:59:35] User458764: has joined #RubyOnRails
[17:59:48] matthewd: grouping/distincting can interfere with whatever else is going on in the query, in the general case (at the most obvious: what if there's a user-provided grouping?)
[18:01:18] matthewd: Personally, I think I'd write it using Answer.latest_by_student
[18:01:25] Macaveli: has joined #RubyOnRails
[18:03:24] guacamole: has joined #RubyOnRails
[18:03:53] pawnbox: has joined #RubyOnRails
[18:04:21] matthewd: AnomalousBit: answers = Answer.latest_by_student.where(tests: { student_id: students }).index_by(&:student_id); students.each do |student| ... answer = answers[student.id]; ... end
[18:04:30] DoubleMalt: has joined #RubyOnRails
[18:04:39] AnomalousBit: yeah, my best method at the moment is to call Answer.connection.select_all with my arel generated query. This just feels wrong. I still get the same number of queries as I would eager loading the relationship, i just have to do the lookups manually
[18:04:51] mikecmpbll: has joined #RubyOnRails
[18:05:57] AnomalousBit: matthewd: Thanks for the suggestion. I prefer to avoid students.each though, i don't need to instantiate all the models to find the associated model
[18:06:21] blackmesa: has joined #RubyOnRails
[18:06:49] matthewd: That was "where-ever you use your collection of students you would otherwise have done the .includes on..."
[18:07:51] AnomalousBit: hmmm, food for thought
[18:08:20] matthewd: (if you don't have a 'students.each' *somewhere*, then you don't need the includes in the first place)
[18:08:31] AnomalousBit: I'm not sure what is more WTF-fy, piece-mealing the association or just getting an array and calling answers[student.id]
[18:10:11] AnomalousBit: I am using students.each, but it's in my view, not the place to be tacking on AR associations
[18:10:11] theslow1: matthewd, downgraded to datashift 0.12.0 and everything works
[18:10:28] theslow1: matthewd, thanks for your suggestions earlier
[18:10:39] herbst: has joined #RubyOnRails
[18:10:50] hahuang65: has joined #RubyOnRails
[18:10:56] matthewd: theslow1: It's fixed on master, too... but there hasn't been a release in 18 months, so ??\_(???)_/??
[18:11:15] kirillzh: has joined #RubyOnRails
[18:11:59] bePolite: has joined #RubyOnRails
[18:11:59] bePolite: has joined #RubyOnRails
[18:12:10] tildes: has joined #RubyOnRails
[18:15:32] sonofdirt: has joined #RubyOnRails
[18:18:40] Maletor: has joined #RubyOnRails
[18:20:02] webdestroya: has joined #RubyOnRails
[18:20:47] k13nox: has joined #RubyOnRails
[18:21:13] shibabu: has joined #RubyOnRails
[18:21:28] par[a]digm: has joined #RubyOnRails
[18:21:43] mordof_work: has joined #RubyOnRails
[18:22:21] bePolite_: has joined #RubyOnRails
[18:24:53] musicnode: has joined #RubyOnRails
[18:27:18] yardenbar: has joined #RubyOnRails
[18:27:33] tvw: has joined #RubyOnRails
[18:28:07] habitullence: has joined #RubyOnRails
[18:28:50] djellemah_: has joined #RubyOnRails
[18:29:17] safety_cut: has joined #RubyOnRails
[18:29:29] habitullence: If I'm doing a request spec on a controller that's used as parent for engine, does anyone know why I get /engien/url/app/url when I use main_app.root_url?
[18:29:37] habitullence: Been bugging me all day
[18:30:28] PedramT: has joined #RubyOnRails
[18:31:22] Axilla: has joined #RubyOnRails
[18:31:37] learnme_: has joined #RubyOnRails
[18:31:47] guacamole: has joined #RubyOnRails
[18:33:18] habitullence: Probably not that easy just need one clue out of 600 brains
[18:33:50] djellemah__: has joined #RubyOnRails
[18:34:14] herbst: has joined #RubyOnRails
[18:34:53] AnomalousBit: habitullence: /config/routes.rb && rake routes are the only clues I have to offer, but it sounds like you're using something different
[18:35:54] AnomalousBit: you could also set a breakpoint (debugger / byebug) and take a look at your request object
[18:36:24] AnomalousBit: see if you were referred (redirected) to where you mentioned
[18:36:26] habitullence: Thanks AnomalousBit.. It's more like a test running in an engine is doing something that I didn't expect with redirect_to.. My debugger was broken earlier, tomorrow I'll get it fixed and start going through source to see what's going on
[18:36:41] chouhoulis: has joined #RubyOnRails
[18:37:15] DigitalDarwin: has joined #RubyOnRails
[18:37:27] habitullence: main_app.something_path works in the engine controller just not in the test. Very little around on testing engine integration.. Head scratching will continue
[18:38:23] jxs_: has joined #RubyOnRails
[18:39:53] musicnode: has joined #RubyOnRails
[18:41:02] djellemah_: has joined #RubyOnRails
[18:45:35] mdw: has joined #RubyOnRails
[18:45:45] DoubleMalt: has joined #RubyOnRails
[18:46:40] tyrbo: has joined #RubyOnRails
[18:48:17] nertzy2: has joined #RubyOnRails
[18:49:21] Frem: has joined #RubyOnRails
[18:52:13] ur5us: has joined #RubyOnRails
[18:52:57] cnk: has joined #RubyOnRails
[18:53:31] mordof_work: has joined #RubyOnRails
[18:54:03] pawnbox: has joined #RubyOnRails
[18:55:10] Palsson: has joined #RubyOnRails
[18:56:33] alexhartley: has joined #RubyOnRails
[18:56:36] herbst: has joined #RubyOnRails
[18:56:57] ascarter: has joined #RubyOnRails
[18:58:02] baweaver: has joined #RubyOnRails
[18:58:04] safety_cut: has joined #RubyOnRails
[18:58:14] manfrin: has joined #RubyOnRails
[19:00:09] ascarter: has joined #RubyOnRails
[19:02:04] ascarter: has joined #RubyOnRails
[19:02:25] musicnode: has joined #RubyOnRails
[19:03:27] hobodave: has joined #RubyOnRails
[19:09:06] jfelchner_: has joined #RubyOnRails
[19:09:36] ryanRT1: has joined #RubyOnRails
[19:10:09] ryanRT1: has joined #RubyOnRails
[19:10:22] SloggerKhan1: has left #RubyOnRails: ()
[19:10:30] hahuang65: has joined #RubyOnRails
[19:10:31] baweaver: has joined #RubyOnRails
[19:11:18] jxs_: has joined #RubyOnRails
[19:11:30] Hans267: has joined #RubyOnRails
[19:12:18] aegis3121: has joined #RubyOnRails
[19:12:38] [Butch]: has joined #RubyOnRails
[19:12:43] Moeh: has joined #RubyOnRails
[19:13:20] chubijs: has joined #RubyOnRails
[19:13:43] bronson: has joined #RubyOnRails
[19:14:20] kmckelvi1: has joined #RubyOnRails
[19:14:29] bePolite_: has joined #RubyOnRails
[19:15:14] par[a]digm: has joined #RubyOnRails
[19:15:22] lemur: has joined #RubyOnRails
[19:15:23] kitsuneyo: has joined #RubyOnRails
[19:18:09] disgrntld: has joined #RubyOnRails
[19:19:20] juddey: has joined #RubyOnRails
[19:20:34] sdwrage: has joined #RubyOnRails
[19:21:30] herbst: has joined #RubyOnRails
[19:25:26] guacamole: has joined #RubyOnRails
[19:26:36] aarkerio: has joined #RubyOnRails
[19:27:20] okdas: has joined #RubyOnRails
[19:27:20] okdas: has joined #RubyOnRails
[19:28:00] Graphettion: has joined #RubyOnRails
[19:29:04] [Butch]: has joined #RubyOnRails
[19:30:51] moeabdol: has joined #RubyOnRails
[19:31:36] bronson: Curious about duplicate jobs in ActiveJob.
[19:32:21] guacamole: has joined #RubyOnRails
[19:33:03] bronson: My app generates and serves PDFs. If the PDF is rendered, the webserver serves it directly. If not, I fire off a job to perform the render.
[19:33:32] bronson: Problem is, there's a window where someone could make ten requests for the same PDF, and launch ten identical render jobs.
[19:33:56] pawnbox: has joined #RubyOnRails
[19:34:08] bronson: Does ActiveJob offer deduping or something like that? (googling suggests the answer is: no)
[19:36:38] safety_cut: has joined #RubyOnRails
[19:37:26] safety_cut: has joined #RubyOnRails
[19:38:08] Cuedain: has joined #RubyOnRails
[19:38:32] Limix: has joined #RubyOnRails
[19:38:57] baweaver: has joined #RubyOnRails
[19:39:29] herbst: has joined #RubyOnRails
[19:39:30] mostlybadfly: has joined #RubyOnRails
[19:39:34] smathy: Correct, your jobs themselves should be idempotent.
[19:40:05] sandstrom: has joined #RubyOnRails
[19:40:16] meoblast001: has joined #RubyOnRails
[19:40:56] habitullence: has joined #RubyOnRails
[19:41:29] kitsuneyo: has joined #RubyOnRails
[19:41:37] bronson: smathy: that makes sense... but is there a good way to ensure I don't launch 20 identical jobs?
[19:42:30] guacamole: has joined #RubyOnRails
[19:42:32] smathy: bronson, at least one AJ backend, Sidekiq (the Enterprise version) allows for unique jobs.
[19:43:17] qejk: has joined #RubyOnRails
[19:43:29] Aherin: has joined #RubyOnRails
[19:45:06] smathy: bronson, it's also not hard to use the Sidekiq API to search for or delete pending scheduled jobs: https://github.com/mperham/sidekiq/wiki/API#scheduled Although this is a brute search of all scheduled jobs, so performance is O(n)
[19:47:49] bronson: huh, interesting. Hadn't really considered the backend yet. Was probably going to go with delayed_job just on fewer moving parts.
[19:47:56] elaptics`away: has joined #RubyOnRails
[19:48:34] bronson: But since I'm going to add Redis to my stack Any Day Now.... Maybe I should go with Sidekiq. Or Resque.
[19:48:50] smathy: That additional moving part, ie. redis, is a huge improvement and a very simple part to install/manage - but ok, I don't know anything about DJ's API for this sort of thing.
[19:48:50] bronson: The tyranny of choice. :-/
[19:49:01] lacrymology: has joined #RubyOnRails
[19:49:08] baweaver: has joined #RubyOnRails
[19:49:16] rvanlieshout: has joined #RubyOnRails
[19:49:42] bronson: Yep, just haven't needed Redis's caching yet. Most of the site can be rendered and served statically.
[19:49:48] learnme_: whats the usual base response time for a rails app on a 2GB 1CPU VM with apache and passenger? I'm getting 1s response times loading up a blank page with no queries...
[19:50:06] bronson: learnme_: yeah that's way too long, even for devmode.
[19:50:25] smathy: learnme_, sounds like it's starting the app as well.
[19:50:44] sonofdirt: has joined #RubyOnRails
[19:50:54] guacamole: has joined #RubyOnRails
[19:51:00] learnme_: How would I go about debugging it?
[19:51:16] learnme_: smathy: what do you mena?
[19:51:37] learnme_: my log file shows the view getting rendered in 50ms...
[19:51:49] learnme_: but, my browser is taking 1s over localhost
[19:51:49] bronson: smathy: so, which one? Resque or Sidekiq?
[19:52:04] learnme_: I haven't ever experienced this before with any other VM I've used.
[19:52:04] smathy: learnme_, well your app and all the gems it depends on are loaded into memory at some point, many app engines do that on the first request, that takes a lot longer than subsequent requests.
[19:52:07] bronson: learnme_: what about further requests? hit reload a few times.
[19:52:18] learnme_: still that persistent 1s
[19:52:47] smathy: bronson, between those two there's no question, sidekiq is a superior superset to resque.
[19:52:58] learnme_: Completed 200 OK in 377ms (Views: 161.5ms | ActiveRecord: 6.0ms)
[19:52:58] bronson: how many workers are you running? are you blowing your memory and swapping?
[19:53:18] learnme_: looking at htop, I'm at 20% mem usage and 5% cpu usage
[19:53:29] goodcodeguy: has joined #RubyOnRails
[19:53:45] bronson: smathy: and it's not much more complex? sounds good, I'll start looking there.
[19:53:46] dionysus69: has joined #RubyOnRails
[19:53:53] smathy: bronson, no more complex.
[19:53:59] matthias_: has joined #RubyOnRails
[19:54:06] learnme_: actually, during the request the CPU usage shoots up to 57%
[19:54:48] smathy: learnme_, you sure your app is running in "production" env?
[19:54:52] evenix: has joined #RubyOnRails
[19:54:59] learnme_: it's running in development
[19:55:14] smathy: learnme_, ok, so that's not surprising then.
[19:55:20] learnme_: want me to swap to production
[19:55:22] bronson: well, it's kinda surprising.
[19:55:22] learnme_: and then retry?
[19:55:29] bronson: sounds like learnme_ has some heavy deps or something.
[19:55:48] smathy: bronson, not on a single core with who-knows what disk contention.
[19:55:53] bronson: yea, no point to benchmarking anything in dev mode.
[19:56:05] guacamole: has joined #RubyOnRails
[19:56:23] MarkAValdez: has joined #RubyOnRails
[19:56:27] bronson: oh true... remembering the insane delays I got over Linode's oversubscribed NAS.
[19:56:27] B1n4r10: has joined #RubyOnRails
[19:56:46] bronson: (they fixed it when I complained)
[19:57:00] nettoweb: has joined #RubyOnRails
[19:57:20] smathy: learnme_, other than when debugging some bizarre problem that happens only in production env, I can't think of any good reason to run a production app in development environment.
[19:57:47] smathy: bronson, plus who-knows-what assets.
[19:58:01] learnme_: oh, I'm not running on prod
[19:58:05] learnme_: I'm on a local VM
[19:58:12] learnme_: im just profiling the application
[19:58:15] learnme_: and I needed a baseline
[19:58:45] herbst: has joined #RubyOnRails
[19:59:13] smathy: learnme_, well, now you have a baseline for your app running on that VM in development mode.
[19:59:32] smathy: learnme_, you can tell any developers you have on single cores with 2GB of RAM what to expect.
[20:00:56] chr5: has joined #RubyOnRails
[20:01:04] smathy: learnme_, there's a massive difference between development and non-development environments.
[20:01:24] learnme_: now im at 100ms
[20:01:26] nettoweb: has joined #RubyOnRails
[20:01:26] learnme_: in production
[20:01:51] learnme_: What changes when I change that environment variable?
[20:02:00] learnme_: What causes that drastic of a change?
[20:02:11] bronson: smathy: and there's https://github.com/mhenrixon/sidekiq-unique-jobs ... which is cheaper than $2000/year.
[20:02:32] bronson: learnme_: development mode reloads the app on each request
[20:02:54] bronson: so you don't need to restart your server after changing (most) files.
[20:03:55] pawnbox: has joined #RubyOnRails
[20:03:57] smathy: bronson, nice one.
[20:04:12] _djbkd: has joined #RubyOnRails
[20:04:33] bronson: ok, I'll give that a shot. thanks smathy.
[20:06:42] HenriettaSalt: has joined #RubyOnRails
[20:08:36] Cohedrin: has joined #RubyOnRails
[20:08:38] stannard_: has joined #RubyOnRails
[20:09:02] smathy: bronson, you're welcome.
[20:10:22] mordof_work: has joined #RubyOnRails
[20:11:45] ryanRT: has joined #RubyOnRails
[20:12:25] ryanRT: has joined #RubyOnRails
[20:12:55] evenix: has joined #RubyOnRails
[20:14:30] FernandoBasso: has joined #RubyOnRails
[20:14:46] Andr3as: good evening everyone
[20:14:53] stannard: has joined #RubyOnRails
[20:15:33] stannard: has joined #RubyOnRails
[20:16:33] Andr3as: lets say i have a stock which is a constituents of many indexes, now lets say i want to set all the indexes in an admin interface. what do you guys say is the best "technique" to set multiple values on a gui and save that as a many to many relationship?
[20:16:42] Andr3as: i have a many to many model already
[20:16:49] Andr3as: its just about the gui
[20:19:03] chr5: Hi guys....
[20:19:07] chr5: I need code help
[20:19:30] chr5: I am beginner programmer
[20:20:33] chr5: I try to develop a simple app with relations between Post, Comments and user
[20:20:50] chr5: I am trying to develop a Form for Comments
[20:21:04] chr5: but when I create the comment, the user_id is not comming
[20:21:12] chr5: anybody can help me?
[20:22:06] cnk: how were you intending to get the user_id?
[20:22:31] chr5: where can i show my little code?
[20:22:36] tvw: has joined #RubyOnRails
[20:23:00] cnk: gist, or whatever
[20:23:02] bronson: still boo. http://gist.github.com
[20:24:16] shibabu: has joined #RubyOnRails
[20:24:36] chr5: <%= semantic_form_for ([@design, @design.comments.build]) do |formulario| %>
[20:24:36] chr5: <%= formulario.text_field :title %>
[20:24:37] chr5: <%= formulario.text_field :body %>
[20:24:37] chr5: <%= formulario.submit %>
[20:24:37] chr5: <% end %>
[20:24:46] bronson: no, don't paste yere
[20:24:51] chr5: I have this code in show.html.erb
[20:24:54] chr5: where can i paste?
[20:25:12] NBarnes: chr5; gist
[20:25:31] MarkAValdez: has joined #RubyOnRails
[20:26:19] ur5us: has joined #RubyOnRails
[20:27:05] chr5: Mi form code is here: https://gist.github.com/anonymous/88f3d7838b76d9bbf5e8
[20:27:15] chr5: My form code i mean
[20:27:30] chr5: Design is the post (Designs)
[20:27:45] arup_r: has joined #RubyOnRails
[20:28:07] evenix: has joined #RubyOnRails
[20:28:08] cnk: Is everyone who will comment logged in?
[20:28:23] chr5: I really dont know where i can asign user_id in my form
[20:28:31] chr5: maybe in controller?
[20:28:41] NBarnes: Why does this company want to hire me for a PHP / node.js position? 0_o
[20:28:46] cnk: I would probably put the user stuff in the controler
[20:28:55] mdw: has joined #RubyOnRails
[20:28:57] safety_cut: has joined #RubyOnRails
[20:29:02] NBarnes: (amount of node and PHP I speak == 0)
[20:29:11] chr5: I share my controller, ok? wait a second please
[20:29:24] cnk: post your form, create the comment object, then add the user_id using whatever your authentication framework gives you. Often there is a current_user variable...
[20:29:44] baweaver: has joined #RubyOnRails
[20:31:24] a1fa: has joined #RubyOnRails
[20:31:37] chr5: My comments controller: https://gist.github.com/anonymous/49f1f3d70699c12448f4
[20:31:38] a1fa: is it possible to combine two ransack results?
[20:32:12] chr5: Where i post, i am in the design show view....
[20:32:27] chr5: When I make a comment, i am in the design view....shop view
[20:32:34] yfeldblum: has joined #RubyOnRails
[20:33:01] cnk: chr5: that seems fine - but you should not have to have line 6
[20:33:03] chr5: I need the form, take my user_id, and my design_id and put in the new comment
[20:33:22] cnk: If this is not working, what error are you seeing in your logs?
[20:33:51] chr5: when i use rails console to check the new comment
[20:33:58] kitsuneyo: has joined #RubyOnRails
[20:33:59] chr5: the user_id is not comming
[20:34:15] netzfisch: has joined #RubyOnRails
[20:34:25] chr5: The comment has been created successfully
[20:34:33] chr5: but the with not user_id
[20:34:45] cnk: in your controller, put: puts "current user is #{current_user.inspect}" and then look at the logs for your server
[20:34:49] chr5: without user_id
[20:34:50] marr: has joined #RubyOnRails
[20:35:12] cnk: What authentication framework are you using?
[20:35:21] chr5: you mean in comments_cotroller file? or in console?
[20:35:34] sushmordio: has joined #RubyOnRails
[20:35:50] cnk: add the puts to your comments_controller file then look at logs/development.log
[20:35:58] chr5: ok, i try
[20:36:17] cnk: or if you are using rails server, it will be in your terminal
[20:36:46] flashpoint9: has joined #RubyOnRails
[20:36:57] chr5: I play in local
[20:37:03] chr5: what is the best? rails server?
[20:37:15] chr5: rails console, i mean?
[20:37:33] mordof_work: has joined #RubyOnRails
[20:37:39] sushmordio: is it a bad idea to mix an API and views in the same app? i'd like to serve my app as an api but also have some sort of dashboard for interacting with a ui
[20:37:39] cnk: not rails console, it does not have an http server so you will not have current_user
[20:37:53] cnk: you have to do this using the controller and a web request
[20:38:31] cnk: sushmordio: I think it's fine - I have done it for several small APIs
[20:38:33] chr5: NameError: undefined local variable or method `current_user' for main:Object
[20:38:57] chr5: wait, it was in console
[20:38:58] cnk: so there is your issue
[20:39:12] cnk: right- as I said, can't use console for this
[20:39:20] chr5: I try in the app, where i put this code?
[20:39:28] chr5: in comments_controller ?
[20:39:54] chr5: in show view?
[20:40:20] bronson: has joined #RubyOnRails
[20:40:56] Malgorath: probably a dumb question but if I have articles belong_to :user and user has_many articles, in a view, how would I do article.user.email (basically get a parent attribute)
[20:41:37] atomical_: has joined #RubyOnRails
[20:41:43] evenix: has joined #RubyOnRails
[20:42:14] kitsuneyo: has joined #RubyOnRails
[20:42:36] djellemah__: has joined #RubyOnRails
[20:42:42] cnk: chr5: put it in your create action - that is where you need to know if current_user exists
[20:43:04] chr5: create action? you mean, the form?
[20:43:10] cnk: Malgorath :that chaining should work fine
[20:43:24] herbst: has joined #RubyOnRails
[20:43:32] cnk: No put it as line 5 in https://gist.github.com/anonymous/49f1f3d70699c12448f4
[20:44:03] mdw: has joined #RubyOnRails
[20:44:12] cnk: see my comment
[20:45:46] Malgorath: cnk, https://gist.github.com/malgorath/bb7ffe7732ca9426b429
[20:46:57] cnk: Malgorath: should be fine - except that if you ever have an article without a user, line 21 in your index will error
[20:47:00] chr5: @chk do i see the log now right?
[20:47:18] Malgorath: cnk, ah It hink the figured out my update isn't working >.< for users
[20:47:19] guacamole: has joined #RubyOnRails
[20:47:45] cnk: chr5: how are you running your rails server?
[20:48:01] cnk: did you use 'rails server' command?
[20:48:13] cnk: if so, the output will be on the terminal
[20:48:27] zotherstupidguy: has joined #RubyOnRails
[20:48:35] cnk: after the POST info for submitting your form
[20:48:53] sonofdirt: has joined #RubyOnRails
[20:49:51] chr5: yes I used rails server command
[20:49:55] djellemah_: has joined #RubyOnRails
[20:50:05] chr5: log file is a long file !
[20:51:04] cnk: if you used rails server, you should be able to look at the terminal you used to start the server and the output you want will be at the end
[20:51:19] chr5: Yes, current user was there...
[20:51:22] cnk: and will update when you make a new request
[20:51:28] chr5: It respond with data
[20:51:41] chr5: It responded with user data
[20:51:56] cnk: OK good. Now you can also log the created comment in the same way. And check that user_id got put where you wanted it
[20:52:23] chr5: throught console is right?
[20:52:26] cnk: and then we can talk about why you should not be passing in params[:comment]
[20:52:27] chr5: Comment.last ?
[20:52:42] Grundell: has joined #RubyOnRails
[20:53:07] chr5: ok I cheked in console the last comment
[20:53:12] chr5: user_id = 2 is right !!
[20:53:17] chr5: but design_id is nil !
[20:53:26] chr5: i need the design_id (the post id)
[20:53:40] chr5: how can i get it?
[20:53:44] pawnbox: has joined #RubyOnRails
[20:53:45] sandstrom: has joined #RubyOnRails
[20:54:13] workmad3: has joined #RubyOnRails
[20:54:34] cnk: The design_id will probably need to be passed in from the form. Unless your comments routing is nested under design
[20:54:51] chilerails: has joined #RubyOnRails
[20:54:58] cnk: and when you get this sorted, please read this: http://guides.rubyonrails.org/action_controller_overview.html#strong-parameters
[20:55:18] B1n4r10: has joined #RubyOnRails
[20:55:47] evenix: has joined #RubyOnRails
[20:56:05] ferr: has joined #RubyOnRails
[20:56:43] baweaver: has joined #RubyOnRails
[20:56:51] pwnd_nsfw: has joined #RubyOnRails
[20:58:15] chr5: cnk, who can i pass the design_id in the form? Can you help me whith this?
[20:58:56] kitsuneyo: has joined #RubyOnRails
[20:59:08] HenriettaSalt: has joined #RubyOnRails
[20:59:14] cnk: <%= hidden_field_tag(:design_id,) %>
[20:59:40] cnk: Look up exact details in the API or guides http://guides.rubyonrails.org/form_helpers.html
[21:00:34] baweaver: has joined #RubyOnRails
[21:01:49] herbst: has joined #RubyOnRails
[21:01:57] herbst: has joined #RubyOnRails
[21:02:08] chr5: do you mean that? https://gist.github.com/anonymous/b559489022010046ac23
[21:02:45] Quintasan: Can I use accepts_nested_attributes_for on the belongs_to side of association?
[21:02:52] bePolite_: has joined #RubyOnRails
[21:04:06] _djbkd: has joined #RubyOnRails
[21:04:53] cnk: chr5: I probably mean: hidden_field :design, :id but I am not sure since I don't use semantic_form_for and don't understand the list in line 1
[21:05:07] sleungcy: has joined #RubyOnRails
[21:05:27] cnk: you might be able to just do formulario.hidden_field :design_id
[21:09:15] stannard: has joined #RubyOnRails
[21:11:21] PedramT_: has joined #RubyOnRails
[21:12:01] evenix: has joined #RubyOnRails
[21:12:36] chr5: cnk: I was trying this code, but i dont really understand the form tags: http://stackoverflow.com/questions/7949097/rails-3-1-post-comment-model-for-blog-how-to-submit-comments-via-ajax
[21:13:11] chr5: I can change the form, I dont mind
[21:13:36] chr5: I just want to understand how i can get both parameter, user_id and design_id in the same time
[21:13:53] chr5: at the same time
[21:13:54] cnk: what does ([@design, @design.comments.build]) do?
[21:13:59] chr5: i dont know
[21:14:10] chr5: I taked here: http://stackoverflow.com/questions/7949097/rails-3-1-post-comment-model-for-blog-how-to-submit-comments-via-ajax
[21:14:12] cnk: can you update your show.html.erb gist with the html from the rowser
[21:14:18] cnk: browser
[21:15:11] snowy: has joined #RubyOnRails
[21:15:33] chr5: do you mean, the full content of shop.html.erb?
[21:15:49] chr5: or do you mean, i make a request in the firefox, and paste all the html code?
[21:17:11] chr5: do you want to see the form html tags that this rails code produce , right?
[21:18:01] cnk: just the part between the form open and close tag
[21:18:07] moeabdol: has joined #RubyOnRails
[21:18:08] cnk: I dn't care about your layout, etc
[21:18:59] tris: has joined #RubyOnRails
[21:19:00] hahuang65: has joined #RubyOnRails
[21:19:14] kies^: has joined #RubyOnRails
[21:19:32] tyrbo: has joined #RubyOnRails
[21:20:29] _djbkd: has joined #RubyOnRails
[21:21:39] herbst: has joined #RubyOnRails
[21:21:55] evenix: has joined #RubyOnRails
[21:22:24] chr5: https://gist.github.com/chr5/34e22ade7bc0be0c556e
[21:22:58] chr5: line 248 i guess
[21:23:09] cnk: chr5: I need to go. but you need to fiddle with hidden_field options until line 249 has the actual design id in it
[21:23:20] hannelita: has joined #RubyOnRails
[21:23:35] cnk: value = 34 or whatever
[21:24:14] hobodave: has joined #RubyOnRails
[21:24:34] chr5: I understand
[21:24:34] kirillzh: has joined #RubyOnRails
[21:25:02] chr5: thank you very much Cintya
[21:29:10] sneakerhax: has joined #RubyOnRails
[21:31:27] tenderlove: has joined #RubyOnRails
[21:33:27] mordof_work: has joined #RubyOnRails
[21:33:50] dexter-tzu: has joined #RubyOnRails
[21:34:41] sonofdirt: has joined #RubyOnRails
[21:35:46] PedramT: has joined #RubyOnRails
[21:38:25] sonofdirt: has joined #RubyOnRails
[21:39:00] herbst: has joined #RubyOnRails
[21:40:40] mordof_work: has joined #RubyOnRails
[21:41:32] evenix: has joined #RubyOnRails
[21:43:21] pawnbox: has joined #RubyOnRails
[21:43:32] chr5: Hey guys, Anyone can help me to send to id in a form?
[21:43:42] Radar: chr5: what have you tried so far?
[21:43:45] chr5: two ids? design_id and designer_id
[21:43:54] quazimodo: has joined #RubyOnRails
[21:43:57] chr5: Ok, I try to make a comment form
[21:44:07] chr5: like a blog, you know?
[21:44:11] chr5: I post a design
[21:44:11] kirillzh: has joined #RubyOnRails
[21:44:23] chr5: and i try to comment this design
[21:44:34] chr5: i have a form in the design show
[21:44:43] chr5: the form create a new comment
[21:45:06] chr5: Comment :belong_to a user and :belong_to a design
[21:45:33] chr5: when i create a new comment, i need a user_id (for the user that create the post)
[21:45:49] chr5: and I need a design_id (the design that is commented)
[21:46:13] netzfisch: has joined #RubyOnRails
[21:46:15] chr5: but when i execute the form in the design view, the design_id is not comming
[21:46:21] dopie: Radar: have you dealt with wicked_pdf before?
[21:46:22] chr5: can you help me to get the design_id?
[21:46:27] Radar: dopie: yes
[21:46:32] Radar: chr5: !enternotspace
[21:46:32] helpa: chr5: The enter key should not be used as a space bar. Lines on IRC can be up to 400 characters long.
[21:46:33] Radar: chr5: !gist
[21:46:33] helpa: chr5: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[21:46:45] Radar: dopie: no I can't help you.
[21:48:13] dopie: Radar: why not? :)
[21:48:27] Radar: dopie: Because I am busy and you can't afford to pull me off my task right now.
[21:48:39] dopie: Youre right :P
[21:49:14] Radar: dopie: and when I help you I often get frustrated because a) you don't show the relevant code 2) you take too long to respond 3) you don't follow instructions.
[21:49:18] Radar: So... I just give up. It's been long enough.
[21:52:04] tyrbo: has joined #RubyOnRails
[21:53:14] luis88: has joined #RubyOnRails
[21:53:29] herbst: has joined #RubyOnRails
[21:53:29] herbst: has joined #RubyOnRails
[21:54:52] mag42c: has left #RubyOnRails: ()
[21:55:51] momomomomo: has joined #RubyOnRails
[21:57:02] bePolite_: has joined #RubyOnRails
[21:57:11] aegis3121: has joined #RubyOnRails
[21:58:26] lacrymology: I have a model which belongs_to another. I want to create the parent model as a nested resource for the child, and the child needs to run some validations that include both the parent and its own fields.. will that work?
[21:59:12] guacamole: has joined #RubyOnRails
[21:59:24] lacrymology: I've been trying some things, right now I've got the relationship backwards, and I'm having issues with the future parent (current child) validating based on the other model's fields because sometimes they're not set yet on create
[22:00:37] baweaver: has joined #RubyOnRails
[22:04:55] jtong: has joined #RubyOnRails
[22:05:15] guacamole: has joined #RubyOnRails
[22:07:10] pulgalipe: has joined #RubyOnRails
[22:09:29] chr5: has joined #RubyOnRails
[22:11:31] hannelita: has joined #RubyOnRails
[22:12:17] herbst: has joined #RubyOnRails
[22:12:26] quazimodo: has joined #RubyOnRails
[22:13:13] ElFerna: has joined #RubyOnRails
[22:13:23] pawnbox: has joined #RubyOnRails
[22:13:24] jeanre: has joined #RubyOnRails
[22:15:39] jtong: has joined #RubyOnRails
[22:16:55] superlou: has joined #RubyOnRails
[22:17:17] ebbflowgo: has joined #RubyOnRails
[22:19:23] KucukMubasir: has joined #RubyOnRails
[22:19:30] zodoz: has joined #RubyOnRails
[22:20:33] jgpawletko: has joined #RubyOnRails
[22:21:16] rickmasta: has joined #RubyOnRails
[22:22:49] NBarnes: has joined #RubyOnRails
[22:23:39] mlohstroh: has joined #RubyOnRails
[22:23:49] mlohstroh: has left #RubyOnRails: ()
[22:25:24] NBarnes: has joined #RubyOnRails
[22:26:17] tyrbo: has joined #RubyOnRails
[22:26:40] aloneintheworld: has joined #RubyOnRails
[22:27:05] shibabu: has joined #RubyOnRails
[22:27:27] smathy: Don't do it!
[22:27:55] stannard: has joined #RubyOnRails
[22:28:07] uris: has joined #RubyOnRails
[22:30:06] yfeldblum: has joined #RubyOnRails
[22:30:35] evenix: has joined #RubyOnRails
[22:30:59] mrgreenfur: has joined #RubyOnRails
[22:31:55] chr5: has joined #RubyOnRails
[22:33:14] matthias_: has joined #RubyOnRails
[22:33:44] bePolite_: has joined #RubyOnRails
[22:34:46] blackmesa: has joined #RubyOnRails
[22:34:48] HenriettaSalt: has joined #RubyOnRails
[22:35:12] herbst: has joined #RubyOnRails
[22:36:10] ur5us: has joined #RubyOnRails
[22:37:08] ur5us_: has joined #RubyOnRails
[22:37:51] NBarnes: has joined #RubyOnRails
[22:37:57] user083: has joined #RubyOnRails
[22:37:57] mrgreenfur: Random question: i need to store a listing of ids on a db row, would you just push it in as text and use regex to search or use jsonb column type to make it more structured?
[22:38:51] mrgreenfur: hrm, nevermind, maybe i shoul djust make another table for it
[22:39:11] slash_nick: mrgreenfur: that's what i was thinking... "why do you _need_ to store that in one row?"
[22:39:12] cnk: in general I would make another table so I could do the mapping
[22:39:29] cnk: but if you can't, I think there is an array serializer mechanism in Rails
[22:39:37] baash05: has joined #RubyOnRails
[22:40:04] mrgreenfur: it???s an array of denormalized references for easier reporting, so i was thinking fo storing in an array type in postgres, but maybe a new table that has everythign explicitly set out will be more maintain able and less hacky
[22:40:32] k13nox: has joined #RubyOnRails
[22:40:36] mrgreenfur: the postgres array and jsonb types are a little finicky when i played with them
[22:40:48] chr5: has joined #RubyOnRails
[22:41:29] baash05: The Json isn't really supported by rails as yet.. Not fully.
[22:42:02] mrgreenfur: seems okay to me? i???m saving http request args from json to a column, but I???m not doing tons of indexing or searching inside the column, so pretty much the same as text
[22:42:05] baash05: The schema.rb file translates json to text..
[22:42:24] baash05: so rspec tests mess up..
[22:42:26] arBmind: has joined #RubyOnRails
[22:42:52] baash05: We were forced to switch to schema.sql. to support it.
[22:43:00] one_zero: has joined #RubyOnRails
[22:43:16] pawnbox: has joined #RubyOnRails
[22:43:52] bronson: has joined #RubyOnRails
[22:43:57] mrgreenfur: baash05: whats htat?
[22:44:37] baash05: You can (if you choose) change from creating schema.rb to creating a sql file instead.
[22:44:41] baash05: works about the same..
[22:47:58] Scripore: has joined #RubyOnRails
[22:50:49] Limix: has joined #RubyOnRails
[22:51:28] Graphettion: has joined #RubyOnRails
[22:53:19] baweaver: has joined #RubyOnRails
[22:54:50] herbst: has joined #RubyOnRails
[22:54:54] Nah^^: has joined #RubyOnRails
[22:54:58] Grundell: has joined #RubyOnRails
[22:56:52] webdestroya: has joined #RubyOnRails
[22:57:08] PedramT: has joined #RubyOnRails
[22:57:29] evenix: has joined #RubyOnRails
[22:58:12] chr5: has joined #RubyOnRails
[22:58:16] alexhartley: has joined #RubyOnRails
[23:01:11] kitsuneyo: has joined #RubyOnRails
[23:01:57] wethu: has joined #RubyOnRails
[23:02:19] nah: has joined #RubyOnRails
[23:02:28] moresilenter: has joined #RubyOnRails
[23:02:52] moresilenter: Hey all! Is there any trick I can do to include every association on my active record?
[23:02:54] musicnode: has joined #RubyOnRails
[23:03:07] Radar: moresilenter: yup, just specify them. It's magic!
[23:03:08] moresilenter: right now I have code like `render json: @resource, include: params[:include]`
[23:03:23] moresilenter: but without specifying them
[23:03:47] Ropeney: has joined #RubyOnRails
[23:03:49] tuelz: has joined #RubyOnRails
[23:03:55] moresilenter: I could map over the associations and get their names, but it seemed like rails would have a cleaner way to do that
[23:04:16] nah: has joined #RubyOnRails
[23:04:25] NBarnes: has joined #RubyOnRails
[23:04:32] baweaver: reflect_on_associations is the only one I can think of
[23:04:56] Radar: moresilenter: There isn't even one association you don't want to include?
[23:05:06] tuelz: I'm new to the ancestry gem, but right now I'm building up a tree, which I expect to work, but only works in weird ways. From their documentation .children should show all children, while .descendants should show direct and indirect children...only .descendants returns anything, though
[23:05:08] baweaver: then if you're really bent on having that accessible, make a generic mixin for it.
[23:05:20] moresilenter: baweaver: yeah I think that's what I'll do
[23:05:23] Radar: tuelz: steps to reproduce in a new app plzkthx
[23:05:55] moresilenter: Radar: I want to include all associations to my CMS that talks to the API
[23:05:58] nahwar: has joined #RubyOnRails
[23:06:21] moresilenter: thanks for the tips, was just hoping there'd be something like `render json: @resource, include: :all` or something
[23:06:24] Radar: hm my hints are "this seems like a bad idea" aren't getting through. Any tips?
[23:06:31] tuelz: Radar: this is just a first run, I'll do some more head scratching before I build up a new app that I expect won't exibit the same behavior :)
[23:06:41] Radar: moresilenter: Nope. Specify them all as you need them or use some reflect_on_associations to get them all.
[23:06:53] Radar: tuelz: Very likely :)
[23:07:28] tuelz: was hoping this was a common pitfall, but I'm guessing there's something weird going on...legacy code and all...yay
[23:07:38] Radar: tuelz: All code is legacy code.
[23:07:55] tuelz: Radar: not the code I'm writing tomorrow :boom:
[23:07:56] baweaver: module GenericScopes; def include_all; includes(self.reflect_on_all_associations.map(&:name)) end end;
[23:07:59] lethjakman-l: has joined #RubyOnRails
[23:08:17] Radar: baweaver: Don't need that self. there.
[23:08:21] ziyadb: has joined #RubyOnRails
[23:08:23] guacamole: has joined #RubyOnRails
[23:08:31] Radar: baweaver: also: this is for a render call
[23:08:44] Radar: baweaver: so @resource.class.reflect_on_all_associations.map(&:name)
[23:08:47] herbst: has joined #RubyOnRails
[23:08:47] herbst: has joined #RubyOnRails
[23:08:56] baweaver: I was thinking of a model level mixin
[23:09:03] Radar: Now that I've actually had breakfast (10am) I can actually do some real thinking.
[23:09:17] baweaver: I just got coffee so I'm a few clicks slow
[23:09:28] baweaver: feel free to say "wtf baweaver"
[23:09:35] rhizome: wtf baweaver
[23:09:42] manfrin_: has joined #RubyOnRails
[23:09:42] baweaver: that was fast.
[23:09:56] rhizome: i was just waiting for permission
[23:10:02] evenix: has joined #RubyOnRails
[23:10:26] baweaver: assume perpetual permission
[23:10:36] Radar: It's not wtf enough imo
[23:10:44] Radar: I've been here long enough that not much is wtf anymore
[23:11:11] Radar: Used to do "code reviews as a service" and once had an app which had so many problems the writeup was almost 40 pages
[23:11:28] quazimodo: has joined #RubyOnRails
[23:11:34] baweaver: does said service exist still?
[23:12:09] baweaver: you could call it OnMyRadar
[23:12:20] ebbflowgo: has joined #RubyOnRails
[23:12:21] Radar: yes it does: https://www.reinteractive.net/service/inspect
[23:12:42] _djbkd: has joined #RubyOnRails
[23:13:03] pawnbox: has joined #RubyOnRails
[23:14:15] workmad3: has joined #RubyOnRails
[23:14:38] guacamole: has joined #RubyOnRails
[23:15:48] tyrbo: has joined #RubyOnRails
[23:16:30] Cork: <notes></notes> (xml) becomes parameters: { "notes"=>nil }
[23:16:33] moeabdol: has joined #RubyOnRails
[23:16:40] Cork: what is the correct way to handle this?
[23:18:32] tuelz: Radar: the .children was being overwritten, hence the weirdness, in case that issue was eating you up on the inside :)
[23:19:11] Radar: tuelz: :D glad you figured it out
[23:19:16] Radar: Cork: is that not correct?
[23:19:27] jmccartie: has joined #RubyOnRails
[23:20:00] Cork: Radar: its a text field it can't be null so i'm getting sql errors
[23:20:10] Cork: and the field is "" note nil
[23:21:35] jmccartie: has joined #RubyOnRails
[23:22:51] Axilla: has joined #RubyOnRails
[23:23:00] guacamole: has joined #RubyOnRails
[23:23:33] hobodave: has joined #RubyOnRails
[23:23:39] Radar: Cork: params[:notes] ||= ""
[23:23:41] nahwar: has joined #RubyOnRails
[23:23:50] ascarter: has joined #RubyOnRails
[23:24:04] Cork: Radar: the problem is i have to do it for every key in the model
[23:24:12] cschneid_: has joined #RubyOnRails
[23:24:31] Cork: contact_name, name, email ...
[23:24:37] edgarlepe: has joined #RubyOnRails
[23:24:42] Radar: Cork: Don't you have validations on the model which catch this before it reaches the DB constraints?
[23:25:39] Cork: Radar: corrently no, but it would still make it impossible to set empty values
[23:25:43] Palsson: has joined #RubyOnRails
[23:25:50] Cork: as "" becomes nil
[23:25:56] Radar: Cork: I am not sure what the real problem being solved here is.
[23:26:20] Cork: Radar: this is an api, and empty tags becomes nil not ""
[23:26:22] tuelz: Cork: that isn't terribly hard since you're just setting it to empty string `params.each { |k,v| k ||= '' }`
[23:26:31] tuelz: but I would guess there's a better way
[23:26:37] Radar: Cork: Still shouldn't that be a validation error on your model?
[23:26:54] Cork: Radar: again, the value sent to the api sin't invalid
[23:27:00] Cork: it gets mangeled into an invalid value
[23:27:09] Radar: Ok, I give up. We're just going around in circles and I can't understand this problem.
[23:27:45] Radar: It'd be great if it was "I did X, expected Y but got Z instead"
[23:27:47] Cork: Radar: if you send <notes></notes> to an api you say "i want to reset notes to nothing"
[23:28:09] Cork: but the parser takes it "i want to change this text column to nil"
[23:28:13] tuelz: I'm guessing you're not sending html elements to your api
[23:28:17] Radar: Cork: So either: iterate through each of the params as tuelz showed you, or allow nil DB columns.
[23:28:24] Cork: tuelz: xml
[23:28:31] baweaver: expected: my ebay package; received: wild bobcat; conclusion: would not buy again
[23:28:34] Cork: Radar: ya, i can work around the parser
[23:28:43] Cork: the question is, is there a way to fix the parser
[23:28:55] tuelz: Cork: so parse the empty xml as an empty string. That can't be terribly hard to do
[23:28:56] Radar: Write your own parser.
[23:29:17] shibabu: has joined #RubyOnRails
[23:29:26] Cork: tuelz: except i have to loop all params, check if it is something that should have been a string
[23:29:29] Cork: and correct them
[23:29:30] herbst: has joined #RubyOnRails
[23:29:42] tuelz: it doesn't really make sense for a parser to interpret empty xml nodes as empty string in the first place
[23:29:43] Cork: without breaking other columns
[23:30:29] Cork: so how do you tell active model to convert it to a matching format for the column then?
[23:30:33] tuelz: and if it can come from the client as empty, why not allow null like radar was saying?
[23:30:36] Cork: cause right now the params and the model doesn
[23:30:42] Cork: *'t match
[23:30:56] Scripore: has joined #RubyOnRails
[23:31:01] Cork: tuelz: it is a text sql column
[23:31:06] Cork: it can't be null
[23:31:07] doodlehaus: has joined #RubyOnRails
[23:31:50] Radar: Yes, it can.
[23:32:09] Radar: It can be null if you remove null: false from your schema
[23:32:22] evenix: has joined #RubyOnRails
[23:32:36] kirillzh: has joined #RubyOnRails
[23:33:13] tuelz: yeah, I'm unaware of a db that doesn't allow null on text fields
[23:33:42] codepete: has joined #RubyOnRails
[23:34:11] tuelz: but I mostly only use postgres so I'm unaware with about a lot of things sql
[23:35:33] goodcodeguy: has joined #RubyOnRails
[23:37:39] juddey: hey so Radar, am I reading it correctly in that reinteractive outsource all their code reviews to your good self?
[23:37:50] Radar: juddey: No, I used to work for them.
[23:39:07] k13nox: has joined #RubyOnRails
[23:40:08] mlohstroh: has joined #RubyOnRails
[23:40:37] bePolite: has joined #RubyOnRails
[23:40:40] musicnode: has joined #RubyOnRails
[23:41:28] juddey: Radar: aah, ok. But why would I want to pay $1k when I could just post my code in this channel and get flamed for free? :D
[23:41:43] Radar: juddey: because I don't write 15 pages of flames in this channel
[23:42:08] sleungcy: has joined #RubyOnRails
[23:42:51] juddey: Radar: the end effect is the same though :D
[23:42:59] juddey: anyway good to know
[23:43:10] pawnbox: has joined #RubyOnRails
[23:44:40] `aspiRe: has joined #RubyOnRails
[23:45:26] nahwar: has joined #RubyOnRails
[23:47:10] chouhoulis: has joined #RubyOnRails
[23:47:57] quazimodo: has joined #RubyOnRails
[23:49:26] ryanRT: has joined #RubyOnRails
[23:51:01] herbst: has joined #RubyOnRails
[23:54:57] user083: How do i get nokogiri installed for osx
[23:55:14] user083: I have been reading the tutorials but it does not help
[23:56:06] ur5us: has joined #RubyOnRails
[23:56:12] evenix: has joined #RubyOnRails
[23:56:43] duncannz: has joined #RubyOnRails
[23:56:50] Craigimus: has joined #RubyOnRails
[23:57:45] duncannz: has joined #RubyOnRails
[23:58:28] PedramT: has joined #RubyOnRails
[23:59:21] guacamole: has joined #RubyOnRails