« Back to channel list

#RubyOnRails - 18 March 2016

« Back 1 day Forward 1 day »
[00:01:04] adavia: has joined #RubyOnRails
[00:03:44] Radar: pex: You might've wanted 1.week.ago.in_time_zone("Eastern Time (US & Canada)")
[00:03:52] Radar: https://gist.github.com/radar/937fa8f562b15501cf58
[00:04:16] pex: @Radar really nice, thank you!
[00:04:40] Radar: ACTION has played time zones before... and won.
[00:07:07] Pathfinder: has joined #RubyOnRails
[00:13:34] hnanon: Are mobile templates/views "better" than trying to create a single responsive set of views?
[00:13:56] hnanon: What do you gals/guys do?
[00:15:29] uglybandersnatch: has joined #RubyOnRails
[00:16:57] sevenseacat: stripe seems pretty awesome so far. looked at stripe checkout, but will be using stripe.js to create a more integrated form
[00:17:34] PedramT: has joined #RubyOnRails
[00:17:54] dopamean_: has joined #RubyOnRails
[00:18:10] pex: has left #RubyOnRails: ()
[00:18:14] hnanon: sevenseacat: I agree. Stripe makes it so easy to accept money online.
[00:18:51] baweaver: has joined #RubyOnRails
[00:19:05] twilling: has joined #RubyOnRails
[00:20:37] _Tariq: has joined #RubyOnRails
[00:21:49] fedexo: has joined #RubyOnRails
[00:23:44] chipotle: has joined #RubyOnRails
[00:27:48] Arcaire: hnanon: That sentence sounds like a shill.
[00:28:24] hnanon: LOL. It does.
[00:28:34] hnanon: But it's true.
[00:31:04] Devalo: has joined #RubyOnRails
[00:32:57] VeryBewitching: We're quite lucky these days, having the facilities we have today wrt application libraries and plugins, the internet was a scarier place when we still had to use fsockopen and write handshake code for a custom service.
[00:33:15] dalbusch1t: has joined #RubyOnRails
[00:33:36] VeryBewitching: Pre payflow pro, pre paypal days.
[00:34:47] Aherin_: has joined #RubyOnRails
[00:34:54] i8igmac: has joined #RubyOnRails
[00:35:00] Cervajz_: has joined #RubyOnRails
[00:35:01] i8igmac: has left #RubyOnRails: ("Leaving")
[00:35:18] i8igmac: has joined #RubyOnRails
[00:36:21] VeryBewitching: I just now realized, I have been on IRC, somewhere or another, for 21 years.
[00:36:29] i8igmac: can i setup a ruby script to start when rails server starts?
[00:36:37] baweaver: has joined #RubyOnRails
[00:36:44] Ropeney: VeryBewitching, i now feel young; cheers!
[00:37:21] VeryBewitching: ACTION considers drinking alright.
[00:37:39] pawnbox: has joined #RubyOnRails
[00:37:48] gz_rain: has joined #RubyOnRails
[00:40:36] kies: has joined #RubyOnRails
[00:42:33] bricker: has joined #RubyOnRails
[00:45:30] wolfravenous: has joined #RubyOnRails
[00:46:14] SteenJobs: has joined #RubyOnRails
[00:46:16] tjbiddle: has joined #RubyOnRails
[00:46:43] _Tariq: has joined #RubyOnRails
[00:48:40] Guest34101: has joined #RubyOnRails
[00:48:55] tomatoes: has joined #RubyOnRails
[00:51:23] crystal77: has joined #RubyOnRails
[00:53:17] johnflux: has joined #RubyOnRails
[00:54:19] Ikri: has joined #RubyOnRails
[00:54:21] jayp: has joined #RubyOnRails
[01:02:02] lyoshajapan: has joined #RubyOnRails
[01:15:39] lyoshajapan: Hello :-) I was wondering, how do I get checkboxes which are mapped on virtual attributes to still show in the form after validation has failed?
[01:16:27] arBmind: has joined #RubyOnRails
[01:21:44] chipotle: has joined #RubyOnRails
[01:24:56] dnewkerk: has joined #RubyOnRails
[01:27:29] pawnbox: has joined #RubyOnRails
[01:28:59] clorisu: has joined #RubyOnRails
[01:31:25] stannard: has joined #RubyOnRails
[01:31:29] statelesscode: has joined #RubyOnRails
[01:34:58] gingray: has joined #RubyOnRails
[01:36:36] sosuniverse: has joined #RubyOnRails
[01:37:28] sosuniverse: has left #RubyOnRails: ()
[01:37:50] dpg1: has joined #RubyOnRails
[01:38:01] aloneintheworld: has joined #RubyOnRails
[01:38:10] dpg1: how I can properly debug this to see which file it's barfing on: Sass::SyntaxError: Invalid CSS after "}": expected selector or at-rule, was "}"
[01:38:21] dpg1: It's causing my rake assets:precompile to barf
[01:39:31] circa1984: has joined #RubyOnRails
[01:39:55] awasum: has joined #RubyOnRails
[01:40:26] freedrull: i'm trying to test a rails app inside of a gem, kind of like devise does https://github.com/plataformatec/devise/blob/master/test/test_helper.rb#L7
[01:40:48] freedrull: doing require "rails_app/config/environment" doesnt seem to boot the app, wonder if there's anything else you have to do
[01:41:02] AntiSpamMeta: has joined #RubyOnRails
[01:41:13] daintyhands: has joined #RubyOnRails
[01:41:52] sleungcy: has joined #RubyOnRails
[01:43:09] dpg1: anyone awake? I need to debug this rake precompile
[01:43:14] dpg1: otherwise I'm boned.
[01:43:20] dpg1: Sass::SyntaxError: Invalid CSS after "}": expected selector or at-rule, was "}"
[01:44:09] RegulationD: has joined #RubyOnRails
[01:45:06] pawnbox: has joined #RubyOnRails
[01:45:23] daintyhands: has left #RubyOnRails: ()
[01:47:31] ziggy: has joined #RubyOnRails
[01:48:50] dpg1: strace barfs here: utimensat(AT_FDCWD, "/sites/baqqer/tmp/cache/assets/sprockets/v3.0/jEf5-MEvfF__YYfLe00VCvIeNh3nI7H1MBVVAHmNZ3Y.cache", NULL, 0) = 0
[01:48:59] dpg1: but that doesn't tell me where the cache was compiled from
[01:49:21] crystal77: has joined #RubyOnRails
[01:50:22] pwnd_nsfw: dpg_, yeah good luck m8
[01:50:32] pawnbox: has joined #RubyOnRails
[01:50:34] pwnd_nsfw: I don't know if there's an easy way to debug that or not
[01:50:45] pwnd_nsfw: Not from my experience..
[01:51:41] delgiudices: has joined #RubyOnRails
[01:55:59] PedramT: has joined #RubyOnRails
[01:56:36] jaequery: has joined #RubyOnRails
[01:56:39] dpg1: oh fuck my life.
[01:57:02] bronson: has joined #RubyOnRails
[01:57:15] _Tariq: has joined #RubyOnRails
[01:57:42] Arcaire: dpg_: You should probably hire a consultant if it's that important.
[01:58:35] dpg1: hahahaha
[01:58:39] dpg1: I AM THE CONSULTANT
[01:59:08] lyoshajapan: Hey, I was wondering if someone could help me with something that seems simple, but actually hard
[01:59:42] lyoshajapan: https://gist.github.com/lyosha85/633112892716d421b976 <-- I cant get the previously checkboxes to show after validation failed, nor can I get them to show in the edit action
[02:02:31] havenwood: dpg_: A missing semicolon can be a real pain.
[02:04:27] dpg1: ;) RIP in peace, amirite
[02:04:50] dpg1: I would give my left nut for a linter that helped right now.
[02:04:56] havenwood: there should be an assets bisect
[02:08:14] atrius: has joined #RubyOnRails
[02:09:50] sleungcy: has joined #RubyOnRails
[02:10:17] htmldrum: has joined #RubyOnRails
[02:12:30] liquid-silence: has joined #RubyOnRails
[02:12:31] liquid-silence: has joined #RubyOnRails
[02:15:58] stannard: has joined #RubyOnRails
[02:21:19] Guest34101: has joined #RubyOnRails
[02:22:41] chagel: has joined #RubyOnRails
[02:26:25] liquid-silence: has joined #RubyOnRails
[02:26:25] liquid-silence: has joined #RubyOnRails
[02:26:26] awasum: has joined #RubyOnRails
[02:27:13] kies: has joined #RubyOnRails
[02:28:08] Chagel_: has joined #RubyOnRails
[02:29:45] Darmani: has joined #RubyOnRails
[02:30:45] sevenseacat: has joined #RubyOnRails
[02:32:47] DmitryBochkarev: has joined #RubyOnRails
[02:33:39] Devalo: has joined #RubyOnRails
[02:35:09] IFrank00: has joined #RubyOnRails
[02:39:42] chagel: has joined #RubyOnRails
[02:44:09] clorisu: has joined #RubyOnRails
[02:45:12] RegulationD: has joined #RubyOnRails
[02:47:25] lyoshajapan: has joined #RubyOnRails
[02:48:09] i8igmac: i have a controller with a little bit of ruby to read from a pipe and display to the client.
[02:48:23] i8igmac: im not sure how to make this accessible to several clients at a time
[02:48:52] i8igmac: maybe i have forgot to configure something?
[02:53:00] roobienoobie: has joined #RubyOnRails
[02:54:36] awasum: has joined #RubyOnRails
[02:54:54] zave: has joined #RubyOnRails
[02:55:16] Oliphaunte: has joined #RubyOnRails
[02:55:37] i8igmac: when you write a basic multi threaded server in ruby, to serve multiple clients.
[02:55:39] i8igmac: Thread.start(server.accept) do |client|
[02:55:43] i8igmac: you might do something like this
[02:55:54] i8igmac: should i need to do this with my controller?
[02:56:21] Oliphaunte: has joined #RubyOnRails
[02:57:03] gbgdev: has joined #RubyOnRails
[02:57:07] AntiSpamMeta: has joined #RubyOnRails
[02:59:25] _djbkd: has joined #RubyOnRails
[03:00:19] null__: has joined #RubyOnRails
[03:00:19] null__: has joined #RubyOnRails
[03:02:10] learnprogramming: has joined #RubyOnRails
[03:06:21] jtong: has joined #RubyOnRails
[03:09:04] Arcaire: i8igmac: Is this not something you can work with websockets to accomplish?
[03:09:04] zave: has joined #RubyOnRails
[03:09:35] i8igmac: i have discovered actioncontroller::live and it seems to be working
[03:11:29] chouhoulis: has joined #RubyOnRails
[03:13:38] i8igmac: it might be easer
[03:14:29] crystal77: has joined #RubyOnRails
[03:17:32] kirillzh: has joined #RubyOnRails
[03:24:00] uglybandersnatch: has joined #RubyOnRails
[03:26:14] mrgreenfur: has joined #RubyOnRails
[03:27:25] zave: has joined #RubyOnRails
[03:34:09] chagel: has joined #RubyOnRails
[03:41:51] chagel: has joined #RubyOnRails
[03:45:52] Oliphaunte: has joined #RubyOnRails
[03:45:59] RegulationD: has joined #RubyOnRails
[03:46:25] jaequery: has joined #RubyOnRails
[03:48:23] i8igmac: Attempt to unlock a mutex which is locked by another thread
[03:48:47] i8igmac: i know what part of my controller does this but i dont understand why
[03:49:19] i8igmac: while line=file.gets
[03:49:20] Oliphaunte: has joined #RubyOnRails
[03:49:27] i8igmac: response.stream.write line
[03:52:37] IFrank00: has joined #RubyOnRails
[03:54:18] enitiz: has joined #RubyOnRails
[03:56:28] enitiz_: has joined #RubyOnRails
[03:57:07] bronson: has joined #RubyOnRails
[03:57:25] PedramT: has joined #RubyOnRails
[03:57:53] sysodaff: has joined #RubyOnRails
[04:01:32] chouhoulis: has joined #RubyOnRails
[04:03:08] Haydos: Has anyone had experience with routes not appearing after deploying via jenkins?
[04:03:30] Haydos: I have a route that goes to a static page, everything works fine on development but when going to staging it just redirects to a 404 page.
[04:04:16] helpa: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[04:04:51] Spami: has joined #RubyOnRails
[04:05:48] Peteykun: has joined #RubyOnRails
[04:05:53] awasum: has joined #RubyOnRails
[04:06:14] htmldrum: has joined #RubyOnRails
[04:06:22] Haydos: can't share because NDA, thanks anyway I guess
[04:07:09] baweaver: has joined #RubyOnRails
[04:07:43] ascarter: has joined #RubyOnRails
[04:08:53] chagel: has joined #RubyOnRails
[04:10:14] sevenseacat: i never remember that one -_-
[04:10:33] lyoshajapan: has joined #RubyOnRails
[04:10:37] helpa: NO FAKE CODE. If you're under an NDA, we cannot help you with your problem. Go hire a consultant.
[04:11:38] Arcaire: ACTION is a consultant.
[04:11:45] Arcaire: Don't hire me, though.
[04:14:35] Darmani: has joined #RubyOnRails
[04:15:02] i8igmac: while line=f.gets; puts line; end
[04:15:16] i8igmac: with this in my controller, what might you expect to happen?
[04:15:16] smoitra: has joined #RubyOnRails
[04:15:36] braincrash: has joined #RubyOnRails
[04:15:45] Ropeney: i8igmac, depends what f is
[04:16:03] i8igmac: well, im using mkfifo pipes
[04:16:30] i8igmac: f=File.open("pipe","r+")
[04:16:54] i8igmac: what ever data you send to the pipe is displayed to the client
[04:16:59] Ropeney: would keep going till EOF?
[04:17:11] i8igmac: it hangs waiting for more data.
[04:17:18] systemsgotyou: has joined #RubyOnRails
[04:17:19] Ropeney: about 65k i think it is
[04:17:31] i8igmac: i didnt know that
[04:18:03] Darmani: Hi everoyne ^^
[04:18:10] i8igmac: if i press the refresh button on the browser, things hang up for a while
[04:18:12] Darmani: everyone* jesus it's been a long day lol...
[04:18:20] i8igmac: also, i can only have one client acces this page
[04:19:27] Darmani: Is there anyone willing to mentor a newbie in the ways on Rails?
[04:19:30] Darmani: I could use some help..
[04:19:32] Ropeney: is there a way to open it as nonblocking?
[04:20:02] i8igmac: so, this is bad practice? letting a loop sit and hang
[04:20:30] Ropeney: in the controller? yes
[04:21:30] i8igmac: so, i hope to stream data to a client, if it was blocking until eof, then the stream close (i think)
[04:21:32] i8igmac: ill try non blocking
[04:21:56] Ropeney: or do it in an ajax?
[04:21:56] i8igmac: i hope to deliver a never ending stream,
[04:22:06] Arcaire: You want websockets, i8igmac
[04:22:06] Ropeney: look at websockets?
[04:22:10] Arcaire: look into actioncable
[04:22:16] Arcaire: don't try to DIY this
[04:22:19] i8igmac: almost like tailing -f /var/log/kern.og
[04:22:20] Arcaire: you will fuck yourself pretty hard
[04:22:37] i8igmac: ill check it out.
[04:22:49] Arcaire: It's honestly probably your best bet
[04:22:53] Arcaire: Long polling is an awful hack.
[04:23:13] i8igmac: i get close to a basic example, it works but malfunctions like afuck
[04:23:16] Arcaire: Websockets is the answer to how lame long polling is.
[04:23:32] Ropeney: Seems extreme Arcaire
[04:23:59] Arcaire: Ropeney: HTTP was never designed for this.
[04:24:05] Arcaire: This isn't what Tim Berners-Lee would've wanted.
[04:24:08] i8igmac: ill try and wip up a example with websockets
[04:24:17] Ropeney: lol, really extreme
[04:24:26] Arcaire: It's... not extreme at all.
[04:24:28] Arcaire: It's completely true.
[04:25:42] Ropeney: pretty sure, websockets, would also be in the same ballpark then
[04:26:03] Arcaire: The RFC for best practices for HTTP long polling (which is only an informational RFC) itself suggests that it is abuse of HTTP.
[04:26:04] i8igmac: eventmachine and such?
[04:26:12] Arcaire: i8igmac: actioncable
[04:26:12] shmilan: has joined #RubyOnRails
[04:26:15] lyoshajapan: has joined #RubyOnRails
[04:27:00] Arcaire: The RFC for WebSockets (which is a completely different protocol to HTTP) is considered a proposed standard.
[04:27:01] baweaver: ActionCable or get a Node server running
[04:27:34] baweaver: If you're rolling your own state machine for long polling, you're making a very critical mistake that will cost you later
[04:28:04] treaki__: has joined #RubyOnRails
[04:28:06] Ropeney: Arcaire, doesnt it use HTTP CONNECT?
[04:28:07] baweaver: If ActionCable doesn't work, just make a simple NodeJS Express server to handle websockets and messaging.
[04:28:20] Arcaire: Ropeney: The only relation WS has to HTTP is the same relationship that TLS has to SMTP.
[04:28:31] i8igmac: did i mention im using puma
[04:28:39] Arcaire: That is, HTTP servers (should) interpret it as an UPGRADE request, same way you can STARTTLS with SMTP.
[04:28:46] Arcaire: It then does no longer utilise HTTP.
[04:28:47] i8igmac: or does that make a difference with your guys suggestion?
[04:28:52] Arcaire: Puma is fine.
[04:29:06] Arcaire: Technically all HTTP servers that support WS are HTTP/WS servers, as they're different protocols.
[04:29:20] baweaver: quite frankly I don't trust ActionCable after ActionController::Live.
[04:29:26] Arcaire: But we just collectively call them "web servers" now to stop people rolling their eyes.
[04:29:27] drale2k: although same port 80, just sayin
[04:29:55] i8igmac: im using actioncontroller::live, all the examples i find are identical
[04:29:59] drale2k: i banged my head against the table for days because ActionCable wasn't working. Turns out Cloudflare doesn't support it yet on the lower tier plans
[04:30:37] Arcaire: drale2k: Unsurprising.
[04:30:54] Arcaire: HTTP is a far easier protocol to manage for a CDN than a streaming protocol.
[04:31:01] drale2k: Arcaire: it is surprising. They posted 2 years ago that they will add it to lower tiers "soon"
[04:31:15] Arcaire: For what it's worth I understand how Cloudflare works from the inside.
[04:31:17] drale2k: so i kinda expected they did it after 2 years
[04:31:19] Arcaire: So, for me, it's not surprising.
[04:31:33] drale2k: idk, it cost me some time to figure out
[04:31:54] chagel: has joined #RubyOnRails
[04:32:29] Arcaire: https://web.archive.org/web/20140803092441/https://support.cloudflare.com/hc/en-us/articles/200169466-Can-I-use-CloudFlare-with-websockets-
[04:32:35] Arcaire: As far back as 2014 they stated they don't support it.
[04:32:54] Arcaire: https://web.archive.org/web/20150906082551/https://support.cloudflare.com/hc/en-us/articles/200169466-Can-I-use-CloudFlare-with-WebSockets-
[04:33:05] drale2k: https://blog.cloudflare.com/cloudflare-now-supports-websockets/
[04:33:09] Arcaire: Approximately a year later, they state it's enabled for Corporate and Enterprise customers, and will be available for other customers "in the future".
[04:33:15] lyoshajapan: has joined #RubyOnRails
[04:33:44] Ropeney: Are websockets handled well on mobile connections, switching between towers?
[04:33:54] drale2k: "Over the next few months, as we get a better sense for the demand and load this feature puts on our systems, we plan to expand support for WebSockets to more customers including those at other tiers of CloudFlare's service."
[04:34:33] Arcaire: drale2k: I find it really weird that you didn't consult the KB article which one would consider the final answer with regards to the current state of <<insert thing>>.
[04:35:08] Devalo: has joined #RubyOnRails
[04:35:10] drale2k: did you read what i posted
[04:35:17] DoctorMonocular: has joined #RubyOnRails
[04:35:25] Arcaire: Nowhere did you indicate that you read the KB article I linked.
[04:35:26] drale2k: why would i not expect them to "roll it out over the next few months" afte rthat
[04:35:36] Arcaire: Probably because you'd read like a normal, capable, human being.
[04:35:56] drale2k: it's an offical blog post
[04:36:04] drale2k: that's what humans read you know
[04:36:10] Arcaire: As opposed to the official knowledgebase article? I really hope you never work on anything that I have anything to do with.
[04:36:20] drale2k: and i didn't study cloudflare, i googled and read the first article
[04:36:30] drale2k: go have a drink or something
[04:36:30] Arcaire: And you wonder why I'm incredulous about this.
[04:36:32] Arcaire: This is why.
[04:36:40] drale2k: don't be mad
[04:36:43] drale2k: get some air
[04:36:46] Ropeney: Your being a bit of a tool about it Arcaire
[04:36:50] Arcaire: Why... Why would I be mad?
[04:37:00] Arcaire: You're complaining about something that is an absolute non-problem.
[04:37:09] drale2k: complaining ?
[04:37:11] drale2k: i am saying
[04:37:16] Arcaire: No, you were complaining.
[04:37:17] drale2k: are you on drugs or something ?
[04:37:20] drale2k: typical IRC smart ass
[04:37:31] drale2k: you are pissing me off, i am going back to work
[04:37:33] Arcaire: >pass ad hominem
[04:37:42] Arcaire: Make sure you read the KB articles about your technology!
[04:37:52] Arcaire: Try not to accidentally use your text editor as a web browser or something.
[04:37:56] Arcaire: ... Unless you're using Emacs.
[04:38:07] drale2k: go back to your cave
[04:38:37] Arcaire: You take some serious personal offence to the fact you were demonstrably incorrect.
[04:38:44] Arcaire: Not really sure what to respond with to that.
[04:38:49] drale2k: you are just a smart ass prick
[04:38:51] Ropeney: where's my popcorn
[04:38:52] drale2k: and wasting my time
[04:39:13] drale2k: i mentioned something that happened and you are writing for 10 mins about it
[04:39:18] Arcaire: >didn't read the KB articles which would've cleared their issue up in ten seconds
[04:39:20] Arcaire: >"you're wasting my time"
[04:39:22] drale2k: don't you have anything better to do
[04:39:55] Arcaire: I'm capable of multitasking.
[04:40:00] Arcaire: I'm also waiting for something to finish. :)
[04:40:04] lyoshajapan: has joined #RubyOnRails
[04:40:24] drale2k: i am also waiting for something to finish
[04:40:46] Arcaire: You should read the knowledgebase articles about the technology you're working with while you wait.
[04:41:14] drale2k: i am under 40, i don't read kb articles, i read blog posts
[04:41:21] drale2k: sry it's a 2000+ thing
[04:41:25] drale2k: you wouldn't know
[04:41:27] Arcaire: I'm 21. I read both, because I'm intelligent.
[04:41:47] Arcaire: I like to have a solid understanding of what the limits of the things I'm working with are, before I work with them.
[04:42:08] drale2k: so much bs
[04:42:18] drale2k: by that logic you would have to go through everything you touch
[04:42:30] Arcaire: I more or less do.
[04:42:39] Arcaire: It's kind of my job. I work in security, not in web applications anymore.
[04:43:05] drale2k: what a pita you are
[04:43:05] _djbkd: has joined #RubyOnRails
[04:43:13] Arcaire: For people who don't read, I am. ;)
[04:43:23] Arcaire: But then I help them fix their issues.
[04:44:13] drale2k: i am sure you mom loves you
[04:44:25] Arcaire: She's quite proud, yeah.
[04:44:35] Ropeney: gettin a bit offtopic now :)
[04:44:44] Arcaire: There's no on-topic content here to disrupt, Ropeney.
[04:45:01] Ropeney: its very unwelcoming to anyone who wishes to create some though
[04:45:17] Arcaire: I've yet to see that actually be the case.
[04:45:28] drale2k: what a bot
[04:46:24] Arcaire: drale2k: Just in case you were wondering, https://support.cloudflare.com/hc/en-us is a really good resource.
[04:46:30] systemsgotyou: if you were going to start a twitter clone today with type of DB would you use?
[04:46:37] shmilan: Building my first real web app-- I have a User model that has_many FavoriteImages. I'm trying to find the top few FavoriteImages that belongs to the most users. Would the easiest way be to implement a counter_cache on the FavoriteImage table?
[04:46:47] systemsgotyou: thats what I had in mind
[04:46:52] Arcaire: systemsgotyou: I'd actually use PostgreSQL.
[04:47:04] RegulationD: has joined #RubyOnRails
[04:47:11] systemsgotyou: scalability is better with mongo right?
[04:47:13] Arcaire: Proven to not shit the bed and drop the contents of databases, for one.
[04:47:17] Arcaire: Not really, not anymore.
[04:47:24] lyoshajapan: has joined #RubyOnRails
[04:47:49] systemsgotyou: so mongodb has problems with dropping contents?
[04:48:01] Arcaire: systemsgotyou: It does in some configurations and under some circumstances.
[04:48:15] Arcaire: I'd just solidly recommend PostgreSQL to anyone who doesn't have a firm set of reasons to use anything else.
[04:49:23] Arcaire: The biggest issue with Mongo is that it's a "NoSQL", meaning roughly that there's no relations between data.
[04:49:42] Arcaire: For something like Twitter, where you have a user with tweets, a tweet with favourites/replies/retweets, you want those relations.
[04:49:43] _djbkd: has joined #RubyOnRails
[04:50:20] Arcaire: shmilan: You can do it without the counter cache but the counter cache reduces the read load.
[04:50:32] pwnd_nsfw`: has joined #RubyOnRails
[04:52:59] xardion: has joined #RubyOnRails
[04:53:06] shmilan: Arcaire: That makes sense. I had read somewhere that counter_cache was being deprecated so I just wanted to get the thumbs up before implementing. Thank you.
[04:53:25] Arcaire: I don't... think so.
[04:54:02] Arcaire: Nope. Just looked at the documentation and it looks fine, shmilan.
[04:54:04] Arcaire: http://api.rubyonrails.org/classes/ActiveRecord/CounterCache.html
[04:54:04] shmilan: Something about it being all wonky in <4.2.. Let me dig up the issue
[04:54:10] duncannz: has joined #RubyOnRails
[04:54:11] trosborn: has joined #RubyOnRails
[04:55:02] duncannz: has joined #RubyOnRails
[04:55:11] tw1sted: has joined #RubyOnRails
[04:55:12] Dreamer3: has joined #RubyOnRails
[04:55:13] JoshL: has joined #RubyOnRails
[04:55:19] Sirecote: has joined #RubyOnRails
[04:55:22] speakingcode: has joined #RubyOnRails
[04:56:02] duncannz: has joined #RubyOnRails
[04:56:09] bricker: has joined #RubyOnRails
[04:56:16] iamvery: has joined #RubyOnRails
[04:56:24] jaequery: has joined #RubyOnRails
[04:56:25] D9: has joined #RubyOnRails
[04:56:27] FLeiXiuS: has joined #RubyOnRails
[04:56:37] slash_nick: has joined #RubyOnRails
[04:57:17] shmilan: https://github.com/sgrif/rails/commit/f072980382db8cb64c09f63001ef805843db51c8
[04:57:29] mattwithoos_: has joined #RubyOnRails
[04:57:44] Kuukunen: has joined #RubyOnRails
[04:58:21] Arcaire: Yes, that's automatic counter caches, not manual ones like you're going to do.
[04:58:30] Arcaire: The feature itself actually hasn't properly worked for ages.
[04:58:42] capin: has joined #RubyOnRails
[04:58:49] Arcaire: But here - http://api.rubyonrails.org/classes/ActiveRecord/CounterCache/ClassMethods.html - you can see no deprecation warning.
[04:58:52] herenow: has joined #RubyOnRails
[04:59:18] maxmanders: has joined #RubyOnRails
[04:59:22] Arcaire: Example of deprecation warning, for reference: http://api.rubyonrails.org/classes/Kernel.html#method-i-silence_stream
[04:59:49] machuga: has joined #RubyOnRails
[04:59:55] euphoriaa: has joined #RubyOnRails
[05:00:20] pwnd_nsfw`: has joined #RubyOnRails
[05:00:35] Arcaire: All good fam.
[05:00:42] Arcaire: I got it covered by searching for FACTS
[05:00:45] Arcaire: in the documentation.
[05:01:11] lorn: has joined #RubyOnRails
[05:01:18] arathald: has joined #RubyOnRails
[05:01:33] Arcaire: drale2k Ropeney: See how quick it can be cleared up with a quick doco search?
[05:01:41] sp1rs: has joined #RubyOnRails
[05:02:36] rohit: has joined #RubyOnRails
[05:02:56] clamstar: has joined #RubyOnRails
[05:03:05] drale2k: Arcaire: sry i turned off noise in my IRC client
[05:03:07] drale2k: what did you say
[05:03:10] shmilan: Thanks a bunch!
[05:03:18] Arcaire: drale2k: just read up
[05:03:21] Arcaire: shmilan: All good yo.
[05:03:37] drale2k: make a blog post if you want me to read
[05:04:01] Arcaire: Can I tweet that
[05:04:04] jenrzzz: has joined #RubyOnRails
[05:04:05] Arcaire: that's the funniest thing I've read today.
[05:04:23] Arcaire: Pretty much sums up the vast majority of people I see in support channels lmao
[05:04:27] lyoshajapan: has joined #RubyOnRails
[05:04:43] yfeldblum: has joined #RubyOnRails
[05:05:14] arup_r: has joined #RubyOnRails
[05:05:17] drale2k: sure you can, pay me royalties
[05:05:59] yfeldblum: has joined #RubyOnRails
[05:06:07] Arcaire: I did it either way so :^)
[05:06:30] pyemkey: has joined #RubyOnRails
[05:07:25] Ropeney: Arcaire, I don't see what your implying to me?
[05:07:32] kpwarr: has joined #RubyOnRails
[05:09:23] Arcaire: Ropeney: Content in forms other than blog posts *can* be useful.
[05:09:36] Ropeney: Arcaire, did I ever say that wasn't the case?
[05:09:56] Arcaire: I was pointing the fact out either way.
[05:10:37] Ropeney: Arcaire, cool story bro :)
[05:11:34] lyoshajapan: has joined #RubyOnRails
[05:13:20] baweaver: ACTION sips tea
[05:15:12] zave: has joined #RubyOnRails
[05:17:39] lyoshajapan: has joined #RubyOnRails
[05:18:03] stannard: has joined #RubyOnRails
[05:18:49] chagel: has joined #RubyOnRails
[05:20:25] rohit: has joined #RubyOnRails
[05:21:08] djbkd: has joined #RubyOnRails
[05:21:27] sp1rs: has joined #RubyOnRails
[05:23:43] Chagel_: has joined #RubyOnRails
[05:24:56] dpg1: has joined #RubyOnRails
[05:25:00] sp1rs: has joined #RubyOnRails
[05:27:20] Rodya_: has joined #RubyOnRails
[05:27:45] i8igmac: has joined #RubyOnRails
[05:28:44] dcunit3d: has joined #RubyOnRails
[05:29:46] dcunit3d: hey so, i'm opening an older rails project. and i want to run the server so that it will respond to hostname.dev instead of the ip address.
[05:30:01] dcunit3d: i just need to do `rails s -b $IP_ADDRESS`
[05:30:09] Ropeney: rails s -b hostname.dev
[05:30:22] dcunit3d: and any hostname that routes to that ip address would work, right?
[05:30:40] dcunit3d: oh ok, that works too? i tried that, but rails isn't responding to requests
[05:30:43] ishamo: has joined #RubyOnRails
[05:31:13] Ropeney: are you using hostname.dev or somethign else?
[05:31:17] dcunit3d: hold up, i've got two config's in my /etc/hosts for api.hostname.dev
[05:31:55] lyoshajapan: has joined #RubyOnRails
[05:33:45] SteenJobs: has joined #RubyOnRails
[05:34:21] dcunit3d: cool, that worked. thanks Ropeney
[05:34:35] Ropeney: dcunit3d, np
[05:34:40] PedramT: has joined #RubyOnRails
[05:38:51] lyoshajapan: has joined #RubyOnRails
[05:39:42] lyoshajapan: has joined #RubyOnRails
[05:42:43] ur5us: has joined #RubyOnRails
[05:42:45] akshat: has joined #RubyOnRails
[05:48:10] jenrzzz: has joined #RubyOnRails
[05:54:51] arup_r: Ropeney: hw r u?
[05:55:06] Ropeney: very well arup_r :)
[05:55:19] arup_r: nice nice...
[05:57:15] janmejay: has joined #RubyOnRails
[05:57:32] strongcode: Does anyone have a good guide/site/blog/series for someone that isn't new to Rails, but would like a refresher that covers the basics/intermediates?
[05:57:54] rohit: has joined #RubyOnRails
[05:57:59] arup_r: strongcode: rails guide
[05:58:12] strongcode: that's what I figured, thanks
[05:58:29] arup_r: yeah.. that's something huge and interesting..
[05:58:59] trosborn: has joined #RubyOnRails
[05:59:21] bronson: has joined #RubyOnRails
[06:06:02] liquid-silence: has joined #RubyOnRails
[06:06:02] liquid-silence: has joined #RubyOnRails
[06:09:28] sp1rs: has joined #RubyOnRails
[06:12:34] Tref: has joined #RubyOnRails
[06:13:22] Rahul_Roy: has joined #RubyOnRails
[06:13:38] uglybandersnatch: has joined #RubyOnRails
[06:15:39] Disavowed: has joined #RubyOnRails
[06:16:10] chagel: has joined #RubyOnRails
[06:21:42] yfeldblum: has joined #RubyOnRails
[06:22:45] Macaveli: has joined #RubyOnRails
[06:23:23] Devalo: has joined #RubyOnRails
[06:23:49] crankharder: has joined #RubyOnRails
[06:25:18] errakeshpd: has joined #RubyOnRails
[06:27:01] errakeshpd: How to implement autocomplete when writing a long paragraph in a textarea ?
[06:29:06] merida: has joined #RubyOnRails
[06:29:41] merida_: has joined #RubyOnRails
[06:34:36] aganov: has joined #RubyOnRails
[06:39:58] ZiggyTheHamster: has joined #RubyOnRails
[06:40:59] arup_r1: has joined #RubyOnRails
[06:48:19] RegulationD: has joined #RubyOnRails
[06:49:23] jenrzzz: has joined #RubyOnRails
[06:50:37] srinidhi: has joined #RubyOnRails
[06:55:15] moonman: has joined #RubyOnRails
[06:55:30] moonman: what is rails' Aryan community?
[06:55:40] moonman: where rather
[06:58:44] tvw: has joined #RubyOnRails
[07:00:33] bronson: has joined #RubyOnRails
[07:00:57] Chagel_: has joined #RubyOnRails
[07:02:02] configged: has joined #RubyOnRails
[07:03:25] _djbkd: has joined #RubyOnRails
[07:03:42] ChanServ: +b *!*@
[07:03:42] ChanServ: ChanServ kicked moonman: Racist troll
[07:08:31] jas02: has joined #RubyOnRails
[07:08:59] jas02: has left #RubyOnRails: ()
[07:09:19] jstransky: has joined #RubyOnRails
[07:09:50] Disavowe1: has joined #RubyOnRails
[07:09:57] scepticulous: has joined #RubyOnRails
[07:12:55] johnflux: has joined #RubyOnRails
[07:14:02] arup_r: has joined #RubyOnRails
[07:17:09] Peteykun: has joined #RubyOnRails
[07:19:21] Pazician: has joined #RubyOnRails
[07:24:54] Pazician: has joined #RubyOnRails
[07:25:10] netzfisch: has joined #RubyOnRails
[07:26:26] ROUN1N: has joined #RubyOnRails
[07:26:59] mhoungbo: has joined #RubyOnRails
[07:28:30] Trynemjoel: has joined #RubyOnRails
[07:28:46] KnownSyntax: has joined #RubyOnRails
[07:28:48] KnownSyntax: has joined #RubyOnRails
[07:29:05] pyemkey: has joined #RubyOnRails
[07:29:19] chagel: has joined #RubyOnRails
[07:33:52] emilkarl: has joined #RubyOnRails
[07:34:25] Chagel_: has joined #RubyOnRails
[07:36:11] alaing: has joined #RubyOnRails
[07:36:28] alaing: has joined #RubyOnRails
[07:36:31] arup_r1: has joined #RubyOnRails
[07:38:00] alaing: hi, i'm building a rails plugin and it automatically includes a dummy app to run tests against. how do i add the plugin to the dummy app?
[07:39:33] sp1rs: has joined #RubyOnRails
[07:39:58] Palsson: has joined #RubyOnRails
[07:41:13] Mia: has joined #RubyOnRails
[07:41:13] Mia: has joined #RubyOnRails
[07:41:20] algernop_k: has joined #RubyOnRails
[07:43:17] Rodya_: has joined #RubyOnRails
[07:44:01] defsdoor: has joined #RubyOnRails
[07:45:14] KevinSjoberg: has joined #RubyOnRails
[07:45:38] bricker: has joined #RubyOnRails
[07:50:23] Pazician: has joined #RubyOnRails
[07:50:47] davee_: has joined #RubyOnRails
[07:51:23] pawnbox: has joined #RubyOnRails
[07:53:19] dpg1: has joined #RubyOnRails
[07:58:23] KevinSjoberg: I currently have a N+1 query for a dynamic scope. I iterate over all UnderProcesses and for each item I fetch the first UnderProcessEntity for a given day. How can I eager load/fix this problem?
[07:58:56] KevinSjoberg: The problem I'm struggling with is that usually you can move a scope into an association instead, but this scope is dynamic, i.e., excepts a parameter.
[07:59:02] netzfisch: has joined #RubyOnRails
[07:59:11] rvanlieshout: then n+1 might even be better then including it
[08:00:22] PlasmaStar: has joined #RubyOnRails
[08:00:57] KevinSjoberg: rvanlieshout: How come?
[08:01:07] hello9: has joined #RubyOnRails
[08:01:21] rvanlieshout: because conditions apply. if you would eager load you would eager load the complete collection
[08:01:47] rvanlieshout: you could create 1 collection containing all UnderProcessEntities you need
[08:02:12] hello9: anyone know of an example or tutorial that shows how to use form_for with multiple objects of the same class, on the same form?
[08:02:50] rvanlieshout: hello9: for_for is always for 1 object
[08:02:58] rvanlieshout: it can, howerver, be used for multiple nested objects
[08:03:20] yfeldblum: has joined #RubyOnRails
[08:03:24] hello9: rvanlieshout, thanks!
[08:04:39] sp1rs: has joined #RubyOnRails
[08:04:40] pyemkey: has joined #RubyOnRails
[08:05:26] tjbiddle: Is there a method to check uniqueness of an attribute? (Not a validation)
[08:06:47] rvanlieshout: tjbiddle: query it?
[08:06:53] merida_: has joined #RubyOnRails
[08:06:54] merida__: has joined #RubyOnRails
[08:06:57] rvanlieshout: Foo.group('bar').having('count(BAR) > 1')
[08:07:43] tjbiddle: rvanlieshout: Just wasn't sure if there was anything built in
[08:08:05] darutoko: has joined #RubyOnRails
[08:08:14] chagel: has joined #RubyOnRails
[08:10:22] Pazician: has joined #RubyOnRails
[08:10:42] tjbiddle: Pretty easy custom validation actually; thanks
[08:11:04] errakeshpd: has joined #RubyOnRails
[08:13:23] krz: has joined #RubyOnRails
[08:14:13] mattwithoos_: has joined #RubyOnRails
[08:14:26] e: has joined #RubyOnRails
[08:14:33] rvanlieshout: why would you want to use a custom validation for this?
[08:16:17] htmldrum: has joined #RubyOnRails
[08:18:28] rvanlieshout: has joined #RubyOnRails
[08:19:00] DoubleMalt: has joined #RubyOnRails
[08:20:59] KevinSjoberg: has joined #RubyOnRails
[08:23:44] arup_r: has joined #RubyOnRails
[08:26:43] Palsson: has joined #RubyOnRails
[08:28:50] tjbiddle: rvanlieshout: Where else would I throw that query?
[08:29:19] rvanlieshout: why not use the validations that exist
[08:29:40] tjbiddle: rvanlieshout: Because it's polymorphic and I don't want it to say "Owner is not unique" I want it to say "ThisModel is not unique"
[08:29:51] tjbiddle: And by using the normal validation it always defaults to the polymorphic attribute name
[08:29:54] rvanlieshout: so change the message
[08:30:05] tjbiddle: I did - with the customer validation.
[08:30:30] tjbiddle: If you just do { message: "blah" } Then it would say "Owner blah" not "ThisModel blah"
[08:30:37] rvanlieshout: but the default validator also supports that
[08:30:44] tjbiddle: rvanlieshout: Nothing I found said that - point me
[08:30:48] arup_r: tjbiddle: use i18n
[08:31:00] rvanlieshout: it's also a safer validation
[08:31:27] arup_r: there rails has %{model} .. which is taking the model name automatically..
[08:31:35] tjbiddle: arup_r: The example I saw on SO using i18n didn't seem to be what I needed
[08:31:41] rvanlieshout: ah that point. then don't fix that in the model
[08:31:43] tjbiddle: Either way - works for now. I'm happy. I'll refactor later
[08:31:57] alaing: has joined #RubyOnRails
[08:31:57] arup_r: ok, tjbiddle i just joined.. :D
[08:32:06] alaing: has joined #RubyOnRails
[08:32:12] nocontrol: has left #RubyOnRails: ()
[08:32:14] nocontrol: has joined #RubyOnRails
[08:32:15] Guest: has joined #RubyOnRails
[08:32:25] alaing: hi, i'm building a rails plugin and it automatically includes a dummy app to run tests against. how do i add the plugin to the dummy app?
[08:32:43] nocontrol: how can you test the has_many associations in minitest ?
[08:33:15] nocontrol: User.respond_to?(:messages) ?
[08:33:39] pwnd_nsfw`: has left #RubyOnRails: ()
[08:33:43] ayoros: has joined #RubyOnRails
[08:33:46] pwnd_nsfw: has joined #RubyOnRails
[08:34:00] pwnd_nsfw: alaing, you shouldn't have to do anything special
[08:34:07] arup_r: nocontrol: why are you testing the association?
[08:34:36] alaing: pwnd_nsfw: not even add a gemfile and reference it?
[08:34:52] arup_r: nocontrol: also associations are method which you will call on instances of User, but not on User
[08:35:10] arup_r: so the code fragment you have shown, not going to work
[08:35:52] pwnd_nsfw: alaing, nah, it's not even a gem yet.
[08:36:01] nocontrol: arup_r: What do you mean why ? To see If the relationship exists
[08:36:08] arup_r: nocontrol: in Rspec, we write expect_any_instance_of(User).to receive(:messages)
[08:36:16] arup_r: no idea in MiniTest
[08:36:19] pwnd_nsfw: I use shoulda matchers
[08:36:21] alaing: pwnd_nsfw: how does the dummy app in the spec folder know about the plugin?
[08:36:24] nocontrol: arup_r: in shoulda also it's easy
[08:36:33] nocontrol: arup_r: but I decided to go with minitest :P
[08:36:34] arup_r: nocontrol: then use that
[08:36:34] pwnd_nsfw: it { should belong_to :model} or has_many
[08:36:53] pwnd_nsfw: alaing, are you not used to the rails magic? Anyways, the lib folder is included I'm sure
[08:37:03] nocontrol: arup_r: I don't want to use a gem for action I want to do
[08:37:07] arup_r: nocontrol: I meant why are you checking if the User instance is getting called that method?
[08:37:21] arup_r: nocontrol: you are using all gems only..:)
[08:37:39] e: has joined #RubyOnRails
[08:37:49] nocontrol: arup_r: how else could I find If the relationship/association exists ?
[08:37:56] arup_r: reusable codes are turned into Gems ..
[08:38:01] nocontrol: User has_many :messages
[08:38:13] alaing: pwnd_nsfw: I'm learning slowly about rails magic ;-)
[08:38:15] [dmp]: has joined #RubyOnRails
[08:38:24] arup_r: nocontrol: if you defined it in User model, then it will exist.. why then again check?
[08:38:31] arup_r: I am not getting your goal
[08:38:32] pwnd_nsfw: alaing, have you tried running the tests yet?
[08:38:39] arup_r: you have to say more
[08:39:02] arup_r: basically in what context you are checking that ?
[08:39:13] pwnd_nsfw: arup_r, lol....
[08:39:16] nocontrol: it's a simple test
[08:39:19] pwnd_nsfw: let the man check the association
[08:39:58] pwnd_nsfw: that's like saying not to check validations in tests
[08:40:13] alaing: pwnd_nsfw: I'm not following a strict TDD cycle just yet, i'm just trying to understand how the dummy app will interact with the plugin
[08:40:26] ferr: has joined #RubyOnRails
[08:40:32] alaing: thats my next thing on my list ;-)
[08:41:09] pwnd_nsfw: alaing, understood. If you run the tests, if you get no errors by default, everything is dandy
[08:41:34] stellarchariot: has joined #RubyOnRails
[08:41:34] nocontrol: arup_r: there's a gem for this https://github.com/steventux/minitest-ar-assertions
[08:41:40] alaing: and not a false positive :-D
[08:41:47] arup_r: pwnd_nsfw: I don't get you.. But nocontrol is trying to see if a User object responding a instance method.. So the intention is not clear
[08:41:54] trosborn: has joined #RubyOnRails
[08:42:02] arup_r: validation check is different thing.
[08:42:28] nocontrol: arup_r: I am trying to see If the relationship exists. If User has a has_many association with the model Message
[08:42:37] arup_r: I wouldn't test the validation method directly,... and I will test if my validation logic with my data
[08:43:01] nocontrol: arup_r: respond_to? isn't a solution, but the closest thing I found in the net related to that
[08:44:00] nocontrol: arup_r: this is a methodology and it's ok but when RSpec and Shoulda give you the ability to test them right away, I am only interested in this implementation in minitest
[08:44:29] nocontrol: I mean it's the simplest thing, it shouldn't be nuclear physics
[08:45:13] stellarchariot: has left #RubyOnRails: ()
[08:45:13] nocontrol: IF minitest doesn't let me do this in 2 minutes (which RSpec/Shoulda actually do) then something is going wrong, either me or MiniTest :D
[08:46:24] chagel: has joined #RubyOnRails
[08:46:48] arup_r: nocontrol: so you have a message object and user object, and you want to check if the message object is associated with a spefic user object? is this what you want to test?
[08:47:07] stellarchariot: has joined #RubyOnRails
[08:47:08] nocontrol: arup_r: not a specific
[08:47:18] stellarchariot: has left #RubyOnRails: ()
[08:47:33] nocontrol: arup_r: If it exists as an association
[08:48:02] nocontrol: ok for a specific user object/fixture, let's assume that
[08:48:02] marr: has joined #RubyOnRails
[08:48:14] nocontrol: for the @user instance
[08:49:24] nocontrol: I could create a @user.message and then see If it .count +1 but this doesn't make much sense
[08:50:06] RegulationD: has joined #RubyOnRails
[08:50:43] arup_r: assert_eqal @user.messages.exists?(message), true
[08:51:20] doublemalt_: has joined #RubyOnRails
[08:51:26] arup_r: nocontrol: ^^ something like that
[08:53:07] Ergo: has joined #RubyOnRails
[08:55:27] nocontrol: arup_r: what is the "message" ?
[08:55:42] nocontrol: I guess I should create it first
[08:56:00] arup_r: it is a Message instance
[08:56:22] rvanlieshout: nocontrol: what are you trying to do?
[08:57:40] nocontrol: arup_r: but you're trying to see If this specific message exists in the related messages so you must have created it before
[08:57:45] trosborn: has joined #RubyOnRails
[08:58:01] sp1rs: has joined #RubyOnRails
[08:58:06] nocontrol: arup_r: well at least it's something to begin with
[08:58:15] nocontrol: rvanlieshout: check an association If it exists
[08:58:19] nocontrol: rvanlieshout: has_many one
[08:58:25] rvanlieshout: what data do you have?
[08:58:34] rvanlieshout: and what do you want to do if it doesn't exist?
[08:58:40] nocontrol: the users(:user) fixture
[08:58:53] rvanlieshout: aah. fixtures
[08:59:01] rvanlieshout: they always exists.. or you're using fixtures wrong
[08:59:02] arup_r: nocontrol: ok, @user = user.messages.build(....); assert_eqal @user.save, true
[08:59:03] rvanlieshout: switch to factories :)
[08:59:40] nocontrol: rvanlieshout: trying to write a test assertion in minitest
[08:59:49] nocontrol: arup_r: makes sense
[09:00:09] Pazician: has joined #RubyOnRails
[09:00:13] baweaver: has joined #RubyOnRails
[09:00:16] futilegames: has joined #RubyOnRails
[09:01:44] rvanlieshout: nocontrol: more specific?
[09:02:16] nocontrol: rvanlieshout: User has_many :messages, does it exist as a relationship in the User model ?
[09:02:45] rvanlieshout: aah like that. https://github.com/thoughtbot/shoulda-matchers
[09:02:49] nocontrol: rvanlieshout: yes
[09:02:56] nocontrol: rvanlieshout: but in minitest alone
[09:03:01] rvanlieshout: https://github.com/thoughtbot/shoulda-matchers#minitest
[09:03:12] nocontrol: rvanlieshout: I don't want to add extra gems
[09:03:17] bronson: has joined #RubyOnRails
[09:03:31] nocontrol: rvanlieshout: you may shout but I decided to go native, If possible 100% Rails
[09:03:38] rvanlieshout: imo a bad approach
[09:03:48] AzaToth: has joined #RubyOnRails
[09:04:16] rvanlieshout: they test relationships really well
[09:04:21] rvanlieshout: it'll take you much time to get there
[09:04:33] nocontrol: I know but I try to keep things minimal without the extra cost
[09:04:52] rvanlieshout: writing shoulda-matchers yourself != without the extra cost
[09:04:52] nocontrol: If it takes 5 lines to test a relationship, most possibly I'll go with shoulda
[09:05:04] rvanlieshout: it'll take a bunch of lines to test it properly
[09:05:06] nocontrol: but I want to give it a chance first
[09:05:24] nocontrol: rvanlieshout: you're sure?
[09:05:37] nocontrol: rvanlieshout: I am completely noob in minitest
[09:05:40] rvanlieshout: cause you also want to test params like dependent, conditions, whatnot
[09:05:56] rvanlieshout: see the code from shoulda-matchers
[09:06:00] rvanlieshout: it'll show you how they test it
[09:06:40] universa1: and you'll likely don't want to test the implementation, more that your class "calls" the appropriate association method. the implementation has been tested in rails ;)
[09:06:58] rvanlieshout: agreed. shoulda-matchers doesn't test the implementation
[09:07:05] rvanlieshout: but does test things like foreign keys
[09:07:14] mikecmpbll: has joined #RubyOnRails
[09:07:31] Pazician: has joined #RubyOnRails
[09:08:16] PedramT: has joined #RubyOnRails
[09:08:17] merida: has joined #RubyOnRails
[09:08:22] merida_: has joined #RubyOnRails
[09:08:27] uglybandersnatch: has joined #RubyOnRails
[09:11:52] jsrn: has joined #RubyOnRails
[09:12:46] nocontrol: I see a lot of people turning around to minitest
[09:13:12] nocontrol: and I feel like Rails has become "everything" so the need for extra gems should be obsolete
[09:13:36] rvanlieshout: imo rails is just part of the gem ecosystem
[09:13:47] nocontrol: I have written lots of tests with RSpec but thing seem to get out of control
[09:13:47] rvanlieshout: in which you write stuff yourself and combine it with community written things
[09:13:55] Pazician: has joined #RubyOnRails
[09:14:09] nocontrol: I agree, Rails is a gem but it arms you with everything necessary
[09:14:58] universa1: you don't need more than ruby... rails is just ruby code.
[09:15:46] nocontrol: universa1: lol it's a surreal
[09:15:52] uglybandersnatch: has joined #RubyOnRails
[09:15:53] nocontrol: kind of thinking
[09:16:05] nocontrol: you don't need more than C
[09:16:22] universa1: you started it :p
[09:16:33] nocontrol: ok I am not being paranoid, I just trust Rails and the community for the features included
[09:16:51] Pazician: has joined #RubyOnRails
[09:17:00] nocontrol: I want to give honour to them by using the well trusted parts like minitest
[09:17:11] universa1: using a gem for everything is most likely wrong, but using no gems at all is also wrong.
[09:17:22] nocontrol: If I don't learn Rails then why use RSpec?
[09:17:31] universa1: because it is nice to use?
[09:17:39] universa1: though minitest/minispec has catched up a lot.
[09:17:44] nocontrol: universa1: yes agreed, I use foreman for example which is not implemented in Rails
[09:18:11] nocontrol: because "everyone uses RSpec" and that's not a reason
[09:18:42] nocontrol: I mean I started reading RSpec before touching Minitest because everyone was saying it's awesome
[09:18:45] arup_r1: has joined #RubyOnRails
[09:18:56] gbgdev_: has joined #RubyOnRails
[09:19:11] pwnd_nsfw: I mean, it is kind of awesome
[09:19:11] nocontrol: I want to support Rails so whatever is missing would be implemented within the framework
[09:20:25] rvanlieshout: not anything should just be added to the framework
[09:20:33] rvanlieshout: rails has quite some dependencies on other gems
[09:20:37] rvanlieshout: as your application should have too
[09:20:55] stannard: has joined #RubyOnRails
[09:21:09] nocontrol: the codebase should include only the necessary things
[09:21:14] nocontrol: the application, I mean
[09:21:21] neanderslob_: has joined #RubyOnRails
[09:21:46] nocontrol: otherwise you will end including 500k lines of code for extra gems that could be 300 lines in ruby
[09:21:49] solars: quick question: I've got a find_or_create in a controller, this method is called by multiple app instances. somehow I get the feeling that it is not threadsafe as I get index warnings from mysql (duplicate entries) - under what circumstances can this be?
[09:22:41] nocontrol: rvanlieshout: everything has a cost and to be able to determine which the cost is and what is the best choice you must be Ruby-wise and Rails-wise
[09:22:48] nocontrol: I hope to gain this skill one day
[09:23:05] nocontrol: anyway, thanks all for the valuable opinions
[09:23:18] nocontrol: I will try to add shoulda for minitest as a beginning
[09:23:36] woo: has joined #RubyOnRails
[09:24:06] rvanlieshout: nocontrol: don't get me wrong. I do support your approach in being careful with just adding gems
[09:24:17] rvanlieshout: you should know how they work properly
[09:24:24] rvanlieshout: but there is no shame in using some
[09:24:40] errakeshpd: has joined #RubyOnRails
[09:25:18] pwnd_nsfw: What do they call those people....
[09:25:26] pwnd_nsfw: that like.. don't want to use any code but what they've written
[09:25:42] adaedra: Wheel rewrite #43534876543
[09:27:15] scope_: has joined #RubyOnRails
[09:28:41] quazimodo: i can't decide how to structure my I18n files
[09:28:50] quazimodo: s/files/keys/
[09:29:21] quazimodo: t("user.confirmations.submit_button")
[09:29:53] scope: has joined #RubyOnRails
[09:30:33] solars: guys, can anyone tell me under what circumstances this is not threadsafe in rails 4.2? https://gist.github.com/solars/0008962b0fb16349918d
[09:30:38] rvanlieshout: quazimodo: try using t('.submit_button')
[09:30:56] rvanlieshout: solars: why would you expect that to not be threadsafe?
[09:31:11] solars: rvanlieshout, I keep getting: ERROR Mysql2::Error: Duplicate entry 'S001145' for key 'index_ar_properties_on_property_id': INSERT INTO `ar_properties` sometimes
[09:31:11] rvanlieshout: also, ArProperty.find_or_create_by(:property_id => property_id) || raise Exceptions::PropertyNotFound.new(property_id)
[09:31:17] quazimodo: rvanlieshout: i never tried that
[09:31:23] rvanlieshout: solars: is the query executed in a transaction?
[09:31:33] rvanlieshout: quazimodo: it'll propose a path for you. see the translation missing key
[09:31:41] solars: rvanlieshout, it's called quite often.. and today I had a very weird issue getting data that was not there, for this property
[09:32:08] solars: rvanlieshout, which query? I only have the statement above from my controller which is issued
[09:32:13] arup_r: has joined #RubyOnRails
[09:32:42] rvanlieshout: solars: check the log
[09:32:48] Pazician: has joined #RubyOnRails
[09:32:53] quazimodo: rvanlieshout: it's not actually doing that, though i do wonder how it works
[09:32:57] arBmind: has joined #RubyOnRails
[09:33:32] solars: rvanlieshout, activerecord log is disabled on this production server unfortunately
[09:33:40] solars: rvanlieshout, but why do you mean it's something with transactions?
[09:33:45] mfaeh: has joined #RubyOnRails
[09:33:46] solars: just to understand
[09:33:50] quazimodo: rvanlieshout: it's not really proposing anything
[09:34:04] quazimodo: just putting 'submit button' on the page
[09:34:24] rvanlieshout: quazimodo: inspect that. isn't it included in a span?
[09:34:30] rvanlieshout: solars: it should find it first, then insert one
[09:34:33] rvanlieshout: in a single transaction
[09:34:50] quazimodo: rvanlieshout: oh cool
[09:35:00] solars: rvanlieshout, so, you mean if the rails method is wrapping it into a transaction?
[09:35:12] solars: rvanlieshout, I'm just calling it, it's not modified
[09:35:14] quazimodo: so it just goes off the routes path to the view eh?
[09:35:36] rvanlieshout: quazimodo: more like file path
[09:35:44] Cervajz: has joined #RubyOnRails
[09:35:51] rvanlieshout: solars: yeah. it should do that. cause it would be weird if it tries to insert it when it actually exists
[09:36:09] solars: rvanlieshout, hmmm.. what else could cause this error then?
[09:36:21] quazimodo: rvanlieshout: i thought about doing that... then i thought myabe it's better to put translations on the resources when possible
[09:36:25] quazimodo: that way it's reusable as
[09:36:35] quazimodo: but ... it wasn't something i fully thought about
[09:36:36] rvanlieshout: solars: that's why you want to see the sql performed
[09:36:49] rvanlieshout: quazimodo: for something like 'submit' that makes sense
[09:37:03] srinidhi: has joined #RubyOnRails
[09:37:17] jenrzzz: has joined #RubyOnRails
[09:37:34] quazimodo: rvanlieshout: then for things like translations for properties (to use via simple_form) i can put that on the resource
[09:37:42] solars: rvanlieshout, hmmm if I understand this right: http://stackoverflow.com/questions/19332842/rails-transactions-with-find-or-create it's not per default - so I have to add it myself?
[09:37:59] rvanlieshout: solars: i don't really do assumptions
[09:38:02] rvanlieshout: enable the sql log :)
[09:38:17] quazimodo: rvanlieshout: do people pull their locale files apart or keep it as 1 big en.yml ?
[09:38:51] rvanlieshout: quazimodo: we switched to gettext
[09:39:05] quazimodo: googling now
[09:39:38] Pazician: has joined #RubyOnRails
[09:39:48] Didac: has joined #RubyOnRails
[09:40:00] quazimodo: that's nice
[09:40:09] quazimodo: if it knows how to translate a string, it'll do it
[09:40:16] quazimodo: otherwise it'll ask you to build the translations?
[09:40:36] mdw: has joined #RubyOnRails
[09:40:45] solars: rvanlieshout, will do.. but one more thing, even if there are transactions around this, if it's not thread safe that won't help much, or do I misunderstand?
[09:41:02] solars: hm ok no it would help
[09:41:04] Pazician: has joined #RubyOnRails
[09:41:15] solars: but then on the other hand I thought that this is already thread safe in rails..
[09:42:24] solars: rvanlieshout, http://rockyj.in/2014/08/16/test_thread_safety_with_concurrent_ruby.html
[09:42:58] acalewin: has joined #RubyOnRails
[09:43:16] Pazician: has joined #RubyOnRails
[09:43:34] quazimodo: rvanlieshout: is it worth it to switch from standard i18n?
[09:43:49] rvanlieshout: solars: your db transaction would make it threadsafe
[09:44:13] rvanlieshout: quazimodo: it's not 100% but we here feel better of writing normal english text in views and such
[09:44:25] dgncn: has joined #RubyOnRails
[09:44:28] PedramT: has joined #RubyOnRails
[09:44:39] solars: rvanlieshout, I will recreate this using these tests and see what helps
[09:44:44] solars: rvanlieshout, thanks a lot for the support :)
[09:45:44] crdpink: has joined #RubyOnRails
[09:49:03] htmldrum: has joined #RubyOnRails
[09:52:27] trosborn: has joined #RubyOnRails
[09:54:41] robbyoconnor: has joined #RubyOnRails
[09:55:41] uglybandersnatch: has joined #RubyOnRails
[09:58:28] sp1rs: has joined #RubyOnRails
[10:00:35] woo: has joined #RubyOnRails
[10:01:50] pawnbox: has joined #RubyOnRails
[10:03:02] Palsson: has joined #RubyOnRails
[10:03:04] kgutteridge: has joined #RubyOnRails
[10:03:25] beauby: has joined #RubyOnRails
[10:06:11] chagel: has joined #RubyOnRails
[10:15:19] PedramT: has joined #RubyOnRails
[10:16:15] Pazician: has joined #RubyOnRails
[10:19:15] Pazician: has joined #RubyOnRails
[10:21:04] yfeldblum: has joined #RubyOnRails
[10:22:26] Fragus: has joined #RubyOnRails
[10:24:37] rubyonrails751: has joined #RubyOnRails
[10:26:17] PedramT: has joined #RubyOnRails
[10:26:26] uglybandersnatch: has joined #RubyOnRails
[10:26:52] workmad3: has joined #RubyOnRails
[10:33:24] Spami: has joined #RubyOnRails
[10:33:51] Cohedrin: has joined #RubyOnRails
[10:34:02] tvw: has joined #RubyOnRails
[10:35:26] Rodya_: has joined #RubyOnRails
[10:39:16] sp1rs: has joined #RubyOnRails
[10:39:43] matthias_: has joined #RubyOnRails
[10:43:29] snowy: has joined #RubyOnRails
[10:44:23] htmldrum: has joined #RubyOnRails
[10:46:04] mdw: has joined #RubyOnRails
[10:48:26] Megamos: has joined #RubyOnRails
[10:51:06] gbgdev: has joined #RubyOnRails
[10:51:07] KevinSjoberg: has joined #RubyOnRails
[10:51:20] mfaeh: has joined #RubyOnRails
[10:51:23] RegulationD: has joined #RubyOnRails
[10:52:12] sp1rs: has joined #RubyOnRails
[10:54:44] pawnbox: has joined #RubyOnRails
[10:54:55] roshanavand: has joined #RubyOnRails
[10:57:12] Pazician: has joined #RubyOnRails
[10:59:29] Detch: has joined #RubyOnRails
[11:01:23] baweaver: has joined #RubyOnRails
[11:04:51] bronson: has joined #RubyOnRails
[11:05:36] htmldrum: has joined #RubyOnRails
[11:06:20] rodfersou: has joined #RubyOnRails
[11:08:09] Sephyros: How i can use pg_search to search in some field with translation?
[11:08:58] Sephyros: eg: i have habitation model, with the type field, in the application type is written in english but i want to search in the i18n translation
[11:08:59] phredus: has joined #RubyOnRails
[11:14:43] srinidhi: has joined #RubyOnRails
[11:16:38] arup_r: has joined #RubyOnRails
[11:17:43] trinaldi: has joined #RubyOnRails
[11:18:06] pawnbox: has joined #RubyOnRails
[11:23:55] dgncn: has joined #RubyOnRails
[11:23:55] quazimodo: has joined #RubyOnRails
[11:25:02] sp1rs: has joined #RubyOnRails
[11:27:21] spiman: has joined #RubyOnRails
[11:27:36] ldnunes: has joined #RubyOnRails
[11:29:04] spiman: hello, i was wondering is there an idiom for when i want a has_many collection proxy object to be fetched again? do you use parent.children(true) / parent.children.all or something else?
[11:30:23] sp1rs: has joined #RubyOnRails
[11:30:47] Dbugger: has joined #RubyOnRails
[11:30:51] Dbugger: Helly everyoen
[11:31:03] Pazician: has joined #RubyOnRails
[11:31:19] meoblast001: has joined #RubyOnRails
[11:32:54] PedramT: has joined #RubyOnRails
[11:33:01] Dbugger: I am having a weird issue today. I have a Stock model, with a foreign key for Product, and I wanted to count how many stock were pointing to the same Product, so I tried this "Stock.count(:all, group: :product)" but it still givs me just the count of all table rows. Is that syntax not correct?
[11:33:13] Palsson: has joined #RubyOnRails
[11:33:54] sp1rs: has joined #RubyOnRails
[11:34:17] Dbugger: I thought it might be a problem with the relationship, so I tried it with a boolean that the table has, "Stock.count(:all, group: :locked)", and I got the same problem...
[11:36:33] Rodya_: has joined #RubyOnRails
[11:37:05] sp1rs: has joined #RubyOnRails
[11:44:55] workmad3_: has joined #RubyOnRails
[11:46:20] n008f4g_: has joined #RubyOnRails
[11:47:20] sp1rs: has joined #RubyOnRails
[11:50:03] workmad3: has joined #RubyOnRails
[11:50:16] armyriad: has joined #RubyOnRails
[11:53:53] Ropeney: has joined #RubyOnRails
[11:55:08] pawnbox: has joined #RubyOnRails
[11:55:24] Pazician: has joined #RubyOnRails
[11:57:14] errakeshpd: has joined #RubyOnRails
[11:59:16] chouhoulis: has joined #RubyOnRails
[11:59:18] Kamuela: has left #RubyOnRails: ()
[12:00:05] daveomcd: has joined #RubyOnRails
[12:02:12] daveomcd: Can anyone help me convert my logic to a hash as shown at the following link? I'm particularly confused on how to do my "or" statements as a hash. https://gist.github.com/daveomcd/aaf3c7cd5bead8e6caaa
[12:03:23] sp1rs: has joined #RubyOnRails
[12:04:21] Guest34101: has joined #RubyOnRails
[12:04:26] spiman_: has joined #RubyOnRails
[12:05:45] PedramT: has joined #RubyOnRails
[12:08:33] Palsson: has joined #RubyOnRails
[12:08:47] pawnbox: has joined #RubyOnRails
[12:08:57] sp1rs: has joined #RubyOnRails
[12:09:33] krz: has joined #RubyOnRails
[12:09:52] zz_timnovinger: has joined #RubyOnRails
[12:10:00] roshanavand: has joined #RubyOnRails
[12:10:45] JakFrist: has joined #RubyOnRails
[12:11:22] errakeshpd: is there any way to use two foreign key for has_many associations ,, models: user and communications [sender_id, receiver_id]
[12:11:36] errakeshpd: https://gist.github.com/errakeshpd/127a6a9459653eb65a76
[12:11:49] Pazician: has joined #RubyOnRails
[12:13:09] sp1rs: has joined #RubyOnRails
[12:13:56] Pazician: has joined #RubyOnRails
[12:15:25] johnflux: has joined #RubyOnRails
[12:15:25] johnflux: has joined #RubyOnRails
[12:19:20] yxejamir: has joined #RubyOnRails
[12:20:00] the_last9: has joined #RubyOnRails
[12:20:09] Peteykun: has joined #RubyOnRails
[12:20:40] KevinSjoberg: has joined #RubyOnRails
[12:21:12] the_last9: how does ActiveRecord delete a row using obj.delete? does it use id=X? what happens if there is no id? does it create a statement that does: delete from x where A=x and B=x and C=x etc, looping over all the variables on the object?
[12:22:21] godzillaenlacasa: has joined #RubyOnRails
[12:22:59] _Tariq: has joined #RubyOnRails
[12:23:52] Pazician: has joined #RubyOnRails
[12:25:37] banister: has joined #RubyOnRails
[12:28:00] deur-: the_last9: if you run stuff in the rails console you can see which queries are performed
[12:28:04] roshanavand: has joined #RubyOnRails
[12:28:24] deur-: the_last9: but to answer your questions: it deletes on ID, unless no id is present on the object. afaik it does nothing in that case
[12:28:53] the_last9: deur-: ah okay. is there a chance that if theres no id it might try and find whatever the primary key is and delete off that?
[12:31:29] deur-: the_last9: if there's a primary key present it will do a delete based off that column. I thought you meant performing a delete on unsaved model instances
[12:32:11] deur-: the_last9: http://apidock.com/rails/ActiveRecord/Base/delete/class
[12:34:29] Sephyros: how i can see public 404, 500 and 422 pages on dev machine?
[12:36:18] _Tariq: has joined #RubyOnRails
[12:37:41] Rodya_: has joined #RubyOnRails
[12:39:30] a1187211: has joined #RubyOnRails
[12:39:48] a1187211: has left #RubyOnRails: ()
[12:44:28] daveomcd_: has joined #RubyOnRails
[12:45:01] fox_mulder_cp: Sephyros: app/public/404.html?
[12:51:25] Ergo^: has joined #RubyOnRails
[12:52:11] SeanLazer: has joined #RubyOnRails
[12:52:50] chagel: has joined #RubyOnRails
[12:53:03] JakFrist: has joined #RubyOnRails
[12:53:07] RegulationD: has joined #RubyOnRails
[12:54:20] Dbugger: has joined #RubyOnRails
[12:57:00] tkiel: has joined #RubyOnRails
[12:59:12] tvw: has joined #RubyOnRails
[13:02:07] baweaver: has joined #RubyOnRails
[13:02:56] flashpoint9: has joined #RubyOnRails
[13:04:35] roshanavand: has joined #RubyOnRails
[13:06:22] woo: has joined #RubyOnRails
[13:07:11] bronson: has joined #RubyOnRails
[13:07:52] treehug88: has joined #RubyOnRails
[13:09:02] Pazician: has joined #RubyOnRails
[13:09:07] _Tariq: has joined #RubyOnRails
[13:10:32] fox_mulder_cp: glebofff: и ходи на фринодный #RubyOnRails
[13:10:39] _Tariq: has joined #RubyOnRails
[13:11:08] Ergo^: has joined #RubyOnRails
[13:12:15] sp1rs: has joined #RubyOnRails
[13:12:18] fox_mulder_cp: adaedra: sorry, u see a strong russian hardcore command :)
[13:13:28] mwlang: has joined #RubyOnRails
[13:13:50] mfaeh: has joined #RubyOnRails
[13:14:42] mwlang: does Rails 4.2 not autoload app/policies or do I need to add that directory to the autoload path? I’ve added the pundit gem to my project, but there’s no documentation (that I can find) saying I need to also tweak Rails’ autoload path.
[13:15:01] Linell: has left #RubyOnRails: ()
[13:15:14] rvanlieshout: mwlang: it autoloads them
[13:15:19] rvanlieshout: restart your rails server and try again?
[13:15:32] mwlang: rvanlieshout: I did and also stopped spring for good measure.
[13:16:13] fox_mulder_cp: mwlang: u must restart app when add a gem and change a actioncable in rails 5.
[13:16:32] fox_mulder_cp: policeies reloaded successfully without restart of app
[13:17:09] rvanlieshout: mwlang: and what exactly is the error?
[13:17:29] mwlang: let me gist. one sec.
[13:19:01] jottr_: has joined #RubyOnRails
[13:20:36] Pazician: has joined #RubyOnRails
[13:21:03] mwlang: rvanlieshout: https://gist.github.com/mwlang/db30d683f48194f6255b
[13:22:27] quazimodo: has joined #RubyOnRails
[13:22:42] rvanlieshout: that could be a load order thing. what if you require it manually in that spec file?
[13:23:05] stannard: has joined #RubyOnRails
[13:24:49] mwlang: rvanlieshout: bingo. needed a require ‘rails_helper’
[13:25:14] mwlang: when I added the require for app/application_policy, it told me Rails didn’t exist. :-o
[13:25:31] mwlang: so adding rails_helper resolved.
[13:25:47] mwlang: ACTION goes to get more coffee
[13:26:03] arup_r: latest Rspec need that file to be required in ever spec file
[13:26:21] tomatoes: has joined #RubyOnRails
[13:31:21] suchness: has joined #RubyOnRails
[13:31:56] suchness: Anyone know if it's possible to left join a scope in active record? Model.scope1.left_join(Model.scope2)
[13:32:19] suchness: Basically getting all results of the first scope where there isn't a result in the second scope?
[13:32:24] htmldrum: has joined #RubyOnRails
[13:34:59] snowy: has joined #RubyOnRails
[13:35:32] rvanlieshout: suchness: .includes(:scope1)
[13:35:56] rvanlieshout: model.scope1.where.not(id: model.scope2.select(:id))
[13:36:02] rvanlieshout: you don't want to use a left join for that
[13:36:20] Pazician: has joined #RubyOnRails
[13:37:02] suchness: How should I approach it?
[13:37:14] rvanlieshout: 14:35 < rvanlieshout> model.scope1.where.not(id: model.scope2.select(:id))
[13:37:45] suchness: Do you know off hand if that will generate 1 or 2 queries?
[13:37:49] DoubleMalt: has joined #RubyOnRails
[13:38:02] suchness: Also I was under the impression that a join of some sort would be much faster than an id not in.
[13:38:17] rvanlieshout: 1) yes, 2) left join is the slowest thing ever.. you really want to use multiple queries over left join almost any time
[13:38:47] rvanlieshout: 3) do you really know enough about databases to actually know what kind of join over seperate queries would be best? or is it just 'less queries is better'
[13:38:47] suchness: It will generate multiple queries?
[13:39:30] suchness: Apparently not
[13:39:39] Rodya_: has joined #RubyOnRails
[13:39:45] Ropeney: has joined #RubyOnRails
[13:40:11] rvanlieshout: so it uses a subquery here
[13:40:22] Snowy_: has joined #RubyOnRails
[13:40:23] rvanlieshout: which in essence is 2 queries
[13:40:34] rvanlieshout: but that'll be better then using a left join
[13:42:28] suchness: Ok great, it looks like it works for me so I will use that, thanks!
[13:42:43] yellow5: has joined #RubyOnRails
[13:43:41] nfk|laptop: has joined #RubyOnRails
[13:45:47] jottr: How would I implement a database agnostic way of quickly pulling a random record from the db? sample() tends to be quite slow. I've used randumb, which looked quite promising, but I ran into this issue: https://github.com/spilliton/randumb/issues/34
[13:46:27] rvanlieshout: why do you need it to be database agnostic?
[13:46:43] jottr: rvanlieshout: Because we might swich the db at some point or other
[13:46:52] rvanlieshout: then fix it then
[13:47:00] rvanlieshout: cause a ruby approach will always be a magnitude slower
[13:47:09] jottr: rvanlieshout: true. So you would go with RAND() then?
[13:47:13] rvanlieshout: use the capabilities of your db
[13:47:23] griffindy: has joined #RubyOnRails
[13:47:26] rvanlieshout: and if you really like make it dependend on a model.connection-property
[13:47:42] roobienoobie: has joined #RubyOnRails
[13:47:44] agit0: has joined #RubyOnRails
[13:47:56] jottr: rvanlieshout: ^ that sentence I did not understand :)
[13:48:09] rvanlieshout: Model.connection holds the connection to the db
[13:48:10] flashpoint9: has joined #RubyOnRails
[13:48:15] rvanlieshout: you could check an attribute of it to see what adapter it's using
[13:48:24] rvanlieshout: and use a db specific approach for a given adapter
[13:48:39] jottr: rvanlieshout: ah ok
[13:48:42] stannard: has joined #RubyOnRails
[13:49:20] jottr: rvanlieshout: What about something like this: Thing.offset(rand(Thing.count))
[13:49:29] rvanlieshout: performs 2 queries
[13:49:40] jottr: Ok. So slower. I see
[13:49:42] Oliphaunte: has joined #RubyOnRails
[13:49:42] bricker: has joined #RubyOnRails
[13:50:08] jottr: And now for something completely different:
[13:51:57] mrgreenfur: has joined #RubyOnRails
[13:52:53] n008f4g_: has joined #RubyOnRails
[13:54:11] FailBit: has joined #RubyOnRails
[13:54:27] FailBit: :regressions:
[13:56:01] FailBit: sometime between 4.2.5 and some routing stuff broke
[13:56:19] Ropeney: has joined #RubyOnRails
[13:56:36] FailBit: trying to track it down
[13:56:41] jottr: We pull some posts of our wordpress blog as json, and render them in our app. Currently we simply store said json file in S3. I would like to move that to the db. Is there a convention of how to name such a db table and related model?
[13:56:43] krz: has joined #RubyOnRails
[13:56:52] banister: has joined #RubyOnRails
[13:57:15] DaniG2k: has joined #RubyOnRails
[13:57:35] DaniG2k: anyone use Sunspot in here or are we all Elasticsearch fans?
[13:57:44] DaniG2k: I'm trying to set it up from scratch but having some trouble
[13:59:09] helpa: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[13:59:42] DaniG2k: 1) I added the gems to my Gemfile
[13:59:48] DaniG2k: 2) I ran bundle install
[13:59:53] DaniG2k: 3) I ran rails generate sunspot_rails:install
[14:00:19] DaniG2k: 4) I ran bundle exec rake sunspot:solr:start
[14:00:47] Pazician_: has joined #RubyOnRails
[14:01:00] DaniG2k: 5) I added a searchable block to my Article model
[14:01:22] DaniG2k: 6) I added a .search call to my controller
[14:01:57] akshat: has joined #RubyOnRails
[14:02:13] DaniG2k: I started my rails server now
[14:02:22] DaniG2k: and am checkinng to see if the search works
[14:03:00] DaniG2k: first thing that fails is in my view: @articles.each do |article|
[14:03:11] DaniG2k: apparently #<Sunspot::Search::StandardSearch:0x007fbe012cb3e0> can't take an .each
[14:03:27] rvanlieshout: where did you find that it can?
[14:03:47] DaniG2k: maybe it requires .results
[14:04:00] rvanlieshout: well.. it's a search, not a result
[14:04:01] rvanlieshout: would make sense
[14:04:23] DaniG2k: so added .results and restarting rails server now
[14:04:33] akshat_: has joined #RubyOnRails
[14:04:37] rvanlieshout: why restart the rails server?
[14:04:39] Ropeney: yes, you want .results.each
[14:04:47] DaniG2k: I get an empty array
[14:04:54] DaniG2k: this used to be easy once
[14:04:57] DaniG2k: something changed
[14:04:59] DmitryBochkarev: has joined #RubyOnRails
[14:05:01] JulienITARD: has joined #RubyOnRails
[14:05:02] Ropeney: thats a good sign :)
[14:05:06] Guest34101: has joined #RubyOnRails
[14:05:15] rvanlieshout: java stuff is never easy :)
[14:05:25] rvanlieshout: DaniG2k: did you index stuff?
[14:06:01] DaniG2k: java drives me nuts
[14:06:08] DaniG2k: rvanlieshout: I'll try
[14:06:52] scope: has joined #RubyOnRails
[14:06:56] DaniG2k: ok, I reindexed
[14:07:06] DaniG2k: same issue I was getting some time ago
[14:07:11] DaniG2k: all the results are returned for a search
[14:07:48] Ropeney: seems to be going in a circle, going to say that issue now?
[14:08:03] jottr: has joined #RubyOnRails
[14:08:06] DaniG2k: ropeney: ?
[14:08:26] Ropeney: gist your code for the search query
[14:11:19] DaniG2k: ropeney: https://gist.github.com/DaniG2k/cb3aacb9db2cde7dc0a5
[14:11:22] DaniG2k: it's pretty standard
[14:12:10] rvanlieshout: what did you search for?
[14:12:11] Ropeney: you call index with ?search=blah ?
[14:12:44] DaniG2k: ropeney: yes, &search=obama
[14:12:58] DaniG2k: ropeney: /s?utf8=✓&search=obama
[14:13:20] Ropeney: in console can you do Article.search { fulltext 'obama' } ?
[14:13:30] rvanlieshout: ok. heading home. time for weekend
[14:13:54] rvanlieshout: you all here 2
[14:14:11] DaniG2k: ropeney: yes that returns the following: SOLR Request (8.1ms) [ path=select parameters={fq: ["type:Article"], q: "obama", fl: "* score", qf: "body_text", defType: "edismax", start: 0, rows: 30} ]
[14:14:20] DaniG2k: => <Sunspot::Search:{:fq=>["type:Article"], :q=>"obama", :fl=>"* score", :qf=>"body_text", :defType=>"edismax", :start=>0, :rows=>30}>
[14:14:26] ql6wlld: has joined #RubyOnRails
[14:16:05] DaniG2k: actually it looks right from the command line
[14:16:12] DaniG2k: Article.search { fulltext 'obama' }.results.count gives me 10 results which seem correct
[14:16:22] chouhoulis: has joined #RubyOnRails
[14:16:24] DaniG2k: on the frontend it just displays them all :/
[14:16:37] Ropeney: in your controller, swap params[:search] for 'obama'
[14:16:55] IFrank00: has joined #RubyOnRails
[14:17:51] DaniG2k: hmm that seems to work
[14:18:02] DaniG2k: so the params are incorrect
[14:18:28] Ropeney: whats the whole path your doing
[14:18:42] DaniG2k: http://localhost:3000/s?utf8=%E2%9C%93&search=obama
[14:19:33] Ropeney: try http://localhost:3000/?search=obama
[14:20:02] Ropeney: i don't know what the /s will be doing unless you have something in your routes?
[14:20:34] DaniG2k: yep I have this in config/routes: get 's', to: 'articles#index', as: :search
[14:20:44] Ropeney: important info
[14:21:00] DaniG2k: maybe I should just remove that
[14:21:06] DaniG2k: seems to be messing things up
[14:21:35] Ropeney: if that doesnt work do `p params` in controller and tell results
[14:21:49] sonofdirt: has joined #RubyOnRails
[14:21:50] Ropeney: don't hate on java for this, you haven't even touched java :P
[14:22:08] DaniG2k: yeah the param is passing correctly
[14:22:16] DaniG2k: my search form reads
[14:22:40] DaniG2k: <%= form_tag(search_path, method: "get") do %>
[14:22:52] DaniG2k: <%= search_field_tag :search, params[:search], :placeholder => "Search...", :class => 'search-box', :id => 'search-box' %>
[14:22:55] axl_: has joined #RubyOnRails
[14:23:01] Ropeney: this wasn't in your gist
[14:23:01] DaniG2k: so it should poit to that route
[14:23:10] DaniG2k: didn't think it would be related
[14:23:13] DaniG2k: I can add it now
[14:23:35] Ropeney: do the p params in index controller and add that output
[14:23:40] Zadrel: has joined #RubyOnRails
[14:24:22] DaniG2k: here's the updated gist: https://gist.github.com/DaniG2k/cb3aacb9db2cde7dc0a5
[14:25:07] Oliphaunte: has joined #RubyOnRails
[14:25:13] Ropeney: where's your submit for that form?
[14:25:38] sonofdirt: has joined #RubyOnRails
[14:25:54] rbennacer: has joined #RubyOnRails
[14:25:58] DaniG2k: ropeney: there is none -_-
[14:26:26] DaniG2k: look at it live here: http://asia-gazette.com it's the little search bar near the words "China Japan Korea Panasia"
[14:26:50] DaniG2k: right now I'm using a SQL query
[14:26:59] DaniG2k: it seems to get triggered properly
[14:27:01] mrgreenfur: has joined #RubyOnRails
[14:27:14] Ropeney: k, what was result of p params?
[14:27:17] kies: has joined #RubyOnRails
[14:27:27] DaniG2k: => "Obama"
[14:27:36] DaniG2k: if I pry into the code in the index
[14:28:03] DaniG2k: the query is being set to *:* so that's the problem :/
[14:28:32] DaniG2k: ropeney: I'm not sure I understand. Where do you want me to p params?
[14:28:35] DaniG2k: in the controller?
[14:28:45] DaniG2k: that will output to the logs?
[14:28:51] Ropeney: yes at the start of your index action then paste me the log output
[14:29:38] DaniG2k: Parameters: {"utf8"=>"✓", "search"=>"obama"}
[14:29:38] DaniG2k: {"utf8"=>"✓", "search"=>"obama", "controller"=>"articles", "action"=>"index"}
[14:29:44] DaniG2k: seems legit
[14:30:35] DaniG2k: hmm somehow the query gets set to *:*
[14:30:40] Ropeney: if works in console, your params are correct and works when you switch params[:search] to 'obama' then...
[14:30:41] DaniG2k: unless I input it manually, in which case it works
[14:30:59] tubbo: it sets the query string to that if it's nil iirc
[14:31:02] Ropeney: try for giggles, p params[:search]
[14:31:05] FailBit: I think 0e27cdf may have broken my app
[14:31:16] FailBit: ACTION reads through more commits
[14:32:29] DaniG2k: ropeney: "obama"
[14:32:34] DaniG2k: -_- this makes no sense
[14:32:35] tjohnson: has joined #RubyOnRails
[14:32:51] Ropeney: goodluck with that lol
[14:32:53] DaniG2k: if I manually set it it works
[14:33:14] Ropeney: p @articles.results
[14:33:20] Ropeney: p @articles
[14:34:02] DaniG2k: ropeney: its too big for me to send here but I can see the query being sent to Solr
[14:34:05] DaniG2k: whcih is wrong
[14:34:13] mostlybadfly: has joined #RubyOnRails
[14:34:14] DaniG2k: OLR Request (4.8ms) [ path=select parameters={fq: ["type:Article"], start: 0, rows: 30, q: "*:*"} ]
[14:34:17] DaniG2k: Article Load (4.0ms) SELECT "articles".* FROM "articles" WHERE "articles"."id" IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30) ORDER BY "articles"."created_at" DESC
[14:34:39] Ropeney: that looks like SQL
[14:34:55] scope: has joined #RubyOnRails
[14:35:25] Fernando-Basso: has joined #RubyOnRails
[14:35:27] Ropeney: is there anything else you havent gisted as "not important" ?
[14:35:37] DaniG2k: ropeney: not that I can think of...really
[14:35:47] DaniG2k: I'm not being malicious >_< I really cant think of anything that would affect thins
[14:35:49] Ropeney: is that the WHOLE controller?
[14:35:51] DaniG2k: maybe sunspot.yml?
[14:36:16] DaniG2k: ooooooooooh shit -_-
[14:36:19] DaniG2k: ropeney: you are right
[14:36:24] DaniG2k: ropeney: im so sorry....
[14:36:38] DaniG2k: ACTION does the walk of shame
[14:37:50] allcentury: has joined #RubyOnRails
[14:38:01] tenderlo_: has joined #RubyOnRails
[14:38:39] woo: has joined #RubyOnRails
[14:38:57] Oliphaunte: has joined #RubyOnRails
[14:40:49] Rodya_: has joined #RubyOnRails
[14:43:15] DaniG2k: ropeney: seems odd
[14:43:21] DaniG2k: I got it to work but it doesn't work if I pass the instance var
[14:43:26] DaniG2k: params[:search] works
[14:43:28] DaniG2k: @search doesn't
[14:43:33] DaniG2k: finally it works :) thanks for the help
[14:50:04] Ropeney: DaniG2k, without all the info it is too hard to help sorry
[14:52:46] agit0: has joined #RubyOnRails
[14:54:23] jottr_: has joined #RubyOnRails
[14:55:41] FailBit: https://gist.github.com/liamwhite/b4def27c9bb917766745
[14:55:51] FailBit: here's my problem
[14:59:22] bricker: has joined #RubyOnRails
[15:00:31] tamole: has joined #RubyOnRails
[15:00:52] smathy: has joined #RubyOnRails
[15:01:23] SanguineAnomaly: has joined #RubyOnRails
[15:02:31] Ropeney: sounds annoying FailBit
[15:03:02] FailBit: I spent 6 hours trying to debug my action
[15:03:03] baweaver: has joined #RubyOnRails
[15:03:11] Ropeney: sounds even more annoying lol
[15:03:11] FailBit: before I realized it wasn't being called
[15:03:17] disgrntld: has joined #RubyOnRails
[15:03:24] iuuso: has joined #RubyOnRails
[15:03:25] Ropeney: rails 4 or 5?
[15:04:39] renanoronfle: has joined #RubyOnRails
[15:04:50] Ropeney: odd, pretty confident i've done a few custom delete paths
[15:05:12] Ropeney: what if you remove the / at start
[15:05:56] FailBit: I can't debug this rn
[15:06:06] krz: has joined #RubyOnRails
[15:06:09] FailBit: if you made a test app and tried it yourself I'd be grateful
[15:06:25] FailBit: I'm on rails specifically
[15:06:39] Ropeney: gimmie few mins
[15:06:55] adavia: has joined #RubyOnRails
[15:07:20] jottr: has joined #RubyOnRails
[15:08:11] norc: has joined #RubyOnRails
[15:08:21] workmad3: FailBit: route precedence is your problem
[15:08:48] Ropeney: lol didn't even look at the resources
[15:08:53] workmad3: FailBit: the `delete /tag_changes/:id` route is grabbing it because that's the first match generated in your routes file
[15:09:00] bronson: has joined #RubyOnRails
[15:09:01] sp1rs: has joined #RubyOnRails
[15:09:43] workmad3: FailBit: correct way to do this would be to do `resources :tag_changes do; collection do; delete :mass_revert; end; end`
[15:10:33] SanguineAnomaly: has joined #RubyOnRails
[15:10:46] workmad3: FailBit: or to move the `delete` to above the `resources :tag_changes`, but it looks like a custom collection route so you should probably do it that way IMO ;)
[15:11:25] sonofdirt: has joined #RubyOnRails
[15:11:45] tubbo: FailBit: what about this? https://gist.github.com/tubbo/b32c04650b56a43de195
[15:11:55] tubbo: oh shit haha workmad3 got it
[15:12:12] reckoner: has joined #RubyOnRails
[15:12:30] tubbo: i've definitely had my fair share of routing issues when trying to override like that, when i learned of the nested collection/member DSL i was so happy
[15:12:57] woo: has joined #RubyOnRails
[15:13:08] workmad3: same... routing precedence has bitten me quite a few times
[15:16:20] maxx88: has joined #RubyOnRails
[15:18:03] Pazician: has joined #RubyOnRails
[15:18:14] sb8244_: has joined #RubyOnRails
[15:20:07] chagel: has joined #RubyOnRails
[15:21:10] sb8244_: Hey! Quick question about the asset pipeline that is throwing me for a loop. We have files that aren't set to precompile showing up in public/assets. It is not due to link or link_tree either.
[15:23:41] FailBit: has left #RubyOnRails: ("WeeChat 0.4.2")
[15:24:10] sp1rs: has joined #RubyOnRails
[15:25:04] workmad3: sb8244_: two possibilities - 1, you're not setting RAILS_ENV before precompiling, so the precompile is using dev settings (which has `debug=true` set, so files will compile into separate units). 2. A gem or engine is adding some files to the precompile array during initialization
[15:27:21] JakFrist: has joined #RubyOnRails
[15:29:00] nerium: has joined #RubyOnRails
[15:29:28] nerium: How would I debug a view that’s only slow in production?
[15:30:31] Guest34101: has joined #RubyOnRails
[15:30:32] reckoner: you know you can run your rails app in production mode locally right?
[15:31:13] eljimmy: has joined #RubyOnRails
[15:31:59] nerium: reckoner: I’ve already tried that. Even used the production database, but it’s fast localy
[15:32:38] uglybandersnatch: has joined #RubyOnRails
[15:32:41] yellow5: has joined #RubyOnRails
[15:32:48] reckoner: ¯\_(ツ)_/¯
[15:33:03] nerium: I even tried commeting out all the code in my controller
[15:34:14] reckoner: what does newrelic say?
[15:37:04] jottr: has joined #RubyOnRails
[15:39:06] ukazap: has joined #RubyOnRails
[15:39:18] sonofdirt: has joined #RubyOnRails
[15:39:48] banister: has joined #RubyOnRails
[15:44:16] Jasaka: has joined #RubyOnRails
[15:47:19] bePolite: has joined #RubyOnRails
[15:47:20] ql6wlld: has joined #RubyOnRails
[15:48:14] zarubin: has joined #RubyOnRails
[15:48:23] shmilan: has joined #RubyOnRails
[15:48:54] FooMunki: has joined #RubyOnRails
[15:50:51] mhoungbo: has joined #RubyOnRails
[15:51:19] marr: has joined #RubyOnRails
[15:51:22] [Butch]: has joined #RubyOnRails
[15:51:56] jottr: has joined #RubyOnRails
[15:54:07] decaff: has joined #RubyOnRails
[15:54:38] nerium: reckoner: rpm doesn’t seam to log timeouts
[15:54:41] rakm: has joined #RubyOnRails
[15:55:10] myntcake: has joined #RubyOnRails
[15:55:11] tubbo: nerium: it logs slow actions though
[15:55:31] nerium: tubbo: Do you know where? I can’t find it in the panel
[15:55:56] tubbo: nerium: it's called 'Transactions'
[15:56:16] DarkBushido: has joined #RubyOnRails
[15:56:16] DarkBushido: has joined #RubyOnRails
[15:56:18] maxdoubt: has joined #RubyOnRails
[15:56:36] myntcake: has anyone here tried the launch school(previously Tealeaf academy) program? what do you guys think of it?
[15:57:12] nerium: tubbo: Like ”/accounts/x/applications/x/transactions ?
[15:57:27] tubbo: nerium: there's a link on the dashboard..
[15:57:48] nerium: Yeah, but that only shows slow actions
[15:57:58] FLeiXiuS: has joined #RubyOnRails
[15:58:01] maxdoubt: hi everybody! has anybody played around with bundling angular2 into rails asset pipeline or thought about unit tests as well? i’m currently using webpack, but was wondering if i could do something a bit more dynamic (systemjs, traceur, etc.)
[15:58:03] reckoner: we deliberately filter code academy's.
[15:58:32] gbgdev: has joined #RubyOnRails
[15:59:02] tubbo: nerium: your question was "How would I debug a view that's only slow in production?"...new relic runs in production...therefore, new relic should be showing your "slow view".
[15:59:32] nerium: tubbo: True, i’m just confused.
[15:59:35] tubbo: maxdoubt: well if you're gonna use another build pipeline, you won't be using sprockets.
[15:59:44] Devalo: has joined #RubyOnRails
[15:59:51] nerium: tubbo: rpm says that thew view takes 230ms
[16:00:01] stardiviner: has joined #RubyOnRails
[16:00:08] tubbo: that's quite slow
[16:00:39] nerium: tubbo: The view I’m talking about timeout after 30 seconds
[16:00:41] tubbo: maxdoubt: but yes, you can use another build pipeline with rails and it works just fine.
[16:00:42] nerium: That’s the problem :)
[16:01:02] maxdoubt: tubbo: unfortunately, cause this is a legacy rails app… i’m stuck with sprockets… and thus trying to navigate that as well. webpack works fine with sprockets… but i don’t like being tied to running webpack on the command line in dev mode
[16:01:05] nerium: I can’t see anything about that in the logs
[16:01:20] tubbo: nerium: newrelic gives you the average response time, so that's probably happening every so often
[16:01:48] nerium: So I guess rpm wont help me
[16:01:55] tubbo: maxdoubt: yeah that kinda sucks
[16:01:58] nerium: I need a list of individuall transactions
[16:02:09] tubbo: nerium: you can dive in even further and see what rails is doing when you hit that action
[16:02:20] zave: has joined #RubyOnRails
[16:02:27] tubbo: new relic is good for figuring out what part of the request is slow, but it won
[16:02:30] nerium: It’s not all urls on a particular action that’s slow, it’s one particular path
[16:02:38] mfaeh: has joined #RubyOnRails
[16:02:40] tubbo: won't* be be able to tell you
[16:02:49] tubbo: how to fix it :)
[16:03:11] nerium: So if 1 out of 10k req are slow It can’t help me I guess
[16:03:23] maxdoubt: tubbo: hoping i can figure out a way to dynamically load / transpile node and all this typescript… and then utilize a similar strategy for testing
[16:03:27] beauby: has joined #RubyOnRails
[16:03:59] maxdoubt: i feel like i spend 2/3 of time doing devops, 1/3 time coding… ugh
[16:05:03] nerium: tubbo: Are you sure timeouts are logged? I think unicorn kills processes slower then 30 sec, meaning that rpm doesn’t have the time to log the request
[16:07:00] merida: has joined #RubyOnRails
[16:07:01] merida_: has joined #RubyOnRails
[16:07:59] sp1rs: has joined #RubyOnRails
[16:08:45] davee_: has joined #RubyOnRails
[16:10:41] tubbo: maxdoubt: it's probably better to just use sprockets.
[16:11:12] tubbo: nerium: i guess if you set unicorn up to do that, yeah. you never actually mentioned the problem you're trying to solve, you just asked a vague question about debugging views in production.
[16:11:27] sb8244: has joined #RubyOnRails
[16:11:36] tubbo: the answer is newrelic, then you dive into the specific piece of the request that's causing the problematic slow speeds and make it faster.
[16:11:55] tubbo: could be anything from rack-timeout to a 503 error
[16:11:56] sb8244: Found answer to the assets question I asked earlier
[16:12:07] sb8244: Sprockets has LOOSE_APP_ASSETS which will include any non js or css files
[16:12:13] sb8244: which is bad when you use es6 or html templates
[16:12:20] sp1rs: has joined #RubyOnRails
[16:12:31] nerium: tubbo: Even if the request is never completed?
[16:12:51] tubbo: nerium: yeah newrelic should be profiling the request, i mean otherwise how would i know about requests that throw an exception?
[16:13:16] nerium: tubbo: Unicorn wont kill processes that raises an error
[16:13:22] tubbo: nerium: rails has quite a few instrumentation hooks that make the newrelic gem possible
[16:13:58] nerium: tubbo: Yes, if they request is complete. In my case it’s killed before its finished
[16:14:48] bob434: has joined #RubyOnRails
[16:15:03] tubbo: nerium: afaik no, that is not correct.
[16:15:13] tubbo: nerium: the hooks will run until the request fails to complete
[16:15:26] tubbo: is nginx not connecting to your app server maybe?
[16:15:33] sonofdirt: has joined #RubyOnRails
[16:16:07] nerium: tubbo: Not sure what you mean with the last sentense
[16:16:18] sp1rs: has joined #RubyOnRails
[16:16:21] Spami: has joined #RubyOnRails
[16:16:36] tubbo: unfortunately my ability to help here is limited...i'm not privy to how your system works.
[16:16:51] nerium: The information not accessable in rpm so I guess that means that it’s not logged
[16:17:14] manfrin: has joined #RubyOnRails
[16:17:52] Oliphaunte: has joined #RubyOnRails
[16:18:03] nerium: I can try to increase the timout in unicorn to 10 min and see if it’s getting logged to rpm
[16:18:50] maxdoubt: tubbo: hmm… like by chaining in browserify for node-modules?
[16:20:01] spiman: has joined #RubyOnRails
[16:20:10] tubbo: maxdoubt: no just use sprockets. :)
[16:20:22] sp1rs: has joined #RubyOnRails
[16:20:23] tubbo: you don't need anything node
[16:20:39] PedramT: has joined #RubyOnRails
[16:21:19] maxdoubt: tubbo: like i can use sprockets-typescript to handle angular2… and i guess angular2 will reference all its dependent node-libraries on its own
[16:22:00] Oliphaun_: has joined #RubyOnRails
[16:24:20] sp1rs: has joined #RubyOnRails
[16:24:39] nerium: tubbo: Now it doesn’t timeout but rpm is still blank. I not sure what I would use the average numbers for
[16:25:40] gbgdev: has joined #RubyOnRails
[16:28:10] crunk_bear: has joined #RubyOnRails
[16:29:37] d0nn1e: has joined #RubyOnRails
[16:30:28] Lingo: has joined #RubyOnRails
[16:32:22] sp1rs: has joined #RubyOnRails
[16:32:51] akshat: has joined #RubyOnRails
[16:35:11] arup_r: has joined #RubyOnRails
[16:36:07] arup_r: Hi.. I want to have dynamic message dependeing on contact_type value.. but my attempt didn't work out.. https://gist.github.com/aruprakshit/11d6fa86e9b5f98ec83d .. What is the trick ?
[16:36:36] arup_r: message should be 'only one primary contact can be assigned' or 'only one secondary contact can be assigned'
[16:36:52] arup_r: but should I capture and add it to message dynamically?
[16:41:25] Maletor: has joined #RubyOnRails
[16:41:31] arup_r: this trick will work I guess, http://stackoverflow.com/a/6073499/2767755 .. now I am into something else.. ;)
[16:41:36] PedramT: has joined #RubyOnRails
[16:42:16] Rodya_: has joined #RubyOnRails
[16:45:03] Spami: has joined #RubyOnRails
[16:47:50] maxdoubt: has joined #RubyOnRails
[16:47:59] tubbo: arup_r: i think you need a custom validation method to alter the errors message like that
[16:48:03] arup_r: any idea from where I am getting error as ​*Mysql2::Error: Unknown column 'lead_contacts.’ *​ https://gist.github.com/aruprakshit/11d6fa86e9b5f98ec83d
[16:48:21] arup_r: tubbo: before reaching there, I got some more wired
[16:48:32] rogue_koder: has joined #RubyOnRails
[16:49:03] tubbo: arup_r: lead_contacts has nothing to do with the code you posted, so that must be getting thrown somewhere else. check all the places you're ordering
[16:49:11] tubbo: like ordering by something in lead_contacts
[16:49:18] wldcordeiro: has joined #RubyOnRails
[16:50:56] arup_r: tubbo: someone from Slack, helping me. he said, probably no primary key I have in the model. And I checked, and find he is true.
[16:50:57] PedramT: has joined #RubyOnRails
[16:51:05] arup_r: so.. I will update you here..
[16:51:14] bronson: has joined #RubyOnRails
[16:51:16] jaequery: has joined #RubyOnRails
[16:51:34] tubbo: arup_r: just let me know if you have a question, otherwise i'll assume you figured it out.
[16:51:43] arup_r: sure tubbo
[16:51:49] tomatoes: has joined #RubyOnRails
[16:51:54] arup_r: he just pinged..
[16:51:59] gbgdev: has joined #RubyOnRails
[16:52:17] arup_r: that's why I updated here..
[16:54:26] mhoungbo: has joined #RubyOnRails
[16:55:03] pawnbox: has joined #RubyOnRails
[16:55:48] sonofdirt: has joined #RubyOnRails
[16:55:49] RegulationD: has joined #RubyOnRails
[16:56:34] sleungcy: has joined #RubyOnRails
[16:57:54] sonofdirt: has joined #RubyOnRails
[16:59:04] sleungcy: has joined #RubyOnRails
[17:03:16] thenextmogul: has joined #RubyOnRails
[17:03:50] Rodya_: has joined #RubyOnRails
[17:05:41] merida_: has joined #RubyOnRails
[17:05:49] pawnbox: has joined #RubyOnRails
[17:05:57] tvw: has joined #RubyOnRails
[17:07:04] KevinSjoberg: has joined #RubyOnRails
[17:09:19] shinnya: has joined #RubyOnRails
[17:10:57] choke: has joined #RubyOnRails
[17:13:09] djbkd: has joined #RubyOnRails
[17:13:26] aarkerio: has joined #RubyOnRails
[17:13:43] djbkd: has joined #RubyOnRails
[17:15:20] scope: has joined #RubyOnRails
[17:16:15] VeryBewitching: has joined #RubyOnRails
[17:18:56] scope: <link href="stylesheets/style.css" rel='stylesheet' type='text/css' />
[17:18:57] scope: <script src="javascripts/jquery-1.11.1.min.js"></script>
[17:18:59] jottr: has joined #RubyOnRails
[17:18:59] scope: hello -- this is mainly to make sure i have a understanding -- when using ROR i dont need to list
[17:19:09] scope: ah that came out wrong damn it
[17:19:16] scope: try again sorry folks
[17:19:18] helpa: scope: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[17:19:39] VeryBewitching: Please don't paste to the channel :D
[17:20:09] scope: all i wanted to ask was scripts like that dont need to be added into aplication.html.erb or index.html.erb
[17:20:13] KensoDev: has joined #RubyOnRails
[17:20:21] scope: instead i just open application.rb and list there correct
[17:20:27] tubbo: scope: no
[17:20:48] tubbo: looks like you're using rails 2.x though
[17:21:19] scope: ruby 2.2.2
[17:21:53] yfeldblum: has joined #RubyOnRails
[17:21:56] tubbo: scope: !assets
[17:21:56] helpa: scope: http://guides.rubyonrails.org/asset_pipeline.html - The Asset Pipeline Guide by Ryan Bigg, Richard Hulse & Mohammad Typaldos
[17:22:08] tubbo: scope: please read that so you know how to sprockets
[17:23:05] moeabdol: has joined #RubyOnRails
[17:23:10] scope: and rails version 4.2.6
[17:24:41] moeabdol1: has joined #RubyOnRails
[17:26:02] DoctorMonocular: has joined #RubyOnRails
[17:28:40] arup_r: has joined #RubyOnRails
[17:30:51] IFrank00: has joined #RubyOnRails
[17:33:13] Guest34101: has joined #RubyOnRails
[17:33:31] IFrank00: has joined #RubyOnRails
[17:37:12] apotry: has joined #RubyOnRails
[17:40:36] bob434: has joined #RubyOnRails
[17:43:51] arup_r: tubbo: figured out https://gist.github.com/aruprakshit/11d6fa86e9b5f98ec83d
[17:45:40] sp1rs: has joined #RubyOnRails
[17:47:33] Oliphaunte: has joined #RubyOnRails
[17:47:36] Rodya_: has joined #RubyOnRails
[17:48:49] pawnbox: has joined #RubyOnRails
[17:49:12] pawnbox_: has joined #RubyOnRails
[17:50:21] zave: has joined #RubyOnRails
[17:50:56] Guest34101: has joined #RubyOnRails
[17:52:05] bronson: has joined #RubyOnRails
[17:52:07] sp1rs: has joined #RubyOnRails
[17:54:22] ayoros: has joined #RubyOnRails
[17:54:42] chagel: has joined #RubyOnRails
[17:56:33] yellow5: has joined #RubyOnRails
[17:56:59] waseem_: has joined #RubyOnRails
[17:59:08] sbarg: has joined #RubyOnRails
[17:59:21] sbarg: has left #RubyOnRails: ()
[17:59:25] flashpoint9: has joined #RubyOnRails
[18:01:18] gingray: has joined #RubyOnRails
[18:01:40] bob434: has joined #RubyOnRails
[18:01:40] DoctorMonocular: has joined #RubyOnRails
[18:02:43] sneakerhax: has joined #RubyOnRails
[18:03:54] sloggerkhan: has joined #RubyOnRails
[18:05:47] bePolite: has joined #RubyOnRails
[18:06:27] workmad3: arup_r: how is that different from `scope: [:lead_id, :contact_type]`?
[18:06:49] alho: has joined #RubyOnRails
[18:07:15] arup_r: workmad3: I need to give first field of the validation as a field name on which I will run the validation logic, right?
[18:07:44] maxdoubt: has joined #RubyOnRails
[18:08:12] workmad3: arup_r: just trying to figure out why you have that `or` condition in there :)
[18:08:22] arup_r: workmad3: oh I see.
[18:08:38] arup_r: I want to run the validation only for 2 values of the field
[18:09:12] workmad3: arup_r: that sounds like you should be using an `if:` condition on the validation then
[18:09:38] arup_r: mistake here
[18:10:02] workmad3: arup_r: `validates :contact_type, uniqueness: { scope: :lead_id }, if: :restricted_contact_type?` followed by adding that restricted_contact_type? method ;)
[18:10:06] arup_r: no I think I need the condition still there.. with `if:`
[18:10:21] zave: has joined #RubyOnRails
[18:10:23] arup_r: ok thinking again :D
[18:11:12] arup_r: well I need condition with `if`
[18:11:22] kshah_: has joined #RubyOnRails
[18:11:22] arup_r: only `if` will will not work
[18:11:40] workmad3: arup_r: `def restricted_contact_type?; contact_type.in? ["primary", "secondary"]; end`
[18:11:56] arup_r: yess ^^ and condition: .. also need
[18:11:58] workmad3: arup_r: why?
[18:12:30] bePolite: has joined #RubyOnRails
[18:12:30] bePolite: has joined #RubyOnRails
[18:12:41] arup_r: because uniqness will run select count(*) from where table_name where contact_type and lead_id
[18:13:14] dcunit3d: has joined #RubyOnRails
[18:13:17] arup_r: and there, if I have duplicate values other than the value of 'prinary' and 'secondary' it will throw error.. which I don't want
[18:13:19] workmad3: arup_r: but the validation will only be triggered if contact type is `primary` or `secondard`
[18:13:50] arup_r: and then SQl query will run for all .. contact_type combinations..
[18:14:05] workmad3: arup_r: no it won't... it'll run an 'exists?' on the contact_type you have
[18:14:51] workmad3: arup_r: e.g. it'll run `SELECT 1 AS one FROM `lead_contacts` WHERE (`lead_contacts`.`contact_type` = BINARY 'primary' AND `lead_contacts`.`lead_id` = 1)` which you can already see in your console output
[18:15:03] arup_r: if: is to enable the validation call.. right? What about the SQl query the uniqness validation will run
[18:15:43] workmad3: arup_r: it runs one call to see if a record with the unique column (and scope columns) exists, if the validation is triggered
[18:16:26] arup_r: you are TRUE
[18:17:06] arup_r: it will pick the contact_type value from its current context, so I don't need it.. true, very true
[18:17:20] arup_r: thanks workmad3
[18:17:39] arup_r: mine was working, so I didn't think after that.
[18:17:59] workmad3: arup_r: also for future reference, if you want a query to check for a set of values, `where(contact_type: %w(primary secondary))` is a bit neater than a hardcoded OR fragment ;)
[18:20:48] bePolite: has joined #RubyOnRails
[18:21:21] greengriminal: has joined #RubyOnRails
[18:22:24] zave: has joined #RubyOnRails
[18:25:04] cnk: has joined #RubyOnRails
[18:26:13] pawnbox_: has joined #RubyOnRails
[18:27:19] pawnbox: has joined #RubyOnRails
[18:27:20] chouhoulis: has joined #RubyOnRails
[18:27:21] maxdoubt: has joined #RubyOnRails
[18:28:31] zave: has joined #RubyOnRails
[18:28:35] chouhoulis: has joined #RubyOnRails
[18:30:07] baweaver: has joined #RubyOnRails
[18:31:29] djbkd: has joined #RubyOnRails
[18:32:30] jottr: has joined #RubyOnRails
[18:33:05] jottr: Hi all. I am taking over a legacy project, to which I would like to add rspec and capybara. I'm not sure how to properly set it up, since it already has a test directory. Said directory contains a test_helper.rb. rspec requires me to use rails_helper.rb instead. Should I somehow migrate the test_helper.rb to rails_helper.rb, or should I simply remove it instead? Here's the current directory structure and
[18:33:07] jottr: the test_helper.rb: https://gist.github.com/jottr/a2061a2caec222416929
[18:35:27] pwnd_nsfw: has joined #RubyOnRails
[18:36:50] tubbo: jottr: run `rails g rspec:install`, then edit config.generators to use test_framework :rspec.
[18:36:57] tubbo: jottr: !generators
[18:36:57] helpa: jottr: http://guides.rubyonrails.org/generators.html - Generators guide written by Jose Valim and Ryan Bigg
[18:37:24] mhoungbo: has joined #RubyOnRails
[18:38:08] jottr: tubbo: thx. What about the test_helper? Should I remove it completely?
[18:38:26] tubbo: jottr: if you're not using minitest, just remove the whole test/ dir altogether.
[18:38:55] sloggerkhan: Does removing Rack::Lock middleware lead to a lot of unexpected side effects?
[18:39:54] workmad3: SloggerKhan: it shouldn't do... it's removed by default in most setups now (I think it still gets thrown in if you're running webrick, because of issues there)
[18:40:18] tubbo: SloggerKhan: in theory, no.. http://tenderlovemaking.com/2012/06/18/removing-config-threadsafe.html
[18:41:28] baweaver: has joined #RubyOnRails
[18:42:21] awasum: has joined #RubyOnRails
[18:43:31] Tref: has joined #RubyOnRails
[18:43:45] sloggerkhan: Great! Thanks! I realized it was enabled and causing issues with some tests on a site I'm working to upgrade. It used to call config.threadsafe!, but that got depricated I didn't realize until now it was controlling whether Rock::Lock was used.
[18:44:58] jstransky: has joined #RubyOnRails
[18:47:39] bkulbida: has joined #RubyOnRails
[18:48:28] mostlybadfly: has joined #RubyOnRails
[18:49:07] mrgreenfur: has joined #RubyOnRails
[18:50:01] Guest5: has joined #RubyOnRails
[18:50:21] diegoviola: has joined #RubyOnRails
[18:51:00] renegadeandy: has joined #RubyOnRails
[18:51:04] Guest5: has left #RubyOnRails: ()
[18:51:18] renegadeandy: Hi people. Can anybody help me with this http 500 from paperclip processing an image after upload : http://stackoverflow.com/questions/36084963/paperclip-throwing-http-500-error-log-is-not-showing-a-clear-reason
[18:51:37] Guest5: has joined #RubyOnRails
[18:53:18] agit0: has joined #RubyOnRails
[18:53:42] Parker0: has joined #RubyOnRails
[18:54:03] zave: has joined #RubyOnRails
[18:55:01] workmad3: renegadeandy: it would be helpful if you could add the exception notifer message that gives you details of the exception
[18:55:39] renegadeandy: workmad3: how do i get that
[18:55:44] renegadeandy: everything you see is all i get?
[18:55:55] workmad3: renegadeandy: exception_notifier sends an email
[18:56:14] renegadeandy: for some reason, no email ever gets sent here!
[18:56:31] workmad3: renegadeandy: that's a problem... because without that, you have no idea what the error actually is
[18:56:54] tubbo: yeah that's your first issue
[18:57:12] tubbo: renegadeandy: if you're in development or test...i think the mail might be in your log and/or tmp/mails
[18:57:23] tubbo: if you don't have an SMTP server set up or anything
[18:57:24] kgutteridge: has joined #RubyOnRails
[18:57:25] RegulationD: has joined #RubyOnRails
[18:57:36] renegadeandy: I do have smtp setup, it just isnt sending the mail
[18:57:50] workmad3: you could also consider pulling exception_notifier out in dev/test mode
[18:58:06] workmad3: it makes things more difficult to debug
[18:58:57] renegadeandy: so if i pull it out in staging - it will end up giving me a proper stack trace?
[18:58:58] kdough: has joined #RubyOnRails
[18:59:14] tubbo: renegadeandy: nah, you should figure out why it's not sending mails...then you'll get a proper stack trace.
[18:59:30] renegadeandy: not sure where to begin with that one
[18:59:34] tonyynot: has joined #RubyOnRails
[18:59:35] renegadeandy: has same config as production
[18:59:38] renegadeandy: production works
[18:59:39] renegadeandy: staging doesnt
[19:00:31] PedramT: has joined #RubyOnRails
[19:00:53] maxdoubt: has joined #RubyOnRails
[19:02:00] djbkd: has joined #RubyOnRails
[19:03:21] djbkd: has joined #RubyOnRails
[19:04:02] zave: has joined #RubyOnRails
[19:04:39] kies: has joined #RubyOnRails
[19:05:31] lemur: has joined #RubyOnRails
[19:05:40] Oliphaunte: has joined #RubyOnRails
[19:12:17] Martyn: has joined #RubyOnRails
[19:12:24] Maletor: has joined #RubyOnRails
[19:13:21] netzfisch: has joined #RubyOnRails
[19:14:03] djbkd: has joined #RubyOnRails
[19:14:05] raunicolae: has joined #RubyOnRails
[19:14:47] raunicolae: has left #RubyOnRails: ()
[19:15:50] meoblast001: has joined #RubyOnRails
[19:17:55] crunk_bear: has joined #RubyOnRails
[19:17:58] chipotle: has joined #RubyOnRails
[19:19:26] podman: has joined #RubyOnRails
[19:19:37] yfeldblum: has joined #RubyOnRails
[19:20:43] djbkd: has joined #RubyOnRails
[19:21:13] jenrzzz: has joined #RubyOnRails
[19:22:29] jottr: Should .rspec be commited to git?
[19:24:55] scope: has joined #RubyOnRails
[19:28:04] diego4: has joined #RubyOnRails
[19:28:35] scope: im a little confused i read the pipe line info and watched 3 or four tutorials think i understand it. now though i get the issue of couldn't find file 'jquery.ui.all' with type 'text/css' but its not called jquery.ui.all its called jquery-ui.all
[19:28:37] tubbo: jottr: yes
[19:29:22] nerium: has joined #RubyOnRails
[19:29:34] mdw: has joined #RubyOnRails
[19:29:53] diego4: has joined #RubyOnRails
[19:29:54] scope: does rails allow you to use both *= require and @import
[19:30:02] scope: or do i have to choose
[19:30:33] jottr: tubbo: thx
[19:30:44] sp1rs: has joined #RubyOnRails
[19:31:17] tubbo: scope: you have to choose. using sprockets' require is not recommended in Sass.
[19:31:55] scope: thank you for being patient by the way
[19:32:03] scope: i piss myself off hahahah
[19:32:56] scope: oooo yer i bloody did it
[19:33:08] scope: thank you tubbo
[19:34:19] axl__: has joined #RubyOnRails
[19:34:32] uglybandersnatch: has joined #RubyOnRails
[19:35:55] srinidhi: has joined #RubyOnRails
[19:37:26] pawnbox: has joined #RubyOnRails
[19:37:40] diego4: has joined #RubyOnRails
[19:37:52] diego4: has joined #RubyOnRails
[19:39:57] kh0d: has joined #RubyOnRails
[19:42:01] bricker1: has joined #RubyOnRails
[19:45:01] PedramT: has joined #RubyOnRails
[19:46:19] renegadeandy: has joined #RubyOnRails
[19:48:11] bob434: has joined #RubyOnRails
[19:49:58] roqo: has joined #RubyOnRails
[19:50:43] maletor_: has joined #RubyOnRails
[19:54:37] diego4: has joined #RubyOnRails
[19:54:51] diego4: has joined #RubyOnRails
[19:55:24] uglybandersnatch: has joined #RubyOnRails
[19:55:42] yellow5: has joined #RubyOnRails
[19:56:12] rubyonrails980: has joined #RubyOnRails
[19:56:50] nerium: has joined #RubyOnRails
[19:57:16] renegadeandy: tubbo: This is what happens when I get an http 500 - https://gist.github.com/renegadeandy/72e8f07ee566a5f38b47
[19:57:19] Anubix: has joined #RubyOnRails
[19:57:21] renegadeandy: No email arrives
[19:57:32] renegadeandy: thr same config on my production server works - and sends emails
[19:59:41] Anubix: Hello, support provide function variable? like this <% provide(:variable, @variable.name %> ?
[20:00:55] IFrank00: has joined #RubyOnRails
[20:01:26] ckmorris: has joined #RubyOnRails
[20:01:28] tubbo: Anubix: wat
[20:02:23] Anubix: tubbo: I have this provide(:canonical, @country_path(@country.continent, @country)) and i test in header <%= test_canonical(yield(:canonical)) %> but it still doesnt work
[20:03:00] Anubix: tubbo: but it still throws error - syntax error, unexpected '(', expecting ')'
[20:06:35] intrigueD: has joined #RubyOnRails
[20:08:09] PedramT: has joined #RubyOnRails
[20:08:15] tubbo: Anubix: !dw
[20:08:15] helpa: Anubix: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[20:09:02] moeabdol: has joined #RubyOnRails
[20:09:42] Anubix: tubbo: wrong number of arguments (given 3, expected 1..2)
[20:10:04] Anubix: tubbo: ok now its clear i found erorr :)
[20:10:15] tubbo: Anubix: glad i could help.
[20:10:18] tubbo: Anubix: !ask
[20:10:18] helpa: Anubix: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[20:12:31] PedramT: has joined #RubyOnRails
[20:13:27] ckmorris: I'm having an issue trying to get a Websocket handshake working. I have an ember app running on localhost:4200 connected by proxy to a Rails 5 API application running on In my app I have added rack-cors and I have configured the /cable resource to allow any origin with any method. Now the rails app says: Request origin not allowed: http://localhost:4200 Failed to upgrade to WebSocket (REQUEST_METHOD: GET, HTTP_CO
[20:14:11] maxx88: tubbo: there must be a list of these shebang short codes somewhere or is it only for the irc moderators
[20:14:21] scope: has joined #RubyOnRails
[20:14:56] sb8244: has joined #RubyOnRails
[20:14:57] slash_nick: maxx88: !tips
[20:14:57] helpa: maxx88: Just the tips: http://logs.ryanbigg.com/tips
[20:15:10] tubbo: maxx88: fwiw, you have to be on a white list to use them. so the bot doesn't get spammed out of existence
[20:15:17] sb8244: ANyone know if I can use link_tree in development but not prod environment?
[20:15:30] sb8244: It allows me to avoid a stale directory issue, but I don't want the assets to appear in public/assets
[20:15:35] maxx88: tubbo: wow, thats a lot of them, thanks!
[20:15:42] maxdoubt_: has joined #RubyOnRails
[20:16:06] slash_nick: and they're all very serious and useful
[20:16:22] gingray: has joined #RubyOnRails
[20:16:27] helpa: slash_nick's other problem
[20:16:27] dpg1: has joined #RubyOnRails
[20:19:47] mwlang: what’s the easiest way to figure out the cause of ActionDispatch::Cookies::CookieOverflow ? It’s not coming from my code directly. Best guess is either devise or dry_crud gem.
[20:19:55] tubbo: sb8244: what's link_tree?
[20:21:32] mwlang: the error’s gist: https://gist.github.com/mwlang/c7a0a4f7a9837cff1745 — I don’t see anything in this chain that would give me a clue as to what’s setting the cookie that’s busting the 4k barrier.
[20:21:55] roshanavand: has joined #RubyOnRails
[20:22:20] slash_nick: mwlang: it doesn't have to be one cookie of that size, correct? you could be setting many cookies
[20:22:53] mdw: has joined #RubyOnRails
[20:23:31] mwlang: slash_nick: you’re probably right. still the question is where because I don’t set session nor cookies in my app’s code. That means it’s happening in one of the gems I’ve included. best guess is devise or dry_crud.
[20:23:46] sb8244: tubbo: it is a sprockets directive that sets up a dependency on an asset to avoid caching issues
[20:24:12] mwlang: looking through dry_crud’s code now as I kinda doubt devise would suffer this issue without a lot of others encountering it.
[20:24:27] gormandy: has joined #RubyOnRails
[20:24:37] Miron: has joined #RubyOnRails
[20:25:06] pawnbox: has joined #RubyOnRails
[20:25:18] tubbo: sb8244: TIL there's a `link` and `link_tree` sprockets directive
[20:26:22] slash_nick: I don't know anything about the dry_crud gem... but it doesn't look like something that would set cookies
[20:27:36] mwlang: slash_nick: I’m thinking this line: session[:list_params][remember_key] ||= {}
[20:27:53] kies: has joined #RubyOnRails
[20:28:23] djbkd: has joined #RubyOnRails
[20:28:50] mwlang: well, that line doesn’t set a key per se, but gives me some hope I’ll find where it does get set. :-p
[20:28:55] replay: has joined #RubyOnRails
[20:29:30] wldcordeiro: has joined #RubyOnRails
[20:29:40] tubbo: sb8244: what exactly is the "win" of using link_tree vs. require_tree?
[20:29:54] sb8244: I don't want to require the files
[20:30:11] sb8244: I have a .js.erb which manually loops over my app/assets/templates folder and puts things in the angular $templateCache object
[20:30:27] sb8244: so I don't want to require, I want to state I have the dependency and then use some ruby to add them
[20:30:37] tubbo: sb8244: that's not what require does :)
[20:30:56] sb8244: doesn't it include it in the file?
[20:31:07] sb8244: oh yea I know why require doesn't work
[20:31:18] sb8244: I can't require assets/templates from assets/javascripts
[20:31:25] sb8244: It gives file not found
[20:31:25] tubbo: sb8244: ah i see.
[20:31:34] tubbo: yeah you're correct about that
[20:31:41] baweaver: has joined #RubyOnRails
[20:31:43] slash_nick: mwlang: ah, yeah... that's probably your culprit
[20:31:58] sb8244: wait I might have lied
[20:32:15] tubbo: sb8244: fwiw i typically put my templates in app/assets/javascripts/templates, because they are js templates :)
[20:32:32] tubbo: sb8244: that allows me to //= require_tree ./templates, then i can do JST['some_template_path'] wherever.
[20:32:46] sb8244: require_tree may actually work
[20:32:48] sb8244: going to test it out
[20:32:54] slash_nick: mwlang: looks like this sets q, sort, sort_dir, and page: https://github.com/codez/dry_crud/blob/a816cb0a4e195c7a392f4e568500f2d1ce71bc63/app/controllers/dry_crud/rememberable.rb#L41-L46
[20:33:10] rogue_koder: has joined #RubyOnRails
[20:33:26] PedramT: has joined #RubyOnRails
[20:33:39] mwlang: slash_nick: *sigh* It’s not that. I commented out the whole frickin’ Rememberable module.
[20:33:59] mwlang: same overflow error even after a Rails restart (and spring full stop)
[20:34:25] mwlang: I guess it’s time to monkey patch ActionPack to just tell me what’s being stored.
[20:34:58] snowy: has joined #RubyOnRails
[20:35:00] slash_nick: mwlang: yeah... did you delete the offending cookie during all that restart-stuff?
[20:35:21] mwlang: slash_nick: no. didn’t think it was even getting stored.
[20:35:43] baweaver: has joined #RubyOnRails
[20:35:49] mwlang: hmmm…now that begs the question…how *do* you clear the cookie slate?
[20:36:09] slash_nick: mwlang: i use the resources tab in my browser's dev tools
[20:38:12] mwlang: slash_nick: not, that, then. monkey patchin’ time.
[20:38:22] duncannz: has joined #RubyOnRails
[20:39:05] hinbody: has joined #RubyOnRails
[20:39:25] halfamind: has joined #RubyOnRails
[20:39:37] Devalo: has joined #RubyOnRails
[20:39:57] halfamind: Puma question: I'm running with 2 workers and my config includes `directory` and `prune_bundler` entries. Occasionally, I see an old worker process stick around after a deploy, but with no parent process. Output of `ps axjf` looks like: https://gist.github.com/joeyAghion/f7c65ad7b528531f03f7
[20:40:09] halfamind: Has anyone run into this and can offer suggestions?
[20:44:07] baweaver: has joined #RubyOnRails
[20:44:24] mwlang: well, I’ll be golly darned. my code after all…flash[:notice] = exception.inspect and the exception itself had an AR model instance record in it.
[20:45:18] slash_nick: mwlang: by golly
[20:45:24] choke: has joined #RubyOnRails
[20:45:45] slash_nick: what in the sam hill?
[20:46:23] mwlang: ACTION being dense as a ram’s skull
[20:47:11] mwlang: I haven’t hit upon cookie issues in years.
[20:47:12] mwlang: so long, I’ve virtually forgotten flash messages are cookies, too.
[20:50:36] srinidhi1: has joined #RubyOnRails
[20:51:31] roshanavand: has joined #RubyOnRails
[20:51:53] tubbo: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
[20:52:28] adaedra: calm down.
[20:52:54] arup_r: i thought me.. so scared :D
[20:53:30] hahuang65: has joined #RubyOnRails
[20:53:59] VeryBewitching: ACTION gives tubbo a cookie.
[20:55:12] tubbo: qqq qqqq, q qqqq q qqqqqqqq qqqqq qqqqq q. qq qqqqqqqqqq qqqq qqq qq qq q qqqq qq qqqq q qqqqq?
[20:55:57] Lingo: has joined #RubyOnRails
[20:57:00] snowy: has joined #RubyOnRails
[20:58:04] Oliphaunte: has joined #RubyOnRails
[20:58:38] jas02: has joined #RubyOnRails
[20:58:51] cUr10u5: has joined #RubyOnRails
[20:58:59] RegulationD: has joined #RubyOnRails
[20:59:07] jas02: has left #RubyOnRails: ()
[20:59:50] PedramT: has joined #RubyOnRails
[20:59:54] VeryBewitching: ACTION gives tubbo some magic mushrooms?
[21:00:24] nerium: has joined #RubyOnRails
[21:02:52] bricker: has joined #RubyOnRails
[21:03:13] djbkd: has joined #RubyOnRails
[21:04:07] mwlang: Pundt rocks. :-)
[21:04:35] scope: https://gist.github.com/scope2229/d98e789729a39fd3f270 can someone take a look at that
[21:04:45] scope: its a jquery-ui.css
[21:05:11] scope: the drop down calendar wont work
[21:05:16] snockerton: has joined #RubyOnRails
[21:05:26] scope: everything else in the page is fine but the calendar
[21:05:28] matthias_: has joined #RubyOnRails
[21:05:45] VeryBewitching: scope: That's a jquery-ui question.
[21:05:52] VeryBewitching: #jquery probably exists.
[21:06:25] baweaver: has joined #RubyOnRails
[21:15:16] stardiviner: has joined #RubyOnRails
[21:15:16] cUr10u5: i am an experienced laravel developer and thinking of trying rails. Please suggest me some good learning resource for experienced developers.
[21:18:03] jenrzzz: has joined #RubyOnRails
[21:19:17] roshanavand: has joined #RubyOnRails
[21:20:07] scope: michael hartl
[21:20:14] scope: good place to start
[21:20:15] maxdoubt: has joined #RubyOnRails
[21:20:51] cUr10u5: i tried that book but it covers very basic and i am familiar with most of the thing
[21:21:27] scope: then just start and as you hit a tough spot google :p
[21:21:58] scope: the hardest part of rails for me was the whole asset pipeline
[21:22:25] bronson: the asset pipeline is a cranky beast.
[21:22:35] roshanavand: has joined #RubyOnRails
[21:22:40] scope: i think i pissed a few people off today
[21:22:48] scope: damn thing is just winding me up
[21:22:52] chipotle_: has joined #RubyOnRails
[21:22:53] cUr10u5: well i am looking for an article or concise guide that would give me a kickstart
[21:23:14] scope: and after hours of working on asset bloody pipeline and thinking i got everything working
[21:23:24] scope: it throws another spanner in the works
[21:23:29] marr123: has joined #RubyOnRails
[21:23:47] cUr10u5: but asset pipeline is no longer a core feature of rails i think
[21:23:59] bronson: cUr10u5: what makes you say that?
[21:24:13] bronson: as much as I'd welcome that news, I don't think it's true.
[21:24:15] ur5us: has joined #RubyOnRails
[21:24:46] cUr10u5: i have read it somewhere
[21:24:50] bronson: and, good luck to whatever project replaces the asset pipeline!
[21:24:57] bob434: has joined #RubyOnRails
[21:24:59] thejoecarroll_: has joined #RubyOnRails
[21:25:11] scope: i hope your wrong
[21:25:24] scope: i just spent the better part of a day researching it
[21:25:29] cUr10u5: no i am not saying its not necessary i am just saying its not a core feature anymore
[21:25:32] rheddry: has joined #RubyOnRails
[21:25:37] bronson: scope: no worries, it's still a core part of Rails 5
[21:25:45] Janno: has joined #RubyOnRails
[21:25:47] eyck_: has joined #RubyOnRails
[21:25:51] aaronseibert_: has joined #RubyOnRails
[21:25:56] rtl: has joined #RubyOnRails
[21:25:59] Radar: [08:23:51] <cUr10u5> but asset pipeline is no longer a core feature of rails i think
[21:26:06] Radar: worst misinformation ever
[21:26:08] jarib: has joined #RubyOnRails
[21:26:14] unreal: has joined #RubyOnRails
[21:26:17] cfloare: has joined #RubyOnRails
[21:26:20] hoylemd: has joined #RubyOnRails
[21:26:20] Radar: cUr10u5: !r4ia
[21:26:20] helpa: cUr10u5: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[21:26:23] sunya7a_: has joined #RubyOnRails
[21:26:34] elaptics`away: has joined #RubyOnRails
[21:26:38] tparenti: has joined #RubyOnRails
[21:26:43] ekem: has joined #RubyOnRails
[21:26:45] raldu: has joined #RubyOnRails
[21:26:46] cUr10u5: helpa: thanks i will check it out
[21:26:48] segy: has joined #RubyOnRails
[21:27:09] strongcode: has joined #RubyOnRails
[21:27:21] fumk: has joined #RubyOnRails
[21:27:35] humd1ng3r: has joined #RubyOnRails
[21:28:38] scope: this is the only script left in my app
[21:28:39] scope: https://gist.github.com/scope2229/9482dedaaf1d8d217f24
[21:28:45] scope: where on earth does it go
[21:29:06] scope: i need it thats for sure and the jquery peeps said my file is all good so has to be the script
[21:29:23] Coldblackice: has joined #RubyOnRails
[21:29:25] AntiSpamMeta: has joined #RubyOnRails
[21:29:44] bronson: scope: stick it in a partial...?
[21:29:57] scope: its a script though
[21:30:09] hahuang61: has joined #RubyOnRails
[21:30:21] ruurd: has joined #RubyOnRails
[21:30:35] scope: same with the datepicer
[21:30:38] g3funk: has joined #RubyOnRails
[21:30:43] mdw: has joined #RubyOnRails
[21:30:43] scope: that script needs removing
[21:31:13] cUr10u5: radar: its written in the railsguide itself
[21:31:24] Radar: cUr10u5: link plz
[21:31:44] Radar: cUr10u5: If it's written in the asset pipeline guide, perhaps it's now the time to tell you that I wrote that one?
[21:31:54] cUr10u5: http://guides.rubyonrails.org/asset_pipeline.html
[21:31:56] bronson: haha, I see
[21:32:08] bronson: That just means it's no longer in rails/rails codebase.
[21:32:11] Radar: cUr10u5: and where exactly does it say that it's deprecated?
[21:32:33] cUr10u5: i didn't say its deprecated
[21:32:36] bronson: “The asset pipeline is technically no longer a core feature of Rails 4, it has been extracted out of the framework into the sprockets-rails gem.”
[21:32:45] baweaver: has joined #RubyOnRails
[21:32:58] cUr10u5: yes that is what i was trying to say
[21:32:59] scope: but its been moved into another aswell
[21:33:10] scope: its a few gems that are installed automatically
[21:33:14] scope: that i understand
[21:33:18] choke: has joined #RubyOnRails
[21:33:38] scope: sass uglifier and another
[21:33:41] Radar: scope: Do you have an app which reproduces the problems you're seeing?
[21:33:47] cUr10u5: you must have misunderstood. i am new to rails and was going through the guide and read it their
[21:33:51] bronson: Radar: admittedly, that's a natural misunderstanding to make... The reader is expected to understand the difference between core code and gems.
[21:33:56] scope: if i push it to github i do
[21:34:07] Radar: scope: yes please
[21:34:25] scope: it confused the hell out of me i red it 20 times wasnt untill i got someone to sit and explain it to me
[21:35:18] Doddlin: has joined #RubyOnRails
[21:35:47] zave: has joined #RubyOnRails
[21:39:23] Radar: longest second ever ;)
[21:39:24] banister: has joined #RubyOnRails
[21:39:32] kdough: has joined #RubyOnRails
[21:40:41] dcunit3d: has joined #RubyOnRails
[21:41:26] scope: hahah sorry
[21:41:29] scope: i forgot to commit
[21:41:34] scope: then forgot to add a message
[21:41:36] scope: https://github.com/scope2229/windsorlodge
[21:41:45] scope: 44% pushed
[21:42:08] scope: slow internet untill april
[21:42:17] scope: the fibre optic cable in the pacific is broken again
[21:42:20] Radar: Will the push be finished before then?
[21:42:43] Radar: Ok, so what's the issue here?
[21:43:24] scope: and the TM people didnt tell anyone about the slow internet problem untill news reporters finally placed an article next day they commented about the fibre optic cable being bodged again
[21:43:43] scope: when uyou open the page and click on the calendar input it wont load
[21:43:49] Radar: Why do you have jquery-1.11.1 and jquery-ui in your app/assets/javascripts directory? They are supposed to come from the jquery-rails and jquery-ui-rails gems
[21:44:11] Radar: You should be using the pg gem in both development and production.
[21:44:19] scope: im a complete noob
[21:44:27] Radar: Don't use different databases in your different envs. Something will work locally and then break when you deploy it.
[21:44:48] scope: so i can delete both scripts
[21:44:57] Radar: There's also no need for an assets group (just remove the group "wrapping" in your Gemfile)
[21:45:08] Radar: And remove bootstrap.js
[21:45:15] replay_: has joined #RubyOnRails
[21:45:22] scope: but then how does the webpage know that the calendar is a popup
[21:45:30] scope: when i remove them nothing gets displayed
[21:45:50] Radar: That's alright, we'll get to that in a moment. Let me fiddle for a few minutes.
[21:46:16] scope: i think i might have an idea
[21:46:20] scope: correct me if im wrong
[21:46:36] scope: the .js files are not needed because i installed them with gem etc
[21:46:42] scope: but the css files are needed
[21:47:06] Radar: CSS files also come with the gem
[21:47:24] scope: now im mind blown
[21:47:36] scope: i might add its 5:47am
[21:47:43] Radar: However, your bootstrap version that you have in your assets file is v3.3.5, but the one from the gem is v4.0.0
[21:47:44] mwlang: if there’s one thing I look forward to with R5 is not having to remember rake vs. rails
[21:47:47] scope: ive been studying since 5pm hahaha
[21:47:57] Radar: scope: WA or... India?
[21:48:06] sonofdirt: has joined #RubyOnRails
[21:48:09] scope: but im english
[21:48:10] Radar: Ah, in between :)
[21:48:30] roshanavand: has joined #RubyOnRails
[21:49:11] codepete: has joined #RubyOnRails
[21:49:49] bronson: cUr10u5, Radar: https://github.com/rails/rails/pull/24244
[21:49:54] bronson: ah, bogus. cUr10u5 left.
[21:51:09] maxdoubt: has joined #RubyOnRails
[21:51:26] jenrzzz: has joined #RubyOnRails
[21:52:41] bronson: mwlang: yep, rake/rails equivalency is nice. unfortunately the code underneath is not ready... guy writing it went silent before it was finished.
[21:53:13] bronson: it'll have some warts until 5.1 probably. small stuff, like docstrings.
[21:53:35] Radar: scope: doing a PR to your repo, one moment
[21:53:43] scope: no worries dont rush
[21:53:47] scope: ive been at it for 13 hours
[21:53:55] scope: im just happy someone can help
[21:54:03] scope: im sure i have a new bold patch
[21:54:17] scope: and the morning radio came on
[21:54:33] Radar: I can't figure out the jquery-ui theme right now
[21:55:06] bronson: ghod, jquery-ui
[21:55:10] bronson: ACTION shudders at the memories
[21:55:20] scope: thats ok so how is it the css files come with the gem
[21:55:43] scope: thats a little confusing as if i want to edit it and make a pretty design is that still possible
[21:56:05] Radar: but perhaps get some sleep first before tackling it?
[21:56:16] scope: yer thats for sure
[21:56:23] scope: i might pick your brain at a later date
[21:57:11] bitkiller: has joined #RubyOnRails
[21:57:50] scope: best get to sleep anyway before all the mosques start up
[21:58:02] Radar: good morning then, scope :)
[21:58:14] scope: hahaha no no good night kind sir
[21:58:25] scope: it kinda doent bother me
[21:58:31] scope: been traveling for over ten years
[21:58:49] scope: havent been back to england since but the english body clock is still there
[21:59:05] scope: can take the man from england but cant take englnd from the man shame really
[21:59:08] scope: hate the place
[21:59:12] mwlang: bronson: bummer that. where’s the repo for it?
[21:59:29] bronson: mwlang: rails/rails
[21:59:29] stannard: has joined #RubyOnRails
[21:59:54] bronson: I forget the classes, can look if you can't find 'em.
[22:00:21] mwlang: ah. I’m going to take a peek.
[22:01:31] mdw7: has joined #RubyOnRails
[22:02:19] djbkd: has joined #RubyOnRails
[22:03:06] IFrank00: has joined #RubyOnRails
[22:03:18] bronson: mwlang: right on. you might want to browse some discussion starting here: https://github.com/rails/rails/issues/23410
[22:05:23] replay: has joined #RubyOnRails
[22:06:39] nerium: has joined #RubyOnRails
[22:06:49] Lingo: has joined #RubyOnRails
[22:07:57] akshat: has joined #RubyOnRails
[22:14:28] ql6wlld: has joined #RubyOnRails
[22:15:31] BlissOfBeing: has joined #RubyOnRails
[22:17:24] _Tariq: has joined #RubyOnRails
[22:17:46] maxdoubt: has joined #RubyOnRails
[22:19:06] sonofdirt: has joined #RubyOnRails
[22:21:23] DmitryBochkarev: has joined #RubyOnRails
[22:23:28] halfamind: has joined #RubyOnRails
[22:25:08] djbkd: has joined #RubyOnRails
[22:26:23] DmitryBochkarev: has joined #RubyOnRails
[22:33:45] baweaver: has joined #RubyOnRails
[22:34:31] akshat: has joined #RubyOnRails
[22:34:44] halfamind: has joined #RubyOnRails
[22:37:39] siaW: has joined #RubyOnRails
[22:38:02] siaW: i need help. how do i make this test pass https://gist.github.com/siaw23/e1ff201df46318b8258a
[22:38:32] mostlybadfly: has joined #RubyOnRails
[22:38:35] siaW: i’m using devise. so all actions redirect to sign_in page. how do i sign in in the tests
[22:40:23] siaW: i updated my accounts controller spec
[22:40:24] siaW: https://gist.github.com/siaw23/e1ff201df46318b8258a
[22:40:25] _Tariq: has joined #RubyOnRails
[22:40:34] ftj: has joined #RubyOnRails
[22:41:45] kgutteridge: has joined #RubyOnRails
[22:47:10] RegulationD: has joined #RubyOnRails
[22:48:07] tomatoes: has joined #RubyOnRails
[22:48:58] codepete: has joined #RubyOnRails
[22:52:33] Cohedrin: has joined #RubyOnRails
[22:54:19] |PiP|: has joined #RubyOnRails
[22:54:34] |PiP|: how do i access request headers in a case-insensitive manner (i.e. in accordance with the RFC)
[22:57:02] nerium: has joined #RubyOnRails
[22:59:58] baweaver: has joined #RubyOnRails
[23:00:34] arBmind: has joined #RubyOnRails
[23:00:41] justinweiss: has joined #RubyOnRails
[23:01:16] Lingo: has joined #RubyOnRails
[23:02:22] mhoungbo: has joined #RubyOnRails
[23:03:03] Devalo: has joined #RubyOnRails
[23:03:49] one_zero: has joined #RubyOnRails
[23:08:10] pawnbox: has joined #RubyOnRails
[23:08:46] superlou: has joined #RubyOnRails
[23:08:51] berk: has joined #RubyOnRails
[23:09:29] ur5us: has joined #RubyOnRails
[23:11:44] berk: has joined #RubyOnRails
[23:12:36] qejk: has joined #RubyOnRails
[23:15:05] siaW: is it normal that i’m using factorgirl and sign_in methods in controller spec? i thought these things are done in feature specs
[23:15:07] siaW: https://gist.github.com/siaw23/e1ff201df46318b8258a
[23:16:31] chouhoulis: has joined #RubyOnRails
[23:22:09] superlou: has joined #RubyOnRails
[23:23:21] choke: has joined #RubyOnRails
[23:26:36] pawnbox: has joined #RubyOnRails
[23:28:23] mikecmpbll: has joined #RubyOnRails
[23:30:51] smathy: |PiP|, what RFC are you talking about?
[23:31:20] nertzy: has joined #RubyOnRails
[23:34:18] roshanavand: has joined #RubyOnRails
[23:35:54] k1t: has joined #RubyOnRails
[23:38:38] zave: has joined #RubyOnRails
[23:40:35] chouhoulis: has joined #RubyOnRails
[23:40:43] djbkd: has joined #RubyOnRails
[23:42:41] bob434: has joined #RubyOnRails
[23:47:27] Pupeno: has joined #RubyOnRails
[23:56:57] gormandy: has joined #RubyOnRails