« Back to channel list

#RubyOnRails - 20 May 2016

« Back 1 day Forward 1 day »
[00:01:38] pawnbox: has joined #RubyOnRails
[00:03:57] keiki_: has joined #RubyOnRails
[00:05:19] keiki_: hey guys I have a noob question hopefully just because I'm tired: I tried to in-console monkeypatch a class I have that's super nested (i.e. did module Foo; module Bar; class Baz; def something; return true; end....) and for some reason while that took, it seemed to have lost the ability to find all the other methods in that class
[00:05:43] keiki_: which..... as far as I remember it's not supposed to do :P
[00:08:21] sdwrage: has joined #RubyOnRails
[00:09:38] smathy: has joined #RubyOnRails
[00:10:31] stardiviner: has joined #RubyOnRails
[00:12:18] keiki: has joined #RubyOnRails
[00:12:34] Radar: keiki_: Foo::Bar::Baz will load the class, and then you can override that method
[00:12:57] Radar: keiki_: What you've done there is defined the class before it's even loaded. When you go to ref it again, Rails will see it's already loaded and so won't go down its autoload path
[00:13:13] keiki: ah needed to req it first, then?
[00:13:25] keiki_: has left #RubyOnRails: ()
[00:13:52] Radar: Just reference it first and let rails take care of the loading of it
[00:14:00] keiki: worked around it
[00:14:06] keiki: wanted to know for future ref
[00:14:08] keiki: blaming it on being tired
[00:14:10] keiki: also hi! :)
[00:22:28] startupality: has joined #RubyOnRails
[00:23:06] Darmani: Hey guys, I wrote a code to hide some links if a user is not the author of a post. But for some reason the author can't even see the links o.o
[00:23:08] Darmani: https://gist.github.com/mfifth/b933d5981aeaac9bb43a83b2c1850470
[00:23:13] Darmani: Is this correct?
[00:23:32] Radar: Darmani: If it's not working then that makes me think it's not correct.
[00:23:47] Radar: Darmani: Consider putting a binding.pry above line 7 and then seeing what the values of current_user and @topic.author.email are
[00:24:06] Darmani: Radar: What's a binding.pry? o.o
[00:24:57] jenrzzz: has joined #RubyOnRails
[00:27:45] Radar: Darmani: add the pry gem to your Gemfile, run bundle install, restart your server, then follow my instructions
[00:27:50] Radar: I think you can work it out from there
[00:28:01] Radar: binding.pry is a breakpoint. It'll stop the code's execution and bring up an interactive console.]
[00:28:53] Darmani: Radar: Okay.
[00:30:20] pepee-: has joined #RubyOnRails
[00:31:30] giom: has joined #RubyOnRails
[00:32:11] RegulationD: has joined #RubyOnRails
[00:33:14] distruggle: has joined #RubyOnRails
[00:35:03] sdwrage: has joined #RubyOnRails
[00:37:33] Darmani: Radar: Do I have to write a test to activate the Pry session?
[00:37:45] Darmani: Or how exactly does it prompt? o.o
[00:37:47] Radar: Darmani: No, you can make a request
[00:37:59] Radar: Darmani: If you make the request where that code is then look at rails server, there will be a prompt open
[00:38:25] Darmani: roger that
[00:39:00] chouhoulis: has joined #RubyOnRails
[00:39:56] superlou: has joined #RubyOnRails
[00:41:22] Darmani: Radar: module ApplicationHelper require 'pry' def admins_only(&block) block.call if current_user.try(:admin?) end binding.pry def author_only(&block) block.call if current_user == @topic.author.email end end
[00:41:32] Darmani: Radar: https://gist.github.com/mfifth/db08c939bfde2926691d4eda2a637c9a
[00:41:45] Darmani: I'm guessing that's not how you do it.
[00:41:47] Radar: No, not there.
[00:41:54] Radar: Inside the author_only method.
[00:41:58] Radar: Above what is now line 11.
[00:42:06] Radar: You want the binding.pry called when the author_only method is called.
[00:42:15] techsethi: has joined #RubyOnRails
[00:43:58] Darmani: Radar: https://gist.github.com/mfifth/db08c939bfde2926691d4eda2a637c9a
[00:44:09] Radar: Did you restart your server?
[00:44:32] Radar: [10:27:44] <Radar> Darmani: add the pry gem to your Gemfile, run bundle install, restart your server, then follow my instructions
[00:45:41] jstransky: has joined #RubyOnRails
[00:46:03] Darmani: Radar: Oh cool I think I'm in the console...
[00:46:12] Radar: current_user is what
[00:46:19] Radar: @topic.author.email is what
[00:47:30] Darmani: current_user is user@forums.com.... and the @topic.author.email is admin@forums.com...
[00:47:50] Radar: current_user is a User object though...
[00:47:58] Radar: Oh, you might have a to_s method defined on it
[00:48:09] jetpack_joe: has joined #RubyOnRails
[00:48:17] sypheren: has joined #RubyOnRails
[00:48:52] Radar: On the User model, I mean,.
[00:49:36] Darmani: I'm still confused I think.
[00:49:43] Darmani: Hang on I have to think about this lol
[00:49:57] Darmani: What are the implications of what we just discovered...
[00:53:10] Darmani: Radar: Wait they are the same Radar... The email from current_user & @topic.author.email are the same. So I should be able to see the links to edit, destroy, etc...
[00:53:18] Radar: No, they are not the same.
[00:53:28] Radar: Darmani: Remove the `to_s` method from your User model and then retry it.
[00:53:58] Darmani: Radar: My user model doesn't have a to_s method o.o
[00:54:20] Radar: Darmani: Then how is current_user == "user@forums.com"?
[00:54:25] Radar: Show me the output from the Pry console please.
[00:55:36] Darmani: Wait what.... It changed??? It was the same a second ago now it's different??
[00:55:51] centrx: has joined #RubyOnRails
[00:56:07] Darmani: Radar: https://gist.github.com/mfifth/db08c939bfde2926691d4eda2a637c9a
[00:57:05] stannard: has joined #RubyOnRails
[00:58:57] Darmani: ohhh I see. I'm comparing an object with an email.
[01:01:53] Darmani: I'm amazing.
[01:02:10] Darmani: ACTION sighs
[01:02:24] Radar: :tada: :tada: :tada:
[01:02:36] Darmani: Radar: Were you silent that whole time on purpose???
[01:02:52] Radar: I was afk
[01:03:13] Darmani: That's a nifty little tool. Pry. I like it.
[01:03:47] Darmani: Alright well that's enough for now. I need to go play video games or something.
[01:03:51] Darmani: Thanks Radar.
[01:04:38] Radar: Yes, pry is handy to figure out what's going on at a specific point
[01:04:47] Radar: I use it quite a lot
[01:04:56] emachnic: has joined #RubyOnRails
[01:08:46] macsteps: has joined #RubyOnRails
[01:09:47] sevenseacat: has joined #RubyOnRails
[01:12:11] wilsonc91: has joined #RubyOnRails
[01:20:23] wilsonc91: has joined #RubyOnRails
[01:22:50] wilsonc91: has joined #RubyOnRails
[01:29:56] agent_white: Evenin' folks
[01:30:06] _Tariq: has joined #RubyOnRails
[01:30:41] maxdoubt: has joined #RubyOnRails
[01:31:03] Ropeney: has joined #RubyOnRails
[01:32:43] manfrin: has joined #RubyOnRails
[01:33:01] flashpoint9: has joined #RubyOnRails
[01:34:01] distruggle: has joined #RubyOnRails
[01:34:37] sdwrage: has joined #RubyOnRails
[01:38:16] diegoviola: has joined #RubyOnRails
[01:45:49] blackmesa: has joined #RubyOnRails
[01:47:46] keiki: has left #RubyOnRails: ()
[01:53:13] _Tariq: has joined #RubyOnRails
[01:54:00] voidDotClass: has joined #RubyOnRails
[02:00:16] chopin: has joined #RubyOnRails
[02:03:40] maxz: has joined #RubyOnRails
[02:05:34] asheinfeld: has joined #RubyOnRails
[02:10:22] quazimodo: has joined #RubyOnRails
[02:11:28] maxdoubt: has joined #RubyOnRails
[02:19:48] syzygy_: has joined #RubyOnRails
[02:19:50] bronson: has joined #RubyOnRails
[02:27:42] noobRORDev: has joined #RubyOnRails
[02:35:40] noobRORDev_: has joined #RubyOnRails
[02:38:34] noobRORDev_: /msg NickServ VERIFY REGISTER noobRORDev_ cvhqgxxqkzfb
[02:39:19] sevenseacat: how are so many people making that mistake lately
[02:41:31] noobRORDev_: has left #RubyOnRails: ()
[02:41:39] ur5us: has joined #RubyOnRails
[02:43:26] noobRORDev_: has joined #RubyOnRails
[02:47:44] jdcauley: has joined #RubyOnRails
[02:49:37] artto: has joined #RubyOnRails
[02:51:41] sdwrage: has joined #RubyOnRails
[02:52:17] blackmesa: has joined #RubyOnRails
[02:52:17] Radar: sevenseacat: maybe it's the same person?
[02:53:58] JoshGlzBrk: has joined #RubyOnRails
[02:55:55] Inside: has joined #RubyOnRails
[02:55:55] Inside: has joined #RubyOnRails
[02:58:37] stannard: has joined #RubyOnRails
[02:59:58] todd: has joined #RubyOnRails
[03:01:11] mbreedlove: has joined #RubyOnRails
[03:06:06] maxdoubt: has joined #RubyOnRails
[03:10:02] macsteps: has joined #RubyOnRails
[03:11:17] braincrash: has joined #RubyOnRails
[03:17:50] chipotle: has joined #RubyOnRails
[03:20:55] k3rn31: has joined #RubyOnRails
[03:21:14] yfeldblum: has joined #RubyOnRails
[03:21:30] kgrz: has joined #RubyOnRails
[03:22:14] _3dwardsharp: has joined #RubyOnRails
[03:22:31] rubysapphire: has joined #RubyOnRails
[03:23:24] rubysapphire: hi all, what is the best way to conform to json api requests to the rails server. Most tuts I see show simple controller implementations of parameters. Is there a gem that handles the jsonapi convention?
[03:27:15] zave: has joined #RubyOnRails
[03:29:22] mbreedlove: has joined #RubyOnRails
[03:31:16] one_zero: has joined #RubyOnRails
[03:31:46] mbreedlove: has joined #RubyOnRails
[03:33:49] RegulationD: has joined #RubyOnRails
[03:36:21] yfeldblum: has joined #RubyOnRails
[03:38:51] centrx: rubysapphire: Check out rails-api and/or grape
[03:42:27] kgrz: has joined #RubyOnRails
[03:45:52] braincra-: has joined #RubyOnRails
[03:47:36] dopie: Can anyone give me some direction on how to improve this code?
[03:47:42] dopie: should I put it in helpers? https://gist.github.com/staycreativedesign/d11dfec4b8ca3003113f6ff2efcb6ef9
[03:53:04] blackmesa: has joined #RubyOnRails
[03:53:26] mfilipe: what is wrong with my migration? https://gist.github.com/mfilipe/1d0494c07713d67a097bd8e103e93627
[03:53:36] crystal77: has joined #RubyOnRails
[03:55:43] moeabdol: has joined #RubyOnRails
[03:55:57] Radar: mfilipe: ":recommended, false"
[03:56:13] kgrz: has joined #RubyOnRails
[03:56:20] Radar: Sorry, that's alright
[03:56:33] quazimodo: has joined #RubyOnRails
[03:56:36] Radar: mfilipe: It's the default: false after it. You can't change the null-ness of the column and the default at the same time
[03:56:45] Radar: use change_column_default after change_column_null
[03:57:55] adre: has joined #RubyOnRails
[04:02:59] jenrzzz: has joined #RubyOnRails
[04:03:27] alfie_max15: has joined #RubyOnRails
[04:04:44] pawnbox: has joined #RubyOnRails
[04:06:06] mbreedlove: has joined #RubyOnRails
[04:06:50] mfilipe: Radar, thanks! your way worked but when I changed to ´:recommended, false´, it worked as well
[04:06:53] njero: has joined #RubyOnRails
[04:10:10] jstransky: has joined #RubyOnRails
[04:13:11] dEPy: has joined #RubyOnRails
[04:14:27] njero: has joined #RubyOnRails
[04:16:54] liquid-silence: has joined #RubyOnRails
[04:16:54] liquid-silence: has joined #RubyOnRails
[04:21:41] noobRORDev: If I am passing thins params "currencies"=>{"currencies_id"=>["", "1", "2", "3"]}
[04:22:02] noobRORDev: what would I put in the strong params
[04:24:30] liquid-silence: jhass so my document to the client worked, sortof
[04:24:58] Guest71278: has joined #RubyOnRails
[04:24:58] FooBarWidget: has joined #RubyOnRails
[04:25:12] LBRapid: has joined #RubyOnRails
[04:25:48] centrx: has joined #RubyOnRails
[04:33:45] k3rn31: has joined #RubyOnRails
[04:38:09] sypheren: has joined #RubyOnRails
[04:43:19] liquid-silence: has joined #RubyOnRails
[04:43:19] liquid-silence: has joined #RubyOnRails
[04:44:24] jstransky: has joined #RubyOnRails
[04:45:36] liquid-silence: @jhass so my document to the client worked, sorry dont know if this got through, internet DC'd
[04:46:12] emachnic: has joined #RubyOnRails
[04:47:02] momomomomo: has joined #RubyOnRails
[04:50:51] centrx: has joined #RubyOnRails
[04:53:01] Devalo: has joined #RubyOnRails
[04:54:05] blackmesa: has joined #RubyOnRails
[04:56:15] grassass: has joined #RubyOnRails
[04:57:26] sameerynho: has joined #RubyOnRails
[04:57:53] AmiMoench: has joined #RubyOnRails
[04:59:06] konsolebox: has joined #RubyOnRails
[04:59:21] yfeldblum: has joined #RubyOnRails
[05:03:13] janebootydoe: has joined #RubyOnRails
[05:06:58] arcjon: has joined #RubyOnRails
[05:09:54] jenrzzz: has joined #RubyOnRails
[05:12:48] kies: has joined #RubyOnRails
[05:13:38] hous: has joined #RubyOnRails
[05:14:34] moeabdol: has joined #RubyOnRails
[05:15:33] kanzure: has joined #RubyOnRails
[05:20:07] Devalo: has joined #RubyOnRails
[05:22:16] quazimodo: has joined #RubyOnRails
[05:28:13] rvanlieshout: has joined #RubyOnRails
[05:36:33] jas02: has joined #RubyOnRails
[05:38:16] Dimik: has joined #RubyOnRails
[05:39:11] pikos: has joined #RubyOnRails
[05:41:30] apotry: has joined #RubyOnRails
[05:48:24] srinidhi: has joined #RubyOnRails
[05:49:35] rakm: has joined #RubyOnRails
[05:54:48] der-landgraf: how do I get rails up to 5.0
[05:54:51] blackmesa: has joined #RubyOnRails
[05:56:38] sevenseacat: der-landgraf: you wait until Rails 5.0 is released, then you follow the upgrade guides
[05:57:11] der-landgraf: cannot upgrade to beta?
[05:57:26] sevenseacat: sure you can, but thats not what you asked
[05:58:10] der-landgraf: mmhm k thanks
[06:00:54] alfie_max15: http://rails5countdown.com/
[06:01:18] alfie_max15: ^ This is not official, but the source code looks interesting ;)
[06:02:09] AmiMoench: has joined #RubyOnRails
[06:02:40] der-landgraf: lol I'll tweet it
[06:06:46] moeabdol: has joined #RubyOnRails
[06:07:09] solars: has joined #RubyOnRails
[06:18:01] swaaws: has joined #RubyOnRails
[06:18:23] gingray: has joined #RubyOnRails
[06:19:07] roelof: has joined #RubyOnRails
[06:19:50] roelof: Hello, I have this hash : [[{"name"=>"Piero di Cosimo", "title"=>"Portretten van Giuliano en Francesco Giamberti da Sangallo", "images"=>{"name"=>"z4", "width"=>389, "height"=>276, "tiles"=>[{"x"=>0, "y"=>0, "url"=>"http://lh6.ggpht.com/eN4-c3_UL3ns7iho-9Co6sKW_rl7VbFjbBSG-FJzvaJIUlPRxjV4jhpugseKx7uZApwlWCYINFgnmoQ_lBh98qoR5w"}]}}], [{"name"=>"Hendrick Avercamp", "title"=>"Winterlandschap met schaatsers", "images"=>{"name"=>"z4
[06:19:57] Axilla: has joined #RubyOnRails
[06:20:14] liquid-silence: has joined #RubyOnRails
[06:20:14] liquid-silence: has joined #RubyOnRails
[06:20:35] roelof: How can I make a variable in a view that only contains the tiles part so I can iterate over it and display the images ?
[06:21:46] Coldblackice: has joined #RubyOnRails
[06:22:00] rvanlieshout: it's an array of an array of hashes?
[06:22:25] swaaws: how can access an "title" in an each do block. every loop an ohter user. in rails console: "User.first.article.first.title“ only one user. rails 4.2.1
[06:23:15] roelof: or can I do something like item["images"]["tiles"].each do ?
[06:23:33] bronson: has joined #RubyOnRails
[06:24:03] rvanlieshout: swaaws: User.first = a user
[06:24:08] rvanlieshout: user.article is a single article
[06:24:11] rvanlieshout: so user.article.first fails
[06:24:38] rvanlieshout: roelof: what exactly is it? it's contains two [ in the beginning. so it's an array containing an array
[06:24:55] chipotle: has joined #RubyOnRails
[06:25:17] swaaws: 1. list of users (devise)
[06:25:39] rvanlieshout: swaaws: what do you want to do?
[06:25:42] roelof: Because there are more items to display. This is only the first item
[06:25:57] rvanlieshout: so you have a list of users. and what do you want to do with that list?
[06:26:38] pramodv: has joined #RubyOnRails
[06:29:50] Coldblackice: has joined #RubyOnRails
[06:30:07] centrx: has joined #RubyOnRails
[06:30:47] swaaws: rvanlieshout: https://gist.github.com/swaaws/a327fe8c46403c97af2974af87e0c9b6
[06:31:27] neanderslob: has joined #RubyOnRails
[06:31:27] existensil: has joined #RubyOnRails
[06:31:55] tris: has joined #RubyOnRails
[06:32:18] veloutin: has joined #RubyOnRails
[06:33:02] rvanlieshout: so explain this
[06:33:07] rvanlieshout: you want to display what of each user?
[06:33:09] rvanlieshout: and why of all users?
[06:33:38] rvanlieshout: cause user.first.article.first.title doesn't make sense whatsoever
[06:33:41] rvanlieshout: and i'm willng to explain
[06:33:46] rvanlieshout: if you explain what you want to have :)
[06:35:42] finnnnnnnnnnn: has joined #RubyOnRails
[06:36:24] MEATCHICKEN: has joined #RubyOnRails
[06:38:05] tetraktys: has joined #RubyOnRails
[06:38:17] emilkarl: has joined #RubyOnRails
[06:38:38] bookies: has joined #RubyOnRails
[06:39:05] crdpink: has joined #RubyOnRails
[06:39:32] swaaws: rvanlieshout: https://gist.github.com/swaaws/a6344f169755485aaff140c30d098344
[06:39:54] rvanlieshout: user.articles.first.title
[06:40:00] kgrz: has joined #RubyOnRails
[06:40:42] itgone: has joined #RubyOnRails
[06:43:02] MEATCHICKEN: has joined #RubyOnRails
[06:44:59] swaaws: rvanlieshout: result https://gist.github.com/swaaws/c011cd5c5f4c1b976c0f31c61f6a79a0
[06:45:13] bookies: I was given a project that I consider large. I am working on getting familiar with the codebase and tidying it up as much as I can. There are controllers that have 500+ lines of code, models that have 350+ lines, no use of concern, very minimal helpers file use and there are methods/actions with more than 150 lines. Is this fine? I think it's a mess when I try to work with all these. Are there any recommendations or guidelines
[06:45:36] sevenseacat: bookies: tidy it up little bit by little bit
[06:45:37] raunicolae: has joined #RubyOnRails
[06:45:59] raunicolae: has left #RubyOnRails: ()
[06:46:48] sevenseacat: whenever you go in there to make a change, see what other tiny little changes you can add to make it nicer to work with
[06:46:55] sevenseacat: plus: tests!!!!!
[06:47:09] aganov: has joined #RubyOnRails
[06:50:04] bookies: sevenseacat: thank you
[06:50:41] roelof: How can I find out which parts outputs this : [{&quot;name&quot;=&gt;&quot;Piero di Cosimo&quot;, &quot;title&quot;=&gt;&quot;Portretten van Giuliano en Francesco Giamberti da Sangallo&quot;, &quot;images&quot;=&gt;{&quot;name&quot;=&gt;&quot;z4&quot;, &quot;width&quot;=&gt;389, &quot;height&quot;=&gt;276, &quot;tiles&quot;=&gt;[{&quot;x&quot;=&gt;0, &quot;y&quot;=&gt;0, &quot;url&quot;=&gt;&quot;http://lh6.ggpht.com/eN4-c3_UL3ns
[06:50:53] smoitra: has joined #RubyOnRails
[06:51:44] roelof: into my index page. Mine index.html.erb looks like this : https://gist.github.com/rwobben/34d8c56cd373817d38070f88188ce235
[06:52:10] roelof: so never in something like p all_data
[06:52:10] sevenseacat: roelof: https://gist.github.com/rwobben/34d8c56cd373817d38070f88188ce235#file-index-html-erb-L1 <%= @all_data
[06:53:06] rvanlieshout: swaaws: show your user model
[06:53:13] rvanlieshout: i think you named your relationships wrong
[06:53:22] rvanlieshout: AND. what do you want to happen when a user doesn't have any articles?
[06:53:40] roelof: bummer, I only want to iterate over the all_data array and display all data seperate :(
[06:54:06] swaaws: has_many :article, dependent: :destroy
[06:54:20] rvanlieshout: swaaws: change that to has_many :articles
[06:54:26] rvanlieshout: second question remains
[06:54:41] sevenseacat: roelof: then don't use <%= to print out @all_data
[06:54:48] sameerynho: has joined #RubyOnRails
[06:55:19] roelof: oke, so <% = prints out , <% executes things. Right ? sevenseacat
[06:55:44] roelof: thanks, now I can make a nice layout of the paintings and the text
[06:55:53] blackmesa: has joined #RubyOnRails
[06:55:57] roelof: Im thinking of a masonary layout
[06:59:37] swaaws: rvanlieshout: i changed has_many :articles and user.articles.first.title, same error undefined method `title' for nil:NilClass
[07:00:05] sevenseacat: then the user doesnt have any articles
[07:00:24] sevenseacat: what do you want to do in that scenario?
[07:01:34] swaaws: articles are ok 2 in db, and 3 users
[07:01:50] sevenseacat: so there's one user without an article
[07:02:24] sevenseacat: what do you want to display for that user?
[07:02:35] swaaws: yep but normaly gives nil return
[07:02:50] sevenseacat: what normally gives nil rteturn?
[07:03:11] kgrz: has joined #RubyOnRails
[07:04:00] AzaToth: has joined #RubyOnRails
[07:04:07] swaaws: if no title(+ description) exist it returns "nil"
[07:04:28] sevenseacat: its the *article* that doesnt exist, not the title
[07:04:40] sevenseacat: so the article is nil, and then you're calling title on it - hence the error
[07:05:25] swaaws: ...testing...
[07:08:29] bookies: I apologise. I am new to refactoring. Is my refactoring to the new file correct? (https://gist.github.com/stefioan/6b781ef54b89ea3a5c97f40c42eafe6c) Will it call the new method?
[07:08:49] noobsu: has joined #RubyOnRails
[07:11:24] macsteps: has joined #RubyOnRails
[07:12:02] sevenseacat: theres one easy way to find out - try it
[07:13:14] comrad: has joined #RubyOnRails
[07:14:01] swaaws: ok thanks every user must have an article to work
[07:14:40] tetraktys: has joined #RubyOnRails
[07:14:51] bookies: sevenseacat, for sure
[07:14:58] fbandov: has joined #RubyOnRails
[07:19:25] noobsu: has joined #RubyOnRails
[07:25:21] arBmind: has joined #RubyOnRails
[07:26:33] alfie_max15: has joined #RubyOnRails
[07:26:55] mark_66: has joined #RubyOnRails
[07:27:00] Devalo: has joined #RubyOnRails
[07:27:02] kgrz: has joined #RubyOnRails
[07:27:43] patrick_star_3: has joined #RubyOnRails
[07:28:42] gingray: has joined #RubyOnRails
[07:28:45] liquid-silence: has joined #RubyOnRails
[07:28:45] liquid-silence: has joined #RubyOnRails
[07:30:15] jstransky: has joined #RubyOnRails
[07:31:10] hahuang65: has joined #RubyOnRails
[07:35:11] RegulationD: has joined #RubyOnRails
[07:39:03] ql6wlld: has joined #RubyOnRails
[07:42:06] shibly: has joined #RubyOnRails
[07:42:46] shibly: has left #RubyOnRails: ()
[07:46:43] artto: has joined #RubyOnRails
[07:49:57] finnnnnnnnnnn: has joined #RubyOnRails
[07:51:23] sameerynho: has joined #RubyOnRails
[07:51:38] kgrz: has joined #RubyOnRails
[07:53:10] SeductiveError: has joined #RubyOnRails
[07:53:13] SeductiveError: anyone else having issues with github?
[07:53:33] SeductiveError: really slow, 500 errors
[07:53:58] bookies: getting a unicorn. This page is taking way too long to load.
[07:54:05] SeductiveError: cant push any commits
[07:55:32] sevenseacat: https://status.github.com/ graphs say things are not happy
[07:55:33] CornishPasty: https://status.github.com/ lol "all systems operational" + that graph
[07:55:52] CornishPasty: Oh hi sevenseacat
[07:56:00] adaedra: Yep, just got a 500
[07:56:31] sevenseacat: thats the AWS version of a status page - 'one service out of our 500000 services are working so we'll put a green check mark'
[07:56:41] SeductiveError: what could it be?
[07:56:54] sevenseacat: seductiveerror: github is having issues. wait for them to be resolved.
[07:56:56] SeductiveError: who pushed the README change and broke Github
[07:57:07] blackmesa: has joined #RubyOnRails
[07:57:08] CornishPasty: "We're investigating some issues with our databases".
[07:57:37] sevenseacat: good thing we all use a *distributed* vcs yeah
[07:57:52] SeductiveError: yeah unless your local box gets nuked
[07:57:54] CornishPasty: If this was SvnHub, good luck committing
[07:57:57] SeductiveError: wheres your god now
[07:58:12] CornishPasty: Oh I don't know what I mean :(
[07:58:22] SeductiveError: its okay cornish =]
[07:58:34] CornishPasty: But yeah, SVN not letting you commit without pushing...
[07:58:38] sevenseacat: committing in an 4GB svn repo when the svn server is a shitbox under the desk - aaaaaaaargh
[07:59:06] CornishPasty: Was just gonna say, sounds like you're speaking from experience
[07:59:16] swaaws: rvanlieshout: now im using ruby 2.3.0 this allows "user.articles.first&.title" http://mitrev.net/ruby/2015/11/13/the-operator-in-ruby/
[07:59:34] sevenseacat: did i mention said shitbox was not accessible on the local network even though it was literally under the next desk
[07:59:46] CornishPasty: How did it work then?
[08:00:01] sevenseacat: fucked if i know
[08:00:18] sevenseacat: swaaws: thats... not a great idea
[08:01:07] alfie_max15: github back up and running.. wow, that was fast
[08:01:08] swaaws: it works ^^
[08:01:09] sevenseacat: because then you're going to want to put a link in, and a picture or something, and instead of just putting all that content in one nice conditional you're going to wrap it in 500 lonely operators
[08:01:19] sevenseacat: and its going to be a total mess
[08:01:48] SeductiveError: thats fine, just add another and make it "&&". then it wont be so lonely
[08:01:50] rvanlieshout: shouldn't you just list the users that have articles?
[08:02:01] adre: has joined #RubyOnRails
[08:02:19] Mia: has joined #RubyOnRails
[08:03:10] sevenseacat: I happen to not be a huge fan of the &. operator because it gets abused in cases like this
[08:03:47] jsrn: has joined #RubyOnRails
[08:03:47] snowy: has joined #RubyOnRails
[08:03:54] kgrz: has joined #RubyOnRails
[08:04:26] mbreedlo_: has joined #RubyOnRails
[08:06:05] swaaws: the title can be selected only in a dropdown
[08:06:06] sevenseacat: I'd also question the use of `articles.first` first by what definition?
[08:07:37] swaaws: by all articles are created...?!?!
[08:08:54] sevenseacat: okay, if you want the first when ordered by creation date, that would be a good thing to specify otherwise that might not be what you get :)
[08:09:39] marr: has joined #RubyOnRails
[08:09:41] swaaws: yep is ....@users = User.order('last_sign_in_at').all.reverse_order
[08:10:15] sevenseacat: I said articles, not users
[08:10:33] fbandov: has joined #RubyOnRails
[08:10:53] swaaws: yep fail is orderd by id
[08:11:12] sevenseacat: you should probably specify that
[08:11:15] sevenseacat: if thats what you want
[08:11:33] swaaws: all is done thanks
[08:12:03] Pazician: has joined #RubyOnRails
[08:12:47] Olipro: has joined #RubyOnRails
[08:12:58] darutoko: has joined #RubyOnRails
[08:13:22] jsrn: has joined #RubyOnRails
[08:14:58] jenrzzz: has joined #RubyOnRails
[08:14:58] jenrzzz: has joined #RubyOnRails
[08:15:18] liquid-silence: has joined #RubyOnRails
[08:15:18] liquid-silence: has joined #RubyOnRails
[08:15:30] janebootydoe: has joined #RubyOnRails
[08:17:49] mbreedlove: has joined #RubyOnRails
[08:19:59] mbreedlove: has joined #RubyOnRails
[08:20:47] Axilla: has joined #RubyOnRails
[08:21:39] drptbl: has joined #RubyOnRails
[08:22:52] insanedreamer: has joined #RubyOnRails
[08:26:01] bronson: has joined #RubyOnRails
[08:28:37] Devalo: has joined #RubyOnRails
[08:28:57] mfoo: has joined #RubyOnRails
[08:32:02] artto: has joined #RubyOnRails
[08:38:38] chouhoulis: has joined #RubyOnRails
[08:41:12] gregf_: has left #RubyOnRails: ()
[08:41:13] liquid-silence: has joined #RubyOnRails
[08:41:14] liquid-silence: has joined #RubyOnRails
[08:42:30] Palsson: has joined #RubyOnRails
[08:42:50] roelof: has joined #RubyOnRails
[08:43:40] roelof: Hello, In a loop I have to pull a http request with HTTParty two times to different urls to retrieve all data for a object
[08:44:16] roelof: Now I read one , process data, read second url , process data and I can send data to my view
[08:44:43] roelof: Is there a way I can read the two url's at the same time and process the data later ?
[08:45:58] Palsson: has joined #RubyOnRails
[08:46:04] roelof: so I can read the two reponses from both urls'and when both are done I can continue with the next one ?
[08:47:27] universa1: but then i'd question if this is really something that should be done directly in the request -> response cycle, i'd look for options to move that to a background job.
[08:47:57] finnnnnnnnnnn: has joined #RubyOnRails
[08:49:28] roelof: oke, can also be a solution. I have now this controller : https://gist.github.com/rwobben/4c95b7e761ba6d16eddbc913ef1d9eaa
[08:49:49] eljimmy: has joined #RubyOnRails
[08:49:50] rvanlieshout: why would you ask if you already have a solution?
[08:49:52] roelof: and looking how I can improve it . I think this one is a little bit slow
[08:50:11] roelof: rvanlieshout: see my last remark
[08:50:12] rvanlieshout: you might want to move this to a service object
[08:50:24] rvanlieshout: well. that can be increased by using threads
[08:50:30] rvanlieshout: but it might even be better to populate this in the background
[08:50:32] rvanlieshout: save it in your db
[08:50:44] rvanlieshout: and use the local db data for the PaintingsController
[08:50:56] voidDotClass: has joined #RubyOnRails
[08:51:21] roelof: oke, so read the data first and put the data I want in a database ?
[08:51:36] rvanlieshout: using activejob
[08:51:37] rvanlieshout: in the background
[08:51:52] roelof: oke, I have to find out then how I can do this ?
[08:52:19] rvanlieshout: similar to how you're doing now
[08:52:23] rvanlieshout: only save the result in ActiveRecord models
[08:52:48] rvanlieshout: in a Painting-model
[08:53:35] rvanlieshout: eventually this action would just be @paintings = Painting.limit(10)-a-like
[08:54:22] roelof: which consist of the name of the painting, the name of the painter and the url's where I can download later the images ?
[08:54:32] rvanlieshout: if you prefer
[08:54:35] rvanlieshout: or download the images too
[08:54:47] rvanlieshout: save them with the model instances (e.g. by using carrierwave)
[08:55:15] roelof: hmm, I will experiment with it but I do not think that will increase the speed if I understand you well
[08:55:45] rvanlieshout: that's why you want to push that task to the background
[08:55:51] rvanlieshout: your users shouldn't have to wait for it
[08:55:57] rvanlieshout: they just use the data available in your local database
[08:56:03] rvanlieshout: which is updated every day or whatnot
[08:56:40] roelof: I do not think that database is updated very often. Maybe once in a few years
[08:56:53] rvanlieshout: then run your background job every week or every month
[08:57:04] rvanlieshout: your users will just use the local database when they access this controller action
[08:57:31] roelof: oke, I have to manually download the data and put it into the database , the first time this site is used
[08:57:31] universa1: i'd also check that you are even allowed to download the images and redisplay them in a new context ;)
[08:58:02] njero: Hi all, which http status will be the best for location based redirects? 301 or 302?
[08:58:05] blackmesa: has joined #RubyOnRails
[08:58:08] rvanlieshout: and it doesn't have to be manually.. could be part of your activejob job
[08:58:10] roelof: im allowed to download it, I have a key to do it , but I make it not working in my paste
[08:58:19] rvanlieshout: n_e_o: that depends on what you want
[08:58:44] rvanlieshout: n_e_o: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection
[08:58:59] universa1: roelof: if you are fine with displaying images from a different origin, you can also just save the image urls and use those.
[08:59:02] roelof: rvanlieshout: sorry. I still do not see how I can download the data in the background and put it into a database
[08:59:21] rvanlieshout: roelof: make it work in the foreground first
[08:59:24] rvanlieshout: then move it to a job
[08:59:28] rvanlieshout: and don't care about speed yet
[08:59:48] deur-_: has joined #RubyOnRails
[08:59:59] njero: rvanlieshout: I'm looking for something like, if a person is looking from one city- I need him to see a different home page
[09:00:01] roelof: It worked in the foreground. I see all the data and images I want
[09:00:24] macsteps: has joined #RubyOnRails
[09:01:19] rvanlieshout: n_e_o: and is it permament? :) see the description of 301 vs 302
[09:02:14] njero: rvanlieshout: yeah got it. I'd go for temporary. He should also able to see original home if he specifically chooses to :)
[09:02:49] njero: thanks rvanlieshout
[09:04:02] mikecmpbll: has joined #RubyOnRails
[09:04:34] mikecmpbll: what's the maximum version `gem 'rails', '~> 3.2' would resolve to?
[09:04:36] njero: my concern was like, in the beginning i don't have more than one city to link to. But for seo I'm making city part of url. But i read like if same data is rendered through different urls, that can lead downgrade seo ranks
[09:04:53] mikecmpbll: actually, `gem 'rails', '~> 4.0'`
[09:04:57] deur-: has joined #RubyOnRails
[09:05:06] rvanlieshout: i always leave the conversation if people start about SEO
[09:05:21] njero: rvanlieshout: :( and y is that?
[09:05:26] rvanlieshout: the webste should be properly visible for a user
[09:05:30] rvanlieshout: proper navigation, proper markup
[09:05:34] rvanlieshout: it ends there
[09:05:44] njero: rvanlieshout: +1
[09:05:47] roelof: rvanlieshout: thanks for the pointers. I will experiment with it
[09:06:04] sevenseacat: mikecmpbll: the current version
[09:06:38] njero: rvanlieshout: but there are situation like if your market is so noisy and need to standout in seo, initially it need some focus rt?
[09:06:41] mikecmpbll: sevenseacat : i thought so, so these gemfiles for travis are incorrect, right? https://github.com/influitive/apartment/tree/development/gemfiles
[09:06:52] mikecmpbll: sevenseacat : all but the 3.2 one will resolve to latest 4.x ?
[09:07:05] rvanlieshout: n_e_o: then you just need to make a better website
[09:07:11] sevenseacat: mikecmpbll: i believe so.
[09:07:21] mikecmpbll: sevenseacat : d'oh :)
[09:07:22] rvanlieshout: use the google tools to see if they think it's ok. do they talk about the exact url in there?
[09:07:59] alexhartley: has joined #RubyOnRails
[09:08:03] njero: rvanlieshout: actually no, my partner worked with seo brought with nonsense up
[09:08:32] rvanlieshout: worked with seo?
[09:08:38] rvanlieshout: they knew the actual formula google uses?
[09:08:55] sevenseacat: spoilers: they don't
[09:08:56] njero: rvanlieshout: nope.. I mean she said she knows
[09:09:15] sevenseacat: if you know its nonsense, tell her its nonsense
[09:09:24] startupality: has joined #RubyOnRails
[09:10:03] njero: sevenseacat: I'm not sure about that. Has url got relevance?
[09:10:26] rvanlieshout: n_e_o: only google knows that
[09:10:29] rvanlieshout: but i seriously doubt it
[09:10:33] sevenseacat: you said it was nonsense, I haven't been paying attention to the conversation
[09:10:41] njero: sevenseacat: :P
[09:11:00] Circuit8: has joined #RubyOnRails
[09:11:09] njero: rvanlieshout: sevenseacat thanks. I'll raise my concerns :)
[09:12:07] JakFrist: has joined #RubyOnRails
[09:14:02] arBmind: has joined #RubyOnRails
[09:15:25] syndikate: has joined #RubyOnRails
[09:17:02] triptec: has joined #RubyOnRails
[09:17:24] mbreedlove: has joined #RubyOnRails
[09:17:33] gregf_: has joined #RubyOnRails
[09:19:55] mbreedlove: has joined #RubyOnRails
[09:21:56] mbreedlove: has joined #RubyOnRails
[09:23:13] chipotle: has joined #RubyOnRails
[09:24:15] chrisml: has joined #RubyOnRails
[09:24:39] pawnbox: has joined #RubyOnRails
[09:24:51] deur-: has joined #RubyOnRails
[09:25:17] mbreedlove: has joined #RubyOnRails
[09:25:17] c355E3B: has joined #RubyOnRails
[09:28:08] tetraktys: has joined #RubyOnRails
[09:33:27] yfeldblum: has joined #RubyOnRails
[09:36:24] RegulationD: has joined #RubyOnRails
[09:40:23] blackhuey: has joined #RubyOnRails
[09:46:52] quazimodo: has joined #RubyOnRails
[09:46:53] drale2k: How do i control access rights per room with ActionCable? Currently i am verifying for the whole channel but now i want to have multiple rooms in a chat and not every user is allowed into every room
[09:47:57] giom: has joined #RubyOnRails
[09:47:57] drale2k: this is how i restrict access right now for the whole channel (ActionCable channel that is) https://gist.github.com/drale2k/aba233fb4edefa4490f7d7592fc5e2eb
[09:50:04] startupality: has joined #RubyOnRails
[09:50:17] tbuehlmann: drale2k: so you'd have one channel per chat room, right?
[09:50:51] drale2k: tbuehlmann: yes so i would have f.e. "stream_from "chat_#{params[:room]}"
[09:52:22] tbuehlmann: you'd authorize again in the #subscribed method then. that way, if the user is authorized to access that room, you stream data to it
[09:53:00] mdw: has joined #RubyOnRails
[09:53:05] tbuehlmann: that won't take uptodate permissions into consideration. if you want that, you might want to check per chat message as in here: https://www.godobject.net/articles/12
[09:54:04] drale2k: tbuehlmann: what do you mean by uptodate permission? Like if i change permission in the middle of a conversation ?
[09:55:10] finnnnnnnnnnn: has joined #RubyOnRails
[09:55:17] drale2k: oh i see, this is on connection creating vs per message checks
[09:55:43] drale2k: thanks a lot that will help
[09:58:11] tbuehlmann: I'm not too happy with checking permissions on each message, but that'll do
[09:58:52] blackmesa: has joined #RubyOnRails
[10:03:11] sameerynho: has joined #RubyOnRails
[10:15:25] startupality: has joined #RubyOnRails
[10:16:04] artto: has joined #RubyOnRails
[10:17:19] startupality: has joined #RubyOnRails
[10:21:39] Axilla: has joined #RubyOnRails
[10:23:44] chipotle: has joined #RubyOnRails
[10:24:03] quazimodo: has joined #RubyOnRails
[10:27:49] blackmesa: has joined #RubyOnRails
[10:28:10] bronson: has joined #RubyOnRails
[10:28:41] deur-: has joined #RubyOnRails
[10:29:03] liquid-silence: has joined #RubyOnRails
[10:29:03] liquid-silence: has joined #RubyOnRails
[10:30:04] der-landgraf: has joined #RubyOnRails
[10:30:13] deur-: has joined #RubyOnRails
[10:30:21] JakFrist: has joined #RubyOnRails
[10:30:25] Devalo: has joined #RubyOnRails
[10:31:38] petor: has joined #RubyOnRails
[10:32:58] emilkarl: has joined #RubyOnRails
[10:34:40] stardiviner: has joined #RubyOnRails
[10:40:37] noobsu: has joined #RubyOnRails
[10:42:22] andrew9184: has joined #RubyOnRails
[10:45:36] ferr1: has joined #RubyOnRails
[10:54:06] apotry: has joined #RubyOnRails
[10:54:41] rodfersou: has joined #RubyOnRails
[10:54:46] tetraktys: has joined #RubyOnRails
[10:56:51] emilkarl: has joined #RubyOnRails
[10:57:23] giom: has joined #RubyOnRails
[11:02:39] macsteps: has joined #RubyOnRails
[11:03:18] netzfisch: has joined #RubyOnRails
[11:04:14] stannard: has joined #RubyOnRails
[11:04:21] artto: has joined #RubyOnRails
[11:07:46] Detch: has joined #RubyOnRails
[11:11:50] mbreedlove: has joined #RubyOnRails
[11:14:12] tetraktys: has joined #RubyOnRails
[11:15:19] srinidhi: has joined #RubyOnRails
[11:15:26] Fernando-Basso: has joined #RubyOnRails
[11:18:07] maucar: has joined #RubyOnRails
[11:23:16] mdw: has joined #RubyOnRails
[11:23:59] giom: has joined #RubyOnRails
[11:33:45] stardiviner: has joined #RubyOnRails
[11:35:17] ldnunes: has joined #RubyOnRails
[11:37:11] RegulationD: has joined #RubyOnRails
[11:39:05] moeabdol: has joined #RubyOnRails
[11:42:21] mbreedlove: has joined #RubyOnRails
[11:49:40] mbreedlove: has joined #RubyOnRails
[11:51:29] fbandov: has joined #RubyOnRails
[11:51:45] silverdust: How do I stop a form submission from ajax:before of ujs
[11:52:03] silverdust: I check for a certain condition but I don't know how to abort
[11:52:26] rork: has joined #RubyOnRails
[11:52:37] rork: has joined #RubyOnRails
[11:52:44] mdw: has joined #RubyOnRails
[11:55:02] artto: has joined #RubyOnRails
[11:55:37] k3rn31: has joined #RubyOnRails
[11:55:57] voidDotClass: has joined #RubyOnRails
[11:58:09] kgrz: has joined #RubyOnRails
[12:02:52] silverdust: figured I had to return false
[12:04:10] Jasaka: has joined #RubyOnRails
[12:05:06] tetraktys: has joined #RubyOnRails
[12:07:48] alaing: has joined #RubyOnRails
[12:08:12] alaing: has joined #RubyOnRails
[12:08:16] Craigimus: has joined #RubyOnRails
[12:08:29] artto: has joined #RubyOnRails
[12:09:17] centrx: has joined #RubyOnRails
[12:09:48] alaing: Hi, I have a .ruby-version file that only has '2.2' in it. is this valid? shouldn't it be somethign like 2.2.5?
[12:10:02] |2701: has joined #RubyOnRails
[12:10:30] alaing: when i tried to bundle install i get rbenv: version `2.2' is not installed (set by /Users/alaing/myapp/.ruby-version)
[12:10:36] Circuit8: has joined #RubyOnRails
[12:10:41] tetraktys: has joined #RubyOnRails
[12:10:43] flashpoint9: has joined #RubyOnRails
[12:11:18] chouhoulis: has joined #RubyOnRails
[12:12:40] GodFather_: has joined #RubyOnRails
[12:12:43] alaing: should the ruby_version include the build number?
[12:13:14] silverdust: are you certain that 2.2.* is installed?
[12:13:28] ql6wlld: has joined #RubyOnRails
[12:13:47] artto: has joined #RubyOnRails
[12:13:57] bkulbida: has joined #RubyOnRails
[12:14:08] Axilla: has joined #RubyOnRails
[12:14:28] GodFather_: has joined #RubyOnRails
[12:14:28] jhass: alaing: chruby and rvm are fine with it and will pick the latest available patch release, rbenv does not allow this
[12:14:40] silverdust: You can run rbenv local but I think it's best to have the third build number
[12:14:49] alaing: silverdust: i do have a couple of 2.2.* installed through rbenv
[12:14:53] alaing: ruby 2.2.5p319 (2016-04-26 revision 54774) [x86_64-darwin15]
[12:15:06] alaing: thats if i use ruby-v in my app folder
[12:15:32] jhass: one workaround for this missing feature of rbenv is https://github.com/tpope/rbenv-aliases
[12:16:02] silverdust: Then just add the patch version
[12:16:04] njero: has joined #RubyOnRails
[12:16:32] blackmesa: has joined #RubyOnRails
[12:16:51] alaing: ah ok I'm looking at another dev teams repo and maybe they are using rvm or chruby
[12:17:17] alaing: I might suggest a build number
[12:17:48] gheegh: has joined #RubyOnRails
[12:17:53] alaing: jhass hmm not bad
[12:18:14] nzst: has joined #RubyOnRails
[12:18:18] alaing: so could i alias 2.2.5 to 2.2?
[12:19:50] jhass: I don't use rbenv but that readme seems sufficient and also one should be able to gather how to do it without the plugin
[12:21:06] nettoweb: has joined #RubyOnRails
[12:23:37] artto: has joined #RubyOnRails
[12:24:59] finnnnnnnnnnn: has joined #RubyOnRails
[12:30:26] bronson: has joined #RubyOnRails
[12:30:46] sameerynho: has joined #RubyOnRails
[12:33:09] King_Rex: has joined #RubyOnRails
[12:38:03] JulienITARD: has joined #RubyOnRails
[12:40:09] refinerysource: has joined #RubyOnRails
[12:41:09] solars: has joined #RubyOnRails
[12:44:24] mbreedlove: has joined #RubyOnRails
[12:47:24] giom: has joined #RubyOnRails
[12:47:52] snowy: has joined #RubyOnRails
[12:48:40] eljimmy: has joined #RubyOnRails
[12:52:07] wolfravenous: has joined #RubyOnRails
[12:52:59] bbrowning: has joined #RubyOnRails
[12:53:38] chipotle: has joined #RubyOnRails
[12:56:10] yellow5: has joined #RubyOnRails
[12:57:46] ramortegui: has joined #RubyOnRails
[12:59:46] arup_r: has joined #RubyOnRails
[12:59:56] chouhoulis: has joined #RubyOnRails
[13:01:26] arup_r: Hi, I am writing a search for a page. The search will search the value of a serialize field, like `serialize :submitted_form_values, Hash`. I did it like https://gist.github.com/aruprakshit/6e0a89c7684bf53058e3b5efb8b56c09#file-dynamicformsubmissionscontroller-rb-L19 . My question is can I improve this? This is an engine code, so I can take DB specific help.
[13:02:56] Veejay: has joined #RubyOnRails
[13:03:43] Veejay: Hello everyone, just to be sure I understand what I'm doing correctly, for a given CSRF token generated for one of my forms, there's supposed to be value stored somewhere in a session, correct?
[13:03:57] Ergo: has joined #RubyOnRails
[13:04:24] fbandov: has joined #RubyOnRails
[13:04:29] arup_r1: has joined #RubyOnRails
[13:04:43] Veejay: If I'm using cookie store as my session mechanism, I should have a cookie set with a value equal (or derived from) the generated CSRF token?
[13:05:56] stannard: has joined #RubyOnRails
[13:07:37] dangerousdave: has joined #RubyOnRails
[13:08:03] srinidhi: has joined #RubyOnRails
[13:11:53] aegis3121: has joined #RubyOnRails
[13:13:57] beauby: has joined #RubyOnRails
[13:15:35] Craigimus: has joined #RubyOnRails
[13:19:50] tvw: has joined #RubyOnRails
[13:20:48] durexlw: has joined #RubyOnRails
[13:20:53] durexlw: sup all :)
[13:22:55] durexlw: Anyone know how to escape a ":" in fixtures? Say I'm writing "description: this means: blabla". When I rake db:fixtures:load this throws an error because of the ":" in the sentence.
[13:23:01] _Stimpy: has joined #RubyOnRails
[13:23:06] Veejay: The answer to my question if it can be of interest for someone in the future: Yes, the CSRF token mechanism is a two-bit one, a tag containing the CSRF token and value stored in the session used for comparison when the request is handled server-side. Because I had set "request.session_options[:skip] = true" for a subclass of my controllers that do not deal with sessions, no session cookie was set, so one
[13:23:08] Veejay: piece was missing for verification
[13:23:15] gopz: has joined #RubyOnRails
[13:23:25] sevenseacat: durexlw: put the string in quotes.
[13:23:42] Veejay: And it prevented protect_from_forgery from doing its job
[13:23:50] durexlw: sevenseacat: it's part in quotes, but you mean the whole thing, right
[13:23:53] durexlw: one sec...
[13:25:03] Veejay: Hey, was I sending to the channel earlier?
[13:25:07] gopz: Does anyone know of a way to output the rails log info into a nicer format that you could query and navigate like json or a hash or something similar?
[13:25:24] Veejay: (I was not identified with nickserv, it might have gotten lost)
[13:25:44] durexlw: sevenseacat: that simple huh... jees... thanks though :) could't find anything on it
[13:26:15] durexlw: Veejay: not identified = no talking :)
[13:26:24] Veejay: OK, thanks
[13:26:53] durexlw: what are you trying to do with the whole csrf token?
[13:27:57] Veejay: Nothing special, just the default CSRF token on forms
[13:28:29] stannard: has joined #RubyOnRails
[13:28:40] Veejay: That I broke when I said "skip the session for that class of controllers"
[13:29:14] antgel: has joined #RubyOnRails
[13:29:21] maxdoubt: has joined #RubyOnRails
[13:30:27] doodlehaus: has joined #RubyOnRails
[13:31:03] allcentury: has joined #RubyOnRails
[13:31:33] zyzioziom: has joined #RubyOnRails
[13:31:41] allcentury: I'm debugging a rails app locally and I'm noticing in the stacktrace the views have a fingerprint on the end of them, such as app/views/admin/users/edit.html.erb:14:in `_app_views_admin_users_edit_html_erb___2683344290590543851_70304591358960'
[13:31:52] allcentury: is that normal or do I have something turned on that is caching the views?
[13:32:22] Devalo: has joined #RubyOnRails
[13:33:23] macsteps: has joined #RubyOnRails
[13:33:37] roelof: has joined #RubyOnRails
[13:33:46] durexlw: allcentury: I believe this has to do with caching, not sure
[13:34:01] petor: has joined #RubyOnRails
[13:34:54] _Tariq: has joined #RubyOnRails
[13:35:25] centrx: allcentury: Yeah, looks like caching, and normal
[13:35:35] tetraktys: has joined #RubyOnRails
[13:36:00] allcentury: centrx: I'm noticing if I edit the view while the server is running (and spring is running), the fingerprint isn't changing and my addition is not loaded until i restart the server
[13:36:03] roelof: Hello, I have a controller named schilderijen_controller.rb that I want to test. But now I run into this problem : https://gist.github.com/rwobben/96ee95bd42cb68d96bf95c0c71c717f1
[13:36:27] centrx: allcentury: dev or production?
[13:37:36] allcentury: roelof: that needs to be a constant, ie RSpec.describe SchilderijenController
[13:37:50] Veejay: roelof: Have you tried SchilderijenController instead of schilderijen?
[13:37:55] centrx: allcentury: I would check your cache settings in config, shouldn’t need to reload for a view in dev IIRC
[13:38:06] centrx: roelof: snake_case is the filename, CamelCase is the class name
[13:38:42] durexlw: what allcentury says: it's a direct link to your controller-class... wasn't that form of describe depricated or at least considered bad practise? Think I read something about that on the minitest:spec gem
[13:39:50] roelof: im not using minitest but rspec
[13:40:02] roelof: but thanks for the help, the controller runs now
[13:40:06] durexlw: "RSpec 3 is also moving away from the outer describe test type inference, as described in this line from their release notes."
[13:41:08] artto: has joined #RubyOnRails
[13:41:27] durexlw: roelof: netherlands or belgium?
[13:41:41] allcentury: centrx: here is my development.rb .. anything stand out? https://gist.github.com/allcentury/021317479b059d6c0b025dcd686c34ff
[13:41:54] liquid-silence: has joined #RubyOnRails
[13:41:54] liquid-silence: has joined #RubyOnRails
[13:42:36] tvw: has joined #RubyOnRails
[13:42:37] finnnnnnnnnnn: has joined #RubyOnRails
[13:42:40] alexhartley: has joined #RubyOnRails
[13:43:52] allcentury: centrx: i got it sorted, don't sweat it
[13:44:00] centrx: allcentury: cool, what was it?
[13:44:18] maxdoubt: has joined #RubyOnRails
[13:44:49] allcentury: I turned on config.consider_all_requests_local = true ; Then edited a view but i should have restarted after that change for obvious reasons
[13:44:55] allcentury: but that was the right configuration to add
[13:45:29] centrx: It worked!
[13:49:32] sdwrage: has joined #RubyOnRails
[13:50:35] durexlw: laterz all
[13:50:59] ferr1: has joined #RubyOnRails
[13:54:11] xalupeao: has joined #RubyOnRails
[13:54:58] jas02_: has joined #RubyOnRails
[13:57:18] amortimer: has joined #RubyOnRails
[13:58:50] _Tariq: has joined #RubyOnRails
[13:59:43] TvL2386: has joined #RubyOnRails
[14:01:08] noobsu: has joined #RubyOnRails
[14:01:22] asheinfeld: has joined #RubyOnRails
[14:01:27] frem_: has joined #RubyOnRails
[14:01:41] emachnic: has joined #RubyOnRails
[14:02:18] ql6wlld_: has joined #RubyOnRails
[14:03:55] makenoise: has joined #RubyOnRails
[14:04:03] asheinfeld: has joined #RubyOnRails
[14:05:35] chouhoulis: has joined #RubyOnRails
[14:05:42] jas02_: has joined #RubyOnRails
[14:06:55] bruce_lee: has joined #RubyOnRails
[14:06:55] bruce_lee: has joined #RubyOnRails
[14:07:29] deur-: has joined #RubyOnRails
[14:12:10] yellow5: has joined #RubyOnRails
[14:12:30] JesseH: has joined #RubyOnRails
[14:16:58] arthurl: has joined #RubyOnRails
[14:17:19] clandry94: has joined #RubyOnRails
[14:17:20] arthurl: hi guys i'm trying to deploy an older rails app (doesn't have gemfile) using capistrano 2.9 - it's complaining about no gemfile/gemfile.lock file- is there an easy work around? i'm thinking maybe overload 'task :bundle_install' ?
[14:18:46] herpless: has joined #RubyOnRails
[14:20:08] truenito: has joined #RubyOnRails
[14:20:37] Craigimus: has joined #RubyOnRails
[14:20:47] fox_mulder_cp: arthurl: may be create this file?
[14:21:47] antgel: has joined #RubyOnRails
[14:22:39] fryguy: arthurl: what is "it" when you say "it's complaining about no gemfile"
[14:22:46] tubbo: arthurl: use capistrano 3 or delete that task. pretty sure capistrano, like rake, lets you delete or reimplement tasks.
[14:23:02] tubbo: capistrano 3 by default doesn't come with bundler support, so if you don't want the task to run you just don't install capistrano-bundler
[14:23:06] tubbo: imho it's a lot easier
[14:24:19] arthurl: the problem is i'm deploying from our jenkins machine which has a bunch of other logic for rolling out other projects via cap 2.9
[14:24:56] arthurl: so i don't want to turn this into a large project by having to upgrade cap
[14:25:15] arthurl: tubbo but that is a good suggestion so thank you
[14:27:28] arthurl: fryguy it being the cap deploy
[14:27:28] chipotle: has joined #RubyOnRails
[14:27:31] arthurl: https://gist.githubusercontent.com/alyssenko/fdbe14da36f06fc91cc4a468bcd73b62/raw/777af18e18a03353fff191edc53a105b74940d47/gistfile1.txt
[14:28:02] arthurl: "-deployment flag requires a Gemfile.lock. Please make sure you have checked your Gemfile.lock into version control before deploying"
[14:28:06] dopamean_: has joined #RubyOnRails
[14:29:45] tubbo: honestly upgrading capistrano is not as big of a deal as you're making it :P
[14:30:11] tubbo: consider that you've been dealing with this problem for at least a day. it doesn't take even half that long to upgrade from capistrano v2 to capistrano v3.
[14:31:53] srinidhi: has joined #RubyOnRails
[14:32:19] arthurl: tubbo this is on an ec2 instance after all- maybe i'll just spin up a replica of or jenkins instance and try the inplace upgrade there
[14:33:18] arthurl: but i also see i can pass --gemfile to bundler which allows me to specify an alternate location of a gemfile- so i'm thinking i can just create a gemfile/gemfile.lock elsewhere
[14:33:36] antgel: has joined #RubyOnRails
[14:33:45] tubbo: arthurl: but your app doesn't use bundler does it?
[14:33:48] arthurl: although i'm not really sure what that means since i do have gems in the vendor/gems path of this application i'm deploying
[14:33:50] tubbo: what's gonna happen haha
[14:34:29] arthurl: tubbo i'd think it will just install the gemset and move on
[14:34:38] arthurl: even though that won't be used by the app yeah?
[14:35:30] liquid-silence: has joined #RubyOnRails
[14:35:30] liquid-silence: has joined #RubyOnRails
[14:35:31] shinnya: has joined #RubyOnRails
[14:35:36] tubbo: arthurl: nope
[14:35:44] tubbo: i mean, unless your app uses bundler and has a Gemfile haha
[14:35:48] tubbo: but it doesn't seem to
[14:36:00] audy: has joined #RubyOnRails
[14:36:16] audy: has joined #RubyOnRails
[14:37:06] techsethi: has joined #RubyOnRails
[14:37:39] artto: has joined #RubyOnRails
[14:37:53] k3rn31: has joined #RubyOnRails
[14:40:36] arthurl: tubbo my understanding is that the part of the deploy that's failing is just doing a bundle install so i don't see why it matters if my app uses bundler- just the deploy is installing a gemset that won't be used by the app ?
[14:40:52] tetraktys: has joined #RubyOnRails
[14:41:19] someish: has joined #RubyOnRails
[14:41:34] tubbo: arthurl: wouldn't it be better to just not do a `bundle install` at all?
[14:41:38] tubbo: since you don't need it?
[14:44:06] roelof: has joined #RubyOnRails
[14:44:19] arthurl: well this is interesting https://lostechies.com/derickbailey/2011/02/24/how-to-have-bundler-load-a-custom-gem-into-a-rails-3-app/
[14:44:47] arthurl: actually no- that doesn't help me
[14:45:11] roelof: why do I get here : body2= JSON.parse(antwoord.body) expect (body2).to include ('artObjects') this error message : NoMethodError: undefined method `to' for #<Hash:0x00000000c56e80>
[14:46:06] crameth: has joined #RubyOnRails
[14:46:51] arthurl: tubbo the issue i may have w/ upgrading to cap 3 is the fact that my other projects still need bundler
[14:47:13] arthurl: so basically we have older rails apps and newer rails apps that both need to be deployed w/ the same cap version
[14:48:46] stannard_: has joined #RubyOnRails
[14:50:12] jhack: has joined #RubyOnRails
[14:51:59] jhack_: has joined #RubyOnRails
[14:52:28] ixti: has joined #RubyOnRails
[14:53:03] ixti: Is there a way to define default constraints in routes
[14:53:23] ixti: I mean I have lots of routes that share some `.../:part/...`
[14:53:42] ixti: And I want to set constrain on `:part` for all of the URLs
[14:53:51] srinidhi: has joined #RubyOnRails
[14:53:52] ixti: Rather then setting it for each of them
[14:53:58] srinidhi: has joined #RubyOnRails
[14:54:23] kareeoleez: has joined #RubyOnRails
[14:54:46] kareeoleez: If I have a dependency inside my gem and then the gem is included in Rails, do I have to add this also to the Gemfile of Rails ?
[14:55:13] FCser: has joined #RubyOnRails
[14:55:31] jhass: if your gem properly declares its dependency, no
[14:55:56] kareeoleez: in gemspec ?
[14:56:11] kareeoleez: from bin/console everything works fine
[14:56:23] kareeoleez: do I have to include it inside the Gemfile of the gem ?
[14:56:35] ixti: if your gem's main require requires that dependency, then it willl be required
[14:57:01] kailido: has joined #RubyOnRails
[14:57:01] ixti: in other words, your rails app will auto-require only waht you have in Gemfile
[14:57:27] kailido: hi, i just hosted my rails app on a VM
[14:57:45] kailido: i have my DB production there, can I check the data outside the vm ?
[14:58:28] tubbo: probably not a good idea, but you can in theory open your database's port on the VM to the outside world so you can connect to it
[14:58:34] maxdoubt: has joined #RubyOnRails
[14:58:48] tubbo: but you probably shouldn't do that so as to mitigate possible attack vectors
[14:59:02] tubbo: because it would _really_ suck to deal with that
[14:59:09] kailido: how can I check my data in postgres via shell? :|
[14:59:26] kareeoleez: ixti: I have required this inside spec.add_development_dependency (gemspec) but it doesn't retrieve it. Do I have to include it in /lib/gemname/gemname.rb ?
[15:00:13] ixti: kareeoleez: developmen_dependencies won't be bundled
[15:00:37] ixti: Let me explain a little bit
[15:01:11] wmoxam: kailido: you can tunnel the connection through ssh
[15:01:17] ixti: `Gemfile` is kind of a manifest of your app's dependencies, that is handled by bundler
[15:01:22] wmoxam: then you can use whatever DB frontent you like
[15:01:45] ixti: bundler will install all gems listed there (unless you will exculde some groups) and their runtime dependencies
[15:01:54] wmoxam: oh, you said VM
[15:02:01] liquid-silence: has joined #RubyOnRails
[15:02:02] liquid-silence: has joined #RubyOnRails
[15:02:09] wmoxam: well same deal I guess
[15:02:20] kailido: yes, im connected via ssh, but i only can do thing via shell
[15:02:22] tubbo: kailido: if you can log into the VM over SSH, then yeah just use the command-line client for your db
[15:02:25] ixti: so, it won't install anything listed in `add_development_depenency`
[15:02:26] SeanLazer: has joined #RubyOnRails
[15:03:01] kailido: im used to pgadmin :(
[15:03:07] ixti: that means that if you will put `require "..."` in your `/lib/gemname/gemname.rb` it will fail with "file is not in load path"
[15:03:09] kailido: im going to check how to do it via command line
[15:03:13] wmoxam: tubbo: sure, but it can be setup as a tunnel so that pgadmin can be used
[15:03:22] wmoxam: kailido: ^^
[15:03:24] tubbo: ^ that was just about what i was gonna suggest haha
[15:03:28] ixti: kareeoleez: so, there are two ways to achieve what you want:
[15:03:37] ixti: 1. add necessary gem into Gemfile
[15:03:38] wmoxam: something like ssh -L 3306:xxx.xxx.xxx.xxx:3306 username@example.com
[15:03:48] tubbo: we do a similar thing here, wherein our production cluster is behind a VPN, so i have to log into the VPN and then i can use whatever UI i want
[15:04:08] ixti: or 2. add it to gem's runtime dependencies and require it in main gem's require path (gem-name)
[15:04:20] jhack: has joined #RubyOnRails
[15:04:24] SeanLazer: does anyone know how to stub out routing constraints or pre-set routing constraints when testing controllers? i have a couple of constraints that do role checks on my users, i just want to stub them to return true or false so i can test the underlying controllers
[15:04:34] Jasaka: has joined #RubyOnRails
[15:04:49] diegoviola: has joined #RubyOnRails
[15:04:57] kareeoleez: ixti: I'm ok with the 1 but didn't get the 2nd
[15:05:00] SeanLazer: i tried WorkerRouteConstraint.any_instance.stubs(matches?: true) in my setup method but it didn't seem to do anything
[15:05:40] finnnnnnnnnnn: has joined #RubyOnRails
[15:06:10] ixti: kareeoleez: when you have `gem "foo-bar"` in your Gemfile, bundler will install `foo-bar` gem and will try to `require "foo-bar"` if fail then will try to `require "foo/bar"` if fail will silently skip that
[15:06:27] ixti: Also, bundler will install all runtime dependencies of `foo-bar`
[15:07:21] ixti: So, if you will add that dependency in gemspec as: `add_dependency` or `add_runtime_dependency`, and then will add `require "depname"` in `lib/foo/bar.rb` your rails app will auto-require that dependency
[15:07:55] ixti: kareeoleez: does it makes sense?
[15:08:44] RegulationD: has joined #RubyOnRails
[15:09:34] kareeoleez: ixti: I guess so :)
[15:09:35] ixti: So, to recap: development dependencies of gemspecs are not installed by bundler, only runtime dependencies are; bundler does not auto-requires dependencies.
[15:09:38] kareeoleez: ixti: thank you
[15:10:08] ixti: bundler auto-requires only dependencies you specify in your app's Gemfile.
[15:10:25] ixti: dependencies of those dependnecies are not handled by bundler
[15:10:46] ixti: i mean bundler will not try to require whole graph of dependencies ;D
[15:14:21] chopin: has joined #RubyOnRails
[15:15:19] liquid-silence: has joined #RubyOnRails
[15:15:19] liquid-silence: has joined #RubyOnRails
[15:18:03] srinidhi: has joined #RubyOnRails
[15:19:54] ql6wlld: has joined #RubyOnRails
[15:20:04] SeanLazer: does anyone know how to manage routing constraints when testing rails controllers?
[15:21:30] rubyonrails771: has joined #RubyOnRails
[15:21:49] rubyonrails771: i have an auth error help
[15:22:35] tubbo: rubyonrails771: !ask
[15:22:35] helpa: rubyonrails771: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[15:22:46] chipotle: has joined #RubyOnRails
[15:22:55] nettoweb: has joined #RubyOnRails
[15:23:46] rubyonrails771: pls 1st time im using irc
[15:24:10] jhass: rubyonrails771: just ask your question, if anyone has an answer they'll respond.
[15:24:31] mitt3ns: has joined #RubyOnRails
[15:25:09] rubyonrails771: The responded_to function in my controller does not work when I use respond.js
[15:25:22] rubyonrails771: is responded_to the correct method?
[15:25:58] jhass: rubyonrails771: !didntwork
[15:25:58] helpa: rubyonrails771: 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.
[15:26:43] tubbo: rubyonrails771: responded_to is not the correct method.
[15:27:16] roelof: has joined #RubyOnRails
[15:27:25] njero: spoon n food
[15:27:28] cabinB: has joined #RubyOnRails
[15:27:29] tubbo: rubyonrails771: http://api.rubyonrails.org/classes/ActionController/MimeResponds.html#method-i-respond_to
[15:27:32] rubyonrails771: thank you SeanLazer
[15:27:33] Sylario: has joined #RubyOnRails
[15:27:51] rubyonrails771: bye gang...... *DAB*
[15:27:53] tubbo: rubyonrails771: no problem. check out the rails guides.
[15:28:12] helpa: http://guides.rubyonrails.org/ - Ruby on Rails guides. Recommended reading.
[15:28:24] njero: alfie_max15: google would've answered that
[15:29:28] chipotle: has joined #RubyOnRails
[15:29:29] alfie_max15: yeah, but i've accepted the fact that majority just haven't realized what google is for ;)
[15:31:04] tubbo: alfie_max15: 1996 called they want their statement back
[15:31:49] Craigimus: has joined #RubyOnRails
[15:32:33] njero: tubbo: shit. I googled that.He didn't the answer :P
[15:32:59] bronson: has joined #RubyOnRails
[15:33:40] quazimodo: I've never used actioncontroller::live
[15:33:42] Sylario: Stupid question : i get that rake is like ANT, but java need to be built, why does a language like ruby neet something like Rake. ANd as we have rake why do we use capistrano and not rake?
[15:33:58] quazimodo: but it seems to me like you'd need n ruby threads (eg. via puma) for n persisted connections?
[15:34:42] macsteps: has joined #RubyOnRails
[15:34:55] Sylario: I know how to use rake, but i do not really get why we are not just using a convention for this kind of tasks
[15:36:58] jhass: first rake version is from 2004? so what did we have back then, XML stuff, arcane Makefile syntax... understandable one would want something utilizing the expressiveness of ruby
[15:38:11] Sylario: The thing is before rails, i worked in QA and we used ruby as a automated test tool. WIthout rake
[15:38:16] fbandov: has joined #RubyOnRails
[15:38:31] artto: has joined #RubyOnRails
[15:38:48] jhass: cvs to svn repo conversion is from early 2003 in fact
[15:38:55] adaedra: the fact you can do without it does not make it useless.
[15:39:39] adaedra: rake allows to run tasks with dependency system quite easily in a ruby syntax. iirc, capistrano is more deployment and remote-execution oriented.
[15:39:44] Sylario: I am not saying it is useless, i am asking why it is used
[15:40:04] Sylario: i want to understand why you consider it useful
[15:40:26] adaedra: To run pre-determined tasks with dependencies easily
[15:40:31] tubbo: sylario: mostly historical. i think what's considered useful is the ability to run tasks within your application's environment from the command line.
[15:40:39] tubbo: like if rails was created today it might not be using rake
[15:40:54] Circuit8: What would it use instead?
[15:40:59] tubbo: but at the time, rake was pretty much in every rubyists' arsenal, so it was a way for rails to "fit in" with the existing ecosystem.
[15:41:02] Sylario: ok, so i am not totally craey
[15:41:27] tubbo: let's not get ahead of ourselves
[15:41:35] chouhoulis: has joined #RubyOnRails
[15:41:58] Circuit8: tubbo: are there alternatives to rake, what do you think rails would use if it were built today?
[15:42:24] Sylario: Some kind of ruby library that you inherit in a ruby script?
[15:42:34] tubbo: Circuit8: probably thor or something. i would imagine that generators and rake tasks would effectively use the same API.
[15:42:38] Sylario: like the tests are done for example
[15:43:08] liquid-silence: has joined #RubyOnRails
[15:43:09] liquid-silence: has joined #RubyOnRails
[15:43:11] tubbo: i think that might be the motivation behind the `rails` task binary interface
[15:43:24] tubbo: so in rails 5 you can just do rails db:migrate instead of needing to remember rake db:migrate, rails generate, etc.
[15:43:39] tubbo: but honestly if rake had better support for taking command-line options and arguments, we probably wouldn't need thor either.
[15:44:10] _3dwardsharp: has joined #RubyOnRails
[15:44:16] crystal77: has joined #RubyOnRails
[15:44:23] Circuit8: Thor seems nice and simple, just looked it up
[15:44:47] Circuit8: tubbo: Thanks
[15:45:16] GodFather: has joined #RubyOnRails
[15:45:37] Sylario: Ok so i will not put rake in useless stuff like coffescript of cucumber
[15:46:13] wolfravenous: has joined #RubyOnRails
[15:47:59] tubbo: let's break down what we learned
[15:48:04] tubbo: - coffeescript: useless
[15:48:06] tubbo: - cucumber: useless
[15:48:16] tubbo: - rake: not necessary
[15:48:37] alfie_max15: clearly, someone has a different definition for the word `useless` ;)
[15:48:50] tubbo: i know what you mean though and for 2/3 of those things i definitely agree with you
[15:49:08] tubbo: cucumber never really helped and coffeescript is really cool but ES6 is better imho.
[15:49:11] Sylario: ok, cucumber is useless in non english speaking country
[15:49:36] Devalo: has joined #RubyOnRails
[15:49:54] tubbo: cucumber is pretty useless in my life, and i live in an english-speaking country
[15:50:24] adaedra: er, we developers from non english-speaking countries can speak english. And we should, as most resources are written in English.
[15:50:42] [Butch]: has joined #RubyOnRails
[15:50:47] Technodrome: has joined #RubyOnRails
[15:50:47] Sylario: Yes but the point of cucumber is to have test written by non tech people
[15:50:56] Sylario: aka the "end user"
[15:51:08] wmoxam: IMO : useless
[15:51:25] smathy: has joined #RubyOnRails
[15:51:25] wmoxam: er, coffeescript is useless
[15:52:22] adaedra: sylario: that's debatable, I'd say.
[15:52:34] adaedra: wmoxam: ruby is useless. Let's write websites in asm!
[15:52:49] tubbo: wmoxam: your opinion is useless
[15:52:58] wmoxam: adaedra: yeah, that's totally the thing I was saying
[15:53:03] wmoxam: tubbo: probably
[15:53:07] Sylario: i really like Haml, like, a lot, but my mind is never confortable when swithching froml js to coffeescript
[15:53:09] chouhoulis: has joined #RubyOnRails
[15:53:20] tubbo: sylario: usually, clients don't like to write code. that's why they pay you ;)
[15:53:20] wmoxam: our company is moving away from coffeescript
[15:53:36] Sylario: in the end i prefer to write js full of { than to use coffescript
[15:53:52] adaedra: that's down to preferences.
[15:53:54] wmoxam: our ruby devs somewhat like coffeescript, but any new js focused devs dislike it
[15:53:59] Sylario: tubbo: that's why i was alway amused by the assumption made on the cucumber website
[15:55:11] bbrowning: has joined #RubyOnRails
[15:55:13] wmoxam: CS did influence ES6, which is a win
[15:55:35] tubbo: rspec began life as an extraction from cucumber, and imho brought over the best elements while losing the cruft.
[15:55:36] wmoxam: IMO it did it's job but its a dead end
[15:56:00] tubbo: CS worked out a lot better when we had less JS to write
[15:56:12] tubbo: but writing it at scale is tough
[15:56:18] davidw: has joined #RubyOnRails
[15:56:36] tubbo: and now that ES6 is becoming native in all browsers...it just makes no sense to use a transpiler except for legacy clients.
[15:56:50] Ropeney: has joined #RubyOnRails
[15:56:59] jhack: has joined #RubyOnRails
[15:57:10] wolfravenous: has joined #RubyOnRails
[15:58:01] emachnic: has joined #RubyOnRails
[15:58:03] wmoxam: https://meta.discourse.org/t/is-it-better-for-discourse-to-use-javascript-or-coffeescript/3153/11
[15:58:04] Sylario: I should start to look into es
[15:58:32] zave: has joined #RubyOnRails
[15:58:51] tubbo: wmoxam: that question is a lot easier to answer when you're not using Ember.js haha...ever try to write Ember in CS? it's fucking barbaric.
[15:58:52] claytonzaugg: has joined #RubyOnRails
[15:59:19] wmoxam: tubbo: :p
[15:59:43] emachnic_: has joined #RubyOnRails
[16:00:08] wolfravenous_: has joined #RubyOnRails
[16:02:57] Sylario: damn, ES6 uses `, i really need to learn Dvorak or bepo
[16:03:21] SeanLazer: i have a weird integration test thing going on
[16:03:23] benlieb: has joined #RubyOnRails
[16:03:29] SeanLazer: i'm doing get '/' and assert_response :success
[16:03:39] SeanLazer: but i'm getting Expected response to be a <2XX: success>, but was a <302: Found> redirect to <http://www.example.com/>
[16:03:43] akshat: has joined #RubyOnRails
[16:04:07] SeanLazer: i don't know where www.example.com is coming from, and i don't know why it's telling me that get '/' is redirecting to, functionally, '/'
[16:04:08] smathy: How is writing CS at scale any harder than JS at scale?
[16:04:17] benlieb: Can someone help me understand this conditional validation I don't understand how the proc is working. It seems the proc should take an argument? https://gist.github.com/benlieb/269fe075e0dfdd25823faa00f5945400
[16:04:56] jgpawletko: has joined #RubyOnRails
[16:05:44] smathy: benlieb, Rails passes the model instance to any conditional method/proc.
[16:06:00] Craigimus: has joined #RubyOnRails
[16:06:11] benlieb: smathy: ah, that's the magic I was missing, since it doesn't seem to ever call the proc
[16:07:03] benlieb: So normally (not validation) if I have @use_dge = proc { |arec| arec.needs_1094c_fields?} and then say if @use_dge, that will always be true since it's not calling the proc, just looking for a truty value...?
[16:08:21] smathy: benlieb, right.
[16:08:41] benlieb: smathy: from the guides: This option is best suited for one-liners.
[16:08:42] smathy: benlieb, you'd have to do: if @use_dge.(self)
[16:09:15] srinidhi: has joined #RubyOnRails
[16:09:30] RegulationD: has joined #RubyOnRails
[16:09:37] VeryBewitching: has joined #RubyOnRails
[16:10:14] smathy: benlieb, right, vs using a method.
[16:10:49] smathy: benlieb, if you're using the same logic elsewhere then I'd recommend using a method.
[16:13:12] smathy: SeanLazer, example.com is the default domain Rails sets for testing. Your controller must be redirecting for some reason, maybe auth?
[16:14:31] doodlehaus: has joined #RubyOnRails
[16:14:57] diegoaguilar: has joined #RubyOnRails
[16:17:17] MrPunkin: has joined #RubyOnRails
[16:18:14] RegulationD: has joined #RubyOnRails
[16:18:18] syzygy_: has joined #RubyOnRails
[16:18:41] finnnnnnnnnnn: has joined #RubyOnRails
[16:18:44] mdw: has joined #RubyOnRails
[16:26:01] polishdub: has joined #RubyOnRails
[16:27:33] mikecmpbll: has joined #RubyOnRails
[16:32:09] cd83x: has joined #RubyOnRails
[16:33:14] mfilipe: has joined #RubyOnRails
[16:35:13] Devalo: has joined #RubyOnRails
[16:35:32] SeanLazer: smathy: Yeah, there is some auth in the setup for the test, maybe that redirect is causing the test case to fail even though i'm also running get '/'?
[16:36:03] finnnnnnnnnnn: has joined #RubyOnRails
[16:36:04] SeanLazer: i think maybe i'll give this a try with capybara since i know how to be more specific about what i want there
[16:36:44] giom: has joined #RubyOnRails
[16:37:25] stardiviner: has joined #RubyOnRails
[16:39:03] sneakerhax: has joined #RubyOnRails
[16:40:07] Technodrome: has joined #RubyOnRails
[16:41:26] chouhoulis: has joined #RubyOnRails
[16:44:53] manfrin: has joined #RubyOnRails
[16:49:18] phrozen77: has joined #RubyOnRails
[16:49:27] GodFather: has joined #RubyOnRails
[16:50:00] am55: has joined #RubyOnRails
[16:51:31] doodlehaus: has joined #RubyOnRails
[16:52:24] wolfravenous: has joined #RubyOnRails
[16:52:25] macsteps: has joined #RubyOnRails
[16:52:49] Terens: has joined #RubyOnRails
[16:53:22] doodlehaus: has joined #RubyOnRails
[16:54:59] Kus: has joined #RubyOnRails
[16:59:23] Dimik: has joined #RubyOnRails
[16:59:55] triptec: has joined #RubyOnRails
[17:01:12] Terens: has joined #RubyOnRails
[17:02:11] cabinB: has joined #RubyOnRails
[17:06:10] mdw7: has joined #RubyOnRails
[17:09:42] qejk: has joined #RubyOnRails
[17:10:25] akshat_: has joined #RubyOnRails
[17:12:01] ModusPwnens: has joined #RubyOnRails
[17:12:26] ModusPwnens: How can I catch exceptions that bubble up in a rails engine? I want to alias them to a different type of exception.
[17:12:50] rogue_koder: has joined #RubyOnRails
[17:12:57] ModusPwnens: config.action_dispatch.rescue_responses doesn't work for me in this case because I need to look at something inside the exception to decide how to alias it
[17:14:32] kgrz: has joined #RubyOnRails
[17:15:00] jgpawletko: has joined #RubyOnRails
[17:15:28] disgrntld: has joined #RubyOnRails
[17:15:56] stannard: has joined #RubyOnRails
[17:17:54] djbkd: has joined #RubyOnRails
[17:18:42] jhass: ModusPwnens: http://api.rubyonrails.org/classes/ActiveSupport/Rescuable/ClassMethods.html#method-i-rescue_from ?
[17:18:56] jhass: oh right, rails engine, nvm
[17:19:17] tubbo: ModusPwnens: you use the `rescue` directive in ruby
[17:19:21] jhass: I guess I'd mount a small rack app instead that wraps the engine
[17:21:01] gheegh: anyone using docker with rails? I"m having a hard time getting my rails app to see my database
[17:24:36] gheegh: Here's my config if anyone has any suggestsion for what i'm missing.. the app isn't seeing the postgres server: https://gist.github.com/wflanagan/c60b61320f549fc7b70f6d260985e937
[17:26:15] tubbo: gheegh: iirc the latest versions of docker-compose dictate that you're supposed to use DNS hostnames and not ENV vars to represent hostnames and such
[17:26:27] tubbo: so instead of that ENV var it should be postgresql
[17:27:04] gheegh: tubbo: Ok. What about for port numbers and the like?
[17:27:12] sypheren: has joined #RubyOnRails
[17:28:37] gheegh: and related.. I find that since it won't boot. .there is no way to make sure that the env vars are configured for it.
[17:29:44] cnk: has joined #RubyOnRails
[17:31:12] tildes: has joined #RubyOnRails
[17:32:30] noobsu: has joined #RubyOnRails
[17:33:51] ModusPwnens: tubbo: Where would I do that? Just in the engine.rb file? I know how I would do this for an actual rails app, but I'm not sure how for a rails engine..
[17:33:57] tubbo: gheegh: this isn't really a rails related question.
[17:34:35] gheegh: tubbo: Yeah, excpet that it relates to database.yml.. but yah, its not programming rails for sure.
[17:34:37] wolfravenous: has joined #RubyOnRails
[17:35:37] bronson: has joined #RubyOnRails
[17:36:01] tubbo: ModusPwnens: i'm not sure how you're going to do that without modifying the engine itself.
[17:36:53] zyzioziom: has joined #RubyOnRails
[17:37:10] Devalo: has joined #RubyOnRails
[17:37:16] moep: has joined #RubyOnRails
[17:38:22] ModusPwnens: tubbo: I mean, I wrote the engine so it's not a problem to modify it
[17:39:19] tubbo: ModusPwnens: find the method that throws the exception and rescue the exception in that ethod.
[17:39:32] tubbo: you can't just "rescue all exceptions the gem throws" because that doesn't make any sense
[17:39:47] tubbo: it's kinda like saying "i want to get an email every time any problem occurs on my computer"
[17:41:21] macsteps: has joined #RubyOnRails
[17:41:27] ModusPwnens: tubbo: but... that's exactly what I want to do.
[17:41:45] ModusPwnens: tubbo: There are certain kinds of exceptions I want to check and re-throw as something else, so I'd like a global way of doing that throughout the engine.
[17:42:13] swinner: has joined #RubyOnRails
[17:42:34] swinner: anyone use haml?
[17:42:40] tubbo: ModusPwnens: you need to be more specific about which errors you want to rescue and where they are coming from
[17:42:51] tubbo: alternatively, you need to not use exceptions for control flow :)
[17:42:59] tubbo: (if that is what you're doing)
[17:43:05] arBmind: has joined #RubyOnRails
[17:43:17] tubbo: > There are certain kinds of exceptions I want to check and re-throw as something else
[17:43:42] tubbo: smells funny :) there's a good chance you're not using exceptions for their intended purpose
[17:44:11] ModusPwnens: tubbo: No, I'll give the full explanation. This models engine exists to take output from some of our services and convert them into nice rails objects. The services are communciated with using java clients. The java clients will throw an exception for 4xx http errors and a different one for 5xx errors.
[17:44:21] cabinB: has joined #RubyOnRails
[17:44:32] alexhartley: has joined #RubyOnRails
[17:44:47] SeanLazer: swinner: i still use haml
[17:44:53] ModusPwnens: tubbo: For the 4xx error ones, I want to look at the exception data to see the exact type of 4xx status and then I want to re-throw that as the corresponding rails exception for that status so that the downstream controllers and javascript handlers can handle the response correctly.
[17:45:42] alfie_max15: swinner, me too
[17:45:46] tubbo: ModusPwnens: why not `rescue_from Your::CustomError, ActiveRecord::RecordNotFound, with: :not_found`?
[17:45:50] tubbo: for example
[17:45:50] Devalo: has joined #RubyOnRails
[17:46:04] ModusPwnens: tubbo: because then it would throw a 404 for all 4xx class errors
[17:46:21] ModusPwnens: tubbo: There's one exception for ALL 4xx errors, and then the actual status is inside the exception
[17:46:35] k3rn31: has joined #RubyOnRails
[17:46:51] rafaelfranca: has joined #RubyOnRails
[17:46:57] tubbo: ModusPwnens: oh i see what you mean. but if you're making http requests, there's a method in your code where you make the actual request right?
[17:47:04] tubbo: so why not rescue the exception there?
[17:47:12] tubbo: swinner: nobody does. zero people.
[17:47:48] ModusPwnens: tubbo: There's many methods where I make a call that results in one of the java clients making a request. I could put a block in every single one of those places that does it, but i'd rather do it in a DRY way
[17:49:23] tubbo: ModusPwnens: you don't have a generic gateway class for making these http requests?
[17:50:09] ModusPwnens: No, because the engine actually exposes active-record-like interfaces so clients don't actually know that under the hood a java client is being used.
[17:50:15] noobsu: has joined #RubyOnRails
[17:50:36] swinner: so Im having a really weird issue with haml I have a loop to display a row then a loop inside to display a relationship in the same row. For some reason haml is adding a tr at the start of the second loop even though I don't add it anywhere
[17:50:40] tubbo: ModusPwnens: the way your engine works under the hood doesn't have to be how it works externally. what the engine is exposing is irrelevant to what i asked.
[17:50:50] beauby: has joined #RubyOnRails
[17:51:06] swinner: https://gist.github.com/swinner2/5242890cbd7e501a712caba4158bedca
[17:51:20] blackmesa: has joined #RubyOnRails
[17:51:27] tubbo: ModusPwnens: let's also be clear about one thing. we're talking about HTTP requests here, so they're HTTP clients. the language used to build the HTTP server is irrelevant.
[17:51:38] |2701: has joined #RubyOnRails
[17:52:12] ModusPwnens: tubbo: Right. Oh, a detail i forgot to mention, the java clients themselves are the ones making the http requests and I don't have control over the java clients really.
[17:52:51] ModusPwnens: tubbo: It's hard to explain this problem without literally explaining the entire architecture.
[17:53:00] tubbo: your architecture SUCKS
[17:53:02] ModusPwnens: tubbo: As well as political things that are somewhat out of my control
[17:53:11] ModusPwnens: tubbo: Yeah, I agree. I didn't decide on it.
[17:53:29] tubbo: so let me get this straight: there's a java client making an http request to your rails app.
[17:53:33] swinner: at line 68 of _data_grid.html.haml it adds a new <tr>... no clue why
[17:53:37] ModusPwnens: tubbo: Oh, no.
[17:53:49] tubbo: so this is a lie? "the java clients themselves are the ones making the http requests"
[17:54:25] ModusPwnens: tubbo: No. My app gets an HTTP request from a web browser. My app then calls something like ModelThatsActuallyBackedByJavaClientsAndNotAR.find({id})
[17:55:02] ModusPwnens: tubbo: that model is located inside this rails engine, which then uses a java client to talk to the service that manages that model, and then the data is returned and the rails engine converts the response into nice rails models.
[17:55:43] swinner: nvm it was an indentation problem... god damn haml wasted 3 hours of my life
[17:56:20] tubbo: ModusPwnens: so then i was right. there SHOULD BE an http gateway class that is doing all the requesting.
[17:56:38] ModusPwnens: tubbo: Depends. The incoming HTTP requests or the outgoing HTTP requests to the services?
[17:56:39] tubbo: ModusPwnens: when you say "java client" you mean it shells out to java or something?
[17:56:44] tubbo: like how does ruby interact with java?
[17:56:48] ModusPwnens: tubbo: Yes. This is actually Jruby on Rails.
[17:57:07] tubbo: ModusPwnens: you know some of this information would've been useful when you actually started the discussion. you're using a non-standard ruby, doing non-standard things..
[17:57:10] tubbo: what a waste of time
[17:57:19] tubbo: i've never used jruby so i have no fucking clue dude
[17:57:24] ModusPwnens: tubbo: Yeah, but none of this would have actually mattered if I didn't have to explain my entire architecture.
[17:57:47] RegulationD: has joined #RubyOnRails
[17:57:47] ModusPwnens: tubbo: The fact that this is JRuby changes little. So we can treat it as if it's regular ruby on rails.
[17:59:13] clandry94: has joined #RubyOnRails
[17:59:53] ModusPwnens: tubbo: JRuby barely changes anything when it comes to actually working with the rails stack. It's as if it's not even there. All standard rails guides and practices still apply and are unaffected
[18:00:16] yellow5: has joined #RubyOnRails
[18:02:14] RegulationD: has joined #RubyOnRails
[18:04:40] diegoaguilar: has joined #RubyOnRails
[18:07:03] yfeldblum: has joined #RubyOnRails
[18:07:33] chipotle: has joined #RubyOnRails
[18:10:12] noobsu: has joined #RubyOnRails
[18:14:23] Coldblackice: has joined #RubyOnRails
[18:15:21] polo100: has joined #RubyOnRails
[18:15:28] polo100: has left #RubyOnRails: ()
[18:18:12] rafaelfranca: has joined #RubyOnRails
[18:18:12] rafaelfranca: has joined #RubyOnRails
[18:18:47] tildes: has joined #RubyOnRails
[18:20:19] Cohedrin: has joined #RubyOnRails
[18:23:22] rickmasta: has joined #RubyOnRails
[18:25:13] aegis3121: has joined #RubyOnRails
[18:26:14] jstransky: has joined #RubyOnRails
[18:29:18] sumobob: has joined #RubyOnRails
[18:29:40] der-landgraf: has joined #RubyOnRails
[18:33:41] lxsameer: has joined #RubyOnRails
[18:33:41] lxsameer: has joined #RubyOnRails
[18:33:41] sbarg: has joined #RubyOnRails
[18:34:47] sbarg: has left #RubyOnRails: ()
[18:34:58] jenrzzz: has joined #RubyOnRails
[18:34:58] jenrzzz: has joined #RubyOnRails
[18:41:55] tubbo: ModusPwnens: personally if i were you, i'd either have one object/class in my ruby code that handles *all* http connections from java or rewrite the java client to throw different exceptions.
[18:46:09] ruurd: has joined #RubyOnRails
[18:52:17] clyfe: has joined #RubyOnRails
[18:52:30] clyfe: has left #RubyOnRails: ()
[18:52:44] wolfravenous: has joined #RubyOnRails
[18:54:54] Megamos: has joined #RubyOnRails
[18:55:16] triptec: has joined #RubyOnRails
[19:00:37] noobsu_: has joined #RubyOnRails
[19:01:26] k1t: has joined #RubyOnRails
[19:02:17] crystal77: has joined #RubyOnRails
[19:05:01] tildes: has joined #RubyOnRails
[19:08:24] mloy: has joined #RubyOnRails
[19:08:42] Pazician: has joined #RubyOnRails
[19:09:30] JakFrist: has joined #RubyOnRails
[19:09:33] truenito: has joined #RubyOnRails
[19:09:54] djbkd: has joined #RubyOnRails
[19:10:18] jhack: has joined #RubyOnRails
[19:11:29] roamingdog: has joined #RubyOnRails
[19:13:15] wolfravenous: has joined #RubyOnRails
[19:14:00] gheegh: Ok. brand new installation on a new database server, and i'm getting anerror when trying to rake db:create that "database XXX does not exist" Anyone had this or have an idea how to fix it?
[19:14:05] macsteps: has joined #RubyOnRails
[19:14:08] gheegh: this is postgres
[19:14:39] clandry94: has joined #RubyOnRails
[19:16:27] alfie_max15: gheegh, do you have spring?
[19:16:31] cnk: does the database user you are connecting as have permission to create new databases?
[19:16:32] giom: has joined #RubyOnRails
[19:16:54] gheegh: its postgres is the user ("root"), and i don't have spring.
[19:16:57] alfie_max15: if you do, `bundle exec rake db:create` should fix your problem
[19:17:37] tubbo: by default, postgres uses the database of the current user as the databas ein which it does its work in. you need to createdb $whatever-user-name-you-are-running-this-command-as in order to actually run db:create
[19:17:52] tubbo: alternatively, run the command(s) as the 'postgres' user since that user will already have a db
[19:18:02] qejk: has joined #RubyOnRails
[19:18:49] sdwrage: has joined #RubyOnRails
[19:19:07] alfie_max15: tubbo, can you explain what you meant by ` postgres uses the database of the current user`
[19:19:28] alfie_max15: is this different from the db we create in the rails app?
[19:19:44] gheegh: alfie_max15: yeah i context it in bundle exec ...
[19:20:51] gheegh: tubbo: Hrm.. i've never had to do that before.. creating new apps.. i've usually been able to rake db:create /migrate and be ready to run.
[19:21:23] alfie_max15: gheegh, no luck? have you set username ??
[19:21:30] alfie_max15: in your database.yml
[19:21:34] gheegh: yes, it's st to "postgres"
[19:22:06] alfie_max15: tubbo, me too, never had to do anything more than rake db:create, but i always specify user as postgres
[19:22:11] gheegh: and before I was getting a password error, so I believe we're past that..
[19:24:16] cnk: gheegh: Postgres's default authentication looks at the operating system user and trys to log them into a database matching that username.
[19:24:56] cnk: so if I just type 'psql', postgres will try to log me into a database named cnk
[19:25:13] Megamos: has joined #RubyOnRails
[19:25:29] gheegh: yeah, i think i'm past user/password errors, unless this "database XXX" does not exist is not an accurate description of the error
[19:25:48] jenrzzz: has joined #RubyOnRails
[19:25:58] cnk: is XXX the name you have in yoru database.yml
[19:26:56] clandry94: has joined #RubyOnRails
[19:27:04] cnk: log into the database as the user you have in the database.yml and see if the user has the createdb permission
[19:27:16] cnk: I think \du should show you
[19:27:44] cnk: you may or may not have to log in as postgres to use \du
[19:27:53] gheegh: cnk: no.. XXX is the name that is confgured in my database.yml file for the database name.
[19:28:45] flujan: has joined #RubyOnRails
[19:28:59] flujan: hello guys. I am porting my app and I need to drop cache_action.
[19:29:37] gheegh: cnk: good thought.. but its there, superuser, createdb, etc.
[19:30:06] benlieb: has joined #RubyOnRails
[19:30:15] cnk: very odd
[19:30:30] flujan: AFAIK, I need to pass the action to the cache method right? Just liket this: <% cache(action: 'recent', action_suffix: 'all_products') do %>
[19:30:30] flujan: All available products:
[19:30:36] Devalo: has joined #RubyOnRails
[19:30:56] cnk: Fraid I can't really help more. I don't run rake db:create - I always create users and databases / permissions from the command line and not from ruby
[19:31:55] Puffball_: has joined #RubyOnRails
[19:32:15] gheegh: yeah, this is in docker.. i'm trying to get setup to use it for dev
[19:32:32] gheegh: so i'm trying not to write too many fragile scripts.. its supposed to work "as is"
[19:32:44] pulpfiction: has joined #RubyOnRails
[19:33:25] chipotle: has joined #RubyOnRails
[19:34:02] manfrin: has joined #RubyOnRails
[19:38:04] bronson: has joined #RubyOnRails
[19:38:59] adre: has joined #RubyOnRails
[19:39:07] _3dwardsharp: has joined #RubyOnRails
[19:39:15] pulpfiction: i'm trying to add something to my secrets.yml like this:
[19:39:26] beauby: has joined #RubyOnRails
[19:41:04] blackmesa: has joined #RubyOnRails
[19:41:16] pulpfiction: config_key: <%= ENV["CONFIG_KEY"] || "1,2,3" %>
[19:41:28] flujan: how debug cache usage in rails? I used to have the messages CACHE HIT CACHE MISS. Now, I don’t have it…
[19:41:53] pulpfiction: when i do Rails.application.secrets["config_key"], it's returning me 123 (without the commas)
[19:41:57] pulpfiction: does anyone have any idea?
[19:42:06] mikeric: has joined #RubyOnRails
[19:42:06] stannard: has joined #RubyOnRails
[19:42:49] alfie_max15: pulpfiction, what is the value of `ENV["CONFIG_KEY"]`
[19:43:19] adaedra: it may be interpreted as a numeric value, try to put quotes outside the erb block
[19:43:34] pulpfiction: actually, the YAML module is parsing it wrong
[19:43:35] pulpfiction: irb(main):014:0> YAML.load(ERB.new("1,2,3").result)
[19:43:50] Devalo: has joined #RubyOnRails
[19:44:14] adaedra: so yeah, `config_key: "<%= ... %>"` may fix it
[19:44:23] emilkarl: has joined #RubyOnRails
[19:44:49] pulpfiction: let me try that, hold on
[19:46:02] alfie_max15: pulpfiction, this worked : YAML.load(ERB.new("\"1,2,3\"").result)
[19:46:08] alfie_max15: ref : https://github.com/tenderlove/psych/issues/273
[19:46:18] dopie: has joined #RubyOnRails
[19:48:01] pulpfiction: alfie_max15, yup, that worked :)
[19:48:08] wolfravenous: has joined #RubyOnRails
[19:48:15] SteenJobs: has joined #RubyOnRails
[19:49:38] JoshGlzBrk: has joined #RubyOnRails
[19:50:28] wolfravenous: has left #RubyOnRails: ()
[19:51:19] wolfravenous: has joined #RubyOnRails
[19:53:39] noobsu: has joined #RubyOnRails
[19:54:42] yaw: has joined #RubyOnRails
[19:55:49] tjohnson: has joined #RubyOnRails
[19:56:21] wolfravenous: has joined #RubyOnRails
[19:59:16] sdwrage: has joined #RubyOnRails
[19:59:33] wolfravenous: has joined #RubyOnRails
[19:59:37] finnnnnnnnnnn: has joined #RubyOnRails
[19:59:51] macsteps: has joined #RubyOnRails
[20:01:22] jenrzzz: has joined #RubyOnRails
[20:02:15] alfie_max15: wolfravenous, what are you testing??
[20:02:18] snowy: has joined #RubyOnRails
[20:02:33] RegulationD: has joined #RubyOnRails
[20:03:33] Terens: has joined #RubyOnRails
[20:04:08] ur5us: has joined #RubyOnRails
[20:04:08] cabinB: has joined #RubyOnRails
[20:04:16] yfeldblum: has joined #RubyOnRails
[20:05:03] noobsu: has joined #RubyOnRails
[20:05:44] matheuslucena: has joined #RubyOnRails
[20:06:08] Talltree: hello, i'm having trouble finding info on doing something specific, i want to check the db if the current entry exists, i got that going, but if it does exist i want to pass some of the posted fields to the existing entry.
[20:06:24] Talltree: i have tried to google that, but dindt find anything that has this functionality
[20:06:58] alfie_max15: Model.where(<conditions>).first.present?
[20:07:14] Talltree: yes, i got that
[20:07:16] alfie_max15: that should check if the entry exists
[20:07:21] Talltree: if @characters.find_by_name(current_name)
[20:07:31] Talltree: that should work too, what i have
[20:07:41] alfie_max15: yes, it should
[20:07:41] Talltree: check if it isnt nil
[20:07:51] alfie_max15: what's the issue you are facing?
[20:07:51] Talltree: but the next part it harder ;)
[20:08:12] Talltree: how do i pass the other info to the char, or add it to the entry?
[20:08:14] giantoctopus: has joined #RubyOnRails
[20:08:46] alfie_max15: @character = @characters.find_by_name(current_name)
[20:09:09] alfie_max15: then do @character.update_attributes(<params>) if @character
[20:09:54] Talltree: so i just add the field names of the values i want to have added or overwritten to the params?
[20:09:59] Talltree: :name :status etc?
[20:10:31] alfie_max15: yes, it should look something like, {name: 'new name', status: 'updated'}
[20:10:52] tildes: has joined #RubyOnRails
[20:11:12] alfie_max15: so the statement would look like: @character.update_attributes(name: 'new name', status: 'updated') if @character
[20:11:25] alfie_max15: you can pass in a single hash also, both should work
[20:11:34] Talltree: the currect POST content is current_name or?
[20:11:49] Talltree: i am doing this as a active record callback
[20:12:03] Talltree: and i am comppleetly new to this ;)
[20:12:09] alfie_max15: which callback specifically?
[20:12:15] Talltree: before_create
[20:12:35] alfie_max15: oh, so you are trying to make sure duplicates aren't created ??
[20:13:01] Talltree: kind of, but also making sure that the other info gets passed to the existing entry.
[20:13:08] Talltree: since i need a history.
[20:13:34] Talltree: experience history of a character in this example...
[20:13:42] Talltree: or check if it died in the meantime :D
[20:14:54] alfie_max15: shouldn't you be just handling this in your create method, instead in a callback?
[20:14:55] Talltree: just checking for the dubplicate is easy, check if it exists and raise an error, but this is harder it seems :D
[20:15:23] alfie_max15: can you explain with an example of 2 or 3 fields ?
[20:15:43] Talltree: i was told that this might be a good idea to do in a callback
[20:16:55] alfie_max15: so, is this callback triggered when you submit your `new` form?
[20:17:34] Talltree: sooo, i plan to feed it via json, and a full block(?) will get posted to the controller with everything, check if the character name exists in the db allready, if it does then update some fields, otherwise just post the complete block.
[20:17:56] noobsu: has joined #RubyOnRails
[20:18:50] Devalo: has joined #RubyOnRails
[20:19:04] jsrn: has joined #RubyOnRails
[20:19:35] Talltree: also, i have the "most recent" experience value of a character in the character table, but the experience history is in another table because it isnt needed in the overview... so when i get a new exp entry i need to add the old ones to the history and update the most recent one
[20:20:33] alfie_max15: you manage another table to hold the histories ?
[20:21:02] Talltree: i begin to think that this doesnt make much sense, but that was the general idea, yes
[20:21:12] Talltree: 2 models, exp nested into exp
[20:21:29] alfie_max15: heard of the paper_trail gem?
[20:21:31] Talltree: character has_many experience etc
[20:21:37] alfie_max15: https://github.com/airblade/paper_trailhttps://github.com/airblade/paper_trailhttps://github.com/airblade/paper_trail
[20:21:41] alfie_max15: https://github.com/airblade/paper_trail
[20:21:55] RegulationD: has joined #RubyOnRails
[20:21:59] alfie_max15: i think you need this
[20:22:10] nettoweb: has joined #RubyOnRails
[20:22:27] Talltree: but what i am trying to do is logical or not?
[20:22:48] Talltree: kinda worries it doesnt make any sense :D
[20:23:12] alfie_max15: as far as i understood, you shouldn't be doing that in your model callbacks
[20:23:34] alfie_max15: it should be done in your controller, maybe as a before_filter to your create action
[20:24:06] alfie_max15: because, the before_create callback is triggered, when a `save` is called on a new object
[20:24:15] rickmasta: has joined #RubyOnRails
[20:24:36] alfie_max15: so only thing you can do to prevent a new object from getting created would be to error out by causing a validation failure
[20:25:01] alfie_max15: but for that, you can have uniqueness validation in your model
[20:25:08] Talltree: ohhhhhhhh didnt know that, thanks for your help
[20:25:36] Talltree: i kind of don't know why you recommend paper_trail for this tho ^
[20:25:56] alfie_max15: because, you were trying to keep track of model changes
[20:26:33] Talltree: i dont need to know if it changed, or when or whatever, i just need it to change^
[20:26:37] alfie_max15: so by using the gem, all you have to do is, check if the object exists, and if it does, just directly update it, and papertrail will make a version of it
[20:27:19] alfie_max15: so, in effect you'll have a history, and you won't need to manually manage it
[20:27:19] roamingdog: has joined #RubyOnRails
[20:27:29] mostlybadfly: has joined #RubyOnRails
[20:27:32] alfie_max15: unless, i misunderstood your requirement ;)
[20:27:33] Talltree: i will definatly look at it
[20:27:40] Talltree: sounds intresting, thanks
[20:28:06] alfie_max15: give it a try, i never got a chance to use it myself :D
[20:29:03] Talltree: what i wonderd, if you use turbolinks there is no loading indication on the site at all
[20:29:27] Talltree: so if i click a link and its something huge, it loads forever without me seeing that the browser does anything.
[20:29:47] Talltree: do you know something that created something like the loading bar that youtube uses?
[20:30:16] alfie_max15: i think so, i used something like that recently
[20:30:57] giom: has joined #RubyOnRails
[20:31:51] Talltree: the ajax lib youtube uses is opensource, i guess i could use it directly, lol
[20:32:13] akshat: has joined #RubyOnRails
[20:32:25] alfie_max15: http://ricostacruz.com/nprogress/
[20:32:35] Puffball: has joined #RubyOnRails
[20:34:11] crystal77: has joined #RubyOnRails
[20:34:21] Talltree: put that into vender-> assets -> js right?
[20:34:53] alfie_max15: yeah, that would do
[20:35:13] maxz: has joined #RubyOnRails
[20:36:29] jenrzzz: has joined #RubyOnRails
[20:38:24] bruce_lee: has joined #RubyOnRails
[20:38:37] Devalo: has joined #RubyOnRails
[20:40:06] Devalo: has joined #RubyOnRails
[20:40:26] noobsu: has joined #RubyOnRails
[20:41:19] Talltree: ha, works perfectly, nice
[20:41:50] blackmesa: has joined #RubyOnRails
[20:43:29] PedramT: has joined #RubyOnRails
[20:45:35] diego1: has joined #RubyOnRails
[20:46:05] Palsson_: has joined #RubyOnRails
[20:46:34] zyzioziom: has joined #RubyOnRails
[20:46:39] Technodrome: has joined #RubyOnRails
[20:47:45] truenito: has joined #RubyOnRails
[20:48:08] diego1: has joined #RubyOnRails
[20:50:19] eljimmy: has joined #RubyOnRails
[20:50:37] centrx: has joined #RubyOnRails
[20:50:39] zave: has joined #RubyOnRails
[20:51:40] stannard_: has joined #RubyOnRails
[20:53:55] blackmesa: has joined #RubyOnRails
[20:55:45] JakFrist: has joined #RubyOnRails
[20:55:49] ericmeds_: has joined #RubyOnRails
[20:57:08] allcentury: has joined #RubyOnRails
[20:57:56] roamingdog: has joined #RubyOnRails
[20:58:09] diego1: has joined #RubyOnRails
[20:58:29] nettoweb: has joined #RubyOnRails
[21:00:36] sdwrage: has joined #RubyOnRails
[21:00:42] noobsu_: has joined #RubyOnRails
[21:01:39] noobsu: has joined #RubyOnRails
[21:03:14] opus_: has joined #RubyOnRails
[21:03:25] eljimbo: has joined #RubyOnRails
[21:03:50] noobsu: has joined #RubyOnRails
[21:09:32] Weavel: has joined #RubyOnRails
[21:09:49] JoshGlzBrk: has joined #RubyOnRails
[21:11:36] triptec: has joined #RubyOnRails
[21:11:56] JoshGlzBrk: has joined #RubyOnRails
[21:12:59] roamingdog: has joined #RubyOnRails
[21:14:06] noobsu: has joined #RubyOnRails
[21:14:31] djbkd: has joined #RubyOnRails
[21:15:31] alexhartley: has joined #RubyOnRails
[21:20:12] ericmeds: has joined #RubyOnRails
[21:23:47] tvw: has joined #RubyOnRails
[21:25:23] sdwrage: has joined #RubyOnRails
[21:26:01] alexhartley: has joined #RubyOnRails
[21:27:35] asheinfeld: has joined #RubyOnRails
[21:27:52] smathy: has joined #RubyOnRails
[21:28:48] macsteps: has joined #RubyOnRails
[21:29:08] roamingdog: has joined #RubyOnRails
[21:29:49] djbkd: has joined #RubyOnRails
[21:30:35] djbkd: has joined #RubyOnRails
[21:32:15] ftj: has joined #RubyOnRails
[21:33:01] noobDev: has joined #RubyOnRails
[21:33:32] ftj: I'm doing a marketplace-type app (think App Store) where people can sell digital goods to each other. I'm creating a helper method that displays a Download, Purchase, or "Edit" link depending on whether the user has downloaded the thing or not, whether they own it or not, etc.
[21:33:34] noobDev: has left #RubyOnRails: ()
[21:33:38] ftj: Can my helper method return a link_to method?
[21:33:57] ftj: Alternatively, can the helper return a partial?
[21:34:56] ftj: It feels stupid to do a whole partial just for a little link_to method (although I do want to return a partial for the more complicated options)
[21:35:39] matheuslucena: has joined #RubyOnRails
[21:35:56] noobRORDev_: has joined #RubyOnRails
[21:35:59] cnk: yes your helper can return link_to
[21:36:13] alfie_max15: noobRORDev_, hi
[21:36:13] cnk: helpers have the same imports as templates
[21:36:40] ftj: cnk Ah I'm an idiot. I only tried it for users that weren't signed in and I wasn't seeing anything...
[21:36:45] ftj: because I was signed in...
[21:37:06] noobRORDev_: Does anyone know how to reset the f.fields_for index?
[21:37:31] theblang: has joined #RubyOnRails
[21:38:27] Terens: has left #RubyOnRails: ()
[21:39:17] Megamos: has joined #RubyOnRails
[21:39:27] bronson: has joined #RubyOnRails
[21:39:44] someish: has joined #RubyOnRails
[21:41:44] beauby: has joined #RubyOnRails
[21:44:28] macsteps: has joined #RubyOnRails
[21:48:23] bennyprofane: has joined #RubyOnRails
[21:51:27] bennyprofane: I just installed rails created a new rails project but the rails server command is giving load errors for sass-rails and coffee-rails
[21:52:15] bennyprofane: the only way I can get it to load is to comment out both sass-rails and coffe-rails in my Gemfile. Is this a known bug? I find it weird that the default settings for a new project are failing to work
[21:52:39] alfie_max15: did you bundle?
[21:53:07] ss_much: has joined #RubyOnRails
[21:53:16] alfie_max15: what are the errors that you get?
[21:53:20] bennyprofane: yeah to fix it I commented out sass-rails and coffee-rails and ran bundle install and now it works
[21:53:40] JoshGlzBrk: has joined #RubyOnRails
[21:53:48] alfie_max15: you mean you are not able to install the two gems?
[21:53:50] bennyprofane: /usr/lib64/ruby/gems/2.1.0/gems/sass-rails-5.0.4/lib/sass/rails/helpers.rb:1:in `require': cannot load such file -- sass (LoadError)
[21:54:03] bennyprofane: that's the error when sass-rails is listed in my Gemfile
[21:54:48] alfie_max15: can you share your Gemfile ?
[21:55:40] JoshGlzBrk: has joined #RubyOnRails
[21:56:11] bennyprofane: it should just be the default Gemfile, I haven't altered anything, I installed rails, ran rails new projectname but it won't work w/o commenting out both sass-rails and coffee-rails gems
[21:56:32] alfie_max15: rails version?
[21:57:28] bennyprofane: there's also a warning about `gem pristine --all`? what does that mean?
[21:57:37] bennyprofane: Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring.
[21:59:22] alfie_max15: bennyprofane, http://stackoverflow.com/questions/22387196/warning-running-gem-pristine-all-to-regenerate-your-installed-gemspecs
[22:00:16] mwlang: has joined #RubyOnRails
[22:00:47] mwlang: I’ve got a Rails 1.2 app I’m porting to Rails 4.x. I keep seeing lines of code like this: @original_page_id = instance_variable_get("@original_page_id")
[22:01:12] mwlang: what the HECK could that be doing other than assigning a variable back to itself?
[22:01:52] mwlang: I’ve been mostly just ignoring this idiocy, but I’m seeing it way to frequently for comfort.
[22:02:48] mwlang: and I’m hoping it’s just some sort of Ruby 1.8.6 thing to force an instance variable into scope of the method that wants to use the variable.
[22:03:02] duncannz: has joined #RubyOnRails
[22:04:08] duncannz: has joined #RubyOnRails
[22:04:41] cnk: what is the context where you are seeing those?
[22:10:16] diegoviola: has joined #RubyOnRails
[22:10:36] apotry: has joined #RubyOnRails
[22:12:21] k1t: has joined #RubyOnRails
[22:13:33] chipotle: has joined #RubyOnRails
[22:17:29] netzfisch: has joined #RubyOnRails
[22:19:24] mikeric: has joined #RubyOnRails
[22:24:16] GodFather: has joined #RubyOnRails
[22:25:01] rickmasta: has joined #RubyOnRails
[22:25:14] bennyprofane: ok I fixed it, I had to create some dirs and a symlink dir in /usr/local/lib64 to redirect `gem pristine --all` to /usr/lib64/ruby/gems/2.1.0 and then for some reason the first `gem pristine --all` failed but I ran it again and it worked
[22:25:46] bennyprofane: then I had to delete the Gemfile.lock and run bundle install and now it works as expected
[22:27:26] bennyprofane: has left #RubyOnRails: ()
[22:27:48] GodFather: has joined #RubyOnRails
[22:28:16] diegoaguilar: has joined #RubyOnRails
[22:29:29] Devalo: has joined #RubyOnRails
[22:31:57] diegoviola: has joined #RubyOnRails
[22:31:59] diegoviola: has joined #RubyOnRails
[22:36:58] sumobob: has joined #RubyOnRails
[22:40:04] Megamos: has joined #RubyOnRails
[22:41:45] djbkd: has joined #RubyOnRails
[22:43:06] zyzioziom: has joined #RubyOnRails
[22:43:54] zyzioziom: has joined #RubyOnRails
[22:46:01] ohnoes: has joined #RubyOnRails
[22:48:17] segy: has joined #RubyOnRails
[22:49:39] k1t: has joined #RubyOnRails
[22:51:17] ohnoes: Hello. I'm having a rather strange issue with Puma + ActionCable on Rails 5.0.0.rc1. When I create two channels or more in my application and restart my server, the server stops responding in my browser. The last line in my `rails server` output is "Registered connection" followed by a string of characters. I have to manually kill the process every time. If anyone could provide me with any pointers to debug the problem myself, t
[22:53:35] asheinfeld: has joined #RubyOnRails
[22:54:15] Pazician: has joined #RubyOnRails
[22:59:07] chipotle: has joined #RubyOnRails
[23:01:08] nettoweb: has joined #RubyOnRails
[23:05:03] ur5us: has joined #RubyOnRails
[23:05:23] ur5us: has joined #RubyOnRails
[23:06:01] shinnya: has joined #RubyOnRails
[23:06:12] dalbuschat: has joined #RubyOnRails
[23:06:34] JesseH: has joined #RubyOnRails
[23:08:42] eljimbo: has joined #RubyOnRails
[23:09:22] Megamos: has joined #RubyOnRails
[23:12:39] k1t_: has joined #RubyOnRails
[23:16:35] eljimmy: has joined #RubyOnRails
[23:17:12] sdwrage: has joined #RubyOnRails
[23:20:13] zyzioziom1: has joined #RubyOnRails
[23:21:14] Cohedrin_: has joined #RubyOnRails
[23:21:42] mwlang: has joined #RubyOnRails
[23:21:49] chopin: has joined #RubyOnRails
[23:23:08] k1t: has joined #RubyOnRails
[23:26:58] benlieb: has joined #RubyOnRails
[23:27:00] alexhartley: has joined #RubyOnRails
[23:27:53] trinaldi: has joined #RubyOnRails
[23:28:29] Emily: has joined #RubyOnRails
[23:34:00] Technodrome: has joined #RubyOnRails
[23:34:21] centrx: has joined #RubyOnRails
[23:36:47] hahuang65: has joined #RubyOnRails
[23:40:31] adre: has joined #RubyOnRails
[23:41:49] bronson: has joined #RubyOnRails
[23:42:09] chopin: has joined #RubyOnRails
[23:42:20] djbkd: has joined #RubyOnRails
[23:42:30] beauby: has joined #RubyOnRails
[23:42:55] hahuang61: has joined #RubyOnRails
[23:43:55] blackmesa: has joined #RubyOnRails
[23:44:42] cd83x: has joined #RubyOnRails
[23:45:06] cd83x: has joined #RubyOnRails
[23:45:31] cd83x: has joined #RubyOnRails
[23:49:28] jhack: has joined #RubyOnRails
[23:55:21] chipotle: has joined #RubyOnRails
[23:55:37] ur5us: has joined #RubyOnRails
[23:56:33] djbkd: has joined #RubyOnRails
[23:59:15] Kus: has joined #RubyOnRails
[23:59:52] sn1ff3r: has joined #RubyOnRails
[23:59:53] Cohedrin: has joined #RubyOnRails