« Back to channel list

#RubyOnRails - 06 April 2016

« Back 1 day Forward 1 day »
[00:00:05] Ericx2x: has joined #RubyOnRails
[00:00:21] s2013: actually i was wondering if there was such a gem that allows you to set some fields as "limited" view for non authorized users. for example i want to get users info.. so if im the user the api returns everything for the user.. but if its some other request, it can return the users name, age, and some other public info. if that makes sense
[00:01:24] Pathfinder: has joined #RubyOnRails
[00:01:54] Radar: I think you could accomplish the same thing by using different templates.
[00:02:30] quazimodo: has joined #RubyOnRails
[00:03:11] s2013: yeah but im thinking you could just set attributes as limited or something in the model so you dont need to mess with multiple templates. ill research it further.. might even work on a gem.. but let me show you what i mean. let me write up a quick gist
[00:03:26] Radar: We tried this with attr_accessible and it didn't work. Use a different template.
[00:03:38] tvon: Do you mean something like row-level permissions/security?
[00:04:13] ekinmur: has joined #RubyOnRails
[00:04:26] tvon: No, never mind, sounds like you want it more based on the form of access.
[00:04:50] tvon: I've done something similar with different serializers, using active model serializers.
[00:06:00] s2013: https://gist.github.com/anonymous/6c03d53b83f158bca6c4a62047164d19
[00:06:01] stardiviner: has joined #RubyOnRails
[00:06:05] s2013: maybe this might make more sense
[00:11:18] SeductiveError: has joined #RubyOnRails
[00:12:01] tvon: s2013: Yeah, personally I'd probably use different serializers (which is basically just using different templates) and pick which one based on access level, but that is admittedly not a very declarative or elegant solution.
[00:12:31] tvon: I mean, I guess you could use cancan to determine what fields you have access to and have one template that shows whatever can be shown based on that access level...
[00:12:46] Radar: s2013: Yes, we tried doing model-level things like (attr_accessible) in the past and it went to shit quickly enough that we abandoned it.
[00:12:56] owenjones: has joined #RubyOnRails
[00:13:00] Radar: s2013: If anything, it should be done on a controller level where you pick the template to render.
[00:13:42] s2013: yeah thats what we are doing now
[00:13:55] s2013: wondered if there was another solution.. oh well
[00:15:12] Ericx2x: has joined #RubyOnRails
[00:15:55] stannard: has joined #RubyOnRails
[00:16:43] joshhbk: has joined #RubyOnRails
[00:19:10] blackmesa: has joined #RubyOnRails
[00:20:04] s2013: Radar are you going to railsconf ?
[00:20:25] Radar: s2013: Nope. 1) Company isn't paying 2) Wife is pregnant.
[00:20:34] s2013: 1) that sucks 2) thats awesome. congrats!
[00:20:43] s2013: when is she expecting?
[00:20:46] Radar: End of Aug
[00:20:52] s2013: oh nice.congrats man
[00:20:55] Radar: thank you
[00:20:55] VeryBewitching: Congratulations Radar
[00:21:36] s2013: must be very stressful and exciting
[00:21:46] Radar: No and yes
[00:21:59] Radar: It's just a lot of waiting
[00:22:04] Radar: the stress will come when the baby does :)
[00:22:11] s2013: oh it will multiply hell of a lot more
[00:22:22] s2013: my friends that had kids, they look like they are dying at times and other times they are super happy
[00:26:12] Wolland: has joined #RubyOnRails
[00:27:33] rickmasta: has joined #RubyOnRails
[00:29:04] Radar: 49% the biggest pain in the ass ever, 51% the most sublime joy you've ever felt
[00:29:09] Radar: ^ quote from somewhere, can't remember where
[00:30:50] pwnd_nsfw`: I'm sure the amount of sleep has something to do with that
[00:32:28] rogue_koder: has joined #RubyOnRails
[00:33:45] owenjones: has joined #RubyOnRails
[00:33:59] sudoubuntu: has joined #RubyOnRails
[00:34:23] SteenJobs: has joined #RubyOnRails
[00:36:53] SteenJobs: hey guys - i’m implementing stripe integration and after the client side receives a token from stripe’s servers, i noticed that their docs advise adding a hidden input to the form, containing the token id, and then submitting the form using JS to the server - why would this be preferable over just sending the post req using JS?
[00:37:01] owenjones: has joined #RubyOnRails
[00:37:15] SteenJobs: also - if i receive errors on the client side back from Stripe, how can i add their contents to flash?
[00:37:56] paradisaeidae: has joined #RubyOnRails
[00:39:40] s2013: Radar haha true
[00:39:56] s2013: btw can someone look at my jbuilder template and let me know what im doing wrong? https://gist.github.com/ss2k/f326ddb13df91963bc59644e2e03b4c4 for some reason it only returns the rsvps not the rest
[00:42:18] mDuff: has joined #RubyOnRails
[00:43:08] Radar: s2013: Do you have an example of what it is returning?
[00:43:11] Radar: seems fine to me
[00:43:14] s2013: yeah thats waht i thought
[00:43:27] tjohnson: has joined #RubyOnRails
[00:44:01] Inside: has joined #RubyOnRails
[00:44:01] Inside: has joined #RubyOnRails
[00:44:36] Radar: I think the json.array! call should be nested inside something like a json.rsvps block
[00:44:48] s2013: ok let me try
[00:44:52] Tempesta: has joined #RubyOnRails
[00:44:52] s2013: butthe event one is still empty :\
[00:45:54] s2013: and rsvp is the one thats being returend oddly enough
[00:48:26] martin290: has joined #RubyOnRails
[00:48:33] martin290: Hey everyone
[00:49:03] s2013: hello martin290
[00:49:16] martin290: How's it going?
[00:49:17] s2013: hmm wrapping the json.array inside json.rsvps seemed to have done the trick i believe. thanks
[00:49:20] s2013: chilling. you?
[00:50:10] martin290: I'm thinking learning ruby
[00:50:41] martin290: I know c# but I want something open source and can be used on Linux
[00:51:01] baweaver: ruby or ruby on rails?
[00:51:14] martin290: Ruby on rails
[00:51:19] baweaver: either way you probably want to join #ruby as well
[00:51:24] baweaver: and definitely learn some ruby first
[00:51:32] helpa: 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
[00:51:41] rafaelfranca: has joined #RubyOnRails
[00:51:48] martin290: Cool thanks
[00:51:54] martin290: Do you think ruby is hard?
[00:51:56] baweaver: The Well Grounded Rubyist and Eloquent Ruby are your best bets for Ruby
[00:52:19] martin290: Easy, like php easy?
[00:52:36] Arcaire: That's subjective.
[00:52:38] Arcaire: I found C easy.
[00:52:52] Arcaire: I'm finding Elixir and initially found Ruby quite difficult.
[00:53:14] Arcaire: It's easy because it's an expressive language.
[00:53:39] baweaver: pretty much that
[00:53:40] martin290: Would you ever go back to another language from ruby?
[00:53:43] baweaver: just jump in
[00:53:43] Arcaire: Very easy to read, intuitive to write and learn. Often your first assumption about a method to do something will be correct.
[00:53:53] Arcaire: Yeah I'm in the process of doing that, but not for reasons that are of any relevance.
[00:53:55] baweaver: also subjective
[00:54:06] baweaver: ruby is good for certain things
[00:54:09] baweaver: but bad for others
[00:54:18] Arcaire: All languages are, yeah.
[00:54:19] sevenseacat: has joined #RubyOnRails
[00:54:20] baweaver: any language is
[00:54:27] owenjones: has joined #RubyOnRails
[00:54:31] Arcaire: e.g., you wouldn't use C/++ for a web application unless you were certifiably insane.
[00:54:40] martin290: How about for a web app which will be very data driven?
[00:55:08] Arcaire: And you *could* use Ruby for high-speed network packet analysis, but you would get better performance out of something else.
[00:55:15] martin290: Would ruby on rails be for that?
[00:55:24] Arcaire: Rails is basically exactly for that.
[00:55:37] martin290: Oh awesome!!!
[00:55:45] martin290: Php is just so....
[00:55:46] jottr: has joined #RubyOnRails
[00:55:53] Arcaire: Inconsistent, generally.
[00:55:57] artto: has joined #RubyOnRails
[00:56:11] Arcaire: Fun fact: It's like that because originally all the function names had to be different lengths due to how the PHP interpreter was written.
[00:56:30] martin290: That's insane
[00:56:57] sp1rs: has joined #RubyOnRails
[00:57:43] algernop_k: That's not nearly as insane as the fact that php allows non-breaking spaces in variable names
[00:58:16] algernop_k: Sprinkle some of those characters in a colleague's source files and watch them descend into complete madness
[00:58:42] Arcaire: algernop_k: I try not to think about that.
[00:58:46] Arcaire: Also emojis but so does Ruby.
[00:58:46] martin290: Does ruby have a debugger? Like, can you step through each line of code?
[00:58:54] Arcaire: It's called `pry.
[00:59:08] martin290: Ok, I think I'm sold already :)
[01:01:04] martin290: Can you recommend a good ide for Windows?
[01:01:25] Arcaire: Most of us here either use Sublime Text ($60USD) or Atom (free). It's just a text editor.
[01:01:30] Arcaire: RubyMine is pretty good though, and an AIO.
[01:02:50] hahuang65: has joined #RubyOnRails
[01:02:53] ekinmur: has joined #RubyOnRails
[01:03:01] yo: has joined #RubyOnRails
[01:03:34] algernop_k: martin290: Do you have any friends/colleagues who use vim?
[01:03:46] tvon: algernop_k: You sound like a missionary
[01:04:18] algernop_k: If so, don't bother with any other editors, save some time and start learning vim now. They'll convert you either way.
[01:04:23] tvon: "Do you have any friends that might be interested in learning the way of vim?"
[01:04:32] barajasfab: has joined #RubyOnRails
[01:04:34] algernop_k: Do you have a moment to talk about Vim? :)
[01:04:37] martin290: algernop_k I knew one person but vim isn't an ide
[01:04:53] Arcaire: martin290: all-in-one
[01:05:02] tvon: martin290: If you're bored you should pop into #vim and kick off with that.
[01:05:07] martin290: Arcaire ah ok
[01:05:19] Arcaire: lol i still don't use vim
[01:05:20] Arcaire: and probably never will
[01:05:25] algernop_k: What's the single most important thin an IDE gives you?
[01:05:34] algernop_k: If it's completion, YouCompleteMe has you covered
[01:05:40] martin290: Code completion?
[01:05:49] neanderslob_: has joined #RubyOnRails
[01:06:05] algernop_k: pry and rescue for that
[01:06:18] martin290: Is pry a gem?
[01:06:34] jenrzzz: has joined #RubyOnRails
[01:06:43] algernop_k: Yes, it's an improved debugger to replace Ruby's default one
[01:07:02] tvon: I still want to try rubymine one of these days, I keep downloading it with the 30 day trial, launching it once and never putting any time into it until the trial expires.
[01:07:04] Radar: everyone knows sublime text 3 is the only editor you will ever need
[01:07:11] baweaver: easy on all the Vim / editor wars
[01:07:23] baweaver: if someone specifically asks a question about it, feel free
[01:07:29] algernop_k: ACTION checks off "start an editor war on irc" on his daily checklist
[01:07:32] baweaver: otherwise, #ruby-offtopic would be a better venue
[01:07:34] Radar: This is a screenshot of my RubyMine setup when I used to use it: http://farm4.static.flickr.com/3363/3631456329_087cca1e7b.jpg
[01:08:10] patrick-sartent: has joined #RubyOnRails
[01:11:05] Radar: aw martin290 is gone
[01:11:35] Radar: I was going to say: probably better off learning Ruby first with Well Grounded Rubyist.
[01:12:45] sevenseacat: is a good book, that one.
[01:13:57] Radar: Also I would like to say: all the cool kids are learning Elixir these days so probably Programming Elixir is a better place to start :P
[01:16:23] rafaelfranca: has joined #RubyOnRails
[01:16:46] SeductiveError: has joined #RubyOnRails
[01:17:48] htmldrum: has joined #RubyOnRails
[01:18:47] rubyonrailed: has joined #RubyOnRails
[01:20:43] Tempesta: has joined #RubyOnRails
[01:20:54] tvon: elixir++
[01:21:18] baweaver: elixir += 1
[01:21:21] tvon: oh, haha
[01:21:24] baweaver: we're still in ruby
[01:21:37] tvon: elixir |> Math.increment_the_thing
[01:22:02] magikid: has joined #RubyOnRails
[01:23:20] Radar: I think you mean elixir |> Kernel.+(1)
[01:23:57] paradisaeidae: even though it's written in java, great editor.
[01:24:23] baweaver: little late to that fire fight mate
[01:25:18] baweaver: ragequit ftw
[01:26:02] Arcaire: nah just a NPE caused the desktop to crash
[01:27:44] jenrzzz: has joined #RubyOnRails
[01:29:04] jottr: has joined #RubyOnRails
[01:30:39] cnk: has joined #RubyOnRails
[01:31:09] Pathfinder_: has joined #RubyOnRails
[01:31:11] hahuang65: has joined #RubyOnRails
[01:33:28] WhatTheRails: is Elixir the next big thing ?
[01:33:58] WhatTheRails: I’m still trying to dominate php
[01:34:24] _Tariq: has joined #RubyOnRails
[01:34:44] Radar: PHP is so 10 years ag
[01:35:27] Radar: WhatTheRails: What if I told you that there has never, is never and will never be a single "next big thing"?
[01:35:31] WhatTheRails: I’d say RoR is 10 years ago, PHP is like 15
[01:35:57] sevenseacat: ACTION raises eyebrow
[01:36:13] tvon: Radar: I mean, it depends on who you listen to. node is kind of the current big thing to a lot of people.
[01:36:20] WhatTheRails: jizz I forgot what channel I was on
[01:36:26] Radar: WhatTheRails: lanugage
[01:36:27] Radar: language*
[01:36:34] Radar: tvon: I have opinions about Node.
[01:36:45] dvinciguerra__: has joined #RubyOnRails
[01:37:01] Radar: Usually it involves swearing, but today I will be eloquent.
[01:37:08] WhatTheRails: tvon: I agree. JS frameworks right now are what RoR was like 8 years ago. Not saying one is better though
[01:37:30] Radar: Node people are attempting -- _and failing at_ -- things that Erlang developers perfected 20 years ago.
[01:38:05] hahuang61: has joined #RubyOnRails
[01:39:45] Radar: Except in the realm of JS/CSS build tools. That's the only thing I think they're getting even close to 'right'
[01:39:53] _Tariq: has joined #RubyOnRails
[01:40:00] paradisaeidae: has joined #RubyOnRails
[01:40:08] Radar: Async programming in Node? Yeah, because ActiveRecord callbacks were such a great idea that I want them _everywhere_
[01:41:51] algernop_k: Writing big applications in Node feels a bit like writing big applications in Perl
[01:42:26] Arcaire: Reminder - Node.js: https://blog.relayr.io/wp-content/uploads/2015/12/NodeJS_pyramid.jpg
[01:43:03] algernop_k: Gotta be fair, that isn't exactly something you should do, for any reason
[01:43:18] WhatTheRails: For some reason all cool examples all over the internet about realtime apps are written using Node
[01:43:31] Arcaire: Like what?
[01:43:33] WhatTheRails: RoR won the Blog examples
[01:43:56] Arcaire: Github.com is my favourite blog written in RoR.
[01:44:04] Arcaire: >written in RoR
[01:44:08] Arcaire: ugh what did i just say
[01:44:16] Radar: Arcaire: are you having a stroke
[01:44:18] Tempesta: has joined #RubyOnRails
[01:44:20] Arcaire: everyone knows what i mean, hopefully
[01:44:21] Radar: WhatTheRails: [citation needed]
[01:44:28] Cohedrin: Radar what specificfly don't you like about AR callbacks?
[01:44:34] moei: has joined #RubyOnRails
[01:44:38] Cohedrin: I see a lot of people that don't like them, curious as to why
[01:44:44] Radar: Cohedrin: One moment, I will get you an example.
[01:45:05] Radar: Cohedrin: what do you expect to happen when I save a brand new Advert model instance in my application?
[01:45:31] DoctorMonocular: has joined #RubyOnRails
[01:45:31] Radar: Like, how many queries do you think should be executed?
[01:45:40] Cohedrin: I see what you're getting at
[01:45:41] Radar: 5? 10? 15?
[01:45:42] Radar: https://gist.github.com/radar/50ac648b24cdff3126466cb209db6493
[01:45:53] Radar: Because when I save an advert in my test environment, it executes 20 queries.
[01:45:59] Radar: And advert is our God model. So there's a lot of that shit happening.
[01:46:02] Cohedrin: yeah, I'll admit, they can be misused horribly
[01:46:19] Radar: And AR callbacks are to blame especially because a lot of these queries are done before or after save.
[01:46:22] Cohedrin: but is there any gripe with them other than they can be misused/used as a crutch?
[01:46:29] Radar: No, that is my only gripe.
[01:46:34] Arcaire: > SQL (0.3ms) INSERT INTO `slugs` (`slug`, `sluggable_id`, `sluggable_type`, `created_at`, `updated_at`)
[01:46:36] Arcaire: >sluggable type
[01:46:41] Cohedrin: yeah, I agree with you
[01:46:43] Radar: Arcaire: yes, we have different sluggable objects.
[01:46:53] Arcaire: the term 'slug' needs to be reinvented
[01:46:59] Radar: I would much rather the "callbacks" be moved into a class and that whole "this is what happens when an advert is saved" flow becomes super obvious.
[01:46:59] Cohedrin: callbacks tend to favor poor pratice due to the nature of them
[01:47:06] Cohedrin: its so easy just to throw something in a callback
[01:47:08] Radar: See also: Spree's Order model ;)
[01:47:12] SeductiveError: has joined #RubyOnRails
[01:47:13] Arcaire: it is neither a high caliber bullet nor a mollusc
[01:47:29] SeductiveError: hi all, how do I stop JSON of model from being outputted in my template?
[01:47:44] Cohedrin: Thats a good point, about the flow not being obvious Radar
[01:47:51] Arcaire: SeductiveError: Don't output it?
[01:47:54] Arcaire: ... alright then
[01:47:58] Cohedrin: comcast got him
[01:48:18] SeductiveError: has joined #RubyOnRails
[01:48:29] SeductiveError: apologies if anyone responded, hit my wifi switch
[01:49:20] Cohedrin: SeductiveError, I'm not sure what you mean by "being outputed from my template"
[01:49:25] Cohedrin: can you clarify
[01:49:29] helpa: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[01:49:31] Arcaire: I want to know how you even managed to hit your wifi switch tbh
[01:49:44] SeductiveError: its near my foot
[01:49:55] stannard: has joined #RubyOnRails
[01:50:37] SeductiveError: comcast had a shitty install, this is an older building so there were no good coax cable hookups, so they had to drill a hole in my wall and the router/modem is right next to my foot
[01:51:43] RegulationD: has joined #RubyOnRails
[01:51:47] SeductiveError: anyways, im just trying to list out my model as a view within the template, as per tutorial on rails docs, and it works fine. but below the list the json is also being output, and I do not want that
[01:52:14] Cohedrin: can you gist the code thats giving you problems?
[01:52:16] Radar: SeductiveError: !rule0
[01:52:16] helpa: SeductiveError: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[01:52:45] sevenseacat: ACTION puts money on an = somewhere instead of a -
[01:54:01] ramfjord: has joined #RubyOnRails
[01:55:09] dstarh: has joined #RubyOnRails
[01:55:13] SeductiveError: sevenseacat you genius you
[01:55:16] sevenseacat: ACTION waits for code
[01:55:32] sevenseacat: next time, post code.
[01:55:51] SeductiveError: sure, i'm in a hurry so it was just a quickie
[01:59:24] joshkovach: has joined #RubyOnRails
[01:59:26] edwinvdgraaf: has joined #RubyOnRails
[02:01:38] owenjones: has joined #RubyOnRails
[02:02:33] HouseMD: has joined #RubyOnRails
[02:02:50] pawnbox: has joined #RubyOnRails
[02:05:08] pawnbox: has joined #RubyOnRails
[02:07:21] rake_db_migrate: has joined #RubyOnRails
[02:11:01] forklee: has joined #RubyOnRails
[02:11:03] rake_db_migrate: has joined #RubyOnRails
[02:11:25] hahuang61: has joined #RubyOnRails
[02:19:13] chipotle: has joined #RubyOnRails
[02:21:26] Pathfinder_: has joined #RubyOnRails
[02:22:59] mwlang: how do I change the heap size for Sunspot Solr? I’ve found several SO answers, but it seems they’re all outdated for 2.2.5
[02:23:24] SteenJobs: has joined #RubyOnRails
[02:23:59] sp1rs: has joined #RubyOnRails
[02:24:18] Radar: switch to ElasticSearch ? ;)
[02:29:42] vuashhhh: has joined #RubyOnRails
[02:30:41] vuashhhh: I need to create an application that allows the user to create contacts with name and email by default AND allows the user to create custom fields for its contacts
[02:30:57] vuashhhh: can somebody give me an overview of what should I do?
[02:31:22] pawnbox: has joined #RubyOnRails
[02:31:45] sevenseacat: step 1: create the application
[02:31:52] sevenseacat: step 2: build your functionality
[02:32:00] vuashhhh: sevenseacat, nice hah
[02:32:10] vuashhhh: I already have the user and default contact working
[02:32:20] sevenseacat: so be more specific about what help you need
[02:32:35] sevenseacat: instead of 'i need an app with X functionality'
[02:32:40] mwlang: vuashhhh: Step 3: get specific with your questions and gist your code
[02:33:20] vuashhhh: I asked about and overview.. but I know, I should gisted first, gonna do this now
[02:36:11] pawnbox_: has joined #RubyOnRails
[02:37:19] IrishGringo: has joined #RubyOnRails
[02:38:30] sudoubuntu: has joined #RubyOnRails
[02:38:34] mwlang: sunspot heap answer: modify config/sunspot.yml and add “memory: 2g” (for example) (used to be “max_memory")
[02:40:53] SteenJobs: when integrating stripe, their docs advise catching the form submission, and after the client side receives a token from stripe’s servers, adding a hidden input to the form containing the token id, and then submitting the form using JS to the server - why would this be preferable over just sending the post req using JS?
[02:42:13] sevenseacat: which post req?
[02:42:18] sevenseacat: there are two
[02:42:56] sudoubuntu: has joined #RubyOnRails
[02:43:39] SteenJobs: token_id => my server
[02:44:07] benlieb: has joined #RubyOnRails
[02:44:45] sevenseacat: you can do that via js, but then you would have to process the response with js, redirect appropriately, show error messages, etc.
[02:44:57] sevenseacat: where all that is i presume built into the normal HTML form submission
[02:45:58] SteenJobs: yea, don’t get me wrong. this way is muchhhh easier. i actually didn’t know of that move, so i’ve been making client-side api calls and having to do the usual chaining promises on the client-side and handling json responses on the server side in each controller, etc.
[02:45:59] phredus: has joined #RubyOnRails
[02:46:00] StevenXL: has joined #RubyOnRails
[02:46:08] SteenJobs: being able to just grab the params is great
[02:46:32] SteenJobs: i was worried it was too good to be true and there was a catch or some reaosn not to do it that way
[02:46:53] vuashhhh: sevenseacat: https://gist.github.com/jonatasbaldin/906673980f847b30ec2cf6951dcb136e
[02:46:56] chagel: has joined #RubyOnRails
[02:47:22] vuashhhh: if you need more code, just tell me
[02:48:42] SteenJobs: sevenseacat: although when i receive the token on the client side (the method and callback are done with stripe methods) is there any way to access flash[] to pass a potential error message to the html?
[02:48:50] djbkd: has joined #RubyOnRails
[02:49:05] sevenseacat: flash is a ruby thing
[02:49:08] sevenseacat: not a JS thing
[02:49:11] SteenJobs: or do i just need to change the dom and its contents with the received error message
[02:49:55] SteenJobs: right - thought maybe there was some way with erb
[02:53:07] benlieb: has joined #RubyOnRails
[02:53:16] georgedrummond: has joined #RubyOnRails
[02:56:00] baweaver: has joined #RubyOnRails
[02:56:25] blackmesa: has joined #RubyOnRails
[03:03:19] chipotle: has joined #RubyOnRails
[03:03:59] jenrzzz: has joined #RubyOnRails
[03:04:59] Chagel_: has joined #RubyOnRails
[03:05:20] workmad3: has joined #RubyOnRails
[03:05:57] sudoubuntu: has joined #RubyOnRails
[03:08:32] qhp: has joined #RubyOnRails
[03:09:06] sudoubuntu: has joined #RubyOnRails
[03:09:39] Devalo: has joined #RubyOnRails
[03:11:21] sypheren: has joined #RubyOnRails
[03:11:35] B1n4r10: has joined #RubyOnRails
[03:11:57] lessless: has joined #RubyOnRails
[03:12:08] paradisaeidae: has joined #RubyOnRails
[03:13:05] dstarh: has joined #RubyOnRails
[03:15:11] braincrash: has joined #RubyOnRails
[03:17:25] fedexo: has joined #RubyOnRails
[03:20:06] artto: has joined #RubyOnRails
[03:21:20] mrgreenfur: has joined #RubyOnRails
[03:22:24] _Tariq: has joined #RubyOnRails
[03:25:54] Rubie: has joined #RubyOnRails
[03:28:10] ramfjord: has joined #RubyOnRails
[03:30:33] paradisaeidae_: has joined #RubyOnRails
[03:33:54] chagel: has joined #RubyOnRails
[03:34:01] owenjones: has joined #RubyOnRails
[03:35:16] sypheren: Hello people of the east
[03:35:29] sypheren: Was there a net split?
[03:36:52] Radar: Sypheren: not as far as I can see.
[03:36:59] mrgreenfur: has joined #RubyOnRails
[03:37:07] sypheren: What magic is afoot
[03:37:14] Radar: What are you seeing?
[03:37:19] Radar: Bright lights that have no clear source?
[03:37:22] arBmind1: has joined #RubyOnRails
[03:37:36] Radar: The vacant block at the end of your street has now got a fully-formed house on it?
[03:37:55] Radar: Are you feeling a strong attachment to the doll you're holding in your hands, as if you have known it forever?
[03:38:24] Radar: A strange hum that you can only feel... with your left elbow?
[03:38:39] falonofthetower: has joined #RubyOnRails
[03:39:37] _Tariq_: has joined #RubyOnRails
[03:39:46] B1n4r10: has joined #RubyOnRails
[03:40:00] Radar: Sypheren: Please answer at once. It's of grave importance.
[03:40:21] sypheren: I'm not sure I'm at liberty to tell
[03:40:25] sypheren: They have me now
[03:40:52] sevenseacat: well shit, there goes another one.
[03:42:42] _Tariq: has joined #RubyOnRails
[03:49:43] yfeldblum: has joined #RubyOnRails
[03:51:45] stannard: has joined #RubyOnRails
[03:52:02] robbyoconnor: has joined #RubyOnRails
[03:57:11] blackmesa: has joined #RubyOnRails
[03:58:20] mwlang: There’s gotta be a better way: params[params.keys.detect{|key| params[key].is_a?(Hash) and params[key].has_key?(:page_id)}][:page_id] => “3” (basically find the page_id in a hash of values one-level down).
[03:59:51] cnk: has joined #RubyOnRails
[04:00:12] sevenseacat: ACTION blinks
[04:00:12] helpa: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[04:00:44] sevenseacat: trying to find a key in an arbitrarily deep hash does sound like a really odd idea.
[04:00:58] baweaver: ruby 2.3 has dig iirc
[04:01:10] sevenseacat: wont do for this use case though
[04:01:33] baweaver: yeah, was thinking dot paths
[04:02:07] mwlang: basically, doesn’t matter who’s holding the “page_id” Just need to pluck it out of the params
[04:02:32] sevenseacat: what if theres more than one?
[04:02:33] sleungcy: has joined #RubyOnRails
[04:02:47] sevenseacat: what if there's none?
[04:02:49] sevenseacat: why do you care?
[04:02:51] mwlang: forms processing is driven via database entries and pokes a hidden page_id into their forms…but the form names can be different.
[04:03:55] baweaver: params.find { |_,v| v.is_a?(Hash) && v[:page_id] }.try(:value)
[04:03:55] mwlang: not railsy at all, but it does work…just wanting to clean this mess up so it’s at least readable.
[04:04:58] baweaver: assuming one layer depth
[04:05:49] mwlang: find, eh? I’m staring at Hash class docs and don’t see that one!
[04:05:55] mwlang: gonna try it, tho'
[04:06:17] baweaver: ah wait, that returns an array doesn't it
[04:06:25] baweaver: last instead of value then
[04:07:17] sudoubuntu: has joined #RubyOnRails
[04:07:35] sp1rs: has joined #RubyOnRails
[04:08:34] mwlang: ok, trying that...
[04:09:14] brentw: has joined #RubyOnRails
[04:10:40] mwlang: simpler: params.find { |_,v| return v[:page_id] if v.is_a?(Hash) and v[:page_id] }
[04:10:46] brentw: curious why you would need to call redirect_to action: :methodname, instead of just redirect_to methodname
[04:10:54] Lumia930: has joined #RubyOnRails
[04:12:15] qhp: has joined #RubyOnRails
[04:12:30] sevenseacat: brent_: I've never used the redirect_to action: syntax.
[04:12:46] njero: has joined #RubyOnRails
[04:13:06] mwlang: brent_: first form is Rails 1.x days.
[04:15:10] brentw: huh, so i'm on my first day of rails, but the tutorial i'm doing told me to redirect back to the main #index page
[04:15:21] mwlang: baweaver: thanks. not the prettiest code, but certainly better!
[04:15:46] Radar: I just used action: syntax not 30 mins ago
[04:15:57] sevenseacat: Radar: u so craycray
[04:15:58] Radar: I am using it becuase I want to redirect to an action in the same controller
[04:16:15] Radar: and I don't want to type redirect_to show_v2_client_advert_path(advert)
[04:16:16] PedramT: has joined #RubyOnRails
[04:16:22] brentw: it didn't give a description of how to, but redirect_to action: :index seemed to work
[04:16:49] brentw: what would be the ideal way?
[04:17:12] Radar: Depends on what the controller is and what the routes are.
[04:17:24] Radar: If that index action is the root action for the app, then redirect_to '/' is the shortest.
[04:17:34] Radar: Or even :/ if you want to golf it.
[04:17:55] chouhoulis: has joined #RubyOnRails
[04:18:27] brentw: looks like the route would be articles_path
[04:18:27] sevenseacat: i would typically just to `redirect_to my_named_path`
[04:18:31] brentw: if i'm reading it right
[04:18:57] brentw: felt like i tried that though and didn't work
[04:18:58] mwlang: brent_: another way => redirect_to root_path if you’ve set your root path in the routes.rb
[04:19:58] chagel: has joined #RubyOnRails
[04:19:58] sevenseacat: "didnt work" is one of those magic things that we can't really help with, without any information
[04:20:07] brentw: i'm trying it again now
[04:20:15] sevenseacat: (you'd be surprised how often that's all we get)
[04:20:22] djbkd: has joined #RubyOnRails
[04:20:22] StevenXL: has joined #RubyOnRails
[04:20:22] StevenXL: has joined #RubyOnRails
[04:20:27] Radar: We even have a tip for it
[04:20:29] Radar: !didntwork
[04:20:29] helpa: 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.
[04:20:32] sevenseacat: "X doesnt work. how do i make it work?"
[04:20:53] brentw: hmm, !didntwork
[04:21:23] brentw: i think before when i had redirect_to articles_path it was showing some error with a different method
[04:21:37] brentw: but can't recall, and worked this time
[04:22:08] PedramT: has joined #RubyOnRails
[04:22:37] brentw: is there a quick explanation for why articles_path is better than action: :index?
[04:23:49] brentw: if my memory is correct I may have been trying to give article_path(@articles) that argument and then getting the error
[04:26:30] Pathfinder: has joined #RubyOnRails
[04:30:25] chagel: has joined #RubyOnRails
[04:31:50] benlieb: has joined #RubyOnRails
[04:33:16] diegoaguilar: has joined #RubyOnRails
[04:35:56] merida: has joined #RubyOnRails
[04:36:01] mwlang: brent_: article_path(@article) usually makes sense. That generates a path to specific article
[04:36:25] mwlang: if you were attempting @articles, you weren’t passing a single instance in.
[04:36:50] mwlang: so the url generator wouldn’t have known what to do with that.
[04:36:52] edwinvdgraaf: has joined #RubyOnRails
[04:38:00] cnk: has joined #RubyOnRails
[04:39:44] Devalo: has joined #RubyOnRails
[04:40:31] brentw: Yeah, that's what I was doing, trying to pass @articles
[04:40:52] StevenXL: has joined #RubyOnRails
[04:43:39] Lumia930`: has joined #RubyOnRails
[04:45:20] rickmasta: has joined #RubyOnRails
[04:46:35] gambl0re: has joined #RubyOnRails
[04:47:27] lessless: guys, is it possible to run custom validation only on update: `validate :phones_attributes_presence, on: [:create, :json_api]` is triggered all the time
[04:47:39] lessless: sorry, only on create
[04:48:13] njero: lessless: http://edgeguides.rubyonrails.org/active_record_callbacks.html
[04:48:50] lessless: n_e_o, where I'm supposed to look to? Did you actually tried that?
[04:49:25] lxsameer: has joined #RubyOnRails
[04:49:41] lessless: and callbacks are not validations, afaik
[04:49:58] Radar: The guide covers both.
[04:50:14] Radar: validate :phones_attributes_presence, on: [:create] is valid syntax and should only trigger the validation when the record is created.
[04:51:43] duncannz: has joined #RubyOnRails
[04:52:27] sevenseacat: the guys have all the answers
[04:52:30] duncannz: has joined #RubyOnRails
[04:55:36] njero: lessless: exact link will be this.. sry.. http://guides.rubyonrails.org/active_record_validations.html#on
[04:55:55] njero: Radar: thanks..
[04:56:15] StevenXL: has joined #RubyOnRails
[04:56:16] lessless: guys, it's triggered even on update when paired with custom context
[04:56:25] Radar: lessless: !rule14
[04:56:25] helpa: lessless: We're not all guys here - while you probably didn't mean to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[04:57:48] Radar: lessless: !rule0
[04:57:48] helpa: lessless: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[04:58:15] Radar: Cannot reproduce in a new app
[04:58:19] Radar: please provide code which reproduces this issue
[04:58:53] apotry: has joined #RubyOnRails
[04:59:12] Radar: https://gist.github.com/radar/7d7a665b5c9e283ed9692cf5a6bf8521
[04:59:18] Radar: This is the code I used to try and reproduce your issue.
[04:59:21] Radar: lessless: Code plz.
[04:59:51] blackmesa: has joined #RubyOnRails
[05:01:26] hxegon: has joined #RubyOnRails
[05:02:58] Lumia930: has joined #RubyOnRails
[05:03:50] lessless: Radar, i think this is it https://gist.github.com/lessless/4a557d13aedf336191199b6abc66bac2
[05:05:26] Radar: lessless: what is create(:post)
[05:05:41] Radar: And what is this json_api option
[05:06:11] Darmani: ACTION is back
[05:06:18] lessless: FactoryGirl method, in this current case similar to Post.create(title: 'Nothing happens'), :json_api is a custom validation context
[05:06:28] Radar: lessless: validation context added by which gem?
[05:06:39] Radar: lessless: Show me how I can reproduce this issue in a new app. I still don't understand.
[05:06:45] Radar: lessless: An app which reproduces this issue would be best.
[05:08:19] StevenXL: has joined #RubyOnRails
[05:09:58] CanTonic: has joined #RubyOnRails
[05:10:25] alex88: has joined #RubyOnRails
[05:11:56] CanTonic: has joined #RubyOnRails
[05:14:05] chagel: has joined #RubyOnRails
[05:15:59] CanTonic: has joined #RubyOnRails
[05:16:56] lxsameer: is there any alternative to `capture` method ?
[05:17:04] jenrzzz: has joined #RubyOnRails
[05:17:26] Radar: lxsameer: !xy
[05:17:26] helpa: lxsameer: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[05:18:11] lxsameer: Radar: I'm using capture in my tests and i get an deprecation error, without an alternative solution
[05:18:23] Radar: lxsameer: !rule0
[05:18:23] helpa: lxsameer: Show rather than tell. Explaining your problem with code, stacktraces or errors is always preferred to explaining it with just text. Show us what's happening, rather than telling us. Put the code on https://gist.github.com and then give us the HTTP link to the Gist.
[05:18:49] lxsameer: Radar: capture(:stdout) is what i use in a 3 line method
[05:19:05] Radar: Warmer....
[05:19:35] Chagel_: has joined #RubyOnRails
[05:19:50] diegoviola: has joined #RubyOnRails
[05:19:57] alex88: has joined #RubyOnRails
[05:20:23] CanTonic: has joined #RubyOnRails
[05:21:13] lessless: Radar, https://github.com/lessless/cvc/blob/master/app/models/post.rb https://github.com/lessless/cvc/blob/master/test/models/post_test.rb
[05:21:23] Radar: lessless: ta
[05:21:36] lessless: maybe I misunderstand custom contexts role? :\
[05:21:40] lessless: what is ta?
[05:21:46] Radar: lessless: shortened version of "thanks"
[05:22:00] benlieb: has joined #RubyOnRails
[05:22:12] lessless: welcome! but there is a line stating that this should actually work https://github.com/rails/rails/blob/e3ceb28e66ca6e869f8f9778dc42672f48001a90/activemodel/lib/active_model/validations.rb#L75
[05:23:39] Radar: lessless: Your test is failing because there are no author attributes present.
[05:24:37] Radar: Your validation method also _always_ adds the errors, regardless.
[05:25:20] Radar: These files in the app make the test pass: https://gist.github.com/radar/9f3ea4a4afdda01ac86dcd617daaa2e3
[05:25:24] Radar: I still don't have a way to reproduce any issue.
[05:27:37] crameth: has joined #RubyOnRails
[05:28:59] Cohedrin: has joined #RubyOnRails
[05:29:35] CanTonic: has joined #RubyOnRails
[05:32:17] GnuYawk: has joined #RubyOnRails
[05:32:42] GnuYawk: has joined #RubyOnRails
[05:36:06] sekrit: has joined #RubyOnRails
[05:37:30] eyeamaye: has joined #RubyOnRails
[05:37:41] aganov: has joined #RubyOnRails
[05:37:59] yfeldblum: has joined #RubyOnRails
[05:38:30] arup_r: has joined #RubyOnRails
[05:47:10] CanTonic: has joined #RubyOnRails
[05:51:04] CanTonic: has joined #RubyOnRails
[05:53:27] CanTonic: has joined #RubyOnRails
[05:54:02] scepticulous: has joined #RubyOnRails
[05:54:37] sudoubuntu: has joined #RubyOnRails
[05:55:49] moeabdol4: has joined #RubyOnRails
[05:58:06] CanTonic: has joined #RubyOnRails
[05:59:33] chagel: has joined #RubyOnRails
[06:00:09] krz: has joined #RubyOnRails
[06:00:31] nodejunkie: has joined #RubyOnRails
[06:00:40] CanTonic: has joined #RubyOnRails
[06:00:47] blackmesa: has joined #RubyOnRails
[06:02:15] joshkovach: has joined #RubyOnRails
[06:03:02] CanTonic: has joined #RubyOnRails
[06:05:19] arup_r: has joined #RubyOnRails
[06:05:26] CanTonic: has joined #RubyOnRails
[06:07:16] baweaver: Anyone know a Twilio dev I could ping? Got a missing person case, need to talk to one ASAP.
[06:08:04] krz: has joined #RubyOnRails
[06:09:02] CanTonic: has joined #RubyOnRails
[06:09:05] Radar: baweaver: no sorry I don't
[06:09:27] baweaver: pinging anyone I know. Friends family asked for help
[06:09:36] baweaver: Phone carrier can only locate them if they get a text
[06:09:55] deadlock: has joined #RubyOnRails
[06:09:57] baweaver: so I made a bot to text at interval using their service. Trying to grab one so they don't flag as malicious
[06:12:31] SPYGAME: has joined #RubyOnRails
[06:13:03] stardiviner: has joined #RubyOnRails
[06:15:24] crameth: has joined #RubyOnRails
[06:17:33] havenwood: I don't know any Twilio devs. Hmm...
[06:18:04] Palsson: has joined #RubyOnRails
[06:18:36] nickenchuggets: has joined #RubyOnRails
[06:18:38] nickenchuggets: has joined #RubyOnRails
[06:18:41] havenwood: https://github.com/orgs/twilio/people
[06:19:54] merida: has joined #RubyOnRails
[06:21:29] qejk: has joined #RubyOnRails
[06:22:41] baweaver: pinging their help channels
[06:22:56] baweaver: bright side, sending an SMS is pretty easy.
[06:24:03] vale_tudo: has joined #RubyOnRails
[06:25:11] chagel: has joined #RubyOnRails
[06:25:32] netzfisch: has joined #RubyOnRails
[06:31:47] Macaveli: has joined #RubyOnRails
[06:33:37] chagel: has joined #RubyOnRails
[06:35:10] dede: has joined #RubyOnRails
[06:35:36] Radar: lessless: Hi. Did you fix your issue?
[06:36:02] lessless: Radar, Just came back from the lunch, looking at it now
[06:37:09] p1k: has joined #RubyOnRails
[06:38:18] p1k: is there a short-hand in rails for skip all callbacks on .save ? rather then listing them out by keys
[06:38:37] chagel: has joined #RubyOnRails
[06:38:58] Cohedrin: p1k you want to skip all callbacks all the time?
[06:39:37] p1k: Cohedrin: just once - something like instance_of_model.save(callbacks:false)
[06:39:41] CanTonic: has joined #RubyOnRails
[06:40:12] tvw: has joined #RubyOnRails
[06:41:48] CanTonic: has joined #RubyOnRails
[06:41:52] Cohedrin: p1k as far as I know, no. Typically you'd use update_columns for that
[06:42:18] Cohedrin: with #save you're always going to get callbacks unless you do Model.skip_callbacks() before hand
[06:42:27] p1k: Cohedrin: yes but you can't but there is no insert_column ? Except for the new batch methods I think
[06:42:30] agit0: has joined #RubyOnRails
[06:42:31] Cohedrin: but you need to remember to renable those callbacks after you save if you go that way
[06:42:45] Cohedrin: insert_column?
[06:42:58] p1k: Cohedrin: Update column requires the entry to exist
[06:43:17] Cohedrin: oh I see, you're trying to save a _new_ record without callbacks
[06:43:45] Cohedrin: is there a particular reason you need to do that? seems like an odd pratice
[06:44:45] djbkd: has joined #RubyOnRails
[06:45:12] p1k: Cohedrin: I need a singleton stub object that will be updated to a normalized record later
[06:45:46] Cohedrin: hm. I suppose the best way to do that would be Model.skip_callbacks { model.save }
[06:45:50] p1k: of course I could persist it somewhere else but that's not very nice, maybe I could call the arel perist directly and by pass AR ?
[06:45:53] Cohedrin: I can't think of a better way to do that
[06:46:15] p1k: oh you can skip_callbacks on a block ?
[06:46:52] Cohedrin: http://apidock.com/rails/ActiveSupport/Callbacks/ClassMethods/skip_callback
[06:46:59] Cohedrin: I believe it was introduced in rails 3
[06:47:09] Cohedrin: so as long as your in a newer rails than that, you should be good
[06:48:09] jstransky: has joined #RubyOnRails
[06:48:38] ur5us: has joined #RubyOnRails
[06:48:55] p1k: Cohedrin: yeah but that's not really from the .save(validate: false) style is it? It means you have to **list all the callbacks explicitly
[06:48:56] solars: has joined #RubyOnRails
[06:49:55] Cohedrin: hm yeah, just tested it, doesn't do excattly what I thought it did
[06:51:54] yottanami1: has joined #RubyOnRails
[06:52:21] yottanami1: How can I write a query like this "select * from posts where sender_id = 1 or reciever_id = 1" using Active Query in Rails?
[06:53:29] mark3: has joined #RubyOnRails
[06:55:55] Cohedrin: p1k *Model._save_callbacks.map(&:filter)
[06:56:10] Cohedrin: Model.skip_callbacks(*Model._save_callbacks.map(&:filter))
[06:56:13] Cohedrin: should work for you
[06:56:16] Cohedrin: its not pretty
[06:56:47] Cohedrin: but I think thats about as good as its going to get without installing a gem
[06:57:44] Cohedrin: yottanami_ Posts.where('sender_id = ? OR reciever_id = ?', 1, 1)
[06:59:18] finnnnnnnnnnn: has joined #RubyOnRails
[07:00:33] artto: has joined #RubyOnRails
[07:01:39] blackmesa: has joined #RubyOnRails
[07:02:30] HouseMD: has joined #RubyOnRails
[07:03:03] Macaveli: has joined #RubyOnRails
[07:04:41] p1k: mapping it doesn't work for custom callbacks though, because ActiveSupport expects a particular mapping in skip_callbacks
[07:04:44] artto: has joined #RubyOnRails
[07:05:35] rakm: has joined #RubyOnRails
[07:05:40] sp1rs: has joined #RubyOnRails
[07:06:22] rakm: is there a way in rails 4 to skip a custom after_create callback, but not validations? i'm migrating some data and there is an after create that touches a related record to update the timestamp. I want to skip that
[07:06:30] HouseMD: has joined #RubyOnRails
[07:07:15] rakm: it's the only callback defined, so if there's a way to skip all callbacks, that's fine also. but not validations, so I can't use (validate: false)
[07:07:43] comrad: has joined #RubyOnRails
[07:07:49] edwinvdgraaf: has joined #RubyOnRails
[07:08:10] Cohedrin: rakm you only want to skip one callback?
[07:08:48] Cohedrin: http://apidock.com/rails/ActiveSupport/Callbacks/ClassMethods/skip_callback
[07:09:19] hahuang61: has joined #RubyOnRails
[07:10:57] p1k: Cohedrin: instance_of_model.save(:_create_record) ?
[07:11:07] p1k: send(:_create_record)**
[07:11:26] DoubleMalt: has joined #RubyOnRails
[07:12:13] Cohedrin: p1k I believe that similar to the way the sneaky_save gem does it
[07:12:20] Cohedrin: though I'm not sure it uses that exact method
[07:12:31] rakm: hmm, how do i define skip_callback on the fly though
[07:12:39] rakm: i'm running a script and don't want to add that to the source code if possible
[07:12:43] lessless: Radar, can you please give it a second look https://gist.github.com/radar/9f3ea4a4afdda01ac86dcd617daaa2e3 ? Maybe it have something to deal with `accepts_nested_attributes_for`
[07:13:05] Radar: lessless: that's my code. Did you update yours?
[07:13:07] Cohedrin: p1k yeah looks like they basically implemented _create_record with a bit more functionality
[07:13:32] lessless: sorry, here it is https://github.com/lessless/cvc/commit/e68a7759c254c6a3e5841c9aae3afb86cfb92efa
[07:14:31] jero_: has joined #RubyOnRails
[07:14:37] Cohedrin: p1k yeah that actually works perfectly from my testing
[07:15:03] p1k: has left #RubyOnRails: ("Leaving")
[07:17:09] sevenseacat: lessless: whats the problem with it, or do we have to guess? :)
[07:18:44] Cervajz: has joined #RubyOnRails
[07:19:24] Radar: lessless: thanks. Taking a look.
[07:19:48] yfeldblum: has joined #RubyOnRails
[07:20:24] yfeldblum: has joined #RubyOnRails
[07:20:41] fernandomm: has joined #RubyOnRails
[07:21:09] sp1rs: has joined #RubyOnRails
[07:21:56] Radar: lessless: same issue.
[07:21:59] Cohedrin: rakm skip_callback is just a method
[07:22:07] Cohedrin: you can call it from anywhere
[07:22:08] Radar: lessless: Your initial author in this case isn't persisted because post attributes isn't specified
[07:22:15] stardiviner: has joined #RubyOnRails
[07:22:18] timiyay: has joined #RubyOnRails
[07:22:29] Cohedrin: Model.skip_callback(:save, :after, : name_of_method)
[07:22:37] Cohedrin: should work
[07:23:14] Cohedrin: but you do have to remeber to renable it after you're done with that approach
[07:23:34] Radar: lessless: this test is a mess
[07:23:44] Radar: lessless: I still can't reproduce an issue
[07:23:56] Radar: lessless: did you even run `rake test` and validate the error that you were getting was the one that you were expecting?
[07:24:56] timiyay: G'day folks
[07:25:00] timiyay: I'm doing a Rails 4.1 to 4.2 upgrade, and have been caught out by some asset precompile config.
[07:25:03] timiyay: In 4.1, I've been using wildcards to add to the assets.precompile array
[07:25:05] timiyay: i.e. 'pages/*css'
[07:25:08] timiyay: In 4.2, this no longer works. I need to specify the exact filename of every asset.
[07:25:11] timiyay: Otherwise I get an error: "Asset was not declared to be precompiled in production."
[07:25:14] timiyay: Should wildcards still work, or do I have to declare each file now?
[07:25:20] Radar: timiyay: they should still work.
[07:25:23] AimlessRAven: has joined #RubyOnRails
[07:25:43] timiyay: hmmm ok, must be something else going down then
[07:25:47] AimlessRAven: how to save this token Devise.friendly_token(length = 64) in my db
[07:26:14] Radar: AimlessRaven: what have you tried/
[07:26:36] AimlessRAven: w8 i create gist
[07:26:48] AimlessRAven: https://gist.github.com/anonymous/86152ef06fadd679fd67db7aa7a58e99
[07:26:55] lightheaded: has joined #RubyOnRails
[07:27:05] AimlessRAven: this is my method to send confirmation email in my admin panel, i need this token to be saved in db
[07:27:34] p1k: has joined #RubyOnRails
[07:27:55] antgel: has joined #RubyOnRails
[07:28:13] AimlessRAven: i have confirmation_token field in my db so how to assign this token yo my field
[07:30:15] nmyr: has joined #RubyOnRails
[07:30:19] GnuYawk: has joined #RubyOnRails
[07:30:40] timiyay: i also upgraded to Ruby 2.3.0, which might be the issue here: https://github.com/rails/sprockets-rails/issues/303
[07:30:43] GnuYawk: has joined #RubyOnRails
[07:31:56] AimlessRAven: Radar: so i assign my db field confirmation_token = Devise.friendly_token(length = 64)
[07:32:07] AimlessRAven: and in my theme mailer i send @newsletter.confirmation_token
[07:32:19] h7br1x: has joined #RubyOnRails
[07:33:04] lessless: Radar, there should be no errors present
[07:37:48] h7br1x: Hello Everyone! Quick question, with a Simple Form Associated Field, how would I make the label_method display two items instead of one? I want to display an :id and :name in my label_method. https://gist.github.com/ktdmedia/674023de079b361e6ac37154696cbdc1
[07:38:07] sevenseacat: h7br1x: write a method that returns both
[07:38:14] sevenseacat: formatted how you want, then use that
[07:38:28] sevenseacat: because you almost certainly don't want :id + :name
[07:38:37] h7br1x: sevenseacat: in my model? I fon
[07:38:48] h7br1x: I don't want :id + :name it was just an example ;)
[07:38:52] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[07:39:42] artto_: has joined #RubyOnRails
[07:44:16] sp1rs: has joined #RubyOnRails
[07:45:20] ferr: has joined #RubyOnRails
[07:46:12] sp1rs: has joined #RubyOnRails
[07:46:19] rickmasta: has joined #RubyOnRails
[07:46:50] jstransky: has joined #RubyOnRails
[07:47:27] mikecmpbll: has joined #RubyOnRails
[07:48:55] AimlessRAven: has joined #RubyOnRails
[07:49:22] AimlessRAven: i create my action mailer, he send email but not my token
[07:49:23] AimlessRAven: https://gist.github.com/anonymous/43cf2d1f349704027db608fc611dc5d9
[07:49:32] AimlessRAven: this is my model, i need to save this token to db and send to user
[07:51:09] tbuehlmann: AimlessRaven: that's not enough code for me to help. a guess: you want self.confirmation_token= instead of confirmation_token=
[07:54:10] dionysus69: has joined #RubyOnRails
[07:55:10] artto: has joined #RubyOnRails
[07:55:33] finnnnnnnnnnn: has joined #RubyOnRails
[07:55:57] pawnbox: has joined #RubyOnRails
[07:58:54] rubyonrailed: has joined #RubyOnRails
[07:59:26] dannyguk: has joined #RubyOnRails
[07:59:34] sypheren: has joined #RubyOnRails
[08:02:36] blackmesa: has joined #RubyOnRails
[08:03:43] moeabdol: has joined #RubyOnRails
[08:04:14] Ropeney: has joined #RubyOnRails
[08:04:34] solars: has joined #RubyOnRails
[08:05:06] marr: has joined #RubyOnRails
[08:05:07] rickmasta: has joined #RubyOnRails
[08:05:17] AimlessRAven: has joined #RubyOnRails
[08:05:20] AimlessRAven: self.confirmation_token = Devise.friendly_token(length = 64) self.update_attributes
[08:05:32] AimlessRAven: is this self.update_attributes save my token in to field
[08:06:29] Macaveli: has joined #RubyOnRails
[08:06:49] mikecmpbll: has joined #RubyOnRails
[08:08:27] ur5us: has joined #RubyOnRails
[08:08:38] chagel: has joined #RubyOnRails
[08:09:31] tbuehlmann: you can just call `save`
[08:09:40] tbuehlmann: but update_attributes will also do that
[08:10:25] _Sypheren: has joined #RubyOnRails
[08:10:36] AimlessRAven: tbuehlmann: i need to call argument maybe self.update_attribute(:confirmation_token)
[08:12:52] darutoko: has joined #RubyOnRails
[08:14:15] AzaToth: has joined #RubyOnRails
[08:14:22] tbuehlmann: either call self.confirmation_token= and save afterwards, or directly call update(confirmation: <token>)
[08:14:51] AimlessRAven: self.confirmation_token = Devise.friendly_token(length = 64) self.update_attributes!
[08:15:28] sevenseacat: try it and see
[08:16:27] moeabdol1: has joined #RubyOnRails
[08:16:45] pawnbox: has joined #RubyOnRails
[08:17:15] sevenseacat: AimlessRaven: IRC is not your IRB.
[08:17:24] rodfersou: has joined #RubyOnRails
[08:17:59] AimlessRAven: sevenseacat: yea your right : )
[08:18:28] sevenseacat: AimlessRaven: so don't treat it as it if was. this isnt the first time I've told you this.
[08:20:57] tbuehlmann: I highly recommend reading http://guides.rubyonrails.org/active_record_basics.html
[08:21:13] soahccc: I'm a little frustrated with creating a text erb template and newlines. Is there an easy way to postprocess the output without doing a render_to_string in the controller?
[08:21:36] Abhijit: has joined #RubyOnRails
[08:23:41] andywww: has joined #RubyOnRails
[08:24:46] andywww: i want to store json in a database. i don’t want to query the json directly (yet), just some metadata around it but i’t feels incorrect storing the json in a text file
[08:24:56] andywww: i’m using mysql btw
[08:25:35] andywww: would it be overkill to introduce a secondary datastore which is more json friendly and store a reference to record in that in the mysql?
[08:28:20] artto: has joined #RubyOnRails
[08:28:31] tbuehlmann: no idea if mysql has a JSON column type, you could read up on that. if there's no JSON column type, use a text column
[08:28:52] elaptics: pretty sure it doesn't
[08:29:00] Ergo: has joined #RubyOnRails
[08:29:10] tbuehlmann: https://dev.mysql.com/doc/refman/5.7/en/json.html
[08:29:45] elaptics: well that proves me wrong :D
[08:30:01] moep: has joined #RubyOnRails
[08:30:39] andywww: aah i was just about to switch to postgres then, thanks for that
[08:30:40] blackhuey: has joined #RubyOnRails
[08:30:50] elaptics: you should still switch anyway :D
[08:31:00] sevenseacat: +1 to switching anywasy
[08:31:30] andywww: i guess its the favourite then
[08:31:35] agit0: has joined #RubyOnRails
[08:31:35] andywww: i’ll switch
[08:31:50] elaptics: there are many advantages to switching
[08:34:35] lxsameer: is there any utility to test json fields on sqlite in rails ?
[08:34:56] andywww: is this a potaato potayto argument?
[08:35:08] one_zero: has joined #RubyOnRails
[08:35:10] andywww: or is one generally accepted as superior?
[08:35:12] sevenseacat: sqlite is a no.
[08:35:23] finnnnnnnnnnn_: has joined #RubyOnRails
[08:35:54] elaptics: andywww: I think the general consensus seems to be that postgres is superior in most ways
[08:36:06] andywww: it certainly seems that way
[08:36:30] tbuehlmann: general consensus in this chat channel at least
[08:36:48] tbuehlmann: well, not even that
[08:36:50] tbuehlmann: mysql is a fine piece of software, don't get me wrong
[08:37:25] lxsameer: sevenseacat: thanks ma'am
[08:38:09] acosonic: has joined #RubyOnRails
[08:38:19] jsrn_: has joined #RubyOnRails
[08:38:31] blackmesa: has joined #RubyOnRails
[08:42:46] merida: has joined #RubyOnRails
[08:42:56] baweaver: has joined #RubyOnRails
[08:44:16] DoubleMalt: has joined #RubyOnRails
[08:44:59] pawnbox: has joined #RubyOnRails
[08:46:17] mbreedlove: has joined #RubyOnRails
[08:46:34] pyemkey: has joined #RubyOnRails
[08:50:12] artto: has joined #RubyOnRails
[08:51:02] theod: has joined #RubyOnRails
[08:51:11] rickmasta: has joined #RubyOnRails
[08:52:39] sp1rs: has joined #RubyOnRails
[08:53:00] Macaveli: has joined #RubyOnRails
[08:54:00] rakm: has joined #RubyOnRails
[08:55:18] srinidhi: has joined #RubyOnRails
[08:56:11] weckl: has joined #RubyOnRails
[09:00:06] yfeldblum: has joined #RubyOnRails
[09:00:40] StevenXL: has joined #RubyOnRails
[09:01:02] Ducky-: has joined #RubyOnRails
[09:01:29] workmad3: has joined #RubyOnRails
[09:03:02] crameth: has joined #RubyOnRails
[09:03:37] arup_r: has joined #RubyOnRails
[09:04:22] codyeatworld_: has joined #RubyOnRails
[09:07:08] arup_r: codyeatworld: Hi
[09:07:19] bonswouar: has joined #RubyOnRails
[09:07:20] codyeatworld: I'm trying to deploy Rails 5 with websockets
[09:07:27] codyeatworld: Can anyone help?
[09:07:42] codyeatworld: I've basically been at it all day/night.
[09:08:01] sevenseacat: depends what the problem is
[09:08:28] bonswouar: Hello ! I haven't use rails for a long time. Trying to reinstall an old project... I'm having an error inside rails : ailties-4.2.6/lib/rails/commands/server.rb:142:in `log_to_stdout': undefined method `formatter' for nil:NilClass (NoMethodError)
[09:08:32] bonswouar: any idea how to fix that ?
[09:08:41] codyeatworld: Well, I was getting 301's in production when actioncable tried to connect to websocket
[09:08:58] bonswouar: I tried adding rails_12factor & activesupport in my Gemfile without success
[09:09:05] codyeatworld: So I tried to do standalone mode.
[09:09:13] FLeiXiuS: has joined #RubyOnRails
[09:09:21] FLeiXiuS: has joined #RubyOnRails
[09:09:29] codyeatworld: And I'm not sure how to setup the nginx proxy to websocket.
[09:09:47] codyeatworld: I have the websocket running on port 3001 in production
[09:10:23] FLeiXiuS: When rendering partials in a view, does that partial have access to the controller vars?
[09:10:49] codyeatworld: Yeah, if they are instance variables.
[09:10:51] arup_r: FLeiXiuS: yes if it is instance variables..
[09:11:07] jgrevich: has joined #RubyOnRails
[09:11:34] codyeatworld: http://stackoverflow.com/questions/23363874/websocket-rails-doesnt-work-on-production-evironment-with-nginx-and-unicorn/25502657#25502657
[09:11:35] arup_r: but it is good to pass those as a local var to partial always.. I read some where it is good practice..
[09:11:43] codyeatworld: describes my problem well
[09:11:48] codyeatworld: I dont want to use passenger
[09:11:53] FLeiXiuS: arup_r, I have a format.js { render 'add_template'} then within that partial it renders another partial. The 2nd render is not receiving any instance variables from the controller
[09:11:55] codyeatworld: I just want to use Nginx, Puma, Redis
[09:12:18] ql6wlld: has joined #RubyOnRails
[09:12:19] roelof: has joined #RubyOnRails
[09:12:34] apotry: has joined #RubyOnRails
[09:12:54] codyeatworld: Maybe i should join an nginx channel too :)
[09:13:32] codyeatworld: you need to set the variables inside the block FLeiXiuS
[09:13:51] FLeiXiuS: codyeatworld, Inside the format.js block?
[09:13:51] codyeatworld: or explicitly add them via locals: { }
[09:14:15] FLeiXiuS: codyeatworld, Even if I define the instance vars witin the controller action?
[09:14:25] arup_r: FLeiXiuS: ok, check if you have values inside add_template first, trying to debug
[09:14:50] codyeatworld: I think so. I don't use respond_to much.
[09:14:59] roelof: When I click on the delete link (line 13 of the _article.html.erb) . the article is not deleted but again displayed. What did I do wrong here . Code : https://gist.github.com/rwobben/130190261047d990eedda0491a44276f
[09:15:51] bonswouar: any idea about my problem someone? would just need a lead, something..
[09:16:07] arup_r: FLeiXiuS: let me know what you see. I remember something like that happened with me while rendering partials from a view which was rendered as a response of JS request.
[09:16:28] arup_r: I am not sure though. I am sure though it works in HTML request...
[09:17:19] one_zero: has joined #RubyOnRails
[09:17:26] pawnbox: has joined #RubyOnRails
[09:17:26] codyeatworld: bonswouar, did you run bundle update before rails server?
[09:18:10] FLeiXiuS: arup_r, They're not getting passed within the respond_to block
[09:18:28] arup_r: FLeiXiuS: show me the controller action as a gist
[09:18:41] arup_r: let me see your code now
[09:18:48] FLeiXiuS: arup_r, Wait - I lied.
[09:19:00] codyeatworld: roelofm try destroy! with a bang
[09:19:26] arup_r: FLeiXiuS: no issues we all do.. :p
[09:19:55] bonswouar: codyeatworld: thanks for your help. Well yes, bundle install & update few times, added gems, etc
[09:21:57] bonswouar: Plus I guess the "server.rb" from rails is executed before my application endpoint ? (just to know if I should check at my rb files or if it's not related)
[09:22:05] roelof: When I click on the delete link (line 13 of the _article.html.erb) . the article is not deleted but again displayed. What did I do wrong here . Code : https://gist.github.com/rwobben/130190261047d990eedda0491a44276f
[09:23:01] codyeatworld: your prefix the rails call? ie bundle exec rails server?
[09:23:18] codyeatworld: But does anyone have experience with Action Cable in production with nginx and puma?
[09:24:22] sevenseacat: unlikely much, given its not released yet :)
[09:24:24] workmad3: codyeatworld: it would suprise me if people did... what with ActionCable still being pre-release and not production-ready yet
[09:25:23] workmad3: hell, they pretty much rewrote the backend between beta1 and beta2 :)
[09:25:43] roelof: hmm, why do I get to see this : Started GET "/articles/7" for at 2016-04-06 09:24:36 +0000 when I do <%= link_to "delete", article_path(@article), method: :delete %>
[09:25:55] roelof: I thought I see a DELETE action then ?
[09:26:34] workmad3: roelof: probably means you're either clicking before JS has finished loading on the page, or you're not loading the rails_ujs driver
[09:26:40] rickmasta: has joined #RubyOnRails
[09:26:45] bonswouar: codyeatworld: I tried `bin/rails server`, `rails server` and `bundle exec rails server` with the same result
[09:26:56] bonswouar: I'm using RVM by the way
[09:27:05] roelof: workmad3: JS as in javascript ??
[09:27:12] workmad3: roelof: yup
[09:27:24] bonswouar: (also tried different ruby & rails versions)
[09:27:27] neanderslob_: has joined #RubyOnRails
[09:27:32] roelof: workmad3: I do not use javascript in my code
[09:27:39] sevenseacat: theres your problem
[09:27:58] sevenseacat: Rails does use JavaScript
[09:28:04] workmad3: roelof: changing the method of a `link_to` requires javascript
[09:28:06] codyeatworld: Hehe, i know. I like to get a head start on features.
[09:28:12] codyeatworld: It works great in development
[09:28:25] codyeatworld: and Im sure i can get it running in production. I know im not far off.
[09:28:28] roelof: workmad3: oke, I did not know that
[09:28:36] Coldblackice: has joined #RubyOnRails
[09:28:50] workmad3: codyeatworld: already set up your nginx server for proxy_protocol?
[09:28:52] TvL2386: has joined #RubyOnRails
[09:28:54] roelof: I use link_to several times for linking and they all work except this one
[09:29:07] sevenseacat: roelof: not for put or delete links
[09:29:09] jgt3: has joined #RubyOnRails
[09:29:17] workmad3: sevenseacat: or post :)
[09:29:28] arBmind: has joined #RubyOnRails
[09:29:43] roelof: Till now I have only implement create
[09:29:52] roelof: now im trying to implement delete
[09:30:06] stardiviner: has joined #RubyOnRails
[09:30:20] snowy: has joined #RubyOnRails
[09:30:42] codyeatworld: Yeah, I have it all running
[09:30:56] codyeatworld: ill get a gist
[09:30:57] workmad3: codyeatworld: proxy_protocol != proxy_pass
[09:31:17] workmad3: codyeatworld: https://www.nginx.com/resources/admin-guide/proxy-protocol/ (it's basically what you need if you want nginx to act as a proxy for websockets)
[09:31:25] roelof: workmad3: how can I look what is the culprit. Too early pressing the delete button or not loading the rails_ujs driver ?
[09:31:45] sevenseacat: roelof: test one, then the other
[09:32:01] roelof: I do a jumpstart tutorial and there is nothing about both
[09:32:12] chipotle: has joined #RubyOnRails
[09:32:33] roelof: sevenseacat: oke, so the first one I can test by waiting a few minutes ??
[09:32:58] sevenseacat: 'before JS has finished loading on the page'
[09:33:24] roelof: yes, so how do I test this ?
[09:33:25] ur5us: has joined #RubyOnRails
[09:33:33] codyeatworld: I'm not 100% on all the terms for nginx. but I'll give that a review right now. I was going off a github issue for examples.
[09:33:35] yfeldblum: has joined #RubyOnRails
[09:33:35] codyeatworld: https://gist.github.com/anonymous/eb015dca0683ac84f2a0e66b1c4eb1e2
[09:34:11] codyeatworld: I have action cable running on the same server as rails. ActionCAble is on port 3001
[09:34:15] artto: has joined #RubyOnRails
[09:34:24] workmad3: codyeatworld: right, so you're definitely not set up for proxy_protocol there :)
[09:34:27] codyeatworld: and i mounted it at "/cable"
[09:34:31] artto: has joined #RubyOnRails
[09:34:50] quazimodo: has joined #RubyOnRails
[09:35:19] roelof: sevenseacat: I have a page here : https://learning-rails-wissel-1.c9users.io/articles/7
[09:35:28] codyeatworld: I've been tweaking this config a lot trying everything i could think of
[09:35:29] roelof: when I press delete nothing happens
[09:35:40] roelof: How can I debug this then the best ?
[09:35:53] htmldrum: has joined #RubyOnRails
[09:35:58] workmad3: codyeatworld: you're lucky that I happened to stumble across stuff about proxy_protocol being needed for nginx to pass websockets connections through earlier this week then :)
[09:36:04] workmad3: (or was it last week? either way)
[09:36:37] sevenseacat: roelof: before it was a GET request, now its nothing happens
[09:36:45] workmad3: codyeatworld: btw, you may also need to start your actioncable server with knowledge of that /cable prefix, if you haven't already
[09:37:07] quazimodo: and i'm going home
[09:37:36] workmad3: (no idea what the command line for it would be, but if you don't then you'll probably find your actioncable requests fail because they're all prefixed with an unexpected `/cable` segment :) )
[09:38:11] roelof: sevenseacat: yep, and if I look at my terminal it looks like it's still a GET request
[09:38:28] sevenseacat: ok, so thats not 'nothing happens'
[09:38:38] codyeatworld: I'm still not sure what to do after reading that
[09:38:44] codyeatworld: I think im burning out finally
[09:38:49] codyeatworld: Been at this for hours...
[09:38:58] sevenseacat: roelof: you should make sure jquery_ujs is included in your page
[09:38:59] codyeatworld: at least 5-6 hours now
[09:39:02] skislak: has joined #RubyOnRails
[09:39:50] roelof: oke, I will add that to application.html.erb
[09:40:17] workmad3: codyeatworld: I've never had to set up nginx in front of websockets, so I'm not sure of every step either :( I basically stashed away 'proxy_protocol' in case I ever needed to
[09:40:34] sevenseacat: roelof: application.js should be included in your page
[09:41:16] roelof: yes, that is also what I mean
[09:41:36] roelof: _article.html.erb is a partial
[09:42:31] workmad3: codyeatworld: but at a rough first-pass... try changing your `listen` directives to include `proxy_protocol` after `ssl` and add the lines from 2,3 and 4 into your location /cable block
[09:46:09] Ergo^: has joined #RubyOnRails
[09:47:00] roelof: sevenseacat: sorry , now I confused. so I schould add something like this : <%= javascript_include_tag "application" %> ?
[09:47:18] sevenseacat: roelof: yes, thats what should be in the head of your layout
[09:47:28] sevenseacat: if you removed it, put it back
[09:47:40] arup_r: I have a scope, where based on user role, result changes. But it seems 2 equivalent query is giving 2 kind of result. As far as I knew, in Rails if I write like `.where(column: [val1, val2,..])` it does IN query. But it is doing `OR` query for me. Looks like something wrong. I am using MySql DB. Gist https://gist.github.com/aruprakshit/384a1dbbf4587a7aee0b154334f9aca5
[09:47:56] arup_r: help me where I am misunderstanding..
[09:48:24] workmad3: arup_r: it's the `nil` in the array
[09:48:32] roelof: sevenseacat: now I see this error : ActionController::InvalidAuthenticityToken
[09:48:44] arup_r: yes, so that `nil` changing the query structure ..?
[09:48:51] sevenseacat: roelof: what else did you remove? your csrf_meta_tags ?
[09:48:53] workmad3: arup_r: if there's a nil in the array, rails will add an `OR column IS NULL` to the generated segment
[09:49:14] workmad3: arup_r: and if there's only one other item in the array, rails will skip the `IN` and flatten to a plain `=` check
[09:50:11] workmad3: arup_r: and that's because a NULL doesn't respond properly to any other checks... `foobar IN (fizzbuzz, NULL)` will only give you results where foobar = fizzbuzz, none where foobar is NULL
[09:50:13] arup_r: I never know that.. So how do you write the query? My need is get leads for which assigned_to is either co-ordinator or none(unassigned)..
[09:50:22] bonswouar: If I comment the two lines about Rails.logger in server.rb it works... How is it possible Rails.logger isn't defined ?! I don't get it.
[09:50:24] arup_r: workmad3: exactly
[09:50:30] workmad3: arup_r: how you write the query is how rails writes the query
[09:50:41] arup_r: That is why my IN SQL query was buggy
[09:50:49] workmad3: arup_r: i.e. assigned_to = 'value' OR assigned_to IS NULL
[09:50:59] arup_r: but ^ that is giving correct result
[09:51:11] arup_r: workmad3: make sense now
[09:51:21] roelof: sevenseacat: I think I start again with the template
[09:51:27] workmad3: arup_r: are you using rails 4 btw?
[09:51:52] arup_r: yes..Rails 4.1.6
[09:51:58] wethu: has joined #RubyOnRails
[09:52:04] workmad3: arup_r: because you could rewrite the other condition as `where.not(current_state: ARCHIVED_STATUSES)` then too
[09:53:00] arup_r: New things I learned today
[09:53:05] n008f4g_: has joined #RubyOnRails
[09:53:29] Guest683: has joined #RubyOnRails
[09:53:32] arup_r: IN works differently when array has `nil` entry.. I never knew.
[09:53:47] arup_r: workmad3: thanks..
[09:54:55] arup_r: I changed it to now to AR way.. because that is safe and tested :D where(assigned_to: [nil, user.id]).where.not(current_state: ARCHIVED_STATUSES)
[09:55:29] Lumia930`: has joined #RubyOnRails
[09:55:48] FooMunki: has joined #RubyOnRails
[09:56:25] bonswouar: Ok apparently codyeatworld's first guess was the right one : it works if I execute directly the rb file, like `ruby handler.rb`. So frustrating to lose so much time on that !
[09:56:35] roelof: sevenseacat: thanks
[09:56:45] roelof: Everything is working fine now
[09:58:34] antgel: has joined #RubyOnRails
[09:59:06] d0nn1e: has joined #RubyOnRails
[10:00:04] FooMunki: has joined #RubyOnRails
[10:03:36] quazimodo: has joined #RubyOnRails
[10:04:23] andywww: has joined #RubyOnRails
[10:05:26] merida_: has joined #RubyOnRails
[10:07:24] dANOKELOFF: has joined #RubyOnRails
[10:17:42] skullz: has joined #RubyOnRails
[10:17:47] skullz: Hey peeps, I'm trying to figure out how do do something using Arel, but I just don't find out how. Let's say an Intern has_many Skills through InternSkills, and I want all interns that has every skills in a list, how would that query look like?
[10:18:41] Spami: has joined #RubyOnRails
[10:19:35] merida: has joined #RubyOnRails
[10:21:19] myntcake: has joined #RubyOnRails
[10:21:52] 7JTAAK0JK: has joined #RubyOnRails
[10:22:22] FastJack: has joined #RubyOnRails
[10:22:52] Pathfinder: has joined #RubyOnRails
[10:25:26] artto: has joined #RubyOnRails
[10:26:03] 7JTAAK0JK: avatarly = Avatarly.generate_avatar('test', opts={})
[10:26:03] 7JTAAK0JK: Hey guys, can someone help me? I try to set generated avatar (using avatarly gem) for new user but something went wrong. Here is a code https://gist.github.com/kakawka/bcf7c03ad944a87378e21fa7c62c1e70
[10:26:07] blackmesa: has joined #RubyOnRails
[10:26:16] 7JTAAK0JK: I use paperclip for upload
[10:26:52] AimlessRAven: has joined #RubyOnRails
[10:27:01] merida: has joined #RubyOnRails
[10:27:06] quazimodo: has joined #RubyOnRails
[10:28:02] merida_: has joined #RubyOnRails
[10:28:35] sp1rs: has joined #RubyOnRails
[10:28:53] merida__: has joined #RubyOnRails
[10:29:27] merida__: has joined #RubyOnRails
[10:30:14] dANOKELOFF: has joined #RubyOnRails
[10:30:21] DenisLukyanov: has joined #RubyOnRails
[10:30:28] rubyonrailed: has joined #RubyOnRails
[10:35:02] mdw: has joined #RubyOnRails
[10:35:43] AimlessRAven: how to get this param = link_to "click here to subsribe amode newsletter", newsletter_activation_url, :confirmation_token => @newsletter.confirmation_token in view newsletter_activation i need there to find @newsletter.confimation-token
[10:36:04] Spanky: has joined #RubyOnRails
[10:36:38] Spanky: Hi, all, speak someone german?
[10:37:54] Spanky: I want start learn Ruby on Rails. To work with it.
[10:38:07] DylanJ: spanky: nicht wirklich
[10:38:31] DylanJ: kennen sie Ruby?
[10:38:38] Spanky: https://bitnami.com/stack/ruby/installerfür Ruby und für Rails http://railsinstaller.org/en
[10:38:50] Spanky: kann ich damit gut anfangen?
[10:39:03] dvinciguerra__: has joined #RubyOnRails
[10:39:39] Spanky: ne, aber in unserer Firma nutzen wir ein Seite die auf Rubyon Rails basiert. Und damit wir die änderungen künfttig selber machen können soll ich es anlernen
[10:39:41] DylanJ: ich hab nicht das gesehen
[10:39:59] DylanJ: welches OS benutzen sie?
[10:40:31] DylanJ: Sie** lol
[10:40:33] Spanky: Windows 2007
[10:41:27] DylanJ: Waaas. Rails + Windows ist möglich aber nicht so gut. Es ist mehr für linux/osx
[10:42:06] Spanky: unsere It arbeitet mit Linux, sprich sollte ich mich vorher nach Linux umrüsten
[10:42:51] Spanky: hast du auch ein gutes deutsches buch das du empfehlen kannst?
[10:43:21] Spanky: https://www.railstutorial.org/book/
[10:43:49] DylanJ: leider nicht in deutsch
[10:44:03] Spanky: ok macht nix, wäre halt schön gewesen
[10:44:07] baweaver: has joined #RubyOnRails
[10:44:10] DylanJ: das ist ein gut buch
[10:45:05] andywww: has joined #RubyOnRails
[10:45:07] Spanky: hab leider nicht so viel zeit grad, bin aber erfreut das ich auf diese Chatgruppe gestossen bin.
[10:45:25] Spanky: Ich werde mich etwas reinlesen und kommen dann nochmals zurück
[10:45:43] srinidhi: has joined #RubyOnRails
[10:45:44] Spanky: aber die links für die downloads waren gut so
[10:46:18] Spanky: Danke bis demnächst ^^
[10:47:05] alex88: has joined #RubyOnRails
[10:48:04] GodFather: has joined #RubyOnRails
[10:50:50] flashpoint9: has joined #RubyOnRails
[10:50:54] AimlessRAven: how to pass parameters in link_to
[10:51:13] artto: has joined #RubyOnRails
[10:51:24] tbuehlmann: AImlessRaven: have you checked http://api.rubyonrails.org/?
[10:51:25] skullz: AImlessRaven: http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to
[10:54:36] rvanlieshout: has joined #RubyOnRails
[10:54:42] krz: has joined #RubyOnRails
[10:55:21] Pathfinder: has joined #RubyOnRails
[10:55:25] AimlessRAven: i ned to pass @newsletter.confirmation_token to = link_to "click here to subsribe amode newsletter", newsletter_activation_url this link
[10:55:35] RegulationD: has joined #RubyOnRails
[10:58:22] artto_: has joined #RubyOnRails
[10:58:37] sp1rs: has joined #RubyOnRails
[11:00:52] fernandomm: has joined #RubyOnRails
[11:00:56] StevenXL: has joined #RubyOnRails
[11:01:15] AimlessRAven: https://gist.github.com/anonymous/84365e7914196dc9532396fba7cbb828
[11:01:33] AimlessRAven: why i get this result
[11:01:50] merida: has joined #RubyOnRails
[11:03:05] merida_: has joined #RubyOnRails
[11:03:49] merida__: has joined #RubyOnRails
[11:04:32] stardiviner: has joined #RubyOnRails
[11:05:03] soahccc: AImlessRaven: find method takes an ID value. custom columns require where() or find_by_xxx
[11:06:25] Mia: has joined #RubyOnRails
[11:08:26] RegulationD: has joined #RubyOnRails
[11:13:18] artto: has joined #RubyOnRails
[11:15:36] AimlessRAven: soahccc: ok i find my target
[11:15:36] AimlessRAven: @newsletter = Sellor::Newsletter.where(:confirmation_token => params[:token])
[11:15:42] AimlessRAven: but how to update this attribute in controller
[11:20:16] trinaldi: has joined #RubyOnRails
[11:24:16] fernandomm: has joined #RubyOnRails
[11:24:26] njero: has joined #RubyOnRails
[11:24:47] vuashhhh: has joined #RubyOnRails
[11:25:22] vuashhhh: hi everyone! I'm having trouble with a project, could you guys help me out? https://gist.github.com/jonatasbaldin/906673980f847b30ec2cf6951dcb136e
[11:25:46] skullz: Hey peeps, I'm trying to figure out how to do something in arel, but I just can't find out how. Let's say an Intern has_many Skills through InternSkills (join table), and I want all interns that has every skills in a list, how would that query look like?
[11:25:53] skullz: I tried this, but it's not working: http://pastie.org/private/m6gdu57tsvvg8ihb4sw64a
[11:26:40] aaronr: has joined #RubyOnRails
[11:26:57] andywww: has joined #RubyOnRails
[11:29:32] merida: has joined #RubyOnRails
[11:31:15] nfk|laptop: has joined #RubyOnRails
[11:33:11] AimlessRAven: has joined #RubyOnRails
[11:33:41] AimlessRAven: https://gist.github.com/anonymous/c68d57accfcb4a102c716a1ce50313cf
[11:33:53] AimlessRAven: why i cannot update this request attribute
[11:34:02] Macaveli: has joined #RubyOnRails
[11:34:28] AimlessRAven: i use @newsletter.update_attribute(:confirmed_at, Date.today)
[11:34:50] nfk|laptop: now this is weird, I have an angular-rails gem and it works but it seems like it's an older version and even weirder trying to google for it only returns angularJS-rails, what's going on?
[11:34:56] AimlessRAven: rails tell me undefined method update_attribute for :Newsletter::ActiveRecord_Relation:0x007f2834419b38>
[11:35:35] SPYGAME: has joined #RubyOnRails
[11:35:41] ldnunes: has joined #RubyOnRails
[11:36:20] rvanlieshout: AimlessRaven: because a relation doesn't have that method
[11:38:13] tildes: has joined #RubyOnRails
[11:39:58] AimlessRAven: rvanlieshout: what method i need to use to update relation field
[11:40:15] rvanlieshout: you should read about what relations are
[11:40:19] rake_db_migrate: has joined #RubyOnRails
[11:40:22] rvanlieshout: it's not 1 record
[11:41:03] antgel: has joined #RubyOnRails
[11:41:21] solars: has joined #RubyOnRails
[11:41:54] nfk|laptop: ah, so for some reason i was using a 3.5 years old gem, gosh
[11:43:17] zave: has joined #RubyOnRails
[11:45:13] pwnd_nsfw`: I feel like RSpec's best practices changes more than MLA format specs
[11:47:53] artto: has joined #RubyOnRails
[11:51:14] King_Rex: has joined #RubyOnRails
[11:53:01] IrishGringo: has joined #RubyOnRails
[11:53:01] GodFather: has joined #RubyOnRails
[11:56:07] sp1rs: has joined #RubyOnRails
[11:59:36] herbst: has joined #RubyOnRails
[12:01:13] herbst: After a update from 4.2.6.rc1 to 4.2.6 i get these (warnings): https://i.imgur.com/1eQkk6V.png Any ideas why this could be? It is the only project where this happened.
[12:02:05] herbst: to clearify this happens when i run tests.
[12:02:17] tbuehlmann: your test suite decided to display ruby warnings
[12:02:58] tbuehlmann: in this case you're using instance variables that weren't defined before they were used
[12:04:10] sp1rs: has joined #RubyOnRails
[12:04:12] solars: has joined #RubyOnRails
[12:04:16] s2013: has joined #RubyOnRails
[12:05:37] dANOKELOFF: has joined #RubyOnRails
[12:05:42] stannard: has joined #RubyOnRails
[12:07:30] herbst: i see whats going on :) I just dont realize why
[12:07:54] GodFather: has joined #RubyOnRails
[12:08:07] herbst: i know i could just use `RUBYOPT=W0 bin/rake` but i would rather know why and change it back
[12:09:32] StevenXL: has joined #RubyOnRails
[12:09:32] StevenXL: has joined #RubyOnRails
[12:09:49] B1n4r10: has joined #RubyOnRails
[12:10:28] vale_tudo: has joined #RubyOnRails
[12:14:13] AntiSpamMeta: has joined #RubyOnRails
[12:16:21] Ergo: has joined #RubyOnRails
[12:16:33] merida_: has joined #RubyOnRails
[12:19:50] artto: has joined #RubyOnRails
[12:20:22] edwinvdgraaf: has joined #RubyOnRails
[12:20:25] AntiSpamMeta: has joined #RubyOnRails
[12:21:17] merida: has joined #RubyOnRails
[12:21:55] hardtail: has joined #RubyOnRails
[12:22:51] johnflux: has joined #RubyOnRails
[12:24:10] ferr: When I try to use helper in controller from application helper, I get undefined method error. I've included it with helper ApplicationHelper
[12:24:45] artto: has joined #RubyOnRails
[12:25:16] herbst: ferr: ether include or directly use ApplicationHelper.method
[12:25:55] ferr: thanks herbst
[12:28:41] artto_: has joined #RubyOnRails
[12:30:29] merida: has joined #RubyOnRails
[12:30:40] njero: Hi every i have a dump question(questionable ;).. Where am i actually supposed to place custom scrubbers for rails-html-sanitizer . Thanks
[12:30:47] artto: has joined #RubyOnRails
[12:31:49] rubyonrailed: has joined #RubyOnRails
[12:32:06] SPYGAME: has joined #RubyOnRails
[12:32:54] pawnbox: has joined #RubyOnRails
[12:33:19] qejk: has joined #RubyOnRails
[12:34:44] n1lo: has joined #RubyOnRails
[12:35:40] SPYGAME: has joined #RubyOnRails
[12:38:53] quazimodo: has joined #RubyOnRails
[12:39:22] dstarh: has joined #RubyOnRails
[12:40:58] Abhijit: has joined #RubyOnRails
[12:41:18] aegis3121: has joined #RubyOnRails
[12:41:42] Abhijit: whats the best way to manage team contributions and after confirming pushing them to production? is it ok if production is the only central repo? or shall i use github/lab?
[12:41:55] merida_: has joined #RubyOnRails
[12:43:47] CodaBrink: has joined #RubyOnRails
[12:44:47] baweaver: has joined #RubyOnRails
[12:45:24] theery: has joined #RubyOnRails
[12:45:28] pawnbox: has joined #RubyOnRails
[12:46:28] drbayer: has joined #RubyOnRails
[12:46:56] mDuff: has joined #RubyOnRails
[12:47:06] pawnbox: has joined #RubyOnRails
[12:47:52] alex88: has joined #RubyOnRails
[12:47:59] artto: has joined #RubyOnRails
[12:49:44] sudoubuntu: has joined #RubyOnRails
[12:49:50] flashpoint9: has joined #RubyOnRails
[12:53:11] godzillaenlacasa: has joined #RubyOnRails
[12:53:47] rake_db_migrate: has joined #RubyOnRails
[12:55:46] futilegames: has joined #RubyOnRails
[12:57:59] herbst: > is it ok if production is the only central repo? - NO O_O
[12:58:31] rvanlieshout: herbst: without a backup?
[12:59:01] herbst: see above i just answered rvanlieshout :)
[13:00:05] rvanlieshout: one repo is ok
[13:00:09] rvanlieshout: use merge of pull requests
[13:00:37] godzillaenlacasa: I'd like to modify the Devise confirmation_instructions mailer... where can I go to do that? I've started the "Use Custom Mailer" tut @ https://github.com/plataformatec/devise/wiki/How-To:-Use-custom-mailer but can't find where to edit
[13:01:18] rvanlieshout: godzillaenlacasa: do you need to edit more then just the view?
[13:01:22] mbreedlove: has joined #RubyOnRails
[13:01:58] godzillaenlacasa: @rvanlieshout yes, I'm also using a Sendgrid template, so I have to modify headers and such
[13:03:03] rvanlieshout: cause https://github.com/plataformatec/devise#configuring-views has info about customizing the view
[13:03:37] Abhijit: do guys this this is good? http://doc.gitlab.com/ee/workflow/gitlab_flow.html i was thinking to do that.
[13:04:00] mbreedlove: has joined #RubyOnRails
[13:04:17] mikecmpbll: has joined #RubyOnRails
[13:04:23] dawidof: has joined #RubyOnRails
[13:04:34] jetpack_joe: has joined #RubyOnRails
[13:04:41] godzillaenlacasa: @rvanlieshout I'm not on the view one... i need to use a controller to send substitution variables to Sendgrid... that's where my problem is
[13:04:50] barajasfab: has joined #RubyOnRails
[13:05:14] johnflux: has joined #RubyOnRails
[13:05:15] ekinmur: has joined #RubyOnRails
[13:06:39] rake_db_migrate: has joined #RubyOnRails
[13:06:50] tildes: has joined #RubyOnRails
[13:06:58] rvanlieshout: oh. then you want to use a custom controller, not a custom mailer
[13:07:06] rake_db_migrate: has joined #RubyOnRails
[13:07:22] pawnbox: has joined #RubyOnRails
[13:07:36] beauby: has joined #RubyOnRails
[13:08:31] dawidof: Could someone share working configuration for nginx, rails 5, actioncable?
[13:08:56] Abhijit: dawidof, check digitalocean docs
[13:09:10] chipotle: has joined #RubyOnRails
[13:09:28] godzillaenlacasa: @rvanlieshout so, if I'm using devise's generated user controller... i have a 'registrations' controller.
[13:10:09] krz: has joined #RubyOnRails
[13:10:59] godzillaenlacasa: @rvanlieshout can I just add a confirmation_instructions method to that controller?
[13:11:03] nukleuz: has joined #RubyOnRails
[13:11:23] pawnbox: has joined #RubyOnRails
[13:11:55] arup_r: has joined #RubyOnRails
[13:12:19] _Tariq: has joined #RubyOnRails
[13:15:49] jhill: has joined #RubyOnRails
[13:15:50] upgrayeddd: has joined #RubyOnRails
[13:16:23] jcp: has joined #RubyOnRails
[13:16:29] mbreedlove: has joined #RubyOnRails
[13:16:59] ebryn: has joined #RubyOnRails
[13:17:09] dawidof: Abhijit, couldn't find rails+nginx+cable, found rails+nginx https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-unicorn-and-nginx-on-ubuntu-14-04, tried. Site is working, but websocket no, got an error in chome console "WebSocket connection to 'ws://imidasbot.ru/cable' failed: Error during WebSocket handshake: Unexpected response code: 404"
[13:18:16] Abhijit: dawidof, no idea then
[13:18:26] _Tariq: has joined #RubyOnRails
[13:18:27] Megamos: has joined #RubyOnRails
[13:18:47] dgncn: has joined #RubyOnRails
[13:18:56] kies: has joined #RubyOnRails
[13:23:11] adre: has joined #RubyOnRails
[13:23:28] artto: has joined #RubyOnRails
[13:23:36] workmad3: dawidof: there probably won't be anything yet, as actioncable is still in beta with no production-ready releases, and the last couple of beta releases have seen quite a bit of churn with it
[13:24:25] workmad3: dawidof: if you want to set it up while still in beta, expect to spend a good chunk of time in nginx docs figuring out how to successfully proxy websocket connections, and then a bunch of time tinkering with actioncable and rails to get it working properly
[13:24:45] darkxploit: has joined #RubyOnRails
[13:24:58] dawidof: workmad3, thanks
[13:28:23] Sephyros: has joined #RubyOnRails
[13:28:40] finnnnnnnnnnn: has joined #RubyOnRails
[13:29:00] petor: has joined #RubyOnRails
[13:30:29] sp1rs: has joined #RubyOnRails
[13:30:43] bauerd: has joined #RubyOnRails
[13:32:22] sp1rs: has joined #RubyOnRails
[13:34:57] TinkerTyper: has joined #RubyOnRails
[13:35:54] theblang: has joined #RubyOnRails
[13:36:42] Balzrael: has joined #RubyOnRails
[13:37:57] diegoaguilar: has joined #RubyOnRails
[13:38:42] petor_: has joined #RubyOnRails
[13:40:11] njero: Hi everyone, I'm facing an issue with Custom Scrubber for rails html permit scrubber
[13:40:13] njero: https://gist.github.com/NeoElit/d1fe81aa60e7d61247f80e2ebdbf0358
[13:41:06] njero: from view, it seem to remove invalid tags. What's wrong?
[13:41:11] brt: has joined #RubyOnRails
[13:41:57] workmad3: n_e_o: isn't removing invalid tags the point?
[13:42:21] njero: workmad3: but it's not.. That's what i'm wondering
[13:42:54] njero: *from view, it doesn't seem to remove invalid tags. What's wrong?
[13:43:00] workmad3: n_e_o: ah, that's better :P
[13:43:30] workmad3: n_e_o: now just add the view code and the compiled HTML output in your gist, and there may be enough info to work with ;)
[13:44:30] s2013: has joined #RubyOnRails
[13:44:44] Tempesta: has joined #RubyOnRails
[13:46:22] rickmasta: has joined #RubyOnRails
[13:47:38] iamvery: has joined #RubyOnRails
[13:48:09] ekinmur: has joined #RubyOnRails
[13:48:30] Detch: has joined #RubyOnRails
[13:48:39] Detch: has joined #RubyOnRails
[13:50:21] njero: workmad3: updated: https://gist.github.com/NeoElit/d1fe81aa60e7d61247f80e2ebdbf0358
[13:50:56] Macaveli: has joined #RubyOnRails
[13:51:06] Pathfinder_: has joined #RubyOnRails
[13:51:09] s2013: has joined #RubyOnRails
[13:51:36] njero: I tried removing the entire allowed tags, still getting content.. Obviously i should be doing something stupid :P
[13:51:38] Macaveli: has joined #RubyOnRails
[13:52:20] B1n4r10: has joined #RubyOnRails
[13:53:15] futilegames: has joined #RubyOnRails
[13:53:38] workmad3: n_e_o: ah right... so it should be stripping out the img, but isn't
[13:53:53] Macaveli: has joined #RubyOnRails
[13:53:59] workmad3: n_e_o: any chance you could put the entire view in there? Can't tell from the fragment if something else weird is happening
[13:54:27] njero: workmad3: yeah sure on sec..
[13:54:53] joshkovach: has joined #RubyOnRails
[13:55:38] stannard: has joined #RubyOnRails
[13:56:08] arup_r: has joined #RubyOnRails
[13:56:20] someish: has joined #RubyOnRails
[13:57:37] stannard: has joined #RubyOnRails
[13:58:06] bbrowning_: has joined #RubyOnRails
[13:58:17] njero: workmad3: updated: https://gist.github.com/NeoElit/d1fe81aa60e7d61247f80e2ebdbf0358
[14:00:27] workmad3: n_e_o: hmm... can't see anything obvious there :/
[14:00:47] workmad3: n_e_o: maybe throw some logging or output statements into your scrubber, make sure it's definitely being invoked?
[14:01:52] njero: workmad3: i tried logging from scrubber, it's being called fine..
[14:01:58] JesseH: has joined #RubyOnRails
[14:02:46] workmad3: n_e_o: did you try logging out `node.name` to make sure it's being called with all the nodes you expect?
[14:03:00] njero: workmad3: let me try..
[14:06:03] njero: workmad3: oops.. allowed_node? method not being invoked.. only it goes through skip
[14:06:11] njero: skip_node?
[14:06:55] njero: and return value of skip_node? doesn't seem to have any effect in the output
[14:08:12] mrgreenfur: has joined #RubyOnRails
[14:09:22] nartes: has joined #RubyOnRails
[14:12:07] n008f4g_: has joined #RubyOnRails
[14:12:39] xardion: has joined #RubyOnRails
[14:12:48] Rubie: has joined #RubyOnRails
[14:15:48] jsrn_: has joined #RubyOnRails
[14:17:19] workmad3: n_e_o: ooh, interesting
[14:17:36] DragonPunch: has joined #RubyOnRails
[14:17:36] workmad3: n_e_o: that's probably the place it's going wrong :) somehow everything is being skipped
[14:18:06] njero: workmad3: i tried returning false for every tags.. still no change :(
[14:19:03] workmad3: n_e_o: weird... and you double-checked your spelling of `allowed_node?` and so on?
[14:20:23] njero: workmad3: :0 .. I copy pasted it from docs only.. that's totally weird
[14:25:13] Yeomra: has joined #RubyOnRails
[14:25:55] Yeomra: has joined #RubyOnRails
[14:27:55] Pathfinder: has joined #RubyOnRails
[14:29:19] herbst: has joined #RubyOnRails
[14:30:05] arup_r: has joined #RubyOnRails
[14:31:03] bollullera: has joined #RubyOnRails
[14:31:26] LastWhisper____: has joined #RubyOnRails
[14:31:33] mhoungbo: has joined #RubyOnRails
[14:32:30] rubyonrailed: has joined #RubyOnRails
[14:34:59] drbayer: has joined #RubyOnRails
[14:35:43] bollullera: has left #RubyOnRails: ()
[14:38:19] rubyonrailed: has joined #RubyOnRails
[14:40:24] artto: has joined #RubyOnRails
[14:40:56] czerasz: has joined #RubyOnRails
[14:42:39] mlangenberg: has joined #RubyOnRails
[14:43:17] mlangenberg: Is there still any reason why a Rails app should depend multi_json and oj gems?
[14:45:43] alex88: has joined #RubyOnRails
[14:47:10] Yeomra: has joined #RubyOnRails
[14:49:27] King_Rex: has joined #RubyOnRails
[14:50:03] arup_r: has joined #RubyOnRails
[14:50:36] Malgorath: has joined #RubyOnRails
[14:51:41] rickmasta: has joined #RubyOnRails
[14:53:04] ecnalyr: has joined #RubyOnRails
[14:53:42] adavia: has joined #RubyOnRails
[14:56:52] arup_r: has joined #RubyOnRails
[14:56:53] rake_db__: has joined #RubyOnRails
[14:57:24] artto: has joined #RubyOnRails
[14:59:14] ashleyw: has joined #RubyOnRails
[15:00:47] Macaveli: has joined #RubyOnRails
[15:03:01] arup_r: How would you click "ok" or 'cancel' button of JS alerts using capybara + Rspec ?
[15:04:40] hive-mind: has joined #RubyOnRails
[15:04:43] syndikate: has joined #RubyOnRails
[15:06:37] aegis3121: has joined #RubyOnRails
[15:09:36] arup_r: ok, got the way https://github.com/thoughtbot/capybara-webkit/issues/84#issuecomment-111632554
[15:09:59] blackmesa: has joined #RubyOnRails
[15:13:54] czerasz2: has joined #RubyOnRails
[15:14:31] mhoungbo: has joined #RubyOnRails
[15:18:34] vuashhhh: just knocking again, if someone could help; http://stackoverflow.com/questions/36449947/application-with-dynamically-custom-fields
[15:19:35] nartes: hi, can't get signature of this method format.html. I am trying to pass there hash with block and notice message.
[15:20:02] arup_r: nartes: no problem. show your code inside a gist.
[15:22:22] nartes: arup_r: `{ render :show, status: :created, location: @product }`.
[15:22:30] GreatDanton: has joined #RubyOnRails
[15:22:40] herbst: has joined #RubyOnRails
[15:22:53] nartes: arpu_r: i as trying to split this block into multilines. But missed the meaning of status: parameter.
[15:23:00] arup_r: is this a JSON request.. nartes?
[15:23:13] nartes: arpu_r: i though that it is a parameter to format.html instead of being a paremeter to render itself.
[15:23:35] nartes: arpu_r: So i just type do\nrender :show, ...\nend. And it works!
[15:24:20] arup_r: nartes: type aru and press TAB ,, what you see? :)
[15:24:28] rickmasta: has joined #RubyOnRails
[15:25:41] nartes: arup_r, thanks!)
[15:25:52] nartes: i was not using autosuggest, sorry! really!)
[15:26:53] arup_r: no problemo
[15:27:23] hnanon: has joined #RubyOnRails
[15:28:53] ramfjord: has joined #RubyOnRails
[15:29:27] n008f4g_: has joined #RubyOnRails
[15:29:33] moep: has joined #RubyOnRails
[15:29:51] solars: has joined #RubyOnRails
[15:30:18] hnanon: I'm having a problem with activerecord reordering ids from a query.
[15:30:23] hnanon: I have https://gist.github.com/anonymous/b5d4fbec3574d1a601c302c22e883806
[15:31:00] hnanon: I'm using the geocoder gem. It returns locations ordered by distance and that's what I want.
[15:31:26] hnanon: So I get all of the ids for the nearest_cities on line 5.
[15:32:14] Dimik: has joined #RubyOnRails
[15:32:28] hnanon: And I go through all of those ids and pull out the ones that have the word "guide" in the post title (line 6).
[15:33:08] hnanon: I take the first one since, I want the city that's nearest to my query (remember geocoder returned them in order of distance).
[15:34:11] hnanon: However, the result is not as expected; the query is reordered by post id.
[15:34:39] hnanon: And I end up with the post that has the earliest id with title containing "guide."
[15:35:11] hnanon: I suppose I'm looking for a way to prevent the ids from being re-ordered?
[15:35:44] Devalo: has joined #RubyOnRails
[15:36:55] Malgorath: has joined #RubyOnRails
[15:38:20] PedramT: has joined #RubyOnRails
[15:38:23] KensoDev: has joined #RubyOnRails
[15:41:18] rickmasta: has joined #RubyOnRails
[15:41:23] krz: has joined #RubyOnRails
[15:43:15] disgrntld: has joined #RubyOnRails
[15:43:29] agit0: has joined #RubyOnRails
[15:43:53] chouhoulis: has joined #RubyOnRails
[15:44:07] polishdub: has joined #RubyOnRails
[15:44:32] chouhoulis: has joined #RubyOnRails
[15:46:05] dionysus69: has joined #RubyOnRails
[15:47:40] Yeomra: has joined #RubyOnRails
[15:48:46] [Butch]: has joined #RubyOnRails
[15:49:38] artto: has joined #RubyOnRails
[15:54:23] nkulig: has joined #RubyOnRails
[15:54:28] mlangenberg: has left #RubyOnRails: ()
[15:55:57] Regulati_: has joined #RubyOnRails
[15:59:40] nartes: what are the default practise if i want to achieve 7 lines per method for this code http://pastebin.com/ULWpEsA8.
[15:59:45] hxegon: has joined #RubyOnRails
[15:59:47] fedexo: has joined #RubyOnRails
[15:59:58] Quintasan: Hi, I have a Project class which has many ReportTypes and many Reports, Reports must belong to a ReportType. Can I somehow create and assign a ReportType when creating a new Report via nested attributes?
[16:00:27] djbkd: has joined #RubyOnRails
[16:00:55] Quintasan: To make it more clear - I want to be able to create a new ReportType when creating a new Report in a certain Project.
[16:01:50] nartes: how to split code into more methods? https://gist.github.com/nartes/59dbc44d5dc07b266effff54c6ecd774
[16:02:00] nartes: i want to achieve 7 lines per method.
[16:02:13] HouseMD: has joined #RubyOnRails
[16:04:13] HouseMD: has joined #RubyOnRails
[16:07:09] Quintasan: nartes: Any particular reason for 7 lines per method?
[16:07:34] nartes: Quintasan, no, just a crazy desire, perhaps )
[16:07:38] petor: has joined #RubyOnRails
[16:08:05] mbreedlove: has joined #RubyOnRails
[16:08:48] Quintasan: nartes: https://gist.github.com/Quintasan/d479207b3f4671510aec4f1699bb0434
[16:09:07] djbkd: has joined #RubyOnRails
[16:09:12] Quintasan: nartes: Other than this you could abstract thing under if and under else blocks
[16:09:19] Quintasan: but I'm not sure whether that's sane
[16:10:29] nartes: Quintasan, thanks, i will better think about something more important))
[16:10:53] Hates_: nartes: I don't think you should treat "7 lines" per method as a hard rule
[16:11:03] Quintasan: nartes: Small methods are nice but going overboard (7 lines) is too crazy
[16:11:09] Hates_: nartes: especially in this case where the lines are created by blocks rather than excessive code
[16:11:23] baweaver: has joined #RubyOnRails
[16:11:26] tbuehlmann: nartes: rubocop "allows" 10 lines, but there was/is discussion about controller action methods, which are perfectly okay, (like yours)
[16:11:28] Quintasan: Do not sacrifice readability for some made up rule.
[16:12:06] nartes: tbuehlmann, can i configure rubocop to allow this. Because my mentor say Metrics/MethodLength 30 is quite a big number)
[16:12:20] tbuehlmann: that's big, your mentor is right
[16:12:23] tbuehlmann: and yes, you can
[16:12:39] nartes: tbuehlmann, but this method create is a bottleneck for this option
[16:12:55] nartes: tbuehlmann, should i just adjust it to fit the method above?
[16:13:22] tbuehlmann: https://github.com/bbatsov/rubocop/blob/3fead1c1be8178d591eea753ac6b96d6c91cf60f/config/enabled.yml#L906-L909
[16:13:26] beauby: has joined #RubyOnRails
[16:13:51] tbuehlmann: what about making it 15 for now?
[16:14:34] tbuehlmann: btw, you can disable cops using comments
[16:14:38] nartes: tbuehlmann, ok, i am not against)
[16:14:52] tbuehlmann: I'm still not sure whether I like having comments for cops, but it's an option
[16:14:55] nartes: tbuehlmann, i understand, i just created them before by myself)
[16:15:32] nartes: tbuehlmann, here is the issue i try to negotiate https://github.com/nartes/distributer-shop/pull/3 ))
[16:20:20] adre: has joined #RubyOnRails
[16:20:30] rakm: has joined #RubyOnRails
[16:21:10] mbreedlove: has joined #RubyOnRails
[16:21:40] seamon: has joined #RubyOnRails
[16:21:55] blackmesa: has joined #RubyOnRails
[16:23:15] djbkd: has joined #RubyOnRails
[16:23:59] herbst: has joined #RubyOnRails
[16:24:41] n008f4g_: has joined #RubyOnRails
[16:26:20] PedramT: has joined #RubyOnRails
[16:26:28] skullz: is there any pattern for constructing custom filters (the user will input the filters in a form)?
[16:26:31] djbkd: has joined #RubyOnRails
[16:26:42] seamon: /whois seamon
[16:27:44] VeryBewitching: has joined #RubyOnRails
[16:28:45] arup_r1: has joined #RubyOnRails
[16:34:06] ramfjord: has joined #RubyOnRails
[16:34:10] nfk: has joined #RubyOnRails
[16:35:17] smathy: has joined #RubyOnRails
[16:37:18] rake_db_migrate: has joined #RubyOnRails
[16:38:04] blackmesa: has joined #RubyOnRails
[16:40:42] ascarter: has joined #RubyOnRails
[16:41:36] epochwolf: hnanon: what are you working on? :)
[16:41:39] PedramT: has joined #RubyOnRails
[16:43:07] tbuehlmann: skullz, what do you mean?
[16:43:20] lxsameer: has joined #RubyOnRails
[16:45:14] GodFather: has joined #RubyOnRails
[16:49:10] delgiudices: has joined #RubyOnRails
[16:51:46] rakm: has joined #RubyOnRails
[16:53:18] lxsameer: any suggestion for testing angularjs apps on rails ?
[16:54:19] ecnalyr: lxsameer: Use Sinatra or something similar in your test suite to run an api that simulates the communication necessary to your angularjs app. . . That is if you don't run a full rails app against your rails app that's running angularjs on top of it.
[16:54:29] benlieb: has joined #RubyOnRails
[16:55:56] ecnalyr: lxsameer: A piece of advice that you didn't ask for: consider making the front-end an entirely separate app (separate from your rails backend). It's not essential that it be done this way, I just personally find it easier.
[16:56:00] ecnalyr: But I don't know your situation/etc.
[16:56:24] drbayer: has joined #RubyOnRails
[16:56:35] lxsameer: ecnalyr, you're right, but I'm working on a legacy cod
[16:56:55] lxsameer: ecnalyr, what test suit do you use for this situation ?
[16:58:03] ecnalyr: lxsameer: If I recall correctly, you can mirror how the official docs explain how to test / develop Rails Engines. (Rails app inception within your test suite)
[16:58:39] ecnalyr: lxsameer: http://guides.rubyonrails.org/engines.html#testing-an-engine -- It's not catered specifically for you, but I found it helpful when I was in a similar situation.
[16:58:52] ecnalyr: lxsameer: (and I used rspec)
[16:59:16] voidDotClass: has joined #RubyOnRails
[16:59:20] ecnalyr: lxsameer: You might want to go all the way and use cucumber though. -- I just used rspec with a webdriver for the js.
[16:59:27] lxsameer: ecnalyr, can rspec test js code ?
[16:59:34] ecnalyr: lxsameer: yes
[16:59:43] voidDotClass: I have a project which involves managing computer monitors, but on rails g model Monitor, it tells me 'monitor' is taken or a reserved word
[16:59:48] lxsameer: ecnalyr, within integration and capybara ?
[16:59:51] ecnalyr: lxsameer: Now, if you want to Unit test your front-end. That's not rspec. You have to use something else.
[17:00:06] ecnalyr: lxsameer: I'm just discussion integration tests.
[17:00:09] lxsameer: ecnalyr, I had jasmin in mind
[17:00:54] ecnalyr: lxsameer: Any preferred js testing framework should work.
[17:01:07] dfockler: has joined #RubyOnRails
[17:01:08] smathy: voidDotClass, pick a different name: http://ruby-doc.org/stdlib-2.3.0/libdoc/monitor/rdoc/Monitor.html
[17:01:31] shinnya: has joined #RubyOnRails
[17:02:24] smathy: Namespace it.
[17:02:47] lxsameer: ecnalyr, thanks buddy
[17:02:49] hnanon: epochwolf: Trying to get the correct landing page to display.
[17:02:56] ecnalyr: lxsameer: Good luck.
[17:03:30] hnanon: Is it possible to prevent query results to be automatically sorted by id?
[17:03:46] skullz: tbuehlmann: for example, a pattern for filtering a very complicated search form. I'm looking into arel and chainable queries, but when I use arel I need to call #find_by_sql, and this returns an Array instead of Relation
[17:03:50] mdw: has joined #RubyOnRails
[17:04:11] hnanon: *... to prevent query results from being automatically sorted by id
[17:04:48] epochwolf: hnanon: which database are you using?
[17:05:03] hnanon: sqlite in development
[17:05:10] vuashhhh: has joined #RubyOnRails
[17:05:11] hnanon: postgresql in production
[17:07:22] sleungcy: has joined #RubyOnRails
[17:08:00] epochwolf: hnanon: did you specify an order in your query?
[17:08:23] tbuehlmann: skullz, do you have an example? what are filters? what kind of form?
[17:08:44] hnanon: epochwolf: No. The array of ids are ordered by the geocoder gem according to distance.
[17:08:48] hnanon: That's what I want.
[17:09:15] hnanon: But when I pass that array in a where method, the result is reordered by the object ids.
[17:09:41] skullz: tbuehlmann: I don't have one now, maybe a ransack advanced form will give you the idea
[17:09:54] epochwolf: hnanon: If you don't give ActiveRecord an order for the query, it'll do whatever it feels like.
[17:10:13] hnanon: epochwolf: I want it to keep the same order.
[17:10:33] hnanon: The same order as the fed-in array.
[17:10:59] hnanon: epochwolf: https://gist.github.com/anonymous/b5d4fbec3574d1a601c302c22e883806
[17:11:02] epochwolf: I don't know of any way to do that.
[17:11:12] hnanon: The same order returned from lines 4 or 5.
[17:11:44] epochwolf: hnanon: ah, you'll need to figure out how to do a join.
[17:12:08] epochwolf: hnanon: what's the gem?
[17:12:39] hnanon: Geocoder returns the results according to distance. That part is fine.
[17:12:42] PedramT: has joined #RubyOnRails
[17:13:49] voidDotClass: Gem::LoadError: You have already activated rake 11.1.2, but your Gemfile requires rake 10.5.0. Prepending `bundle exec` to your command may solve this.
[17:13:54] voidDotClass: what does that mean?
[17:14:04] voidDotClass: getting that randomly when i run rake db:migrate
[17:14:07] voidDotClass: was working previously
[17:14:40] manfrin: has joined #RubyOnRails
[17:14:53] Macaveli: has joined #RubyOnRails
[17:15:07] mikecmpbll: has joined #RubyOnRails
[17:15:44] epochwolf: hnanon: I think I have a solution, let me type it out.
[17:15:50] epochwolf: hnanon: good news, geocoder is using where() underneath. We just need to figure out how to take that query and shove it into the join.
[17:16:37] epochwolf: nearest_cities = City.near(location, 1000)
[17:16:38] epochwolf: Post.joins(:city).merge(nearest_cities).where("title like ?", "%Guide%").first
[17:17:08] epochwolf: You'll need to double check it's sorting properly. :)
[17:17:46] marcules: has joined #RubyOnRails
[17:18:28] tubbo: voidDotClass: it means that the `rake` in your $PATH doesn't jive with the version of Rake that Bundler has loaded. the `bundle exec` thing will figure all that stuff out beforehand, which is why it's always safer to use `bundle exec` on deployments.
[17:18:44] epochwolf: tubbo: I prefer my bare naked rake.
[17:19:07] epochwolf: But, I also like to use a chainsaw naked.
[17:19:11] tubbo: voidDotClass: but locally, one can usually use the binstub in `bin/rake` to a.) utilize spring and b.) ensure you're always running the "right" version of Rake.
[17:19:26] tubbo: to figure out where your rake command is coming from, use `which rake`
[17:19:31] tubbo: epochwolf: on a deployed server?
[17:19:47] workmad3: tubbo: don't forget that in deployments, you'll typically have your gems vendored into `vendor/bundler`, which is very unlikely to be in your $PATH anyway :)
[17:20:18] tubbo: i kinda like adding $APP/vendor/bundle/bin to $PATH though
[17:20:53] workmad3: tubbo: heh :) I try to avoid adding as much as possible to my environment on server deploys
[17:21:17] voidDotClass: tubbo, but i havent changed anything in my environment, so why did it change out of the blue
[17:21:33] finnnnnnnnnnn: has joined #RubyOnRails
[17:21:45] workmad3: voidDotClass: probably means another project or gem installed a more recent version of rake
[17:22:10] cnk: has joined #RubyOnRails
[17:22:51] Marco_: has joined #RubyOnRails
[17:23:09] voidDotClass: workmad3, so if i change the rake ver in my gemfile, will that work?
[17:23:34] workmad3: voidDotClass: or just use `bundle exec rake` instead
[17:24:03] hnanon: epochwolf: That doesn't return posts with the second condition.
[17:24:12] workmad3: voidDotClass: or consider using a setup where you remove the need to worry about it (like the rubygems-bundler plugin, or the bundler oh-my-zsh plugin)
[17:24:16] hnanon: The title part.
[17:24:27] herbst: has joined #RubyOnRails
[17:24:27] herbst: has joined #RubyOnRails
[17:25:31] hnanon: Hmm. The SQL looks like it is returning the title part.
[17:26:16] epochwolf: hnanon: poke at it for a minute, I need to grab some tea.
[17:26:25] hnanon: Ok, I am.
[17:27:52] n008f4g_: has joined #RubyOnRails
[17:29:11] mustmodify: has joined #RubyOnRails
[17:29:49] mustmodify: I know I've researched this before but can't remember... when you break down and write straight SQL, what method can you use to sanitize input?
[17:30:08] delgiudices: has joined #RubyOnRails
[17:30:34] HanaNix: has joined #RubyOnRails
[17:30:37] CanTonic: has joined #RubyOnRails
[17:31:07] smathy: mustmodify, one of the methods that comes up in this google search: https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=rails+sanitize+sql
[17:31:34] Malgorath: dang smathy back it again with the google vans :D
[17:32:17] moep: has joined #RubyOnRails
[17:32:22] mustmodify: now all you need to do is to write a bot that figures out which words from a requiest need googling and will do it automatically.
[17:32:28] eyeamaye: has joined #RubyOnRails
[17:33:09] Malgorath: some of the help ahve something like !lmgtfy keywords
[17:33:15] tubbo: gem install damn_daniel
[17:33:44] Malgorath: tubbo: ah you get pop culture I see
[17:33:47] dannyguk: has joined #RubyOnRails
[17:34:00] delgiudices: has joined #RubyOnRails
[17:34:02] Malgorath: mikecmpbll: you here by chance?
[17:34:09] sp1rs: has joined #RubyOnRails
[17:34:09] mikecmpbll: Malgorath : i am
[17:34:35] Malgorath: mikecmpbll: so I spent 24 hours trying to build a simple engine and so far have had core failed.
[17:34:45] Malgorath: er hard core even
[17:34:54] ekinmur: has joined #RubyOnRails
[17:35:08] tubbo: that sucks
[17:35:23] B1n4r10: has joined #RubyOnRails
[17:35:28] benlieb: I have some rescue_from logic in my application controller. Sometimes these get trigger from within an after_action filter, and in those cases I don't want to render anything. How can I know in the rescue_from method if I get there from an exception in an after_action filter? I tried response.sent? but it seems to be always false in the rescue_from method
[17:35:45] Malgorath: I'm not sure how to build it to do what I need. I'm building a 'todo list' engine to work off things, I know 'how' I want it, just what steps between concept and creation are missing.
[17:36:14] benlieb: Otherwise I get "Render and/or redirect were called multiple times in this action."
[17:36:35] Malgorath: like in the models/workpackages.rb should be something like has_many :tasks, through: linking_table
[17:36:41] Malgorath: or something like that
[17:37:11] rake_db_migrate: has joined #RubyOnRails
[17:37:14] mikecmpbll: have you used rails before?
[17:37:18] tubbo: why do you need an engine to build a todo list?
[17:37:25] Malgorath: just not sure really how to do this in engines
[17:37:31] mikecmpbll: tubbo : he's extending some issue tracker rails app, forgot the name
[17:37:38] rake_db_migrate: has joined #RubyOnRails
[17:38:01] Malgorath: openproject(I don't like it)
[17:38:13] mikecmpbll: Malgorath : so you need a model for your tasks? or is that an openproject model already?
[17:38:27] tubbo: seems pretty weird
[17:38:37] Malgorath: mikecmpbll: the workpackages is in OP but i need to build a few models to add on with the engine
[17:38:42] tubbo: but i like the idea of an extendable project management app though, that you don't have to pay for
[17:38:45] mikecmpbll: have you done that?
[17:39:14] Cohedrin: has joined #RubyOnRails
[17:39:25] mikecmpbll: i'm trying to understand what your issue is, because i'm not going to write a rails plugin for you.
[17:39:33] mosez: has joined #RubyOnRails
[17:39:35] mikecmpbll: would be quicker if you said what the issue was :)
[17:39:35] Malgorath: mikecmpbll: everything I have found on google has been a bit cryptic
[17:39:39] arup_r: has joined #RubyOnRails
[17:39:56] tubbo: not as cryptic as our understanding of your issue
[17:40:10] zave: has joined #RubyOnRails
[17:40:10] Malgorath: I'm just not confident in how to approach this from a 'ground up' method. I'm normally a troubleshooter/fixer
[17:40:30] mikecmpbll: you create a gem, which has pretty much the same structure as the rails app you're extending
[17:40:51] Malgorath: can I generate models as per a normal rails app?
[17:41:01] mikecmpbll: "a gem" basically means a directory with a project_name.gemspec file.
[17:41:04] tubbo: bin/rails generate works in your plugin
[17:41:07] Malgorath: so basically this is an app inside an app?
[17:41:10] smathy: benlieb, you can't know, that's not how exceptions work. Instead create a new exception (or exceptions) and in your after_* callbacks raise those instead of the ones you're raising, and then don't rescue those (or re-raise them if they're that class).
[17:41:30] mikecmpbll: Malgorath : they essentially get "merged" as i said yesterday
[17:41:49] Malgorath: mikecmpbll: yesterday is a bit fuzzy, had a bad sinus headache most of the day
[17:41:53] mikecmpbll: so when you include your plugin in the openproject rails app, your pluin's stuff will be available
[17:42:13] Malgorath: right, I have an empty plugin already showing up
[17:42:19] mikecmpbll: showing up where?
[17:42:26] Malgorath: in Openproject's plugin list
[17:42:34] mikecmpbll: oic, so it has something special.
[17:42:50] mikecmpbll: uhm. then i don't really know enough about it.
[17:42:56] hnanon: epochwolf: It's returning a city instead of a post.
[17:42:57] mikecmpbll: how did you make that happen?
[17:43:13] tubbo: Malgorath: most likely it will be a combo of reading documentation and the actual OpenProject source code to figure out exactly what you need to do.
[17:43:14] webdestroya: has joined #RubyOnRails
[17:43:29] mikecmpbll: indeed, and the source code of existing openproject plugins, like i also said yesterday :p
[17:43:41] Malgorath: mikecmpbll: one sec I'll find the page
[17:43:43] tubbo: like for example, people creating plugins for our platform need to include a special module in their app and decorate classes using our special `decorate <class_name> do` syntax.
[17:44:10] Malgorath: https://www.openproject.org/open-source/development/create-openproject-plugin/
[17:44:38] Malgorath: mikecmpbll: problem is, there are no 'non-core' plugins for this
[17:44:49] mikecmpbll: i found one on github the other day
[17:44:50] tubbo: yeah it looks like openproject follows the same idea
[17:44:52] Malgorath: like no one does developing for it
[17:44:59] herbst: has joined #RubyOnRails
[17:45:02] xardion_: has joined #RubyOnRails
[17:45:17] benlieb: smathy: actually it turns out I was in an edge case. response.sent? works fine but if you happen to have called render nothing: true you've "rendered" even though response.sent? is false
[17:45:38] Malgorath: mikecmpbll: the ones I saw where 2+ years old and for version 3 OP when things changed bit time in 4 and 5 versions
[17:45:53] mikecmpbll: Malgorath : either way, looks like it just generates the plugin structure for you with some specific stuff for openproject i guess.
[17:46:00] mikecmpbll: it's still just a rails plugin afaict
[17:46:55] mikecmpbll: so back to the actual issue. what is it? :D
[17:47:08] Malgorath: mikecmpbll: The whole process in concept seems simple, like grabbing a pencil just out of reach
[17:47:31] Malgorath: mikecmpbll: after i generate the engine, where do I go from there
[17:48:12] tubbo: you write code
[17:48:45] tubbo: the whole point of generating the engine with the generator they provide is getting past the boilerplate that you'd need to figure out, so you can just start writing code as if you were in a real rails app
[17:48:54] hahuang61: has joined #RubyOnRails
[17:49:09] benlieb: smathy: ok, never mind I think I may have actually found a bug in rails. I don't say that lightly, lol. Actually I've never said that.
[17:49:27] Malgorath: I guess its just confusing me cause in my plugin directory there isn't even a bin/ dir
[17:50:00] benlieb: smathy: https://gist.github.com/benlieb/9bd6d4083dcc2a168de754c50a4f9170
[17:50:07] benlieb: what is that about?
[17:50:08] jenrzzz: has joined #RubyOnRails
[17:50:30] benlieb: a race condition? or some hidden trigger that sends the response only after #body is accessed?
[17:51:03] Malgorath: Sucks cause I was brought into this project with promises of a mentor and so far there isn't anyone here that can show me anything or help me with any issues.
[17:51:13] syndikate: has joined #RubyOnRails
[17:51:49] tubbo: that's where you really get to learn :)
[17:51:53] blackmesa: has joined #RubyOnRails
[17:52:11] tubbo: catastrophically failing over and over again is the best, albeit the most expensive, way to learn what works and what doesn't
[17:53:04] Malgorath: tubbo: yeah, Im just getting frustrated with how this is proceeding. I want to learn this but can't really find anyone that can even get me started
[17:53:18] epochwolf: hnanon: What's the updated code?
[17:53:49] mdw: has joined #RubyOnRails
[17:54:11] smathy: benlieb, looking at body causes @sent to be set.
[17:54:44] benlieb: smathy: looks that way. pretty iffy that
[17:55:05] hnanon: epochwolf: https://gist.github.com/anonymous/43a3e288be8e5cebc56ff07eea10dd3c
[17:55:33] godzillaenlacasa: has joined #RubyOnRails
[17:55:46] epochwolf: hnanon: what does landing_page.class.name return?
[17:56:01] smathy: benlieb, *is* that way, I wouldn't say it if not. And yeah, s'pose it's iffy, there are lots of side-effects in Rails.
[17:56:52] hnanon: epochwolf: Post.
[17:56:55] rickmasta: has joined #RubyOnRails
[17:57:08] hnanon: Hmm. But landing_page.id returns a city id.
[17:57:22] mikecmpbll: Malgorath : your lack of rails knowledge seems to be holding you back
[17:57:24] epochwolf: hnanon: how do you know landing_page.id is a city id?
[17:57:41] hnanon: By it's number. It's very high.
[17:58:03] Macaveli: has joined #RubyOnRails
[17:58:14] hnanon: No posts exist with that id.
[17:58:22] pawnbox: has joined #RubyOnRails
[17:58:27] Malgorath: mikecmpbll: probably. I can't seem to find any decent tutorials that I can get through and remember, I swear I'd gone through r4ia probaly 3 times in the last year.
[17:58:43] cnk: How about trying Upcase?
[17:58:48] mikecmpbll: Malgorath : there's still no real question that you've asked which is in any way answerable, though.
[17:58:57] cnk: that might get you some more focused coaching
[17:59:11] mikecmpbll: "how do i write a model for this plugin?" would be an example of a question that one might be able to answer definitively.
[17:59:18] Malgorath: cnk: I'll google it
[17:59:32] epochwolf: hnanon: can you find the sql query for line 5 in the log? Something is definitely weird.
[17:59:39] Malgorath: mikecmpbll: oh sorry, I thought I did ask that.
[17:59:43] cnk: https://upcase.com/join
[17:59:57] mikecmpbll: Malgorath : what did the generator provide for you in app/models/?
[18:00:03] cnk: I have been fairly impressed with Thoughtbot so might be worth while
[18:00:03] hnanon: Pasting it now...
[18:00:06] mikecmpbll: are there any files or directories?
[18:00:23] Malgorath: mikecmpbll: an empty directory
[18:00:52] Malgorath: plugin/engine-name/app/models/ --empty
[18:00:52] mikecmpbll: so it's not wanting you to namespace the plugin, i guess. so create a file in there
[18:00:53] baweaver: has joined #RubyOnRails
[18:00:56] benlieb: smathy: can you refer me to where in the source that's happening? I looked at http://api.rubyonrails.org/classes/ActionDispatch/Response.html#method-i-body but it's not inside #body
[18:01:17] rogue_koder: has joined #RubyOnRails
[18:01:26] mikecmpbll: the name should be the model name (singular form) dot rb.
[18:01:28] Malgorath: I created a tasks.rb file
[18:01:36] Malgorath: er crap forgot singular
[18:01:38] rake_db_migrate: has joined #RubyOnRails
[18:01:57] S1kx: has joined #RubyOnRails
[18:02:06] mikecmpbll: Malgorath : !activerecord
[18:02:08] hnanon: epochwolf: https://gist.githubusercontent.com/anonymous/775238cc54c38e2a7310fbe61cc6b405/raw/0e36c3aa6d66afb58b6adf712d1ad13711927bac/log.sql
[18:02:24] smathy: Malgorath, !activerecord
[18:02:34] smathy: Heh, I guess not :)
[18:02:35] arup_r: Malgorath: You need to revise the book again... otherwise you have to ask at every moment.
[18:02:50] epochwolf: hnanon: ah... yeah, something got messed up. I'll need to do some research.
[18:03:09] benlieb: arup_r: t'es français?
[18:03:13] Malgorath: arup_r: er I mean okay.
[18:03:31] benlieb: malgorath: he means "review"
[18:03:54] arup_r: benlieb: I meant go thrugh again. :D.
[18:04:30] eyeamaye: how can I add a child's attributes into the parent's response body?
[18:04:47] smathy: eyeamaye, models don't have response bodies.
[18:05:00] seamon: has joined #RubyOnRails
[18:05:07] ekinmur: has joined #RubyOnRails
[18:05:17] Malgorath: I understood the message. I'm not a smart but I catch inferences often, I'm just trying to figure out how things in rals work, when I learned python/django I had a friend teach me and I several times had to remind him I don't do theorycraft well if you expect me to remember things
[18:05:29] eyeamaye: hmm… then maybe a better way to ask this is, how can I add custom fields to response body?
[18:06:02] arup_r: eyeamaye: are you submitting form ?
[18:06:28] eyeamaye: AJAX PUT. and the response body contains all the model's attributes. I want to add some stuff in there.
[18:06:32] Siyo: has left #RubyOnRails: ("Leaving")
[18:07:09] Malgorath: mikecmpbll: don't I need a migration file also to add in new tables to the db?
[18:07:13] arup_r: ok.. Are you using jquery-ujs to make Ajax call?
[18:07:14] cnk: eyeamaye: Create an as_json method in the parent model - or use a jbuilder template - or use active model serializer
[18:07:35] mikecmpbll: Malgorath : sure do, tables don't get magically created. all explained in the official guides.
[18:07:35] eyeamaye: cnk: oooh is that what jbuilder templates are for? neat.
[18:07:38] arup_r: ok.. see ^
[18:07:51] eyeamaye: arup_r: no, just promises and XHR
[18:08:11] arup_r: You are saying response, I am reading it request.. eyeamaye all good now :)
[18:08:17] cnk: basically I see those 3 options as a progression, use the first until it is a pain, then consider the other 2
[18:08:24] Malgorath: mikecmpbll: yeah, I know how to rails g model tablename field1:string to generate them but I'm still getting stuck on how to do that in this plugin
[18:08:29] drbayer: has joined #RubyOnRails
[18:08:35] arup_r: cnk: I agree with you
[18:08:42] GG: has joined #RubyOnRails
[18:08:50] mikecmpbll: Malgorath : what happens when you do that?
[18:09:07] eyeamaye: thanks cnk!
[18:09:33] herberzt: has joined #RubyOnRails
[18:09:36] skullz: is it possible to get a relation out a SQL?
[18:09:42] herberzt: quick Q. If i have a model called auctions and that has a has_may relationship is there a way to do something like auction.items.any.active? that will return true if active is true for any of auction.items?
[18:09:52] petor: has joined #RubyOnRails
[18:10:00] Malgorath: mikecmpbll: one sec firing up my VM so I'm in the correct env to run rails for that project
[18:10:06] skullz: by the way, this SQL is generated by AREL
[18:10:10] mustmodify: has left #RubyOnRails: ()
[18:10:11] mikecmpbll: you mean you haven't tried? :)
[18:11:03] herberzt: @mikecmpbll who are you adressing?
[18:11:50] epochwolf: hnanon: try City.near(location, 1000, :select => "cities.*, posts.*")
[18:11:56] Malgorath: mikecmpbll: I did, was just getting i up again
[18:12:08] mikecmpbll: herberzt : @auction.items.where(active: true).exist?
[18:12:19] Malgorath: mikecmpbll: rails g model task title:string description:text due:datetime completed:datatime yields a message about needing to do rails new projectname
[18:12:40] epochwolf: hnanon: the problem is the .merge is overwriting the select bits from Post. Geocoder has it as a documented problem with no good solutions.
[18:12:48] epochwolf: https://github.com/alexreisner/geocoder#known-issue
[18:12:49] mikecmpbll: or exists? i always forget which, ruby/rails seems to to have little convention on those method naming
[18:12:58] Malgorath: mikecmpbll: I ran that command in /vagrant/plugins/openproject-work_packages_todo_list
[18:13:26] herberzt: active? is a function I want to apply
[18:13:28] mikecmpbll: oh right. haven't worked with a plugin for a while so i don't know. just ditch the generators and write the files yourself.
[18:13:51] herberzt: if it is true for any item i want to do X
[18:13:52] mikecmpbll: herberzt : herberzt @auction.items.any?{ |a| a.active? }
[18:14:02] herberzt: ill give that a try
[18:14:03] baweaver: has joined #RubyOnRails
[18:14:10] hnanon: epochwolf: What will that :select => do?
[18:14:16] mikecmpbll: probably nicer to create a scope if the work can be done in the database though.
[18:14:25] mikecmpbll: then you can do auction.items.active.any?
[18:14:52] epochwolf: hnanon: um... I'd read up on some SQL, it sets the SELECT clause for the query.
[18:14:59] mikecmpbll: they're subtly different, i don't remember why but i preferred exists? i think .any? will do a count(*) and exists? does a limit 1
[18:14:59] PedramT: has joined #RubyOnRails
[18:15:03] herberzt: mikecmpbll: word!
[18:15:11] smathy: ...or auction.any_active_items?
[18:15:22] mikecmpbll: yeah, why not, go crazy.
[18:15:29] baweaver: has joined #RubyOnRails
[18:16:09] Malgorath: mikecmpbll: should I manually create the db/migration/directory to put my migrations in?
[18:16:48] nartes: has joined #RubyOnRails
[18:17:47] mikecmpbll: Malgorath : yep
[18:18:01] mikecmpbll: well, no. it's db/migrate
[18:18:35] Malgorath: yeah I realized its migrate when looking at it, my brain just auto-typed migration since I was thinking about making migration files
[18:19:42] delgiudices: has joined #RubyOnRails
[18:19:43] hnanon: epochwolf: ActiveRecord::StatementInvalid (SQLite3::SQLException: no such table: posts: SELECT cities.*, posts.*, (69.09332411348201 * ABS(cities.latitude - 40.742551) * 0.7071067811865475) + (59.836573914187355 * ABS(cities.longitude - -84.1052256) * 0.
[18:20:33] crdpink: has joined #RubyOnRails
[18:20:38] agit0: has joined #RubyOnRails
[18:20:59] hnanon: epochwolf: Back to this...https://gist.github.com/anonymous/b5d4fbec3574d1a601c302c22e883806...
[18:21:23] hnanon: Is there a way to order by nearest_cities_ids?
[18:21:42] hnanon: For line 6.
[18:21:44] crdpink: has joined #RubyOnRails
[18:22:08] arup_r: has joined #RubyOnRails
[18:22:47] Ergo: has joined #RubyOnRails
[18:22:50] s2013: has joined #RubyOnRails
[18:23:36] arup_r: skullz: auction.items.where(active: true).any?
[18:23:58] rickmasta: has joined #RubyOnRails
[18:24:07] baweaver: arup_r: try count instead, faster
[18:24:09] antgel: has joined #RubyOnRails
[18:24:22] baweaver: auction.items.where(active: true).count.zero?
[18:24:33] herberzt: i already solved this problem
[18:24:34] arup_r: hm.. good point.
[18:24:36] herberzt: thank you though
[18:25:00] tbuehlmann: also: #exists?
[18:25:17] Coldblackice: has joined #RubyOnRails
[18:25:25] mikecmpbll: yeah, exists? was the best last time i looked
[18:26:08] edwinvdgraaf: has joined #RubyOnRails
[18:26:27] smathy: baweaver, `active?` was a method running some "more than just `true`" check.
[18:27:03] mikecmpbll: we assume :)
[18:27:05] skullz: arup_r: ?
[18:27:17] epochwolf: hnanon: try Post.where(city_id: [nearest_cities_ids]).where("title like ?", "%Guide%").sort_by{|p| nearest_cities_ids.index(p.city_id) }.first
[18:27:25] arup_r: sorry that was wrong tab completion.
[18:27:29] arBmind1: has joined #RubyOnRails
[18:27:48] B1n4r10: has joined #RubyOnRails
[18:28:24] sp1rs: has joined #RubyOnRails
[18:30:33] xploshioon: has joined #RubyOnRails
[18:31:32] smathy: skullz, your problem is opaque, best to show what you're talking about in a gist.
[18:32:02] GodFather: has joined #RubyOnRails
[18:32:44] Frem: has joined #RubyOnRails
[18:34:28] jstransky: has joined #RubyOnRails
[18:34:32] Malgorath: mikecmpbll: got any idea on the method to rake db:migrate my migrations? cause i just did bundle exec rake db:migrate > ./errors.txt (empty file)
[18:34:51] Malgorath: did the from the openproject base_dir
[18:34:58] Malgorath: er did that even
[18:35:36] tercenya: has joined #RubyOnRails
[18:35:54] eyeamaye: has joined #RubyOnRails
[18:36:04] theblang: has joined #RubyOnRails
[18:37:07] mikecmpbll: should work, you might have to bundle install first in the main project
[18:37:25] mikecmpbll: you have the plugin in your project's gemfile, right?
[18:37:28] hnanon: epochwolf: I think that's working...
[18:37:47] mikecmpbll: for development purposes it'll be something like gem 'my_plugin', path: '../plugins/my_plugin'
[18:38:09] mikecmpbll: Malgorath :^
[18:38:45] ashleyw: has joined #RubyOnRails
[18:39:14] eyeamaye: cnk: I'm reading through https://robots.thoughtbot.com/better-serialization-less-as-json and it seems to make a good case for skipping overriding as_json / serializable_hash and going straight for a serializer.
[18:40:28] eyeamaye: they're overriding as_json with super though, you might be proposing I just completely override it?
[18:41:19] skullz: smathy: I'm building the SQL query using arel, and I would like to know if I there's a way to get a relation from it
[18:41:32] DoubleMalt: has joined #RubyOnRails
[18:42:26] cnk: I was just offering options. The Thoughtbot article is more throurough than 2 lines on IRC
[18:42:38] cnk: but now you can make a more informed decision
[18:42:41] eyeamaye: skullz, are you referring to activerecord relations?
[18:42:58] Malgorath: mikecmpbll: bundle exec rake openproject_work_packages_todo_list:install:migrations was the line, its rake <plugin_name>:install:migrations then rake db:migrate
[18:43:00] cnk: For a lot of what I do, adding a little config in as_json is sufficient
[18:43:01] skullz: eyeamaye: exactly, sorry for the confusion
[18:43:39] mikecmpbll: Malgorath : oh, weird.
[18:44:10] leftpad: has joined #RubyOnRails
[18:44:20] eyeamaye: cnk: yeah, your response told me exactly what I needed, i'm just trying to get an idea of your reasoning. which you provided, so thanks again!
[18:44:25] Malgorath: mikecmpbll: thats why this is confusing me so much, seems they changed the more 'basic' methods of doing things in this
[18:44:41] eyeamaye: skullz: so are you asking if you can find out what the activerecord relationship is from another gem?
[18:45:06] eyeamaye: i'm looking at arel now.
[18:45:24] herbst: has joined #RubyOnRails
[18:45:58] jhack: has joined #RubyOnRails
[18:46:02] herberzt: has joined #RubyOnRails
[18:46:29] eyeamaye: are you trying to get the has_many? or are you trying to build a query for the id of whatever object you're looking for? or are you trying to get a child object without knowing what the child is?
[18:47:43] bratsche: has joined #RubyOnRails
[18:49:59] godzillaenlacasa: is it possible to call a javascript function from a controller?
[18:50:22] eyeamaye: godzillaenlacasa: why?
[18:50:27] herberzt: has joined #RubyOnRails
[18:51:13] godzillaenlacasa: I need to be able to change button information when clicked based on a DB call.
[18:52:20] skyjumper: has joined #RubyOnRails
[18:52:29] godzillaenlacasa: @eyeamaye maybe I'm thinking about this all wrong
[18:53:11] eyeamaye: maybe someone can tell you a better way to do this but you probably want to make an AJAX call on the client. you might want to pop out a specific controller for that action.
[18:53:38] eyeamaye: but no, you can't run javascript in the controller. you can have javascript on the client interact with a controller through AJAX though.
[18:53:51] mdw: has joined #RubyOnRails
[18:54:00] godzillaenlacasa: @eyeamaye ok, that's a good starting point for me to read up on... thanks
[18:54:21] skyjumper: so I'm trying to use strong_parameters to permit only certain values. the docs suggest this is possible: https://github.com/rails/strong_parameters#permitted-scalar-values
[18:54:22] hnanon: epochwolf: Thank you for your help.
[18:54:32] skyjumper: but in practice, it no worky: https://gist.github.com/anonymous/ed2c48bafe7e7b9fcc12d46fa625c039
[18:54:44] skyjumper: Rails
[18:54:45] hnanon: I'm getting, I think, an unrelated error now: NoMethodError: undefined method `geocoded_by' for #<City:0x000000061170a0>
[18:55:06] Malgorath: mikecmpbll: I named my migration file db/migrate/0000_createwptasks.rb should I do the full datetime stamp as per normal is generated with g model?
[18:55:28] hnanon: I have this in my City model: geocoded_by :name
[18:55:35] hnanon: name is a city attribute.
[18:55:41] futilegames: has joined #RubyOnRails
[18:55:44] hnanon: It's straight from the geocoder readme.
[18:56:01] mikecmpbll: Malgorath : yes
[18:57:39] codezomb: has joined #RubyOnRails
[18:57:42] smathy: skullz, your problem is opaque, best to show what you're talking about in a gist.
[18:57:49] arup_r: has joined #RubyOnRails
[18:58:38] skyjumper: should strong_parameters be able to permit specific values?
[18:59:05] Malgorath: mikecmpbll: ActiveRecord::DuplicateMigrationNameError: Multiple migrations have the name CreateWpTasks
[18:59:06] mikecmpbll: skyjumper : no
[18:59:34] mikecmpbll: Malgorath : the error is pretty self-explanatory
[19:00:11] Malgorath: mikecmpbll: I'm in the openproject directory grep "CreateWpTasks" * -R only yields one entry
[19:00:45] diegoaguilar: has joined #RubyOnRails
[19:01:06] rake_db__: has joined #RubyOnRails
[19:01:15] smathy: skyjumper, the docs mean: "permitted hash keys that point to scalar (ie. not list) values"
[19:01:25] mikecmpbll: Malgorath : you probably didn't need to do that rake task
[19:01:40] mikecmpbll: i think it's finding both copies from the plugin and from the openproject directory
[19:01:57] mikecmpbll: just delete it from the openproject db/migrate directory
[19:01:57] Malgorath: ah okay, I'll remove that and see if it creates the table
[19:03:51] rakm: has joined #RubyOnRails
[19:04:30] Sephyros: has joined #RubyOnRails
[19:05:37] Malgorath: mikecmpbll: when I do rake db:migrate I get NameError: uninitialized constant CreateWpTasks, here is my migration file: https://gist.github.com/anonymous/8de0112226fbc73d1bf831a768c67236
[19:06:06] Macaveli: has joined #RubyOnRails
[19:06:20] mikecmpbll: rename the class to CreateWpTasks
[19:06:53] DoubleMalt: has joined #RubyOnRails
[19:06:55] mikecmpbll: CreateWPTasks -> create_w_p_tasks, CreateWpTasks -> create_wp_tasks (and visa-versa)
[19:07:33] sp1rs: has joined #RubyOnRails
[19:07:48] Sephyros: Hello, i have a ruby question, is there any simplification to equality operator in this case: https://gist.github.com/Sephyros/7f5a1aa0853fc58c28f2394b51b77006
[19:07:54] blackmesa: has joined #RubyOnRails
[19:08:12] Sephyros: something like "if c == a or b"
[19:08:28] mikecmpbll: Sephyros : if [a,b].include?(c)
[19:08:39] Malgorath: mikecmpbll: thanks, had a datatime type to, fixed it and now its all gravy
[19:08:46] mikecmpbll: Malgorath : good times.
[19:08:47] Malgorath: aka working for the migration
[19:08:50] Coldblackice_: has joined #RubyOnRails
[19:08:54] arup_r: Sephyros: use || instead..
[19:09:20] rickmasta: has joined #RubyOnRails
[19:09:21] Malgorath: now to figure out the next step and 'link' them with a pre-existing table
[19:09:29] mikecmpbll: Malgorath : !associations
[19:09:29] helpa: Malgorath : http://guides.rubyonrails.org/association_basics.html - Active Record Association Basics by Mike Gunderloy
[19:10:40] Malgorath: mikecmpbll: I kinda understand associations I'm just trying to think is there a way to do this without modifying the model file in the main openproject/app/model to link them
[19:11:12] mikecmpbll: you can re-open files from the main project in your plugin
[19:11:34] Malgorath: really? sweet, I guess I need to look up hwo to do that
[19:11:44] mikecmpbll: class SomeModel # file some_model_decorator.rb
[19:12:00] mikecmpbll: belongs_to :foobar
[19:12:12] myntcake: has joined #RubyOnRails
[19:12:49] Malgorath: mikecmpbll: thanks, also going to read through http://edgeguides.rubyonrails.org/engines.html#overriding-models-and-controllers
[19:13:01] Sephyros: mikecmpbll and arup_r : thanks!
[19:13:18] meoblast001: has joined #RubyOnRails
[19:15:29] eyeamaye: has joined #RubyOnRails
[19:16:04] Cervajz: has joined #RubyOnRails
[19:17:51] B1n4r10: has joined #RubyOnRails
[19:18:21] Malgorath: mikecmpbll: in your example, the model I want to modify is WorkPackage in openproject/app/models/work_package.rb so shuild I do class WorkPackage # file work_package.rb then next line will be has_many :wp_tasks ?
[19:18:21] Cervajz_: has joined #RubyOnRails
[19:19:17] Malgorath: and I put all that in a app/models/work_package.rb in my plugin directory?
[19:20:31] mdel: has joined #RubyOnRails
[19:22:25] Malgorath: Think if I can get this last part of extending from the original project to modify files then I might be able to get my concept at least partial viable
[19:23:16] mikecmpbll: has joined #RubyOnRails
[19:23:43] tildes_: has joined #RubyOnRails
[19:23:47] mikecmpbll: Malgorath : correct, but don't give it the same filename
[19:24:02] mikecmpbll: actually, wait i dunno
[19:24:22] ekinmur: has joined #RubyOnRails
[19:25:10] drewdfw: has joined #RubyOnRails
[19:25:11] baweaver: has joined #RubyOnRails
[19:28:17] Malgorath: mikecmpbll: thanks for coming back to answer that, I'm now looking at how I change the WorkPage templates
[19:28:22] herberzt: has joined #RubyOnRails
[19:28:53] PaulePanter: baweaver, smathy: I didn’t have time to do more about it, but here is my benchmark: http://paste.debian.net/425217/
[19:29:46] rake_db_migrate: has joined #RubyOnRails
[19:31:19] Cohedrin: has joined #RubyOnRails
[19:31:32] smathy: PaulePanter, so, not actually testing find_by vs find rescue at all.
[19:32:49] Yeomra: has joined #RubyOnRails
[19:35:08] eyeamaye: has joined #RubyOnRails
[19:35:49] dannyguk: has joined #RubyOnRails
[19:35:53] nartes: has joined #RubyOnRails
[19:36:07] Malgorath: god when I run this on a vm its taking 50-80 seconds to reload a page >.<
[19:36:37] seamon: has joined #RubyOnRails
[19:36:40] nickjj: Malgorath, are you using vagrant?
[19:36:53] PaulePanter: smathy: No. The original statement was about rescue being slow.
[19:37:31] Malgorath: nickjj: yeah
[19:37:49] nickjj: Malgorath, have you tried using rsync for sharing folders?
[19:37:50] smathy: [12:29:47] PaulePanter: smathy, baweaver, Moeh: My last experiments showed that, when dealing with ids, using User.find in a rescue block is the way to go, when the missing user is really the exception (less then five percent).
[19:37:59] smathy: PaulePanter, the context was very clear.
[19:38:01] PedramT: has joined #RubyOnRails
[19:38:05] nickjj: it's about a billion times faster than the default
[19:38:17] Malgorath: nickjj: its in browser file changes that takes so long, in term I can vi in and out without issue
[19:40:21] Malgorath: gah, I'm gonna have to move this to a non-vm box as its just unbearable... or is that unbarable? I forget the one to use
[19:41:09] baweaver: Malgorath: http://stackoverflow.com/questions/8670080/rails-3-1-on-ubuntu-11-10-under-virtualbox-very-slow
[19:41:13] nickjj: before i started using docker i used to use vagant with rsync, it never took more than 2 seconds to sync dozens of assets
[19:41:26] baweaver: there are probably newer versions of it, but that's the general idea
[19:41:56] Jasaka: has joined #RubyOnRails
[19:43:07] mikecmpbll: has joined #RubyOnRails
[19:43:21] mikecmpbll: damn sleepmode.
[19:44:30] PaulePanter: smathy, baweaver: I guess I have to apologize, and missed the context indeed.
[19:44:36] Malgorath: are there virtualenv (from python) equiv in Ruby?
[19:44:39] smathy: PaulePanter, no problem man, happens to us all.
[19:44:41] PaulePanter: smathy, baweaver: Sorry for that yesterday.
[19:45:11] Malgorath: like I have rbenv but thats for system wide version management I believe
[19:45:20] arBmind: has joined #RubyOnRails
[19:45:57] smathy: Malgorath, what sort of version management do you think you need?
[19:46:36] DoctorMonocular: has joined #RubyOnRails
[19:47:07] Malgorath: smathy: I just don't want various version of gem files being installed for different project, thats why I'm using VMs right now to pretty much isolate and only update gems when I want to for that project not a system wide update everytime
[19:47:48] herbst: has joined #RubyOnRails
[19:48:34] mikecmpbll: yeah, that's what bundler does.
[19:48:37] Malgorath: baweaver: yes, and everytime I run an app that has a different version of a gem then another I'd have to run bundler update or install just to run that app, then do it again for another. virtualenv in python lets me use different versions of django and pip packages without actually altering the system wide settings
[19:48:47] mikecmpbll: Malgorath : no you wouldn't.
[19:49:07] baweaver: ACTION has to sneak off for a bit
[19:49:34] sypheren: has joined #RubyOnRails
[19:49:46] Malgorath: when run bundler install it does not update the entire gem file to requested versions in Gemfile for the location of ruby?
[19:50:08] mikecmpbll: it will install any gems that aren't already installed
[19:50:15] mikecmpbll: that means specific versions of gems.
[19:50:30] futilegames: has joined #RubyOnRails
[19:50:54] rickmasta: has joined #RubyOnRails
[19:51:21] mikecmpbll: the Gemfile.lock, which is managed by bundler, specifies gems and versions for each project.
[19:51:22] DonOtreply: has joined #RubyOnRails
[19:51:26] Malgorath: mikecmpbll: what I'm asking is if I have an application that use lets say rails 4.2.2 and another that requires 4.2.4, does bundler keep them seperate?
[19:51:41] Malgorath: oh... well damn then
[19:51:45] Malgorath: *facepalms*
[19:52:02] Malgorath: glad I spent a few hours setting up multiple VMs for various projects
[19:52:07] mikecmpbll: gem list rails
[19:52:17] mikecmpbll: rails (4.2.5, 4.1.14, 4.1.10, 4.1.8, 4.0.4)
[19:52:41] Malgorath: lol rails (4.2.6,,, 4.2.4)
[19:52:47] Malgorath: I r special
[19:52:57] mikecmpbll: u r not developing rails for as long as i
[19:53:16] mikecmpbll: or more accurately, seeing as this laptop is new, you don't have projects on super old versions of rails like i :p
[19:53:20] Malgorath: you don't wanna know how long I've had my toe in the RoR waters
[19:53:48] Malgorath: put it this way, I bought R3ia when it was still relevant
[19:54:05] mikecmpbll: thats not paticularly long.
[19:54:59] rake_db_migrate: has joined #RubyOnRails
[19:55:23] PaulePanter: http://paste.debian.net/425240/
[19:55:24] Malgorath: think 2 years
[19:55:36] PaulePanter: I wonder that I can just hit enter to wrap the line.
[19:55:40] PaulePanter: … in http://paste.debian.net/425240/
[19:55:44] hnanon: epochwolf: Thank you again. It's working perfectly.
[19:55:45] Malgorath: bah there is a command on bot to say when you were first here but I forget whent hat is
[19:55:48] PaulePanter: The downside is, the space is missing.
[19:56:38] mikecmpbll: yeah, i dunno either
[19:57:08] PaulePanter: Closing the line with `… [space]" \` and starting the next line with `"` seems to work.
[19:57:10] rake_db_migrate: has joined #RubyOnRails
[19:58:04] arup_r: Malgorath: some powerful people has access to those commands.. tht's not for all of us.. :p
[19:58:22] Malgorath: arup_r: I could have sworn it was one that anyone could use
[19:58:34] mikecmpbll: none of the commands are, afaik
[19:58:45] Malgorath: maybe it was another channel
[19:59:41] Malgorath: there ya go :D
[19:59:55] mikecmpbll: oops, sorry mike.
[20:00:31] B1n4r10: has joined #RubyOnRails
[20:00:56] Malgorath: You'd think I'd be better at RoR but that time was also when wife and I were having lots of issues and I was dealing with pinched nerves in lower back
[20:01:28] mikecmpbll: troubled times.
[20:01:48] futilegames: has left #RubyOnRails: ()
[20:01:56] baweaver: has joined #RubyOnRails
[20:01:58] Malgorath: I think she had a voodoo doll or something
[20:02:57] delgiudices: has joined #RubyOnRails
[20:03:25] yfeldblum: has joined #RubyOnRails
[20:05:40] smathy: What I don't understand Malgorath is why you'd just assume something insane instead of checking and seeing what bundler actually does.
[20:06:16] hahuang61: has joined #RubyOnRails
[20:07:04] Gkj8899: has joined #RubyOnRails
[20:08:55] sp1rs: has joined #RubyOnRails
[20:12:07] chouhoulis: has joined #RubyOnRails
[20:13:02] njero: has joined #RubyOnRails
[20:14:36] baweaver: has joined #RubyOnRails
[20:15:26] jtong: has joined #RubyOnRails
[20:15:48] Devalo: has joined #RubyOnRails
[20:16:08] srinidhi: has joined #RubyOnRails
[20:18:46] shpoont: has joined #RubyOnRails
[20:19:00] Uranio: has joined #RubyOnRails
[20:24:40] shpoont: has joined #RubyOnRails
[20:26:27] shpoont: has joined #RubyOnRails
[20:26:47] chipotle: has joined #RubyOnRails
[20:28:13] shpoont: has joined #RubyOnRails
[20:28:28] htmldrum: has joined #RubyOnRails
[20:29:12] ashleyw: has joined #RubyOnRails
[20:29:44] barajasfab: has joined #RubyOnRails
[20:30:01] shpoont: has joined #RubyOnRails
[20:30:07] Malgorath: smathy: being able to sit down and just 'look' into things is not something I have a lot of time or focus for usually. I know its a horrible habit and I should be abused for assuming anything with development but... its a bad ole habit I got into a few years back and I'm trying to break it as I come to things
[20:31:06] mices: has joined #RubyOnRails
[20:31:15] epochwolf: I'll second the abuse.
[20:31:19] Malgorath: mikecmpbll: ah the funny thing just happened, looking at the new features in OpenProject, version 5.1 has tasks built in(not exactly like we wanted but close) so all my time on this will be moot may 13th >.< ah well, learned some good stuff about engines at least and probably will need it again
[20:32:04] jtong: has joined #RubyOnRails
[20:32:24] mices: in this statement from model class Proc is expecting controller and model as arguments? tracked owner: [:create], owner: Proc.new{ |controller, model| controller.current_user }
[20:32:49] Malgorath: I just really don't like this application in general though, it just seems like a poorly designed app. I mean why not have task lists for everything from the start, seems like in a Project Management software a kind of critical piece
[20:33:37] mikecmpbll: mices : no idea, what is tracked?
[20:33:55] shpoont: has joined #RubyOnRails
[20:34:15] jenrzzz: has joined #RubyOnRails
[20:34:15] jenrzzz: has joined #RubyOnRails
[20:34:23] mices: mikecmpbll: this is the line of code to put in your model for the public activity gem
[20:34:40] mikecmpbll: mices : look at the public activity docs then? :)
[20:34:59] mices: i have it doesn't teach me ruby though
[20:35:18] rickmasta: has joined #RubyOnRails
[20:35:50] mices: database commit is rolling back so my model is suspect so i'm looking at that line
[20:36:12] sdwrage: has joined #RubyOnRails
[20:36:13] mices: even though i know it's not the problem
[20:36:21] Disavowed: has joined #RubyOnRails
[20:36:32] dannyguk: has joined #RubyOnRails
[20:36:50] mices: i thought whatever's between the |'s is what proc expects for arguments
[20:37:30] B1n4r10: has joined #RubyOnRails
[20:41:04] shpoont: has joined #RubyOnRails
[20:41:48] seamon: has joined #RubyOnRails
[20:43:44] Megamos: has joined #RubyOnRails
[20:46:04] rakm: has joined #RubyOnRails
[20:49:09] ur5us: has joined #RubyOnRails
[20:49:59] tubbo: mices: usually docs from random gems won't teach you ruby. for that, you probably want a book or a tutorial or something.
[20:50:34] petor: has joined #RubyOnRails
[20:51:56] scepticulous: has joined #RubyOnRails
[20:56:01] rubyonrailed: I’m having trouble using Devise with my Rails engine. I followed the devise wiki here https://github.com/plataformatec/devise/wiki/How-To:-Use-devise-inside-a-mountable-engine But my devise routes are not showing up. Here’s a gist of the code. https://gist.github.com/anonymous/f4619e18a09199e52ee58fdfeabc36a6
[20:57:06] mices: how can i find out why my transaction's rolling back on commit i looked at development.log and mysql/error.log i don't see anything
[20:59:22] xalupeao: has joined #RubyOnRails
[21:01:07] xalupeao: i have a question
[21:01:17] KensoDev: has joined #RubyOnRails
[21:01:31] xalupeao: i have a Contact model, this model has_many Activities
[21:02:01] diegoaguilar: has joined #RubyOnRails
[21:02:05] xalupeao: and i need get all Contact with have 3 or more Activities record
[21:02:28] xalupeao: how do can do it?
[21:02:31] jenrzzz_: has joined #RubyOnRails
[21:03:00] ramfjord_: has joined #RubyOnRails
[21:03:49] Scient: by writing a sql query
[21:04:12] xalupeao: is not possible use Ative Record?
[21:04:18] StaticVoid: has joined #RubyOnRails
[21:05:05] smathy: xalupeao, easiest might be to use a counter cache.
[21:06:06] xalupeao: you have a example?
[21:06:58] hahuang61: has joined #RubyOnRails
[21:07:08] apeiros: xalupeao: Contact.where("(select count(*) from activities where activity.contact_id = contacts.id) > ?", min_activities)
[21:07:09] cnk: xalupeao: Look for an active record query that does 'having' with 'count' - see the AR query interface guide at guides.rubyonrails.com
[21:07:39] apeiros: that'd be one way to do it. counter cache will certainly yield faster results.
[21:08:06] flashpoint9: has joined #RubyOnRails
[21:08:17] jgt4: has joined #RubyOnRails
[21:08:28] cnk: yes a counter cache would be worthwhile if this is a common query in the app
[21:09:12] xalupeao: but, how can use the counter cache?
[21:10:04] cnk: a counter cache means add a column activity_count to your Contact table and then rails will keep that in sync as you add / remove Activity records
[21:10:12] cnk: read guides about counter_cache
[21:10:36] cnk: if you have an activity_count column, the query is trivial
[21:10:42] tubbo: i kinda wish you could do subqueries in activerecord
[21:11:04] Cohedrin: tubbo are you using postgres
[21:11:21] apeiros: but the syntax is IMO not worth it. I prefer to just use sql.
[21:11:35] jtong_: has joined #RubyOnRails
[21:11:55] tubbo: Cohedrin: yeah
[21:12:07] Cohedrin: postgres_ext gem is probably what you're looking for
[21:12:08] apeiros: oy, guides are down
[21:12:24] tubbo: Cohedrin: oh yeah i know about that, it's pretty good.
[21:12:41] tubbo: there's also Squeel if you like DSLs
[21:12:52] rickmasta: has joined #RubyOnRails
[21:14:06] theery: has joined #RubyOnRails
[21:15:50] tubbo: apeiros: i'm with you...it's a lot easier to debug
[21:16:05] tubbo: squeel can sometimes make...interesting choices for how it structures queries. AR/ARel is the same way
[21:20:36] pwnd_nsfw`: I'm trying to help someone out real quick
[21:20:52] pwnd_nsfw`: They have their app running on ec2, but I know nothing about it really
[21:21:05] pwnd_nsfw`: anyways, they update code locally, push it to github, pull to their ec2 instance
[21:21:19] pwnd_nsfw`: the code is shown to be updated, but when you visit the page through url, nothing has changed
[21:21:51] Hates_: pwnd_nsfw`: have they restarted the app?
[21:22:01] pwnd_nsfw`: How? He was saying touching restart.txt somewhere
[21:22:05] pwnd_nsfw`: that doesn't make sense to me
[21:22:27] tubbo: well touch tmp/restart.txt in your app dir would restart passenger if that's the app server he's using
[21:22:43] tubbo: ps -ef | grep Passenger would tell you i think
[21:23:15] jtong: has joined #RubyOnRails
[21:23:57] pwnd_nsfw`: tubbo, yeah, he has it
[21:24:36] Hates_: pwnd_nsfw`: depending on what else is hosted on the box, you could try cycling nginx
[21:24:39] tubbo: that should do it
[21:25:25] pwnd_nsfw`: Hm, nothing updating correctly. It's code in the application layout
[21:25:27] pwnd_nsfw`: static, at that
[21:25:33] pwnd_nsfw`: Not even showing at all
[21:26:15] ashleyw: has joined #RubyOnRails
[21:26:18] tubbo: yeah maybe restarting nginx might help
[21:26:29] pwnd_nsfw`: I think I myb found out the issue... lol
[21:26:39] pwnd_nsfw`: He has beta and production folders
[21:26:48] pwnd_nsfw`: Trying to do this through teamviewer...
[21:27:10] pwnd_nsfw`: I'm nto allowed to have his github or any other info
[21:27:58] tubbo: probably a darknet market
[21:28:04] HanaNix: has joined #RubyOnRails
[21:28:16] pwnd_nsfw`: Not close, actually
[21:28:27] pwnd_nsfw`: I'm coming to the conclusion that Asians are not very good at web development
[21:28:33] pwnd_nsfw`: I know that's a huge generalization
[21:28:54] pwnd_nsfw`: any codebase I've seen by vietnamese or korea thus far... have been like.. da fuck man
[21:29:08] pwnd_nsfw`: like, this particular codebase.... doesn't use any view helper methods
[21:29:38] pwnd_nsfw`: He has html form tag
[21:29:47] pwnd_nsfw`: and right after, he <%= the auth token %>
[21:29:48] craysiii: has joined #RubyOnRails
[21:30:28] jhack: thats a huge generalization pwnd_nsfw`
[21:30:38] chipotle: has joined #RubyOnRails
[21:30:44] rickmasta: has joined #RubyOnRails
[21:31:18] hxegon: has joined #RubyOnRails
[21:31:36] baweaver: indeed, let's leave the racism out of it
[21:32:18] baweaver: intended or not, we'll leave it at that
[21:32:49] drbayer: has joined #RubyOnRails
[21:33:04] eyeamaye: does anyone know if I can use jsonapi-resources along with html templates?
[21:38:17] kirillzh: has joined #RubyOnRails
[21:40:09] flashpoint9: has joined #RubyOnRails
[21:40:50] tubbo: eyeamaye: you should be able to if you use the mixin
[21:41:07] tubbo: controller mixin*
[21:41:37] tubbo: oh wait but jsonapi_resources is a route method, hmm
[21:41:40] tubbo: yeah i dunno
[21:43:51] edwinvdgraaf: has joined #RubyOnRails
[21:44:05] eyeamaye: tubbo: hmm. jsonapi-resources /might/ be a little overkill. but the problem i'm trying to solve is creating and deleting linked resources, basically in the same way described in this sample curl from the peeps example.
[21:44:08] eyeamaye: curl -i -H "Accept: application/vnd.api+json" -H 'Content-Type:application/vnd.api+json' -X POST -d '{ "data": { "type": "phone-numbers", "relationships": { "contact": { "data": { "type": "contacts", "id": "1" } } }, "attributes": { "name": "home", "phone-number": "(603) 555-1212" } } }' http://localhost:3000/phone-numbers
[21:45:16] eyeamaye: maybe i can accomplish this with a normal serializer though.
[21:47:02] djbkd: has joined #RubyOnRails
[21:48:12] eyeamaye: hmm actually I'm pretty sure I can.
[21:49:09] herbst: has joined #RubyOnRails
[21:50:50] pawnbox: has joined #RubyOnRails
[21:51:55] jenrzzz: has joined #RubyOnRails
[21:54:29] delgiudices: has joined #RubyOnRails
[21:54:59] powersurge: has joined #RubyOnRails
[21:55:06] powersurge: any word on when rails 5 is releasing?
[21:55:13] powersurge: haven't heard anything in a while
[21:55:32] havenwood: I recall there's an app written in Go that does a countdown.
[21:56:19] yohle: has joined #RubyOnRails
[21:58:18] voidDotClass: has joined #RubyOnRails
[21:59:23] ensyde_: has joined #RubyOnRails
[22:02:41] baweaver: has joined #RubyOnRails
[22:03:48] PedramT: has joined #RubyOnRails
[22:06:10] tubbo: powersurge: http://rails5countdown.com/
[22:07:10] sonOfRa: has joined #RubyOnRails
[22:07:38] Seich: has joined #RubyOnRails
[22:07:52] matthewd: See also: https://github.com/rails/rails/milestones/5.0.0 -- I'd blame whoever has the most open/assigned issues
[22:08:01] hahuang61: has joined #RubyOnRails
[22:09:53] tubbo: watch it be matthewd
[22:10:09] flashpoint9: has joined #RubyOnRails
[22:10:13] smathy: There's only one "release blocker" :)
[22:10:31] Darmani: has joined #RubyOnRails
[22:10:35] chipotle: has joined #RubyOnRails
[22:11:00] Darmani: Radar? o.o
[22:11:02] neanderslob_: has joined #RubyOnRails
[22:11:51] baweaver: has joined #RubyOnRails
[22:15:10] hahuang61: has joined #RubyOnRails
[22:17:13] diegoaguilar: has joined #RubyOnRails
[22:18:50] mwcmitchell: has joined #RubyOnRails
[22:22:05] eyeamaye: has joined #RubyOnRails
[22:23:23] delgiudices: has joined #RubyOnRails
[22:25:24] thomasfedb: has joined #RubyOnRails
[22:25:24] thomasfedb: has joined #RubyOnRails
[22:29:37] SteenJobs: has joined #RubyOnRails
[22:30:01] SteenJobs: hey guys - best way to set max words rather than characters for a text input?
[22:32:07] cnk: Javascript
[22:32:12] baweaver: has joined #RubyOnRails
[22:32:30] SteenJobs: cnk: thanks, will do
[22:32:43] SteenJobs: i’m sure there must be some good jquery plugin out there - any ideas?
[22:34:35] kies: has joined #RubyOnRails
[22:35:08] jenrzzz: has joined #RubyOnRails
[22:37:05] SteenJobs: all good - found what i needed, thanks man
[22:37:16] dannyguk: has joined #RubyOnRails
[22:37:51] jtong_: has joined #RubyOnRails
[22:39:04] TheNet: has joined #RubyOnRails
[22:40:23] herpless: has joined #RubyOnRails
[22:41:48] King_Rex: has joined #RubyOnRails
[22:42:00] alex88: has joined #RubyOnRails
[22:42:20] aloneintheworld: has joined #RubyOnRails
[22:44:59] rakm: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[22:47:35] ur5us_: has joined #RubyOnRails
[22:49:50] ur5us: has joined #RubyOnRails
[22:53:05] delgiudices: has joined #RubyOnRails
[23:04:49] owenjones: has joined #RubyOnRails
[23:05:11] benlieb: has joined #RubyOnRails
[23:09:00] rake_db_migrate: has joined #RubyOnRails
[23:12:09] chouhoulis: has joined #RubyOnRails
[23:18:02] delgiudices: has joined #RubyOnRails
[23:19:11] CanTonic: has joined #RubyOnRails
[23:19:31] yfeldblum: has joined #RubyOnRails
[23:21:48] chouhoulis: has joined #RubyOnRails
[23:23:45] _Tariq: has joined #RubyOnRails
[23:23:54] Ropeney: has joined #RubyOnRails
[23:24:21] jenrzzz: has joined #RubyOnRails
[23:24:25] flashpoint9: has joined #RubyOnRails
[23:30:25] SteenJobs: has joined #RubyOnRails
[23:33:06] n008f4g_: has joined #RubyOnRails
[23:34:05] quazimodo: has joined #RubyOnRails
[23:35:19] newbieuser: has joined #RubyOnRails
[23:35:51] rake_db_migrate: has joined #RubyOnRails
[23:36:20] GodFather: has joined #RubyOnRails
[23:37:08] stujah1: has joined #RubyOnRails
[23:37:40] jhack: has joined #RubyOnRails
[23:38:10] rake_db_migrate: has joined #RubyOnRails
[23:39:37] JesseH2: has joined #RubyOnRails
[23:41:04] newbieuser: has joined #RubyOnRails
[23:41:52] theblang: has joined #RubyOnRails
[23:42:54] qejk: has joined #RubyOnRails
[23:43:34] newbieuser: has left #RubyOnRails: ()
[23:43:52] Rubie: has joined #RubyOnRails
[23:45:22] DLSteve: has joined #RubyOnRails
[23:48:21] ekinmur: has joined #RubyOnRails
[23:50:02] hxegon: has joined #RubyOnRails
[23:50:41] herbst: has joined #RubyOnRails
[23:50:43] yohle: has joined #RubyOnRails
[23:50:52] TheNet: has joined #RubyOnRails
[23:52:17] hahuang65: has joined #RubyOnRails
[23:52:40] Uranio: has joined #RubyOnRails
[23:53:54] dalbuschat: has joined #RubyOnRails
[23:54:38] Cohedrin: has joined #RubyOnRails
[23:57:45] yfeldblum: has joined #RubyOnRails
[23:59:22] baweaver: has joined #RubyOnRails