« Back to channel list

#RubyOnRails - 20 April 2016

« Back 1 day Forward 1 day »
[00:00:14] egray: has joined #RubyOnRails
[00:01:53] SteenJobs: has joined #RubyOnRails
[00:03:24] Ropeney: has joined #RubyOnRails
[00:07:03] roamingdog: has joined #RubyOnRails
[00:14:03] jstransky: has joined #RubyOnRails
[00:16:46] Puffball: has joined #RubyOnRails
[00:17:24] yardenbar: has joined #RubyOnRails
[00:17:24] crystal77: has joined #RubyOnRails
[00:17:51] Cooooo: has joined #RubyOnRails
[00:20:50] KnownSyntax_: has joined #RubyOnRails
[00:22:48] w1lson: has joined #RubyOnRails
[00:23:03] roamingdog: has joined #RubyOnRails
[00:23:24] RahulT: has joined #RubyOnRails
[00:24:10] sbarg: has joined #RubyOnRails
[00:25:42] Oliphaun_: has joined #RubyOnRails
[00:29:13] htmldrum: has joined #RubyOnRails
[00:33:46] baweaver: has joined #RubyOnRails
[00:34:38] aloneintheworld: has joined #RubyOnRails
[00:35:31] Megamos: has joined #RubyOnRails
[00:36:51] idefine: has joined #RubyOnRails
[00:38:54] baweaver: has joined #RubyOnRails
[00:40:45] roamingdog: has joined #RubyOnRails
[00:42:15] Oliphaunte: has joined #RubyOnRails
[00:42:25] gr1zzlybe4r: has joined #RubyOnRails
[00:43:32] beauby: has joined #RubyOnRails
[00:43:54] one_zero: has joined #RubyOnRails
[00:49:14] dlt_: has joined #RubyOnRails
[00:49:23] GriffinHeart: has joined #RubyOnRails
[00:50:12] cmhobbs: has joined #RubyOnRails
[00:50:40] pawnbox: has joined #RubyOnRails
[00:53:30] cmhobbs: i'm updating an app from 3.2 to 4.0 and objects from one of the models can no longer be saved. it appears to be the only model to have this problem. activesupport is throwing "NoMethodError: undefined method `to_datetime' for false:FalseClass": http://paste.lisp.org/display/314085
[00:53:45] cmhobbs: anyone have ideas for where i might start looking? i almost dove into the line numbers on the gem but that seemed like a red herring
[00:53:50] SteenJobs: has joined #RubyOnRails
[00:54:21] cmhobbs: i can't figure out what line of this (spaghetti filled) model might be causing that issue
[00:54:49] cmhobbs: well, that paste wrapped poorly... sorry
[00:55:52] syndikate: has joined #RubyOnRails
[00:57:14] petor: has joined #RubyOnRails
[00:57:29] idefine: has joined #RubyOnRails
[01:00:47] Arcaire: The reason it's rolling back appears to be that you're trying to reuse the test email which has a unique constraint.
[01:00:54] Arcaire: > User Exists (1.6ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'test@hotmail.com' LIMIT 1
[01:01:22] Arcaire: Can't really tell without code tbh.
[01:01:32] idefine: has joined #RubyOnRails
[01:01:34] jenrzzz: has joined #RubyOnRails
[01:01:34] jenrzzz: has joined #RubyOnRails
[01:01:53] Arcaire: `to_datetime` is a valid method, but it's being applied to something it shouldn't be being applied to.
[01:02:20] idefine: has joined #RubyOnRails
[01:02:29] cmhobbs: i can't figure out where it's being applied
[01:02:34] cmhobbs: the spaceship on time is troublesome
[01:02:43] w1lson: Hey guys i've been working on learning rails lately - just wondering what you guys thought of rails-api? I'm working on a new web api, and i've used django rest framework a bunch in the past.
[01:02:45] cmhobbs: i wonder if it might be related to all the has_many relationships in this messy model
[01:02:52] cmhobbs: because i have a bunch of has_many errors
[01:03:21] cmhobbs: Arcaire: i'll clean up some of my notes on this model and make a paste
[01:06:26] cmhobbs: Arcaire: be gentle... i inherited this mess: http://paste.lisp.org/display/314087
[01:06:36] cmhobbs: i need to clean a lot of crap out of this model
[01:06:48] Arcaire: christ can you at least use !gist
[01:06:51] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[01:07:00] Arcaire: paste.lisp.org is as bad as Lisp itself
[01:07:34] cmhobbs: i'll copy it there
[01:07:36] cmhobbs: i dont' care for github
[01:07:40] Arcaire: https://gist.github.com/Arcaire/04442c14fb5b1f4e84246ee42dcc1ef9
[01:07:49] Arcaire: and neither do i but at least the code is readable
[01:07:59] cmhobbs: https://gist.github.com/cmhobbs/fd56a869088d722face3de4057fca696
[01:08:57] sevenseacat: has joined #RubyOnRails
[01:09:12] Arcaire: so you've updated your Gemfile and w/e yeah?
[01:09:23] cmhobbs: yeah, most of my specs pass except for the ones that try to create user objects
[01:09:29] Arcaire: run `gem cleanup`
[01:09:32] cmhobbs: so yeah, updated everything as per the guide
[01:09:46] cmhobbs: i didn't do that, no. nuked my Gemfile.lock and my .gem directory (using chgems)
[01:09:56] maxdoubt: has joined #RubyOnRails
[01:10:06] Arcaire: it shouldn't load an older version of the library
[01:10:13] Arcaire: but i can see that happening in some obscure edge case if you have old versions installed
[01:10:16] cmhobbs: other than some broken routes, this is the only issue i have
[01:10:28] cmhobbs: old version of rails or activesupport?
[01:10:38] Arcaire: Rails using an older version of activesupport
[01:10:59] cmhobbs: only rails installed is 4.0.1, activesupport is 4.0.1
[01:12:22] cmhobbs: i may try to clear out these warnings before i tackle this problem again. they might be related as they're warnings for active record and active support
[01:12:33] cmhobbs: thanks for taking a look, Arcaire
[01:12:53] s2013: has joined #RubyOnRails
[01:13:33] s2013: sup folks
[01:15:01] joshkovach: has joined #RubyOnRails
[01:17:41] bronson: has joined #RubyOnRails
[01:21:35] DoctorMonocular: has joined #RubyOnRails
[01:21:42] davidfrey: has joined #RubyOnRails
[01:21:58] roamingdog: has joined #RubyOnRails
[01:22:39] jhack: has joined #RubyOnRails
[01:22:54] davidfrey: Can I drop only the test database with rake db:drop in Rails 3.2? RAILS_ENV=test rake db:drop seems to drop both test and development databases. Same if RAILS_ENV is not specified.
[01:23:27] Radar: david____: Show us config/database.yml with no passwords please
[01:23:37] Radar: david____: I can think that it would be dropping the test db if it was the same db as the dev db.
[01:25:01] maxdoubt: has joined #RubyOnRails
[01:25:07] davidfrey: https://gist.github.com/dcki/183ab166ca2327ba8b7f3e03cb92ba0a
[01:25:19] Radar: ok, that checks out.
[01:25:43] Radar: How are you confirming the dev database is being dropped too?
[01:27:09] davidfrey: Just `ls db`. The development.sqlite3 file gets deleted.
[01:27:40] Radar: Which version of Rails?
[01:29:16] davidfrey: It looks like Rails 4.2 behaves better. Maybe this rake task just can't be told not to drop the dev database with the test database in 3.2.
[01:30:43] davidfrey: Maybe I'll just dump and restore the dev db before and after the rake db:drop...
[01:32:53] flashpoint9: has joined #RubyOnRails
[01:32:53] Radar: david____: I don't know, sorry.
[01:33:26] davidfrey: No problem, thanks for looking and thanks for giving me a chance to think about this with someone!
[01:36:28] aurum_infide_: has joined #RubyOnRails
[01:36:36] davidfrey: Wait, never mind! I had a typo: RALIS_ENV
[01:38:27] timdotrb: has joined #RubyOnRails
[01:43:03] Wingar: has joined #RubyOnRails
[01:44:23] Radar: yes that'll be doing it.
[01:44:38] Radar: maybe next time copy+paste the command?
[01:49:37] DoctorMonocular: has joined #RubyOnRails
[01:49:41] flashpoint9: has joined #RubyOnRails
[01:51:34] aloneintheworld: Would anyone tell me what is the easiest way to use a ES6 react component (https://github.com/enkidevs/react-search-input) on my existing Rails application which is already using react-rails ? All I find is tons of manuals that spends hours configuring browserify, babel, node, npm, webpack, es6, etc
[01:51:54] aloneintheworld: there must be some easier way
[01:52:29] sevenseacat: thats what they all said
[01:52:42] maxdoubt: has joined #RubyOnRails
[01:53:24] Arcaire: aloneintheworld: react pretty much requires babel anyway so you're going to be halfway there
[01:53:28] Radar: no. there is no easier way. there is no dana, only webpack
[01:54:14] aloneintheworld: Arcaire: I’m already using babel then. But i haven’t configured anything babel-related. Just installed react-rails and have already written multiple react components
[01:54:43] GriffinHeart: has joined #RubyOnRails
[01:55:31] Arcaire: aloneintheworld: If you read the installation section of react-rails carefully you will find the answer to your question.
[01:55:46] roamingdog: has joined #RubyOnRails
[01:57:15] aloneintheworld: I’ve read it and still have no idea how to use https://github.com/enkidevs/react-search-input on my rails app
[01:57:46] cmhobbs: has left #RubyOnRails: ("Leaving")
[01:57:57] davidfrey: has left #RubyOnRails: ()
[01:59:20] flashpoint9: has joined #RubyOnRails
[02:00:20] smathy: has joined #RubyOnRails
[02:01:32] htmldrum: has joined #RubyOnRails
[02:02:06] caudill: has joined #RubyOnRails
[02:04:17] roamingdog: has joined #RubyOnRails
[02:17:19] maxdoubt: has joined #RubyOnRails
[02:18:00] smathy: has joined #RubyOnRails
[02:21:06] GriffinHeart: has joined #RubyOnRails
[02:21:16] jstransky: has joined #RubyOnRails
[02:23:00] DZj091231kld: has joined #RubyOnRails
[02:23:56] rohit: has joined #RubyOnRails
[02:26:13] rohit_: has joined #RubyOnRails
[02:27:40] SteenJobs: has joined #RubyOnRails
[02:29:03] twilling: has joined #RubyOnRails
[02:29:27] chagel: has joined #RubyOnRails
[02:30:21] rohit: has joined #RubyOnRails
[02:31:06] rohit: has joined #RubyOnRails
[02:31:31] JohnnyTao: has joined #RubyOnRails
[02:32:55] akshat: has joined #RubyOnRails
[02:34:08] shanson: has joined #RubyOnRails
[02:35:12] GriffinHeart: has joined #RubyOnRails
[02:37:46] fedexo: has joined #RubyOnRails
[02:38:51] hxegon: has joined #RubyOnRails
[02:41:22] emachnic: has joined #RubyOnRails
[02:44:00] sypheren: has joined #RubyOnRails
[02:49:03] eljimmy: has joined #RubyOnRails
[02:52:48] brent__: has joined #RubyOnRails
[02:53:02] beilabs: has joined #RubyOnRails
[02:56:46] frankwest: has joined #RubyOnRails
[02:57:42] sleungcy: has joined #RubyOnRails
[02:57:48] GriffinHeart: has joined #RubyOnRails
[03:06:32] idefine: has joined #RubyOnRails
[03:07:20] shanson: has joined #RubyOnRails
[03:09:12] arBmind1: has joined #RubyOnRails
[03:11:40] braincrash: has joined #RubyOnRails
[03:17:08] ss_much: has joined #RubyOnRails
[03:17:43] i4: has joined #RubyOnRails
[03:17:48] i4: hi there
[03:18:01] GriffinHeart: has joined #RubyOnRails
[03:18:26] i4: I try to configure the language switching on my site, but it's not working (
[03:18:45] i4: Where I can find working step-by-step guide?
[03:19:02] DoctorMonocular: has joined #RubyOnRails
[03:19:27] i4: Because all links which I found in internet is not working for me... =( rails 4.2.6 ruby 2.3.0
[03:19:50] i4: Please help
[03:19:59] bronson: has joined #RubyOnRails
[03:20:01] flashpoint9: has joined #RubyOnRails
[03:20:08] Ropeney: i4 http://guides.rubyonrails.org/i18n.html
[03:20:20] i4: Ropeney, it's not working
[03:20:34] Ropeney: i4, thats a shame
[03:21:15] i4: I told you, it's not working for me
[03:21:25] i4: I tried allready
[03:21:35] sevenseacat: define 'not working'
[03:21:42] Arcaire: i4: That guide works for pretty much everyone else ever.
[03:21:46] Ropeney: no, you said all the guides you've tried (I can't see the guides you've tried) and you haven't said whats not working
[03:21:49] Spami: has joined #RubyOnRails
[03:21:57] Arcaire: So either you're a super-special case that nobody out of thousands has run into, or you're not following the guide properly.
[03:21:58] Ropeney: there's a !help thing somewhere
[03:22:03] Arcaire: !notworking
[03:22:07] helpa: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[03:22:07] Arcaire: or something
[03:22:16] sevenseacat: also aliased as !dw i think
[03:22:25] Arcaire: Glad between three of us at least one person knows the commands. :^)
[03:22:27] i4: when i try use gem i18n i got an error :ru is not a valid locale
[03:22:39] i4: but this locale is present in configs from this guide
[03:22:46] sevenseacat: i4: please gist the code giving you the error, with the full error
[03:22:46] i4: ok, i try to use gem 'rails-i18n'
[03:23:55] i4: on wich site I can paste my code?
[03:24:01] nickenchuggets: has joined #RubyOnRails
[03:24:02] i4: !pastebin
[03:24:16] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[03:24:34] Ropeney: I can't use them :P
[03:26:14] patrick_star: has joined #RubyOnRails
[03:27:24] tjbiddle: has joined #RubyOnRails
[03:27:55] SteenJobs: has joined #RubyOnRails
[03:28:23] i4: https://gist.github.com/anonymous/307cef5398d7b53a823a8d86f29ea4eb
[03:28:27] i4: This is my files
[03:28:47] idefine: has joined #RubyOnRails
[03:28:57] tjbiddle: Hey guys. Just looking for ideas: I have my sign_in page; but it has the login, registration, and forgot password <divs> all in the same page but hidden - which you can switch to with some buttons. If I'm registering, and there's an error - what would be the best way to force back to the registration page? I was thinking put in some hidden element, and then check with JS if it's there, and then hide/show the appropriate div
[03:29:57] sevenseacat: tjbiddle: hey everyone*
[03:30:12] tjbiddle: sevenseacat: I use guys as gender agnostic, but sure.
[03:30:24] idefine: has joined #RubyOnRails
[03:30:38] sevenseacat: i4: and whats the full error you're getting
[03:31:00] Ropeney: is `<%= link_to "Russian", :locale=>'ru'%>` even valid?
[03:31:26] tjbiddle: Ropeney: Needs a parameter for where the link actually goes
[03:31:58] GriffinHeart: has joined #RubyOnRails
[03:31:58] i4: sevenseacat, I always see only English no Russian
[03:32:01] sevenseacat: well no, i believe that would go to the same page with a different locale param
[03:32:17] i4: There is now error now, because I use rails-i18n gem
[03:32:24] sevenseacat: i4: what do your logs say when you click on the Russian link?
[03:32:26] i4: but when I change the language nothing happens
[03:33:19] i4: log https://gist.github.com/anonymous/806b4cbfab2d62a6728407fc41b7e1d1
[03:33:20] Ropeney: I don't get what your trying to change, is the word Russian different in any other language?
[03:33:28] Arcaire: i4: have you created a ru.yml locale?
[03:33:34] Ropeney: or are you expecting all the content on the page to just be another language?
[03:33:41] crdpink2: has joined #RubyOnRails
[03:33:50] Arcaire: Ropeney: I feel it's that.
[03:33:54] i4: and when I press English i see in log Parameters: {"locale"=>"en"}
[03:34:08] i4: Arcaire, yes ofcourse
[03:34:16] Arcaire: i4: and it's in the locales/ dir?
[03:34:23] Arcaire: config/locales
[03:34:27] sevenseacat: ok, so whats in English that isnt supposed to be, or vice versa
[03:34:56] i4: yes there is en.yml and ru.yml
[03:35:47] Ropeney: I suggest re read that guide, on what you actually get from the internationalization
[03:36:10] i4: I set the english locale and it's seems ok, but when I refresh page or use some link it's switched back to russian lang, and there is in the logs: Parameters: {"locale"=>"ru"}
[03:36:44] i4: I want to choose the language for site
[03:36:45] sevenseacat: right, so you're not persisting the locale anywhere
[03:36:52] sevenseacat: you're requiring it to be passed in on every request
[03:37:11] Arcaire: i4: store your locale in the session
[03:37:16] i4: and when i choose RU i want to see russian language for all translation text, but when i choose EN i want to see English words
[03:37:20] Ropeney: i4: http://guides.rubyonrails.org/security.html#sessions
[03:37:29] sevenseacat: +1 to storing it in the session
[03:37:47] sevenseacat: but it would be great to get a straight answer to any question asked
[03:38:24] i4: and why it's not stored in session now from i18n guide?
[03:38:39] Arcaire: Because i18n has nothing to do with storage of preferences whatsoever.
[03:38:52] Arcaire: The i18n guide is to do with translation and that's it. That's the beginning and end of it.
[03:38:58] sevenseacat: because you're not storing it there
[03:39:10] sevenseacat: if you want it stored, you have to actually store it
[03:39:20] Ropeney: i4, if the link changed it for the whole site, what happens when some other visitor changes it back.
[03:39:29] i4: maybe you can advice the trueway guide step by step for storing the location?
[03:39:34] Ropeney: anyway off to lunch,. gl
[03:39:49] i4: Ropeney, I understand that session is true way
[03:39:59] Arcaire: i4: if you need a step-by-step for that you need to go back and read the rails fundamentals guides tbh
[03:40:01] sevenseacat: i4: http://guides.rubyonrails.org/security.html#sessions as Ropeney linked you earlier
[03:41:08] i4: i'll try
[03:42:39] pawnbox: has joined #RubyOnRails
[03:43:22] hxegon: has joined #RubyOnRails
[03:43:52] thejamespinto: has joined #RubyOnRails
[03:45:16] i4: thank you all!
[03:45:43] diegoaguilar: has joined #RubyOnRails
[03:45:58] SteenJobs: has joined #RubyOnRails
[03:47:46] fox_mulder_cp: has joined #RubyOnRails
[03:47:50] mbreedlove: has joined #RubyOnRails
[03:48:44] i4: hmm, but working only stored locale. it's include /en/ or /ru/ before links and stored after page refresh
[03:48:47] s2013: having a brainfart.. so user has many groupsand groups has many users, through a memberships table.. so i want to get list of group that theuser does not belong to
[03:49:29] i4: But not working for <%= t(:current_language) %><br>
[03:49:49] sevenseacat: well what is that translation defined as?
[03:50:09] i4: in ru.yml as "RUSSIAN", and in en.yml as "ENGLISH"
[03:50:39] i4: but i always see "RUSSIAN"
[03:51:12] sevenseacat: when your locale is set to English? this is really hard to debug with limited information
[03:51:46] i4: i see in logs that with page refresh locale is Parameters: {"locale"=>"en"}
[03:52:05] i4: and in all urls i see "/en/" including
[03:52:14] shanson: has joined #RubyOnRails
[03:52:24] sevenseacat: yeah I can't help when you keep changing the information
[03:52:28] baweaver: has joined #RubyOnRails
[03:52:33] mbreedlove: has joined #RubyOnRails
[03:52:45] i4: what I need to show?
[03:52:57] i4: I try to solve this problem, but can't)
[03:53:04] nickenchuggets: has joined #RubyOnRails
[03:53:22] hxegon: has joined #RubyOnRails
[03:53:33] s2013: sevenseacat do you freelance?
[03:53:34] sevenseacat: if your locale is set to English, and your en.yml defines the translation as "English", then you will not be seeing "Russian"
[03:53:39] sevenseacat: s2013: for you? no.
[03:53:56] s2013: that wasnt the question though, was it?
[03:54:12] sevenseacat: then yes, I do.
[03:56:01] s2013: what version of rails supports left_outer_joins?
[03:56:12] s2013: im on 4.2 but thatdoesnt seem to work
[03:56:18] i4: when I change the locale I see that changed only params[:locale], and session[:locale], I18n.default_locale, I18n.locale - is always RU
[03:56:23] sleungcy: has joined #RubyOnRails
[03:56:35] i4: sevenseacat, I think it's a problem
[03:56:48] sevenseacat: I think you have a problem, yes. i have no idea what it is.
[03:56:54] Arcaire: i4: set i18n.locale = sessions[:locale] on each page load
[03:57:11] i4: Arcaire, how?
[03:57:26] Arcaire: The way you'd set anything else?
[03:58:21] i4: sessions or session?
[03:58:28] sevenseacat: first everything is en, then everything is ru, then everything is broken, then I have no idea whats going on
[03:58:48] s2013: Group.joins("LEFT OUTER JOIN memberships ON groups.id = memberships.group_id").where("memberships.user_id != ?", User.first.id)
[03:59:10] petor: has joined #RubyOnRails
[03:59:13] s2013: this is returning 0 results.. but im trying to make it so it returns everything except groups that has User.first as a member
[03:59:22] godzillaenlacasa: has joined #RubyOnRails
[03:59:34] Arcaire: i4: not sure, why don't you look at the guide about sessions you were linked earlier?
[03:59:44] Arcaire: (hint: i'm telling you that you should know this or know where to look up the information)
[04:00:14] mbreedlove: has joined #RubyOnRails
[04:00:23] i4: I get this guide already and locale store is working now but only for params[:locale]
[04:00:45] Arcaire: i feel like you have no idea how to program in Ruby.
[04:00:59] Arcaire: s/ in Ruby//
[04:01:08] sevenseacat: Arcaire: dude.
[04:01:17] Arcaire: sevenseacat: person *
[04:01:17] context: i4: how do you execute something at the beginning of every request
[04:01:21] i4: Arcaire, I'm newbie
[04:01:22] Cache_Money: has joined #RubyOnRails
[04:01:31] Arcaire: i4: That's the problem. You've not committed to learning the fundamentals.
[04:01:36] sevenseacat: Arcaire: fine. don't be rude.
[04:01:42] Arcaire: As a result, you're going to run into shit like this nonstop and have no basis on how to solve your issue.
[04:02:21] Radar: +1 sevenseacat
[04:02:33] i4: yep, you right... I spend the 6 hours for this problem already...
[04:02:36] Arcaire: Alright, Radar and sevenseacat seem like they want to help you through this so I'll let them do it.
[04:02:43] ChanServ: +q *!*@gateway/web/irccloud.com/x-xewusjnxudblkqoh
[04:02:44] Radar: Thanks buddy.
[04:03:07] eljimmy: has joined #RubyOnRails
[04:03:14] i4: context, in application_controller
[04:03:44] context: are you stating that or guessing
[04:04:05] i4: context, please can you explain what do you mean?
[04:04:06] eljimbo: has joined #RubyOnRails
[04:04:21] i4: I don't undertand
[04:05:02] context: actually.... lets try this again
[04:05:12] context: HOW do you execute something at the beginning of every request
[04:05:14] sevenseacat: Arcaire: rule 8 is the relevant rule, btw
[04:05:51] i4: in application_helper.rb i think
[04:06:13] s2013: Radar any clue as to what im doing wrong? Group.joins("LEFT OUTER JOIN memberships ON groups.id = memberships.group_id").where("memberships.user_id != ?", User.first.id) <-- im trying to return allgroups that the first user does not belong to.this query returns 0 groups
[04:06:15] i4: or :before_filter in controller
[04:06:20] Radar: !crystalball
[04:06:25] Radar: s2013: Sorry it's broken
[04:06:47] context: i4: there you go.
[04:06:53] i4: I'm a little confused
[04:07:01] context: i4: now set I18n.locale from either params or session like arcaire said.
[04:07:17] Radar: s2013: I think I asked this on SO a few years ago. Let me look for that.
[04:07:32] i4: before_filter :set_locale
[04:07:32] i4: def set_locale
[04:07:32] i4: I18n.locale = params[:locale] || session[:locale] || I18n.default_locale
[04:07:32] i4: session[:locale] = I18n.locale
[04:07:34] s2013: ok sure thanks
[04:07:38] Radar: i4: !gist
[04:07:38] helpa: i4: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[04:07:39] i4: Already set
[04:07:39] Radar: i4: !rule3
[04:07:39] helpa: i4: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[04:07:42] i4: ops sorry
[04:07:58] Radar: s2013: http://stackoverflow.com/questions/1314408/finding-all-records-without-associated-ones
[04:08:17] Radar: s2013: difference is that the answer there us using a LEFT JOIN instead of a LEFT OUTER JOIN?
[04:08:23] Radar: s2013: *shrug*. My SQL-fu is still crap.
[04:08:24] i4: context, i set the def :set_locale
[04:08:30] s2013: k le tme try just left join
[04:08:41] i4: and do the before_filter :set_locale
[04:08:51] context: i4: yeah.. so go see that its being executed, and see that its being set
[04:09:05] s2013: left join returns 0 as well. hmm let me read the SO then
[04:09:07] drptbl: has joined #RubyOnRails
[04:09:11] context: puts / Rails.logger / <%= some_stuff %> are your friends
[04:09:24] context: give yourself eyes to see whats actually going on
[04:09:31] i4: it's executed, but sets only params[:locale]
[04:09:48] s2013: wow smathy answered as well.nice
[04:10:19] context: i4: set_locale doesn't "set" anything in params.
[04:10:27] ewilliam: what's the idiomatic way to do bring up a specific association without doing something like user.wallets.find_by(wallet_type_id: 1) there's 2 wallet types, and i want to do something like user.customer_account or user.merchant_account. decorators? helpers?
[04:10:41] s2013: oh wait your thing is a bit different Radar cause yours doesnt have a join table
[04:10:51] Radar: ewilliam: define a new has_many association which uses where.
[04:10:53] Radar: s2013: indeed
[04:10:54] context: i4: again puts/Rails.logger, so PUTS your params, and PUTS your session and PUTS the default_locale, SEE what is going on in your code
[04:11:07] i4: ok i'll try
[04:11:11] s2013: yeah mine does.. hmm
[04:11:40] ewilliam: Radar: nice. thanks!
[04:12:02] Cohedrin_: has joined #RubyOnRails
[04:12:33] Radar: s2013: Maybe you're going about this wrong? How about Group.where.not(id: current_user.memberships.pluck(:group_id)) ?
[04:12:35] chaas: has joined #RubyOnRails
[04:12:53] lxsameer: has joined #RubyOnRails
[04:13:02] s2013: yeah i can do that but i wondered if there was a more elegant way
[04:13:21] rarruda: has joined #RubyOnRails
[04:13:32] jenrzzz: has joined #RubyOnRails
[04:13:32] jenrzzz: has joined #RubyOnRails
[04:14:16] s2013: that makes 2 queries though right?
[04:15:17] Ratler: has joined #RubyOnRails
[04:15:27] tjbiddle_: has joined #RubyOnRails
[04:16:53] djgraham: has joined #RubyOnRails
[04:17:44] swav: has joined #RubyOnRails
[04:17:52] i4: context, i set the logger.debug "#{I18n.locale}" in my application_controller.rb and when I choose EN locale and params[:locale] is ok - EN, but i18n.locale always is :ru :(
[04:18:35] scrooloose: has joined #RubyOnRails
[04:18:43] moeabdol: has joined #RubyOnRails
[04:18:47] idefine: has joined #RubyOnRails
[04:19:35] patrick_star: has joined #RubyOnRails
[04:19:48] i4: and when I change the locale... my logger.debug in "def set_locale" show nothing o.O
[04:19:57] i4: like a set_locale not working
[04:20:29] context: is set_locale being called at all ?
[04:21:56] i4: i think no
[04:26:10] Devalo: has joined #RubyOnRails
[04:26:39] context: there you go, found your problem
[04:32:42] thejamespinto: has joined #RubyOnRails
[04:33:06] i4: context, I can't understand why def set_locale is not working in application_controller.rb o.O
[04:33:20] i4: I use before_filter :set_locale BEFORE
[04:33:28] i4: but there is no any reaction from def
[04:34:02] smoitra: has joined #RubyOnRails
[04:34:24] context: IS it running? its a yes or a no
[04:34:34] context: puts "SET LOCALE IS EXECUTING"
[04:34:53] bruno-: has joined #RubyOnRails
[04:35:07] context: and your controller is deriving from ApplicationController where set_locale is located?
[04:35:29] context: troubleshoot. if its not executing figure out why.....
[04:36:00] context: see where code is being executed, see where its not. try moving the before-filter to the controller you are actually accessing
[04:36:07] context: FIND the brokeness....
[04:36:10] i4: i set logger.debug already into the DEF set_locale
[04:36:31] context: do you know what DEF means ?
[04:36:36] i4: but it's never show
[04:36:43] yfeldblum: has joined #RubyOnRails
[04:36:52] context: i just gave you a few things to do
[04:37:05] i4: def is a set i think
[04:37:10] i4: and I must call DEF
[04:37:18] i4: to execute the code into the def
[04:37:25] i4: in the def, I mean
[04:37:27] c00lways: has joined #RubyOnRails
[04:37:29] context: i think you need to learn a little more of the basics...
[04:38:18] i4: i confused
[04:38:29] i4: 7 hours on the one task
[04:39:15] c00lways: has joined #RubyOnRails
[04:39:56] htmldrum: has joined #RubyOnRails
[04:40:06] Spami: has joined #RubyOnRails
[04:40:12] i4: context, how can I run the code from set_locale?
[04:40:43] egray: has joined #RubyOnRails
[04:43:30] context: yeah. def defined a method. you should understand this after 7 hours.
[04:43:55] i4: yep I understand thus
[04:44:03] i4: and understand that I must call the method
[04:44:14] context: i4: i said MULTIPLE things to help you, and you have done none of them. i can understand why its taken you 7 hours, cause you haven't done a damn thing
[04:45:46] i4: I use before_filter :set_locale that must call :set_locale
[04:46:07] patrick_star: has joined #RubyOnRails
[04:46:23] i4: and if i set this in ApplicationController it must be initilized in all child controllers
[04:46:39] sleungcy: has joined #RubyOnRails
[04:47:00] Ropeney: s2013 I think you want a full outer right join?
[04:50:27] idefine: has joined #RubyOnRails
[04:50:43] i4: arrrrrrrrrghhhhhhhhh
[04:50:56] Ropeney: i4, your still not having luck?
[04:51:01] mbreedlove: has joined #RubyOnRails
[04:51:04] i4: I puts set_locale and before_filter into the home controller
[04:51:07] i4: and it's working
[04:51:11] i4: but why??
[04:51:19] Ropeney: why is it working?
[04:51:26] i4: why it's not working in application contorller?
[04:51:43] ChanServ: -q *!*@gateway/web/irccloud.com/x-xewusjnxudblkqoh
[04:51:54] Arcaire: i was muted?
[04:51:58] i4: and when it's in home controller all working fine
[04:52:00] Radar: i4: Show us your HomeController plz
[04:52:00] Arcaire: i was afk, not muted
[04:52:01] Ropeney: does it have other before_filters?
[04:52:05] Arcaire: i4: give me like
[04:52:07] Arcaire: five minutes
[04:52:09] Arcaire: i'm making an app
[04:52:11] Arcaire: to show you
[04:52:25] Arcaire: localization switching and stuff
[04:52:28] Ropeney: thats some dedication :)
[04:52:33] Arcaire: 2:02 PM <ChanServ> You have been quieted on #RubyOnRails by helpa
[04:52:35] Arcaire: oh hey i was muted
[04:52:48] Arcaire: Ropeney: I'm waiting for an AV scan to finish to test some malware I wrote
[04:53:12] i4: home_controller https://gist.github.com/anonymous/75ecb9bcbf6a8d5096b208c80aea3915
[04:53:57] Ropeney: doesn't look like a whole home controller
[04:54:26] GriffinHeart: has joined #RubyOnRails
[04:54:53] i4: Ropeney, abother code is not needed
[04:55:05] i4: Ropeney, not important for this task
[04:55:13] Ropeney: i4, its not working for you, you can't work it out in 7 hours. You sure you want to be the one who decides whats not important?
[04:55:37] sevenseacat: for all we know, you've defined that inside another method accidentally
[04:55:41] sevenseacat: (i've seen that before)
[04:56:08] Ropeney: or have more then 1 before filter
[04:56:12] i4: sevenseacat, yep because it's empty)
[04:56:27] sevenseacat: i4: please gist your controller.
[04:56:41] lemur: has joined #RubyOnRails
[04:59:13] i4: shiiiiiit
[04:59:17] i4: i found.
[04:59:33] i4: i have dupblicate of: def set_locale
[05:00:13] i4: https://gist.github.com/anonymous/e8cb3ca4f67a9193be058e850788ed06
[05:00:18] i4: with this code
[05:01:45] smathy: has joined #RubyOnRails
[05:01:50] i4: ACTION knocks his head to the wall
[05:01:53] Arcaire: Locales: https://gitlab.com/Arcaire/int/tree/master/config/locales || Controller: https://gitlab.com/Arcaire/int/blob/master/app/controllers/application_controller.rb || Index: https://gitlab.com/Arcaire/int/blob/master/app/views/application/index.html.erb
[05:01:56] Arcaire: if ur still wondering
[05:01:59] s2013: has joined #RubyOnRails
[05:02:06] Cohedrin: has joined #RubyOnRails
[05:02:08] Arcaire: bad app, please don't follow any of the general practices I made, I just focused on the stuff you needed.
[05:02:26] i4: one moment
[05:03:14] Arcaire: "def locale" is just a controller action that I have the route "/locale" mapped to. I'd recommend using params instead of a toggle.
[05:03:17] Ropeney: good its resolved :D
[05:04:19] i4: Arcaire, I'm scared by your code)
[05:04:35] Arcaire: http://imgur.com/a/DQH4v images of result as well if you're wondering what it'd look like
[05:04:46] s2013: has joined #RubyOnRails
[05:04:52] Arcaire: What's scary about that code? :x
[05:04:56] i4: @locale = session[:locale] for what it's needed?
[05:05:09] Arcaire: That's used for this line: https://gitlab.com/Arcaire/int/blob/master/app/views/application/index.html.erb#L11
[05:05:24] Arcaire: Only for me to show you what locale is currently set. Normally you'd use it to showcase what language the user is using in the top right as a little flag or something.
[05:05:28] s2013: what code
[05:05:30] Arcaire: You wouldn't do it that way, but you'd load a flag image.
[05:06:01] i4: thanks for your time
[05:06:11] Arcaire: s2013: This code: http://imgur.com/05r9oEc
[05:06:11] i4: i'll try to understand now
[05:06:24] i4: thanks to all)
[05:06:29] idefine: has joined #RubyOnRails
[05:06:33] Arcaire: s2013: nothing scary about that whatsoever, right?
[05:08:14] Arcaire: Welp I just realised the content of that index.html.erb is slightly-racist copypasta.
[05:08:18] Arcaire: I thought it was just a shitpost at Australia.
[05:09:35] DragonPunch: has joined #RubyOnRails
[05:09:37] SteenJobs: has joined #RubyOnRails
[05:11:27] rvanlieshout: has joined #RubyOnRails
[05:14:09] smathy: "Its" should be "It's"
[05:14:47] Arcaire: i just grabbed something random from reddit.com/r/copypasta, i won't lie
[05:18:12] idefine: has joined #RubyOnRails
[05:18:32] jenrzzz: has joined #RubyOnRails
[05:18:38] jenrzzz: has joined #RubyOnRails
[05:19:18] JohnnyTao: has joined #RubyOnRails
[05:20:33] JohnnyTao: has left #RubyOnRails: ()
[05:21:46] tjbiddle: has joined #RubyOnRails
[05:22:25] agent_white: has joined #RubyOnRails
[05:25:27] Radar: hey agent_white
[05:25:42] tjbiddle: Using Devise: I have overwritten my RegistrationController; how do I sign-in my user after the account has been created?
[05:26:05] Radar: tjbiddle: What does the default RegistrationsController do?
[05:26:45] tjbiddle: Radar: https://github.com/plataformatec/devise/blob/master/app/controllers/devise/registrations_controller.rb#L14 I honestly can't tell
[05:26:53] tjbiddle: Devise's coding style hurts my head
[05:27:00] Synthead: has joined #RubyOnRails
[05:27:04] Radar: tjbiddle: https://github.com/plataformatec/devise/blob/master/app/controllers/devise/registrations_controller.rb#L22
[05:27:12] Radar: https://github.com/plataformatec/devise/blob/master/app/controllers/devise/registrations_controller.rb#L105-L107
[05:27:15] helpa: Next question, please!
[05:27:25] Radar: sign_in(:user, user) for example
[05:28:17] tjbiddle: Radar: Cool, was just about to ask what the first param would be. Thank you
[05:28:30] Radar: ACTION has played Devise THE GAME too much
[05:29:02] tildes: has joined #RubyOnRails
[05:29:03] Arcaire: Armchair Gymnastics: The Game
[05:29:04] Arcaire: Devise DLC
[05:29:08] chagel: has joined #RubyOnRails
[05:29:18] smathy: Devise is a sentence, not a game.
[05:29:20] Arcaire: The base game is ruby-install and chruby.
[05:29:24] Radar: It's better than authlogic which was better than restful_authentication which was better than...
[05:29:46] tjbiddle: Radar: Heh. Yeah anytime I mess with it it hurts my head for a week until I get it implemented and I don't touch it again for months - and then I forget it all
[05:29:48] smathy: I way prefer authlogic to devise.
[05:29:58] tjbiddle: And then by that time they've changed it all 😂
[05:30:00] Radar: smathy: Psychopath
[05:30:09] Arcaire: There's a second expansion pack called "The Channel: The Game", which simply loads up your PDF viewer with a file containing the entirety of https://logs.ryanbigg.com/tips
[05:30:15] smathy: Naah, at least all the shit is out in the open.
[05:30:19] Radar: Arcaire: no https bro
[05:30:25] Arcaire: you monster
[05:30:28] Radar: Arcaire: (plz don't hack)
[05:30:30] smathy: ...but yeah, really I prefer just writing the 10 lines of code myself.
[05:30:37] Arcaire: mitm'd your tips
[05:30:37] Radar: Arcaire: oh fuck
[05:30:45] Radar: ACTION RIP
[05:31:14] smathy: Sorcery is ok.
[05:31:48] p1k: has joined #RubyOnRails
[05:34:04] yfeldblum: has joined #RubyOnRails
[05:34:29] GriffinHeart: has joined #RubyOnRails
[05:34:34] sp1rs: has joined #RubyOnRails
[05:35:42] mbreedlove: has joined #RubyOnRails
[05:37:14] idefine: has joined #RubyOnRails
[05:37:27] mbreedlove: has joined #RubyOnRails
[05:42:02] PedramT: has joined #RubyOnRails
[05:43:38] PedramT_: has joined #RubyOnRails
[05:44:25] rahult_: has joined #RubyOnRails
[05:44:42] solars: has joined #RubyOnRails
[05:44:51] PedramT__: has joined #RubyOnRails
[05:45:12] rohit: has joined #RubyOnRails
[05:47:18] moeabdol: has joined #RubyOnRails
[05:48:52] moeabdol: has joined #RubyOnRails
[05:49:09] petor: has joined #RubyOnRails
[05:49:18] RegulationD: has joined #RubyOnRails
[05:51:21] roamingdog: has joined #RubyOnRails
[05:51:51] i4: hm, how can I set for different languages one file for abbr of languages? for example /locale/languages.yml that contains abbr of countries and languages: en, ru, cn, it, au etc...
[05:52:06] Arcaire: Why would you bother?
[05:52:38] i4: some common yml in locale
[05:53:02] netzfisch: has joined #RubyOnRails
[05:53:12] PedramT: has joined #RubyOnRails
[05:53:14] i4: because i need en: English, ru: Русский, th: ภาษาไทย, etc
[05:53:42] mbreedlove: has joined #RubyOnRails
[05:53:46] i4: In order not to repeat the same things in different language files
[05:54:02] i4: this info is dublicated in each lang.yml file now
[05:54:11] i4: and I think it's not correct.
[05:54:42] pawnbox: has joined #RubyOnRails
[05:54:50] Arcaire: i4: That's not really duplicated.
[05:55:16] Radar: i4: Because different countries are abbreviated differently in different languages.
[05:55:21] Arcaire: https://gist.github.com/Arcaire/3070f9f047578478e9c6e496623bd7ba
[05:55:35] i4: in en.yml: "en: lang: en: 'English'", and in th.yml teh same: "en: lang: en: 'English'" etc
[05:55:51] Radar: why do you have an en key defined in th.yml
[05:56:01] Radar: i4: Gist the full versions of your translation files
[05:56:02] smathy: i4, if in whatever language "th" is the word for English is really "English" then so be it.
[05:57:58] i4: https://gist.github.com/anonymous/ba2318465a3992f6375e0b4d0180877e
[05:58:04] i4: this is en and ru YML
[05:58:11] Radar: Seems fine.
[05:58:13] rohit: has joined #RubyOnRails
[05:58:33] Spami: has joined #RubyOnRails
[05:58:34] i4: but in tt: block in EN and RU the content is the same
[05:58:41] smathy: ...doesn't to me.
[05:58:43] sevenseacat: if its the same for every language, why is it being translated at all
[05:58:44] Radar: You could define a fallback local which is called... I dunno, shared.
[05:58:54] Radar: Or what sevenseacat said too.
[05:58:55] smathy: i4, if the strings for every locale are the same then you don't need them in the locale YAML file.
[05:59:06] i4: If there is two files it's can be done, but if there'll be 20 files... in each the same part of code - it's no good
[05:59:28] i4: smathy, right! and where I can put them?
[05:59:42] i4: to then call from
[05:59:58] smathy: i4, just put the string in your views.
[06:00:03] i4: shared.yml
[06:00:25] Arcaire: i4: This is why I said use flags. ;)
[06:00:30] i4: smathy, it's no good idea for me because the list of languages is generates automatically
[06:00:41] i4: I use Flags and text
[06:00:45] Arcaire: Just use flags.
[06:00:55] sevenseacat: Arcaire: how does that solve the problem at all?
[06:01:02] smathy: i4, so generate it elsewhere.
[06:01:04] Arcaire: sevenseacat: Because you can hardcode those. :)
[06:01:17] Arcaire: You don't need six different variations of the name for the country when you just have the flag.
[06:01:17] sevenseacat: "list of languages is generates automatically"
[06:01:26] Arcaire: From the locale.yml
[06:01:26] sevenseacat: there is only one variation of the name.
[06:01:30] smathy: i4, as sevenseacat said, if the strings are the same for every language then they don't belong in your locale files.
[06:01:38] crdpink: has joined #RubyOnRails
[06:01:43] i4: smathy, ok
[06:01:49] smathy: Arcaire, do us a favor and look at the gist.
[06:02:04] Arcaire: you mean this: https://gist.github.com/anonymous/ba2318465a3992f6375e0b4d0180877e ?
[06:02:51] smathy: Arcaire, yep, see how the strings are the same in both YAML files.
[06:03:16] Arcaire: ACTION waits for someone to point out the part where the solution he gave won't work and instead is more effort than writing it in a yml file.
[06:03:25] smathy: Arcaire, so it's not "six different variations of the name" - what are you not getting here?
[06:04:01] Arcaire: I pulled the number out at random. I'm aware there's only two, which are actually just one.
[06:04:13] Arcaire: But should any other locales be introduced in future, that number of repeated content could be inflated to six.
[06:04:16] smathy: ...there's not two, there's ONE.
[06:04:25] Arcaire: 4:04 PM <Arcaire> I pulled the number out at random. I'm aware there's only two, which are actually just one.
[06:04:27] sleungcy: has joined #RubyOnRails
[06:04:28] sevenseacat: one set of country names.
[06:04:32] Arcaire: Are you using forty-column lines or something mate?
[06:04:40] smathy: There's ONE word for each language regardless of which locale is being used.
[06:04:46] Arcaire: Wow that's almost like what I said.
[06:04:54] i4: I switch language by this code: https://gist.github.com/anonymous/d0adddbdc41280f823d811620f3059b4
[06:04:57] smathy: Regardless of whether the locale is en or ru the word for "en" is "English"
[06:05:18] Arcaire: Neat, flags.
[06:05:25] smathy: i4, good.
[06:05:31] mbreedlove: has joined #RubyOnRails
[06:05:51] i4: and this code <%= t('lang.tt.'+"#{i}") %> generates the languages names
[06:06:18] smathy: i4, so just put the language names in your LANGS_KINDS or something, make it a hash.
[06:06:33] sevenseacat: personally, I'd be included to just stick a helper method that returns a hash of codes and names in a helper module
[06:06:40] sevenseacat: what smathy said
[06:07:32] sevenseacat: Arcaire: for the second time today, you're not being amy kind of constructive.
[06:07:43] GriffinHeart: has joined #RubyOnRails
[06:07:52] i4: I thought there is another solution for the locales, but ok
[06:08:02] smathy: ACTION tries to keep my unproductive moments down to three or four per day
[06:08:17] Arcaire: Four is maximum.
[06:08:25] smathy: i4, the locale files are for when there are different strings for each locale
[06:08:29] smathy: ...if they're the same, just use the strings.
[06:08:41] i4: now i understand that
[06:08:43] i4: thanks)
[06:12:01] dangrahn: has joined #RubyOnRails
[06:13:32] i4: L_NAMES = { ru: "Русский", cn: "Chinese", en: "English" }, and then = User::L_NAMES[:en] - profit
[06:14:19] sevenseacat: that has added benefits because you can get a hash of all languages easily, keep an ordering, etc.
[06:15:43] sp1rs: has joined #RubyOnRails
[06:17:11] idefine: has joined #RubyOnRails
[06:17:23] petor: has joined #RubyOnRails
[06:18:52] i4: How can I use #{i} for * in <%= User::L_NAMES[:*] %>
[06:19:08] i4: Something like this <%= User::L_NAMES[:+"#{i}"] %>
[06:19:58] sevenseacat: depending on what i is, User::L_NAMES[i] should work - no need for interpolation
[06:20:24] ur5us: has joined #RubyOnRails
[06:20:37] mbreedlove: has joined #RubyOnRails
[06:20:56] i4: is is "en" or "cn" or "ru"
[06:21:23] bronson: has joined #RubyOnRails
[06:21:57] smathy: i4, did someone mention you can iterate over a hash too? User::L_NAMES.each do |code, name|
[06:22:07] i4: = User::L_NAMES[i] is not working, because it's should be [:en]
[06:22:39] i4: to difficult construction imho
[06:23:17] tildes: has joined #RubyOnRails
[06:23:48] sevenseacat: if i is a string, then you would need to convert it to a symbol, ie. i.to_sym
[06:23:57] sevenseacat: because you have defined your hash with symbol keys
[06:24:01] Coldblackice_: has joined #RubyOnRails
[06:24:11] sevenseacat: but none of this is Rails-specific - just basic Ruby
[06:25:44] tjbiddle: Hm, this seems to keep using a GET request rather than DELETE. Ideas anyone? https://gist.github.com/thomasbiddle/1c6d0e04f099cea2e2525ed2f9a0168c
[06:25:59] sevenseacat: JavaScript errors?
[06:26:10] sevenseacat: no JavaScript?
[06:26:30] sevenseacat: no jquery_ujs?
[06:26:35] sevenseacat: so many possibilities!
[06:26:57] ishamo: has joined #RubyOnRails
[06:28:17] smathy: i4, see my comment in your gist: https://gist.github.com/anonymous/d0adddbdc41280f823d811620f3059b4
[06:29:06] chipotle: has joined #RubyOnRails
[06:29:09] i4: very interesting solution
[06:29:12] i4: simple)
[06:30:04] Ropeney: tjbiddle, a delete is a get?
[06:30:30] tjbiddle: Ropeney: No, delete is a separate http verb than get
[06:30:34] xcesariox: has joined #RubyOnRails
[06:30:41] Ropeney: thats not supported
[06:30:46] sevenseacat: Ropeney: what
[06:30:47] Ropeney: so they use a get, with a header
[06:31:05] tjbiddle: Ropeney: Yes it is: http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to
[06:31:11] xcesariox: sevenseacat : hey soul sister
[06:31:16] tjbiddle: And from Devise: ` destroy_user_session DELETE /users/sign_out(.:format)`
[06:31:24] Radar: tjbiddle: please stop typing
[06:31:28] Radar: tjbiddle: Read what sevenseacat said
[06:31:29] netzfisch: has joined #RubyOnRails
[06:31:31] Radar: tjbiddle: then answer those questions
[06:31:38] Radar: tjbiddle: then you can continue typing
[06:31:43] beilabs: has joined #RubyOnRails
[06:31:51] tjbiddle: Radar: Ah, didn't realize those messages were for me - never got a mention
[06:31:54] Radar: Radar's 4-step-progress for success.
[06:32:15] sevenseacat: if only everyone subscribed to Radar's four-step plan
[06:32:22] Radar: sevenseacat: that'd be nice
[06:32:32] zpe: has joined #RubyOnRails
[06:32:46] xcesariox: sevenseacat has been here for the longest time i know.
[06:32:47] tjbiddle: sevenseacat: No errors in JS. The link works - it just makes a GET request (Which then says no route found, etc etc.)
[06:32:55] idefine: has joined #RubyOnRails
[06:32:57] Ropeney: it is a GET request...
[06:33:06] Radar: xcesariox: I've been here for (I think) 5-6 years longer.
[06:33:09] sevenseacat: Ropeney: see four step plan
[06:33:11] tjbiddle: Ropeney: Well I don't want it to be a GET request
[06:33:13] Spami: has joined #RubyOnRails
[06:33:17] Ropeney: thats why you have a data-method
[06:33:34] Ropeney: i don't think there is any issue here though
[06:33:41] sevenseacat: tjbiddle: so are you loading Rails' jquery_ujs onto your page?
[06:34:03] tjbiddle: Rails needs jquery? *eyes open*
[06:34:06] sevenseacat: that's what reads the data-method and uses it to make delete requests
[06:34:15] sevenseacat: yes, jquery-rails should be in your Gemfile.
[06:34:16] Radar: it's included by default in application.js
[06:34:27] sevenseacat: and loaded in your application.js.
[06:34:31] xcesariox: sevenseacat = x , Radar = x + 6 so what is sevenseacat 's years of service in here?
[06:34:39] sevenseacat: xcesariox: I've been here since Jan 1 2011.
[06:34:44] tjbiddle: `//= require jquery_ujs` is in application.js and `gem 'jquery-rails', '~> 4.0.4'` is in my Gemfile
[06:34:47] Radar: xcesariox: I've been here since ~June 2007.
[06:34:51] tjbiddle: Sec, checking page source
[06:35:00] Radar: and application.js is included by default in application layout.
[06:35:17] xcesariox: Radar , sevenseacat are you both replying me via some scripts or you manually type that to me actually?
[06:35:23] sevenseacat: firebug (or your browser's equivalent) should help you quickly determine if that file is being loaded
[06:35:27] sevenseacat: xcesariox: typing manually.
[06:35:31] Radar: xcesariox: Who can even say what reality is?
[06:35:33] xcesariox: sevenseacat : lol , okay.
[06:35:39] tjbiddle: jquery_ujs is included in my page source (Although, of note: I'm not using application.html.erb; using a different layout - but looks like no issue as it's included)
[06:35:44] xcesariox: Radar : oh i can actually make a bot that says that here. HAHA
[06:35:51] xcesariox: Radar like !year
[06:35:59] crankharder: has joined #RubyOnRails
[06:36:03] Ropeney: are you looking at the request type in the browser?
[06:36:18] quazimodo: I need to monitor rpush to make sure it stays alive
[06:36:19] xcesariox: i think i have been here for about 2 years.
[06:36:21] quazimodo: but I have no idea how
[06:36:26] xcesariox: quazimodo YOYOYOYO!!
[06:36:29] Radar: Actually, earliest Rails version I can recall is 1.1.2, so that'd mean I've just gone past my 10 year Rails anniversary.
[06:36:37] xcesariox: quazimodo WHERE HAVE YOU BEEN ASSHOLE
[06:36:42] quazimodo: whatcha mean?
[06:36:47] tjbiddle: Ropeney: It ends up being a GET, as mentioned - but unsure why.
[06:36:53] xcesariox: Radar : checking me up huh
[06:37:01] Ropeney: tjbiddle, its meant to be a get, with headers
[06:37:05] tjbiddle: Radar: Railsaversary*
[06:37:16] Ropeney: tjbiddle, i don't think this is your issue for why its not routing
[06:37:25] xcesariox: Radar : why you have access to the bot
[06:37:40] bruno-: has joined #RubyOnRails
[06:37:42] Radar: xcesariox: Why not?
[06:38:01] xcesariox: Radar : you have access in this chan?
[06:38:11] jstransky: has joined #RubyOnRails
[06:38:11] tjbiddle: Ropeney: Request headers have no mention to delete
[06:38:17] tjbiddle: Just GET /users/sign_out
[06:38:35] egray: has joined #RubyOnRails
[06:38:39] Radar: tjbiddle: Please follow all lighted signs and crew member instructions.
[06:38:44] Radar: xcesariox: /msg chanserv access #rubyonrails list
[06:38:59] tjbiddle: Radar: Did I miss one?
[06:39:31] Radar: tjbiddle: You haven't answered our questions regarding 1) jquery-rails being in your gemfile 2) jquery + jquery_ujs being in application.js and 3) if application.js is included in your application layut.
[06:39:38] tetraktys: has joined #RubyOnRails
[06:39:45] tjbiddle: Radar - I've answered all of those actually
[06:39:50] roamingdog: has joined #RubyOnRails
[06:40:02] Radar: tjbiddle: Oh I missed that amongst xcesariox's stuff.
[06:40:22] ChanServ: +b *!*@gateway/web/irccloud.com/x-xewusjnxudblkqoh
[06:40:22] ChanServ: ChanServ kicked Arcaire: is banned from this channel
[06:40:37] smathy: I didn't see you confirm jquery only jquery_ujs.
[06:40:43] xcesariox: Radar : I feel honoured lol.
[06:40:52] tjbiddle: But short answer: Yes, yes, and yes (However using a different layout - but it looks to be in the page source)
[06:41:02] tjbiddle: smathy: True, so yes - also included
[06:41:05] sevenseacat: to be fair, i only asked about jquery_ujs, because having it without jquery would lead to js errors, which they said there are none
[06:41:28] jstransky: has joined #RubyOnRails
[06:41:51] sevenseacat: tjbiddle: have you embedded this link inside some invalid HTML, like another link?
[06:42:00] Radar: tjbiddle: No JS errors on the page?
[06:42:12] tagaulap: has joined #RubyOnRails
[06:42:46] moeabdol: has joined #RubyOnRails
[06:43:01] tjbiddle: sevenseacat: Ding. Probably it. It's in a header with some dropdown stuff. I remember I had some issue with my modal window links being broke here as well and had to do with JS now that I think about it
[06:43:17] tjbiddle: I'll investigate, thanks!
[06:43:23] AzaToth: has joined #RubyOnRails
[06:43:39] sevenseacat: let us know the results of the investigation :)
[06:44:06] egray: has joined #RubyOnRails
[06:44:38] tjbiddle: sevenseacat: If my laptop doesn't end up in the pool from frustration I will :)
[06:47:41] aurum_infide_: has joined #RubyOnRails
[06:49:04] Oog: has joined #RubyOnRails
[06:49:37] Oog: ActionView::Template::Error: A copy of ShiftWindow has been removed from the module tree but is still active!
[06:49:52] Oog: i used to only get this when changing files but im not changing anything and ive restarted the rake task and it is happening everytime........
[06:50:23] i4: hm, if I try to check digit or not... and this is not working <% if Float(code) %>
[06:50:35] i4: how can I check that code is digit or string?
[06:51:02] aganov: has joined #RubyOnRails
[06:52:11] sailing: has joined #RubyOnRails
[06:52:56] sailing: hi all, i'm new here.
[06:53:02] Radar: hi sailing
[06:53:15] sailing: wow, fast reply
[06:53:29] Radar: You'd think I'm a robot but really I'm just a guy with some quick fingers.
[06:54:24] sailing: just finish configuring my erc
[06:54:45] sailing: haven't use it for years
[06:54:48] sevenseacat: sailing: howdy
[06:55:07] sailing: hi sevenseacat
[06:55:23] idefine: has joined #RubyOnRails
[06:55:30] sailing: irc on emacs
[06:56:36] rohit: has joined #RubyOnRails
[06:57:09] sailing: is it polite to blatter here on none tech topic? :)
[06:58:06] sailing: or do you guys have some channels recommended? :)
[06:58:18] sailing: with great appriciation
[06:58:49] stannard: has joined #RubyOnRails
[07:00:00] Radar: sailing: Best to ask in #freenode about that. They'll give better referrals than we can.
[07:00:14] baweaver: has joined #RubyOnRails
[07:00:39] sailing: thanks quick fingers man :). i'll try
[07:04:56] Macaveli: has joined #RubyOnRails
[07:05:59] woo: has joined #RubyOnRails
[07:07:01] aiguu: has joined #RubyOnRails
[07:08:27] sailing: has joined #RubyOnRails
[07:10:54] sailing: has joined #RubyOnRails
[07:11:41] idefine: has joined #RubyOnRails
[07:13:43] aiguu: has joined #RubyOnRails
[07:16:39] moeabdol: has joined #RubyOnRails
[07:18:28] brt: has joined #RubyOnRails
[07:22:30] helpa: has joined #RubyOnRails
[07:23:50] ekem: has joined #RubyOnRails
[07:24:08] sailing`: has joined #RubyOnRails
[07:24:35] srinidhi: has joined #RubyOnRails
[07:24:55] havenwood: has joined #RubyOnRails
[07:24:55] havenwood: has joined #RubyOnRails
[07:25:06] sp1rs: has joined #RubyOnRails
[07:25:21] Palsson: has joined #RubyOnRails
[07:25:55] pipework: has joined #RubyOnRails
[07:26:01] Voxxit: has joined #RubyOnRails
[07:26:47] Thai_: has joined #RubyOnRails
[07:28:07] rafaelfranca: has joined #RubyOnRails
[07:28:14] matt_d: has joined #RubyOnRails
[07:28:24] mbreedlove: has joined #RubyOnRails
[07:28:42] edwinvdgraaf: has joined #RubyOnRails
[07:28:47] Cervajz: has joined #RubyOnRails
[07:29:42] brainslug: has joined #RubyOnRails
[07:29:45] pLaToOn: has joined #RubyOnRails
[07:29:57] i4: offtopic... can't rememeber music group with two singers man and woman... and they are sing the song la la la to correct you... la la la la revolution (or generation) love... and women is sexually sigh between the words... maybe somebody remember... the name of the group is something like Machine Imagine or something else
[07:30:51] i4: can't remember
[07:30:56] Cervajz_: has joined #RubyOnRails
[07:31:06] tildes: looking for "present?" like matcher for rspec, or any other way to make this prettier
[07:31:10] tildes: expect(announcement.announcement_type_id).to_not eql(nil)
[07:31:30] tbuehlmann: `.to be_present` will work
[07:31:39] tbuehlmann: this will work for all ?-methods
[07:32:11] sevenseacat: thats what I'd do
[07:32:14] egray: has joined #RubyOnRails
[07:32:23] tildes: tbuehlmann: Thanks, will do! I remember reading about it, but sometimes these things don't stick at first sight.
[07:34:10] pawnbox: has joined #RubyOnRails
[07:36:13] i4: and music in this song like the beginning in Rammstein - Frei Heit
[07:36:27] i4: first 20 secs
[07:36:34] antgel: has joined #RubyOnRails
[07:36:51] ur5us: has joined #RubyOnRails
[07:37:59] Pumukel: has joined #RubyOnRails
[07:38:15] dionysus69: has joined #RubyOnRails
[07:38:45] bruno-: has joined #RubyOnRails
[07:39:10] aiguu: has joined #RubyOnRails
[07:39:17] petor: has joined #RubyOnRails
[07:40:08] mark_66: has joined #RubyOnRails
[07:42:05] arup_r: has joined #RubyOnRails
[07:42:26] mikecmpbll: has joined #RubyOnRails
[07:42:42] rafaelfranca: has joined #RubyOnRails
[07:43:10] idefine: has joined #RubyOnRails
[07:43:11] baweaver: has joined #RubyOnRails
[07:43:15] Ergo: has joined #RubyOnRails
[07:43:49] tildes: i4: code.is_a? String, code.is_a? Numeric
[07:44:04] i4: thanks)
[07:45:37] i4: i do like this <% if !code.match(/\A\d+\Z/) %>
[07:48:44] roamingdog: has joined #RubyOnRails
[07:49:03] mbreedlo_: has joined #RubyOnRails
[07:49:44] tildes: i4: if code is always a string, regexp makes more sense
[07:50:06] RegulationD: has joined #RubyOnRails
[07:50:59] drzel: has joined #RubyOnRails
[07:53:17] tildes: what might be nice channels for a javascript beginner / advanced beginner?
[07:53:35] baweaver: ##javascript
[07:54:06] baweaver: though you might just want to read through: Javascript the Good Parts, Functional Javascript, Effective Javascript, and The Javascript Ninja
[07:54:17] baweaver: most of those are ranging mid to advanced
[07:54:27] sevenseacat: JavaScript the Good Parts is a quick read, it wont take long :P
[07:54:33] baweaver: You Don't Know JS is a git repo with a bunch of advanced topics.
[07:54:49] baweaver: Also consider reading into ES6
[07:55:07] baweaver: (Ecmascript 6, and look up why it's called that for bonus points)
[07:55:27] mbreedlove: has joined #RubyOnRails
[07:57:24] tildes: baweaver: thanks, that's several resources I hadn't heard about. I have read good parts, eloquent javascript, and I have JS ninja collecting dust on my bookshelf
[07:58:57] idefine: has joined #RubyOnRails
[08:01:20] snowy: has joined #RubyOnRails
[08:01:21] baweaver: Eloquent is a fairly good intro
[08:01:43] baweaver: Functional Javascript helps you wrap your head around patterns that aren't OO based
[08:02:08] tildes: baweaver: it certainly helped me to get something working, and also to decipher the very concisely written good parts
[08:02:30] baweaver: some people just pack more into fewer words
[08:02:32] tildes: yup, seems interesting based on the reviews
[08:02:49] baweaver: That, and look up anything Raganwald touches
[08:03:01] baweaver: Javascript Allonge for one, mostly ebooks
[08:03:17] baweaver: https://leanpub.com/u/raganwald
[08:03:21] baweaver: he has a few Ruby ones too
[08:04:04] baweaver: http://raganwald.com/ - and most of his blog posts are amazing reads as well.
[08:05:22] tildes: baweaver: hadn't heard about him, thanks for the tip
[08:05:28] konsolebox: has joined #RubyOnRails
[08:06:32] tildes: apparently he really loves a good espresso :D
[08:06:44] GriffinHeart: has joined #RubyOnRails
[08:09:30] jsrn: has joined #RubyOnRails
[08:09:33] mikecmpbll: has joined #RubyOnRails
[08:13:16] darutoko: has joined #RubyOnRails
[08:16:19] thejamespinto_: has joined #RubyOnRails
[08:17:31] Olipro_: has joined #RubyOnRails
[08:21:14] yardenbar: has joined #RubyOnRails
[08:23:35] bronson: has joined #RubyOnRails
[08:25:00] woo: has joined #RubyOnRails
[08:25:56] roamingdog: has joined #RubyOnRails
[08:27:12] tetraktys: has joined #RubyOnRails
[08:27:48] sailing: has joined #RubyOnRails
[08:27:50] matthias_: has joined #RubyOnRails
[08:29:20] jsrn: has joined #RubyOnRails
[08:29:28] n008f4g_: has joined #RubyOnRails
[08:30:30] beilabs: has joined #RubyOnRails
[08:30:34] idefine: has joined #RubyOnRails
[08:30:43] siaW: i wrote this model, i’d like someone with more experience to tell me if it’s OK. what’s bad and what i can change. https://github.com/siaw23/devsnap/blob/master/app/models/developer.rb
[08:30:45] siaW: i’d be grateful
[08:31:10] rvanlieshout: the indent is off
[08:32:50] tildes: siaw: too long lines, unnecessary reference to self, things that rubocop could tell you as well
[08:32:52] rvanlieshout: 2) consider using a service-object for getting the actual image (cause it relies on the outside world)
[08:33:11] rvanlieshout: 3) don't include a full message name, use a key and translate that (error on uniqueness)
[08:33:13] Guest87001: has joined #RubyOnRails
[08:33:18] rvanlieshout: and 4) indent
[08:33:19] tildes: siaw: also maybe put the url somewhere more visible in the class, it is a constant after all sort of
[08:33:29] rvanlieshout: cause that's really important
[08:34:00] rvanlieshout: and indeed rubocop it :)
[08:34:35] sevenseacat: i dont know the point of having a public get_svg_image method because whatever you call it with will be overridden on save anyway
[08:34:47] Guest87001: Can anyone explain to me why I can do rails c then ExecJS.runtime and I see @command=["nodejs", "node"] and I can execute javascript. But for the LIFE of me I cannot get sprockets to see it.
[08:34:53] sevenseacat: get_svg_image isnt a really great name anyway
[08:35:38] sevenseacat: there's zero validation on what you can pass to get_svg_image, also
[08:35:41] Guest87001: RAILS_ENV=production rake assets:precompile --trace shows me Sprockets::FileNotFound: couldn't find file 'nodejs' with type 'application/javascript'
[08:35:51] tildes: I wholly agree with service-object idea, will make for a clearer test suite too
[08:36:55] siaW: i knew it! there’s a lot i’m doing wrong :)
[08:37:08] siaW: thanks for the input, i’ll rewrite it and ask for help again :D
[08:37:22] siaW: sevenseacat: btw, how would you name that? :p
[08:37:42] sevenseacat: did you write tests for this code?
[08:37:49] sevenseacat: try doing that first.
[08:38:32] siaW: test for the model i haven’t written. but i will now
[08:39:06] Spami: has joined #RubyOnRails
[08:39:25] tildes: siaw: I have been working to get into writing tests first, and I think upcase.com has been a very helpful resource in that
[08:39:34] bollullera: has joined #RubyOnRails
[08:39:39] tildes: it can totally be done, and it will make for a smoother flow in all ways
[08:39:46] zpe: has joined #RubyOnRails
[08:39:48] bruno-: has joined #RubyOnRails
[08:40:18] workmad3: has joined #RubyOnRails
[08:40:22] siaW: tildes: i know. i didn’t start learning to write programs by writing tests first, and it’s a habit i’m fighting to get rid of
[08:40:27] sevenseacat: something inside me rankles at the 'heres my code, review it for me' mentality
[08:41:10] njero: has joined #RubyOnRails
[08:42:48] sevenseacat: like... if you're working on a project with other people, or an open source project, or hopefully in some kind of mentorship project, that's their job
[08:43:31] tildes: sevenseacat: not all people have access to anybody who would lend a moment to give constructive feedback IRL
[08:43:51] tildes: of course one should seek for such people. but the thing can be, that there is no access
[08:43:55] tildes: for the time being
[08:44:05] sevenseacat: tildes: this is an open-source project, being worked on in collaboration with other people.
[08:44:09] sevenseacat: those people are there.
[08:44:48] tvw: has joined #RubyOnRails
[08:46:57] tens0r: has joined #RubyOnRails
[08:49:50] skislak: has joined #RubyOnRails
[08:50:02] jenrzzz: has joined #RubyOnRails
[08:50:02] jenrzzz: has joined #RubyOnRails
[08:50:57] sevenseacat: that may have come across as slightly harsh, but that's my opinion.
[08:52:07] Vircung: has joined #RubyOnRails
[08:52:31] Olipro_: has joined #RubyOnRails
[08:53:49] siaW: sevenseacat: it’s ok :) i understand you
[08:54:54] siaW: and of course i accept your opinion…
[08:55:14] siaW: if someone will help me on here, then why not?
[08:56:00] siaW: i appreciate this channel a lot really, thanks to people like you and tildes, and context, and smath and all
[08:56:04] tildes: personally I'm simply happy for the rare moments where I might be able to help someone, not the least because I have been helped so many times before
[08:56:50] siaW: tildes: exactly. and that’s good. someday if i become as experienced as you or sevenseacat, i’d LOVE to give back and help too
[08:57:43] tildes: siaw: there's an ocean and a mountain of distance between me and sevenseacat, to her advantage
[08:57:57] tildes: and sevenseacat's contribution really is huge
[08:58:13] siaW: yeap i know about that :)
[08:58:51] moei: has joined #RubyOnRails
[08:59:55] siaW: but thanks :P
[09:00:09] siaW: for me, if i find something difficult i’ll always come here :D :D
[09:00:57] siaW: sometimes i feel i “annoy” sevenseacat. in such cases it’s the devil in me working
[09:01:41] quazimodo: has joined #RubyOnRails
[09:01:42] quazimod1: has joined #RubyOnRails
[09:02:10] idefine: has joined #RubyOnRails
[09:04:11] pawnbox: has joined #RubyOnRails
[09:06:43] aiguu: has joined #RubyOnRails
[09:08:18] FooMunki: has joined #RubyOnRails
[09:08:47] BaNzounet: Can't we use multiple times `= render layout: 'popups/layout' do ` I've two popup in a page doing that, but the output is a mixed between the two :/ Isn't this the way to do such things?
[09:09:41] FooMunki: has joined #RubyOnRails
[09:10:11] blackhuey: has joined #RubyOnRails
[09:10:17] artto: has joined #RubyOnRails
[09:19:54] chagel: has joined #RubyOnRails
[09:22:03] rohit: has joined #RubyOnRails
[09:23:36] sp1rs: has joined #RubyOnRails
[09:24:59] doublemalt_: has joined #RubyOnRails
[09:25:45] quazimodo: has joined #RubyOnRails
[09:25:46] quazimod1: has joined #RubyOnRails
[09:27:54] shilon: has joined #RubyOnRails
[09:29:10] Megamos: has joined #RubyOnRails
[09:32:15] idefine: has joined #RubyOnRails
[09:32:16] BaNzounet: is that understanable what I'm trying to explain?
[09:32:54] patrick_star_2: has joined #RubyOnRails
[09:34:12] moeabdol: has joined #RubyOnRails
[09:34:40] BaNzounet: understandable*
[09:40:29] bruno-: has joined #RubyOnRails
[09:41:28] myntcake: has joined #RubyOnRails
[09:42:19] baweaver: has joined #RubyOnRails
[09:45:33] quazimodo: has joined #RubyOnRails
[09:45:35] quazimod1: has joined #RubyOnRails
[09:47:21] jstransky: has joined #RubyOnRails
[09:47:54] htmldrum: has joined #RubyOnRails
[09:48:34] pawnbox: has joined #RubyOnRails
[09:50:44] njero: has joined #RubyOnRails
[09:50:52] RegulationD: has joined #RubyOnRails
[09:52:57] artto: has joined #RubyOnRails
[09:53:13] willwright: has joined #RubyOnRails
[09:54:21] willwright: has left #RubyOnRails: ()
[09:55:08] Weavel: has joined #RubyOnRails
[09:55:13] GriffinHeart: has joined #RubyOnRails
[09:57:55] srinidhi: has joined #RubyOnRails
[09:59:42] pawnbox: has joined #RubyOnRails
[10:01:14] petor: has joined #RubyOnRails
[10:02:41] beilabs: has joined #RubyOnRails
[10:04:18] idefine: has joined #RubyOnRails
[10:04:53] beilabs_: has joined #RubyOnRails
[10:07:26] aiguu: has joined #RubyOnRails
[10:07:32] beilabs__: has joined #RubyOnRails
[10:08:43] quazimodo: has joined #RubyOnRails
[10:08:46] quazimod1: has joined #RubyOnRails
[10:12:36] srinidhi: has joined #RubyOnRails
[10:12:52] sasasekaric: has joined #RubyOnRails
[10:14:52] tvw: has joined #RubyOnRails
[10:15:27] shibly: has joined #RubyOnRails
[10:15:51] shibly: has left #RubyOnRails: ("Leaving")
[10:15:59] smoitra: has joined #RubyOnRails
[10:17:05] beilabs: has joined #RubyOnRails
[10:18:34] dgncn: has joined #RubyOnRails
[10:19:02] TvL2386: has joined #RubyOnRails
[10:19:28] beilabs: has joined #RubyOnRails
[10:20:05] idefine: has joined #RubyOnRails
[10:20:06] aiguu: has joined #RubyOnRails
[10:20:18] marr: has joined #RubyOnRails
[10:22:27] sailing`: has joined #RubyOnRails
[10:22:27] sailing: has joined #RubyOnRails
[10:22:39] c355E3B: has joined #RubyOnRails
[10:22:48] ur5us: has joined #RubyOnRails
[10:23:00] tribals: has joined #RubyOnRails
[10:23:24] siaW: when a user visits my app, i can safely put a method in my index method (if index is my root_path) to check this. what if i want to know when a user left my app. how would i be able to do this?
[10:25:31] tribals: in what order to call finder methods like `joins`, `where`, etc?
[10:25:57] tribals: does order has any meaning?
[10:26:01] workmad3: tribals: any order you want, as long as it's before a call that executes the query
[10:26:32] workmad3: tribals: it can have some meaning for final order in the query, but that's only if you call the same method multiple times
[10:26:57] tribals: workmad3: thanks
[10:29:18] beilabs_: has joined #RubyOnRails
[10:29:54] beilabs: has joined #RubyOnRails
[10:31:32] |RicharD|: has joined #RubyOnRails
[10:31:50] aiguu: has joined #RubyOnRails
[10:31:52] |RicharD|: I'm having a problem doing a simple task with a old rails 3 shop
[10:32:06] konsolebox: has joined #RubyOnRails
[10:32:13] |RicharD|: https://gist.github.com/anonymous/a03616be2b9b91c7b43dcb76513f067a
[10:32:15] njero: !problematic disaster!
[10:32:19] |RicharD|: it goes in timeout and give me Killed
[10:41:23] diegoaguilar: has joined #RubyOnRails
[10:41:30] bruno-: has joined #RubyOnRails
[10:42:48] chagel: has joined #RubyOnRails
[10:44:46] prgmmr: has joined #RubyOnRails
[10:45:15] artto: has joined #RubyOnRails
[10:45:17] diegoaguilar: has joined #RubyOnRails
[10:45:47] tens0r: has joined #RubyOnRails
[10:47:17] brt: has joined #RubyOnRails
[10:48:30] tbuehlmann: |RicharD|: have a stacktrace?
[10:48:40] |RicharD|: no, btw I guess is OOM
[10:48:44] |RicharD|: now I'm doing a test
[10:49:31] arBmind: has joined #RubyOnRails
[10:51:39] idefine: has joined #RubyOnRails
[10:52:19] tetraktys: has joined #RubyOnRails
[10:53:14] emachnic: has joined #RubyOnRails
[10:58:07] syndikate: has joined #RubyOnRails
[10:58:43] n008f4g_: has joined #RubyOnRails
[11:01:16] artto: has joined #RubyOnRails
[11:03:15] artto: has joined #RubyOnRails
[11:03:25] rodfersou: has joined #RubyOnRails
[11:10:10] AimlessRAven: has joined #RubyOnRails
[11:10:13] AimlessRAven: = f.select :resource, options_from_collection_for_select(Sellor::Category.all, :id, :name), :include_blank => true, input_html: {class: 'select2'}
[11:10:16] Chagel_: has joined #RubyOnRails
[11:10:24] AimlessRAven: i wanna add here and Sellor::Tags.all, but arguments go too many
[11:10:33] AimlessRAven: how to include Sellor::Tag.all here
[11:12:48] norc: has joined #RubyOnRails
[11:14:00] GodFather: has joined #RubyOnRails
[11:15:56] chagel: has joined #RubyOnRails
[11:17:47] rvanlieshout: that's some nasty copy paste done there
[11:17:59] rvanlieshout: combinding 1.8 and 1.9+ hash style
[11:18:17] Ergo^: has joined #RubyOnRails
[11:18:24] arBmind: has joined #RubyOnRails
[11:19:02] ishamo: has joined #RubyOnRails
[11:19:17] sajinmp: has joined #RubyOnRails
[11:19:27] artto: has joined #RubyOnRails
[11:19:47] petor: has joined #RubyOnRails
[11:20:59] workmad3: |RicharD|: try using `.find_each` instead of `.all.each`
[11:21:08] |RicharD|: ah why this ?
[11:21:11] |RicharD|: (just curious)
[11:21:22] workmad3: `find_each` doesn't load the entire collection into memory at once
[11:22:06] workmad3: so if you're suspecting OOM errors, or dealing with large tables, you should generally consider `find_each`
[11:22:48] workmad3: http://apidock.com/rails/v3.0.0/ActiveRecord/Batches/find_each
[11:23:16] sailing`: has joined #RubyOnRails
[11:23:16] sailing: has joined #RubyOnRails
[11:23:28] idefine: has joined #RubyOnRails
[11:23:35] ldnunes: has joined #RubyOnRails
[11:28:35] renegadeandy: has joined #RubyOnRails
[11:28:50] siaW: has left #RubyOnRails: ()
[11:30:30] marienz: has joined #RubyOnRails
[11:30:56] ferr: has joined #RubyOnRails
[11:32:33] aiguu: has joined #RubyOnRails
[11:32:58] shilon: has joined #RubyOnRails
[11:33:51] moeabdol: has joined #RubyOnRails
[11:34:34] sp1rs: has joined #RubyOnRails
[11:37:27] Ropeney: has joined #RubyOnRails
[11:41:45] bruno-: has joined #RubyOnRails
[11:42:59] Ergo^: has joined #RubyOnRails
[11:43:28] baweaver: has joined #RubyOnRails
[11:43:46] crameth: has joined #RubyOnRails
[11:46:09] idefine: has joined #RubyOnRails
[11:49:18] matthias_: has joined #RubyOnRails
[11:51:02] artto_: has joined #RubyOnRails
[11:51:05] idefine: has joined #RubyOnRails
[11:51:43] idefine: has joined #RubyOnRails
[11:54:58] egray: has joined #RubyOnRails
[11:55:42] smoitra: has joined #RubyOnRails
[11:59:09] rrawlins: has joined #RubyOnRails
[12:03:16] rafaelfr_: has joined #RubyOnRails
[12:03:20] maxdoubt: has joined #RubyOnRails
[12:05:19] King_Rex: has joined #RubyOnRails
[12:06:32] PedramT: has joined #RubyOnRails
[12:06:33] renegadeandy: If i have //= require private_pub this in my application.js but i want to move it into application.html.erb so i can put a condition around it - not to load it in the test environment, how do I do that?
[12:07:16] PedramT: has joined #RubyOnRails
[12:07:50] maxdoubt: has joined #RubyOnRails
[12:08:37] arpegius: has joined #RubyOnRails
[12:10:54] artto: has joined #RubyOnRails
[12:11:36] renegadeandy: can anybody help me to workout what the javascript_include_tag equivalent of that is
[12:12:44] norc: renegadeandy: Have another asset with that sprockets directive, and then just javascript_include_tag unless Rails.env.testing?
[12:12:50] idefine: has joined #RubyOnRails
[12:12:59] norc: renegadeandy: I mean it sounds silly because your test suite should be able to handle it.
[12:13:52] renegadeandy: when you say have another asset with that sprockets directive…you mean add another js file into assets/javascripts with simply //= require private_pub inside of it, then load that using javascript_include_tag and a condition?
[12:14:03] norc: renegadeandy: Yup.
[12:14:08] renegadeandy: norc: sweet trying it now
[12:15:18] agit0: has joined #RubyOnRails
[12:16:41] RahulT: has joined #RubyOnRails
[12:16:47] maxdoubt: has joined #RubyOnRails
[12:16:56] JakFrist: has joined #RubyOnRails
[12:18:26] chipotle: has joined #RubyOnRails
[12:19:01] renegadeandy: norc: so i have this in my application.html.erb : <%= javascript_include_tag "private_pub" unless Rails.env.testing? %> and I have this inside my private_pub.js file : //= require private_pub but the private_pub js fails to load…it jiust doesnt load at all. Any ideas?
[12:19:09] mrgreenfur: has joined #RubyOnRails
[12:20:41] RahulT: has joined #RubyOnRails
[12:21:09] norc: renegadeandy: Im thinking that the sprockets directive should not even be necessary.
[12:21:26] norc: Either way. "doesnt load at all" is a rather undescriptive error description.
[12:21:31] renegadeandy: norc: so......
[12:21:39] renegadeandy: well that code results in the following html
[12:21:43] RahulT: has joined #RubyOnRails
[12:21:55] norc: renegadeandy: Network log from your browser and your server log in a gist would be nice.
[12:22:01] renegadeandy: <script src="/assets/private_pub.js?body=1"></script>
[12:22:12] renegadeandy: which is not loading my javascript from the require
[12:22:38] renegadeandy: im still getting edit:490 Uncaught ReferenceError: PrivatePub is not defined
[12:22:47] renegadeandy: which is because the require private_pub is failing
[12:23:56] sailing: has joined #RubyOnRails
[12:24:01] sailing`: has joined #RubyOnRails
[12:24:07] renegadeandy: its cos i called my second sprockets file private_pub.js, when i called it pp.js it worked...
[12:24:22] GodFather: has joined #RubyOnRails
[12:24:45] tvw: has joined #RubyOnRails
[12:24:48] sp1rs: has joined #RubyOnRails
[12:25:20] norc: renegadeandy: If the asset is in your assets/javascript you can use javascript_include_tag on it directly without any sprockets.
[12:25:32] norc: Well. Sprockets is still involved. But you do not need the //= directive.
[12:25:35] renegadeandy: the assets isnt that
[12:25:39] renegadeandy: the asset is in a gem somewhere
[12:26:16] rohit: has joined #RubyOnRails
[12:26:48] norc: renegadeandy: Why do you want to exclude the asset from your tests?
[12:26:53] bronson: has joined #RubyOnRails
[12:27:45] renegadeandy: because the gem pulls in another js file from another server, and the chat server is not online for the test environment, so it hangs up capybara
[12:27:53] norc: renegadeandy: Then you need to mock these things out.
[12:27:56] renegadeandy: as its getting a connection refused
[12:27:58] norc: Do not exclude entire javascript assets.
[12:28:12] renegadeandy: how would i mock that out?
[12:28:44] norc: renegadeandy: Explain how and when that js file is loaded.
[12:29:07] idefine: has joined #RubyOnRails
[12:29:21] norc: renegadeandy: By excluding entire JS libraries you are opening yourself up for quite useless tests, because without all JS libraries events might propragate differently, the DOM might be different...
[12:30:10] renegadeandy: It is loaded in application.js at the top of application.html.erb
[12:30:22] renegadeandy: there is a sprockets directive in there which references the js from a gem
[12:30:31] renegadeandy: this then loads 2 js files
[12:30:43] renegadeandy: one in the gem, and using a configuration file - looks for another js file on another server
[12:31:00] norc: renegadeandy: Maybe I should have asked first: Are you using capybara-webkit or something similar?
[12:33:39] aiguu: has joined #RubyOnRails
[12:33:45] moeabdol: has joined #RubyOnRails
[12:34:19] drptbl_: has joined #RubyOnRails
[12:35:19] norc: renegadeandy: Can you gist some snippet so I can see what you mean by "looks for another js file on another server"
[12:35:28] norc: Because right now I have no clue what language or kind of mechanism you are talking about.
[12:36:23] drptbl: has joined #RubyOnRails
[12:37:03] roamingdog: has joined #RubyOnRails
[12:38:56] sp1rs: has joined #RubyOnRails
[12:40:25] beauby: has joined #RubyOnRails
[12:41:22] maxdoubt: has joined #RubyOnRails
[12:43:12] szulak: has joined #RubyOnRails
[12:43:32] dlt_: has joined #RubyOnRails
[12:43:41] Detch: has joined #RubyOnRails
[12:44:36] hxegon: has joined #RubyOnRails
[12:45:12] mrgreenfur: has joined #RubyOnRails
[12:46:26] moeabdol: has joined #RubyOnRails
[12:49:09] aiguu: has joined #RubyOnRails
[12:49:38] shanson: has joined #RubyOnRails
[12:50:48] SeanLazer: has joined #RubyOnRails
[12:51:30] Cervajz: has joined #RubyOnRails
[12:51:43] hello9: has joined #RubyOnRails
[12:53:21] Cervajz_: has joined #RubyOnRails
[12:54:34] hello9: hey, I have a database that was generated from a SQL dump from a database that is a current Rails ENV. When I connect to the new database, Rails in the console can't find any of the tables (though they are there). Do I need to rerun the migrations for it to be recognized? thanks
[12:55:59] norc: hello9: Double check that the environment you are running your console from is the same as the one containing your database in your config/database.yml
[12:57:32] norc: hello9: The only reason rails cannot find the tables is if they are not there, which means your rails application is probably connected to a different database than where you loaded your dump into.
[12:58:08] ramortegui: has joined #RubyOnRails
[12:58:25] norc: Or rather your rails console is running in the "wrong" environment.
[12:58:38] hello9: @norc thanks will try and check it out now
[12:59:29] flashpoint9: has joined #RubyOnRails
[12:59:53] norc: hello9: ActiveRecord::Base.connection_config
[13:00:26] idefine: has joined #RubyOnRails
[13:00:38] mrgreenfur: has joined #RubyOnRails
[13:00:45] petor: has joined #RubyOnRails
[13:02:37] macsteps: has joined #RubyOnRails
[13:03:30] jhack: has joined #RubyOnRails
[13:03:39] sp1rs: has joined #RubyOnRails
[13:04:07] silvertail: has joined #RubyOnRails
[13:04:27] Ergo: has joined #RubyOnRails
[13:04:34] moeabdol: has joined #RubyOnRails
[13:04:51] AlexJakeGreen: has joined #RubyOnRails
[13:05:00] arup_r: has joined #RubyOnRails
[13:08:31] silvertail: has joined #RubyOnRails
[13:11:07] silvertail: good morning all!
[13:14:53] eljimmy: has joined #RubyOnRails
[13:16:04] codelahoma: has joined #RubyOnRails
[13:18:00] drbayer: has joined #RubyOnRails
[13:18:06] pokEarl: has joined #RubyOnRails
[13:18:45] tetraktys: has joined #RubyOnRails
[13:19:08] spastorino: has joined #RubyOnRails
[13:20:25] joshkovach: has joined #RubyOnRails
[13:21:15] g3funk: has joined #RubyOnRails
[13:21:17] chipotle: has joined #RubyOnRails
[13:22:45] yellow5: has joined #RubyOnRails
[13:24:46] sailing`: has joined #RubyOnRails
[13:24:46] sailing: has joined #RubyOnRails
[13:25:15] artto: has joined #RubyOnRails
[13:28:21] bruno-: has joined #RubyOnRails
[13:28:29] bronson: has joined #RubyOnRails
[13:28:41] idefine: has joined #RubyOnRails
[13:29:19] sp1rs: has joined #RubyOnRails
[13:30:39] hxegon: has joined #RubyOnRails
[13:31:41] akshat: has joined #RubyOnRails
[13:33:07] jobewan: has joined #RubyOnRails
[13:33:33] DragonPunch: has joined #RubyOnRails
[13:35:19] artto: has joined #RubyOnRails
[13:37:50] petor: has joined #RubyOnRails
[13:39:07] drbayer: has joined #RubyOnRails
[13:39:25] aegis3121: has joined #RubyOnRails
[13:39:34] akshat_: has joined #RubyOnRails
[13:39:49] artto: has joined #RubyOnRails
[13:41:16] beilabs: has joined #RubyOnRails
[13:41:36] renegadeandy: has joined #RubyOnRails
[13:42:06] PedramT: has joined #RubyOnRails
[13:43:00] gheegh: has joined #RubyOnRails
[13:43:39] Megamos: has joined #RubyOnRails
[13:44:14] PedramT: has joined #RubyOnRails
[13:46:05] crameth: has joined #RubyOnRails
[13:47:12] King_Rex: has joined #RubyOnRails
[13:47:31] solars: hi, I've got a database default for a certain field, however, for certain objects I need to override this default so I created an after_initialize method that sets it to a different value if it's nil - the problem is that due to the default it doesn't seem to be nil already at that time but set to the db default - how can I avoid this?
[13:47:41] shibly: has joined #RubyOnRails
[13:48:13] shibly: has left #RubyOnRails: ("Leaving")
[13:48:22] shibly: has joined #RubyOnRails
[13:48:26] shibly: has left #RubyOnRails: ("Leaving")
[13:48:46] cpruitt: has joined #RubyOnRails
[13:48:46] Macaveli: has joined #RubyOnRails
[13:49:41] brt: has joined #RubyOnRails
[13:49:48] sajinmp: has joined #RubyOnRails
[13:49:55] aiguu: has joined #RubyOnRails
[13:50:02] context: solars: you understand the meaning of "default" right
[13:50:12] context: if you dont want a default, then dont set a default.
[13:50:52] agent_white: has joined #RubyOnRails
[13:51:03] blackmesa: has joined #RubyOnRails
[13:51:27] hxegon: has joined #RubyOnRails
[13:51:42] solars: context, default does not mean it is restricted to one value
[13:51:56] context: it never said it was restricted
[13:52:03] context: you just said you dont want it to default to the default though
[13:52:26] pawnbox: has joined #RubyOnRails
[13:52:28] solars: I did not, i said I want to use a different value as default, which means if not set
[13:52:32] context: your words: "the problem is that due to the default it doesn't seem to be nil"
[13:52:39] context: its not nil because its the default.
[13:52:52] solars: yes but at some point it is nil, before rails set it
[13:53:14] solars: which is already before after_initialize
[13:53:19] context: you TOLD it to set it, cause its the default.
[13:53:37] context: rails reads the default from the db when your app starts up
[13:53:40] solars: context, you know what callbacks are, right
[13:53:53] solars: but the default is set at some point in the chain
[13:53:56] context: and is setting it for you, cause thats what yo uwant, A DEFAULT
[13:53:59] solars: and this is what I want to intercept
[13:54:19] context: alright look
[13:54:24] solars: nevermind
[13:54:26] context: if your default is NOT what the default is suppose to me
[13:54:35] solars: you didn't get my question
[13:54:36] coalwater: has joined #RubyOnRails
[13:54:38] context: then remove the "not default default" from the database
[13:54:44] solars: yeah, nevermind
[13:54:45] Ropeney: has joined #RubyOnRails
[13:55:31] context: solars: look at what you are saying please.... you are upset the field is set to the default, cause you do not want the field to DEFAULT to that value.
[13:55:59] context: you created an isntance, the field DEFAULTS to that value
[13:56:12] solars: context, I disagree, because you didn't understand my question. callbacks are exactly made for intercepting the chain
[13:56:18] solars: but I don't want to discuss it
[13:56:20] context: if your DEFAULT needs to be dynamic, then dont set a default.
[13:56:32] chipotle: has joined #RubyOnRails
[13:57:49] context: solars: yeah, there is no before_initialize that i am aware of.
[13:58:14] coalwater: Is there a way I could create a plugin that overrides the default `counter_cache` module?, but not monkey patch it, like create a different provider of some sorts
[13:58:39] context: solars: your question didnt involve callbacks besides 'after_init didnt work' your question was 'how can i avoid this', to which you have the option of not using a default in the DB
[13:59:08] xcesariox: has joined #RubyOnRails
[13:59:20] solars: context, its okay
[14:00:28] idefine: has joined #RubyOnRails
[14:01:04] sp1rs: has joined #RubyOnRails
[14:01:45] stardiviner: has joined #RubyOnRails
[14:02:11] chagel: has joined #RubyOnRails
[14:02:16] sajinmp: has joined #RubyOnRails
[14:03:33] macsteps: has joined #RubyOnRails
[14:03:37] artto: has joined #RubyOnRails
[14:04:38] diegoviola: has joined #RubyOnRails
[14:05:01] DragonPunch: has joined #RubyOnRails
[14:05:59] quazimodo: has joined #RubyOnRails
[14:06:05] quazimod1: has joined #RubyOnRails
[14:06:29] macsteps: has joined #RubyOnRails
[14:06:36] s2013: has joined #RubyOnRails
[14:07:21] s2013: smathy do you remember the time you answered radars question on SO
[14:08:19] finnnnnnnnnnn: has joined #RubyOnRails
[14:08:58] maxdoubt: has joined #RubyOnRails
[14:11:17] finnnnnnnnnnn: I have a form, based on a model, which has a requriement for a variable number of fields. EXAMPLE - the form is for a Person, person has a name, age, gender and then can have multiple hobbies, so I’ll need to add an unknown number of hobbies to the person model. hobby1: reading, hobby2: dancing, hobby99: fishing. How do I model this?
[14:12:16] arup_r: s2013: o/ :)
[14:13:21] tbuehlmann: finnnnnnnnnnn: there's the entity–attribute–value model, but you could also just save the fields as JSON/hstore. depends on your needs
[14:14:54] blackmesa: has joined #RubyOnRails
[14:15:27] finnnnnnnnnnn: tbuehlmann: hstore looks useful http://nandovieira.com/using-postgresql-and-hstore-with-rails, thanks.
[14:16:12] artto: has joined #RubyOnRails
[14:16:26] idefine: has joined #RubyOnRails
[14:18:14] siaw_: has joined #RubyOnRails
[14:18:43] Jasaka: has joined #RubyOnRails
[14:19:42] shibly: has joined #RubyOnRails
[14:20:04] siaW: has joined #RubyOnRails
[14:20:34] shibly: Is it possible to do this in layout or view: <% @books.each do |book| %> <% book=book+1 %> ...?
[14:23:31] dopie: has joined #RubyOnRails
[14:25:20] mrgreenfur: has joined #RubyOnRails
[14:25:37] RegulationD: has joined #RubyOnRails
[14:25:56] tetraktys: has joined #RubyOnRails
[14:26:55] roamingdog: has joined #RubyOnRails
[14:26:56] sailing`: has joined #RubyOnRails
[14:26:56] sailing: has joined #RubyOnRails
[14:26:57] shibly: Is using rvm suggested/recommended here?
[14:27:13] sevenseacat: its certainly a viable option.
[14:27:17] smathy: has joined #RubyOnRails
[14:28:05] aiguu: has joined #RubyOnRails
[14:28:51] drbayer: has joined #RubyOnRails
[14:28:57] pablolm: has joined #RubyOnRails
[14:29:24] epochwolf: shibly: I use it.
[14:30:05] shibly: epochwolf, Did you face any problem?
[14:30:28] jhack: has joined #RubyOnRails
[14:30:33] artto: has joined #RubyOnRails
[14:30:42] epochwolf: shibly: not that I remember but I know how rvm works and can deal with any problems it might cause.
[14:32:13] idefine: has joined #RubyOnRails
[14:33:34] n008f4g_: has joined #RubyOnRails
[14:34:47] pablolm: Hello! I'm having trouble running a Rails app. I'm using rbenv. I downloaded the repo with the app, then bundle installed, and then when I run "rails -v" I get this: "Could not find activesupport-4.1.8 in any of the sources Run `bundle install` to install missing gems."
[14:35:14] finnnnnnnnnnn: has joined #RubyOnRails
[14:35:22] pablolm: anyone knows how to fix that?
[14:36:13] smathy: pablo__, `bundle exec rails -v`
[14:36:39] Yeomra: has joined #RubyOnRails
[14:36:48] pablolm: smathy, I get the same output
[14:37:07] sevenseacat: what did `bundle install` output?
[14:37:16] sevenseacat: can you gist it?
[14:37:23] smathy: pablo__, start from `bundle install` and copy-paste your whole terminal session into a gist ^ :)
[14:37:29] shibly: has left #RubyOnRails: ("Leaving")
[14:38:02] sevenseacat: smathy: good morning to you
[14:38:14] pablolm: yes, right away
[14:41:21] pablolm: Here's the bundle install output: https://gist.github.com/pablo-avalancha/e83b7cb82641a7d23146bb53cffa5a03
[14:43:15] soahccc: that is malicious right? We use cookies to save return URLs on login which could potentially overflow but it's not hitting the app stack, right? https://gist.github.com/2called-chaos/8c591f64467dadbf91a05f0a91f8f08b
[14:43:28] darkxploit: has joined #RubyOnRails
[14:43:37] sevenseacat: pablo__: yeah it finishes with an error, so you need to fix that
[14:43:54] sevenseacat: you're missing postgres development libraries
[14:44:10] sevenseacat: https://gist.github.com/pablo-avalancha/e83b7cb82641a7d23146bb53cffa5a03#file-gistfile1-txt-L89-L127
[14:44:30] sevenseacat: pablo__: what distro are you using?
[14:44:36] smathy: ...not to mention the last two lines.
[14:45:24] pablolm: sevenseacat, Ubuntu 15.10
[14:45:29] stannard: has joined #RubyOnRails
[14:45:32] xcesariox: has joined #RubyOnRails
[14:45:35] sevenseacat: then you'll need to install libpq-dev
[14:45:40] sevenseacat: and then try bundling again
[14:47:02] idefine: has joined #RubyOnRails
[14:47:51] pablolm: great, I'm doing that, will tell you if it works
[14:49:20] sevenseacat: it will fix that error. i can't guarantee there won't be others.
[14:49:56] petor: has joined #RubyOnRails
[14:52:34] tubbo: i think you *can* guarantee that there *will* be others, though...
[14:52:40] yellow5: has joined #RubyOnRails
[14:52:45] tubbo: given that's our job, solving an endless stream of problems ;)
[14:53:31] smathy: s/job/hobby/
[14:53:47] arup_r: I need one Newrelic advise. https://gist.github.com/aruprakshit/ebd005adbb02006fbf56dd6a89220849 .. I could paste here, but it is a huge text.
[14:53:55] i4: has joined #RubyOnRails
[14:54:01] smathy: ...well, my job is also solving endless streams of problems, but I don't think that's what you meant ;)
[14:54:23] sevenseacat: hah I was going to say that
[14:56:36] tubbo: well that is what i meant haha
[14:57:16] drbayer: has joined #RubyOnRails
[14:58:09] tubbo: arup_r: if i were to guess, i'd think newrelic is not saving data in case anything in those queries is sensitive. for example, how would you prevent newrelic from saving off full credit card details?
[14:58:29] arup_r: ^ yes same here I am thinking
[14:58:53] stannard: has joined #RubyOnRails
[14:58:53] xcesariox: has joined #RubyOnRails
[14:58:56] arup_r: But they could ignore only what we have ignore parameter list... rest data can be given..:/
[14:58:57] tubbo: new relic isn't that great at catching errors, but it's pretty good at catching performance problems.
[14:59:05] tubbo: errors meaning like, an exception or a bug.
[14:59:08] zave: has joined #RubyOnRails
[14:59:08] coalwate1: has joined #RubyOnRails
[14:59:12] arup_r: if the data was there, I can right away say the reason of the error
[14:59:20] arup_r: exceptions tubbo
[14:59:41] arup_r: 500 from same action reported by by newrelic 5 time since yesterday
[14:59:48] tubbo: arup_r: they *could*, but that's Yet Another Configuration Setting (TM) and forces people to configure it, otherwise they basically put newrelic in a place in which they can be sued.
[15:00:12] arup_r: ah, didn't know it TM .. Let me read there
[15:00:29] chagel: has joined #RubyOnRails
[15:00:38] arup_r: I could grep the production log .. but it so active log, not able to grep there.. many many lines and so active.
[15:00:45] tubbo: arup_r: that was a joke. what i mean is that newrelic didn't want to bother every developer on earth who uses it to configure things away, they just said "screw it we're not saving your data"
[15:01:15] tubbo: arup_r: if you just pasted the full contents of that query into the production.log, you'd be able to see the relevant data. you can then run that query in your db console and see what happens.
[15:01:17] pablolm: sevenseacat thank you very much, it work as a charm!
[15:01:40] tubbo: arup_r: because that query, with the '?' interpolation and all, is what will be outputted into the log by rails/active_record.
[15:01:43] arup_r: tubbo: you mean with grep right?
[15:02:14] arup_r: got you!..
[15:02:22] tubbo: arup_r: yeah. i actually prefer to use the program `less` because it has forward and backward search capabilities and doesn't flood your shell history. and you can use vim movement commands to navigate around the file
[15:02:38] tubbo: but cat log/production.log | grep "THE QUERY" will work too.
[15:02:47] Devalo: has joined #RubyOnRails
[15:02:49] arup_r: thanks tubbo.
[15:03:04] arup_r: I was first ensuring if NewRelic has the UI..
[15:03:08] smathy: cat | grep - what am I seeing?
[15:03:43] arup_r: another question .. Any too who does what NewRelic do, and also add data of query just asking.. :)
[15:03:50] aegis3121: has joined #RubyOnRails
[15:03:53] lancejordan: has joined #RubyOnRails
[15:04:20] sevenseacat: lancejordan: good evening
[15:04:47] shilon: has joined #RubyOnRails
[15:05:15] tubbo: https://www.youtube.com/watch?v=ISXiFJS9D5A
[15:05:58] lancejordan: is it appropriate to post a RoR job listing here?
[15:06:57] arup_r: no. I can take you some where.. if you want :)
[15:06:57] arup_r: lancejordan: ^
[15:06:58] arup_r: there is a official channel to post as many job as you want
[15:07:25] finnnnnnnnnnn: has joined #RubyOnRails
[15:07:42] OTORelic: has joined #RubyOnRails
[15:07:43] sevenseacat: there's no such "official" channel, to the best of my knowledge.
[15:07:58] sevenseacat: it would be inundated with garbage, if there was.
[15:08:09] arup_r: sevenseacat: I am talking about the Slack Rails channel :)
[15:08:23] sevenseacat: thats not in any way official.
[15:08:24] arup_r: they have a channel for jobs #work
[15:08:33] OTORelic: has joined #RubyOnRails
[15:08:45] arup_r: ahh.. yeah ... sorry wrong word I used ...
[15:09:21] arup_r: I didn't mean that official .. but anyway. Next question is coming from me soon!
[15:09:33] idefine: has joined #RubyOnRails
[15:11:06] webdestroya: has joined #RubyOnRails
[15:13:31] roamingdog: any idea what could be the culprit here? First I verify users table is empty, then I create one user, and get 'email already taken' error, gist: https://gist.github.com/anonymous/ebd72f6afc892c515468316de5f3e533
[15:14:45] sevenseacat: roamingdog: gist the full code and error
[15:15:02] sevenseacat: for example, what is `admin`?
[15:16:02] shilon: has joined #RubyOnRails
[15:19:32] roamingdog: sevenseacat: https://gist.github.com/anonymous/5cac9d4756aafe07773a2a1a3cba62cb
[15:19:43] roamingdog: admin is a boolean
[15:20:02] moeabdol: has joined #RubyOnRails
[15:20:02] arpegius: has joined #RubyOnRails
[15:20:39] roamingdog: oops forgot the error... 1 sec
[15:20:46] sevenseacat: the factory would be nice too
[15:21:32] tubbo: sevenseacat: this channel is in no way official.
[15:21:52] artto: has joined #RubyOnRails
[15:22:22] sevenseacat: tubbo: http://rubyonrails.org/community/ its listed there which gives it *some* credibility
[15:22:24] tubbo: if it *is* official i'm pretty sure we have to adhere to some code of conduct and then i can't just scream obscenities all day ;(
[15:23:35] Ropeney: tubbo, I do believe that does happen?
[15:23:54] tubbo: ropeney: exactly, and i intend to keep it that way ;)
[15:24:22] roamingdog: sevenseacat: https://gist.github.com/chrislerum/9df31409b2d5b1d5fa26b7bea1a3c6a2
[15:24:35] sevenseacat: http://rubyonrails.org/conduct/ IRC is not in the scope.
[15:24:40] bradleyprice: has joined #RubyOnRails
[15:24:45] tubbo: > Using welcoming and inclusive language
[15:24:47] tubbo: literally no op does this
[15:25:06] tubbo: i kid, i kid
[15:25:09] sevenseacat: roamingdog: ah hah, the error comes from a different line
[15:25:55] sevenseacat: roamingdog: it appears your sign_in method is colliding with the provided devise one
[15:26:32] sevenseacat: https://gist.github.com/chrislerum/9df31409b2d5b1d5fa26b7bea1a3c6a2#file-trace-L45-L46 that looks very wrong, that the sanitizer is calling your spec method
[15:26:45] sevenseacat: when trying to access a controller action
[15:27:38] roamingdog: huh. renaming to 'my_sign_in' just gives me undefined method `sign_in'
[15:27:41] sailing`: has joined #RubyOnRails
[15:27:41] sailing: has joined #RubyOnRails
[15:28:32] roamingdog: i changed the method name in spec_helper
[15:28:53] sevenseacat: yes, if the error has changed, you need to gist the new error.
[15:29:31] stannard: has joined #RubyOnRails
[15:29:59] roamingdog: https://gist.github.com/chrislerum/f312a42be58f4ff584be370877a22ae9 new error
[15:30:29] sevenseacat: you renamed the method in your spec_helper file, but not when you call it in your spec.
[15:30:44] sevenseacat: https://gist.github.com/chrislerum/f312a42be58f4ff584be370877a22ae9#file-error-after-change-method-name-L10-L11
[15:31:00] roamingdog: yes, as a sanity check. will change the call now...
[15:31:19] sevenseacat: i'm not sure what that was supposed to prove, but okay :)
[15:31:59] roamingdog: https://gist.github.com/chrislerum/398254c2ee5a2aea3d2f24fcf680d0cd
[15:32:34] kies: has joined #RubyOnRails
[15:32:51] sevenseacat: roamingdog: you've moved past the sign in failure. go forth and make the spec pass.
[15:34:10] roamingdog: with that, yes it's past my issue, thank you. i wish i understood better what was the cause - how does devise's sign_in method come into play?
[15:35:30] Ropeney: roamingdog, your going to have to do more then that to sign in though, I believe.
[15:35:55] sp1rs: has joined #RubyOnRails
[15:36:11] sevenseacat: roamingdog: you're calling a controller action that requires authentication. it's redirecting to the devise sessions page, which attempts to sign in a user based on existing data, it seems
[15:36:13] roamingdog: ropeney: ah yes, there's to be further steps to visit page, fill in fields and log in
[15:36:40] sevenseacat: this part of the backtrace covers it - https://gist.github.com/chrislerum/9df31409b2d5b1d5fa26b7bea1a3c6a2#file-trace-L45-L48
[15:36:44] Ropeney: so your going to put that in your sign_in method?
[15:37:19] roamingdog: ropeney: yes, it's there commented out now actually
[15:37:25] roamingdog: ropeney: why, bad idea?
[15:37:46] Ropeney: roamingdog, nope just checking you knew :) couldn't see your comments
[15:37:57] roamingdog: ropeney: thanks
[15:38:37] Ropeney: I did think devise had all this built into it though, as helper methods
[15:38:49] sevenseacat: it does. you're not calling them.
[15:39:21] armyriad: has joined #RubyOnRails
[15:39:27] roamingdog: sevenseacat: i believe this cropped up when upgraded devise to 4; apparently some changes regarding strong_parameters, will have to investigate
[15:40:53] RegulationD: has joined #RubyOnRails
[15:41:34] idefine: has joined #RubyOnRails
[15:41:55] Ropeney: roamingdog, https://github.com/plataformatec/devise/wiki/How-To:-Test-with-Capybara mine point you in the right direction
[15:42:43] roamingdog: ropeney: perfect, thanks a lot
[15:45:05] sp1rs: has joined #RubyOnRails
[15:46:18] baweaver: has joined #RubyOnRails
[15:46:39] moeabdol: has joined #RubyOnRails
[15:49:40] yardenbar: has joined #RubyOnRails
[15:49:48] emachnic: has joined #RubyOnRails
[15:50:21] [Butch]: has joined #RubyOnRails
[15:52:59] disgrntld: has joined #RubyOnRails
[15:53:04] [Butch]_: has joined #RubyOnRails
[15:53:25] aegis3121: has joined #RubyOnRails
[15:58:11] baweaver: has joined #RubyOnRails
[15:58:13] n008f4g_: has joined #RubyOnRails
[15:59:42] pawnbox: has joined #RubyOnRails
[16:00:02] Palsson: has joined #RubyOnRails
[16:00:58] Spami: has joined #RubyOnRails
[16:01:19] udiudi: has joined #RubyOnRails
[16:01:52] coalwate1: has left #RubyOnRails: ()
[16:02:16] jhack: has joined #RubyOnRails
[16:03:23] artto: has joined #RubyOnRails
[16:06:46] macsteps: has joined #RubyOnRails
[16:09:16] Cohedrin: has joined #RubyOnRails
[16:09:29] shilon: has joined #RubyOnRails
[16:11:06] qejk: has joined #RubyOnRails
[16:13:10] idefine: has joined #RubyOnRails
[16:13:41] bradleyprice: has joined #RubyOnRails
[16:14:27] shibly: has joined #RubyOnRails
[16:14:47] shibly: We can use/call all ruby functions in views/layout, right?
[16:15:07] shibly: Like <% @books.push(99) %> in views or layout
[16:15:29] shibly: @books is array
[16:15:49] tubbo: shibly: all ruby is valid within ERb tags, yeah :)
[16:16:33] shibly: tubbo, What's ERb tags? <% .. %> this?
[16:16:52] tubbo: shibly: yes. http://ruby-doc.org/stdlib-2.3.0/libdoc/erb/rdoc/ERB.html
[16:16:53] dionysus69: has joined #RubyOnRails
[16:17:16] tubbo: also TIL the first google result for "ERB" is now "Epic Rap Battles of History". what a time to be alive
[16:19:49] shibly: ERB = extended ruby , right?
[16:20:37] shibly: Some say views are for presentation only, it should not include processing in views/template
[16:20:47] shibly: Some framework is made with this concept
[16:20:49] tubbo: shibly: "Embedded" Ruby
[16:20:54] bradleyprice: has joined #RubyOnRails
[16:20:58] shibly: Oh, embedded
[16:21:05] emachnic: has joined #RubyOnRails
[16:21:24] tubbo: shibly: yeah i would argue that from a code design standpoint, you shouldn't need to perform too much logic in a view template.
[16:22:05] emachnic_: has joined #RubyOnRails
[16:22:34] tubbo: there are several "logic-less" templating languages out there, but i find that concept to be more popular in the javascript community, specifically those who develop single-page apps.
[16:24:51] antgel: has joined #RubyOnRails
[16:24:58] artto: has joined #RubyOnRails
[16:25:32] stannard: has joined #RubyOnRails
[16:26:07] Cache_Money: has joined #RubyOnRails
[16:27:23] shibly: has left #RubyOnRails: ("Leaving")
[16:28:04] polishdub: has joined #RubyOnRails
[16:29:28] smathy: It's all logic, just a different type of logic.
[16:29:33] IrishGringo: has joined #RubyOnRails
[16:30:12] epochwolf: tubbo: django's default views use a limited templating language.
[16:30:52] epochwolf: personally, I like defining functions in views.
[16:31:05] AmiMoench: has joined #RubyOnRails
[16:31:06] idefine: has joined #RubyOnRails
[16:31:11] lancejordan: @arup_r are you still here?
[16:31:27] artto: has joined #RubyOnRails
[16:31:29] tubbo: gfy epochwolf
[16:32:39] xcesariox: has joined #RubyOnRails
[16:32:58] shibly: has joined #RubyOnRails
[16:33:08] shibly: When would we get rails 5?
[16:33:14] DoctorMonocular: has joined #RubyOnRails
[16:33:32] epochwolf: ACTION shrugs
[16:37:35] tubbo: shibly: http://rails5countdown.com/
[16:39:17] shinnya: has joined #RubyOnRails
[16:39:19] FastJack: has joined #RubyOnRails
[16:39:22] DoctorMonocular: has joined #RubyOnRails
[16:41:18] Devalo: has joined #RubyOnRails
[16:41:52] maxdoubt: has joined #RubyOnRails
[16:44:42] _djbkd: has joined #RubyOnRails
[16:44:57] shibly: I have installed rails 4 with ruby-2.3 , will i be able to install rails 5 with this ruby?
[16:45:06] manfrin: has joined #RubyOnRails
[16:45:57] smathy: shibly, yes.
[16:46:52] shibly: What will be the command to install rails 5?
[16:46:59] shibly: gem update rails?
[16:49:20] wldcordeiro: has joined #RubyOnRails
[16:49:43] smathy: shibly, not that simple, no, there'll be a fair bit of new things to update in the config for an existing 4.x app.
[16:51:12] artto: has joined #RubyOnRails
[16:51:25] maxdoubt: has joined #RubyOnRails
[16:51:46] shibly: smathy, So editing the Gemfile to "gem 'rails', '5.0'" then bundle update ?
[16:52:12] dopie: has joined #RubyOnRails
[16:54:57] Cache_Money1: has joined #RubyOnRails
[16:55:02] tubbo: shibly: bundle update rails, then you'll want to bundle exec rake rails:upgrade to go through all the configuration that needs to be added/changed.
[16:55:16] tubbo: don't just "bundle update" everything, handle each dependency issue
[16:57:07] smathy: shibly, no, that's specifically what I said would NOT be enough.
[16:57:48] smathy: ...well, `bundle update` vs `gem update` - but that's all bundle update is doing.
[16:57:59] tvw: has joined #RubyOnRails
[17:00:18] stannard: has joined #RubyOnRails
[17:00:37] stannard: has joined #RubyOnRails
[17:01:00] sleungcy: has joined #RubyOnRails
[17:01:53] shibly: tubbo, Is it the command? bundle exec rake rails:upgrade
[17:02:14] smathy: shibly, it's a tool.
[17:02:48] idefine: has joined #RubyOnRails
[17:02:52] blackmesa: has joined #RubyOnRails
[17:03:16] shibly: Is it the correct command? bundle exec rake rails:upgrade
[17:03:30] Cohedrin_: has joined #RubyOnRails
[17:03:57] n008f4g_: has joined #RubyOnRails
[17:04:53] artto: has joined #RubyOnRails
[17:05:00] GnuYawk: has joined #RubyOnRails
[17:05:14] shibly: Bundler is a gem
[17:05:30] tubbo: shibly: rake -T to view all tasks
[17:05:54] JakFrist: has joined #RubyOnRails
[17:06:46] shibly: tubbo, Shouldn't the command be bundle exec rake rails:update ?
[17:06:55] shibly: Instead of rails:upgrade
[17:07:00] shibly: smathy, What's AT?
[17:07:02] tubbo: shibly: rake -T to view all tasks
[17:07:18] smathy: I was correcting tubbo, it's rake -AT to see all the tasks.
[17:07:25] tubbo: you don't need the -A
[17:07:26] shibly: tubbo, rake -T has rails:update not rails:upgrade
[17:07:27] smathy: rake -T only shows those tasks with comments
[17:07:42] tubbo: tasks with comments aren't supposed to be run directly ;)
[17:07:56] smathy: tubbo, well in r5 rails:update has no comment.
[17:08:13] tubbo: smathy: well that is lame ;)
[17:08:25] sp1rs: has joined #RubyOnRails
[17:08:27] tubbo: smathy: someone is gonna get fired for this.
[17:08:43] smathy: tubbo, and anyway, the lack of comments doesn't mean it shouldn't be run.
[17:09:02] shibly: So it should be rails:update instead of rails:upgrade.
[17:09:50] smathy: shibly, if that's what the task is called, then yes, that'll be it.
[17:10:53] tubbo: smathy: tubbo | tasks with comments aren't supposed to be run directly ;)
[17:10:56] tubbo: don't twist my words
[17:11:16] smathy: tubbo, I wasn't meaning to, add "directly" to the right place in my comment. It's still true.
[17:11:48] smathy: tubbo, take a look at the -AT tasks, there are heaps of good things in there that are just not commented either because they're advanced or obscure.
[17:12:54] tubbo: yeah like i didn't realize you could name tasks like 'rake tmp/sockets'
[17:12:58] tubbo: i suppose that just mkdirs the folder?
[17:13:03] shibly: What's comemnt in task?
[17:13:14] smathy: I dunno, -W to get to the source, docs is in the code ;)
[17:13:22] tubbo: smathy: too lazy
[17:13:25] tubbo: you tell me instead
[17:13:28] tubbo: this is IRC after all
[17:13:29] smathy: ACTION too ;P
[17:14:12] smathy: I *refuse* to learn, you can't make me!
[17:14:15] beilabs: has joined #RubyOnRails
[17:14:33] shibly: What's comemnt in task?
[17:15:07] tubbo: shibly: !dry
[17:15:07] helpa: shibly: Don't repeat yourself. Asking the same question repeatedly will not give you more answers.
[17:15:47] RegulationD: has joined #RubyOnRails
[17:15:56] tubbo: it just means the task is documented with a `desc` method. typically you define a task like task :whatever do ... end
[17:16:33] shibly: What's `desc` method?
[17:16:40] tubbo: shibly: http://jasonseifer.com/2010/04/06/rake-tutorial
[17:17:40] joshkovach: has joined #RubyOnRails
[17:17:41] aegis3121: has joined #RubyOnRails
[17:17:41] sp1rs: has joined #RubyOnRails
[17:18:00] netzfisch: has joined #RubyOnRails
[17:18:11] benlieb: has joined #RubyOnRails
[17:19:35] eljimmy: has joined #RubyOnRails
[17:21:53] idefine: has joined #RubyOnRails
[17:23:06] JakFrist: has joined #RubyOnRails
[17:23:46] Cohedrin: has joined #RubyOnRails
[17:25:14] DoctorMonocular: has joined #RubyOnRails
[17:25:15] benlieb: can anyone remind me of how to make a partial that acts like "wrapper"? I would like to make a partial for bootstrap's modal-dialog, and put arbitrary content inside it.
[17:25:34] eljimador: has joined #RubyOnRails
[17:26:01] benlieb: is there some kind of render do syntax?
[17:26:40] SteenJobs: has joined #RubyOnRails
[17:26:50] itsmeduncan: has joined #RubyOnRails
[17:27:08] macsteps: has joined #RubyOnRails
[17:27:15] benlieb: maybe the :layout option?
[17:28:18] shibly: There are many tools/gems for rails, i will learn about those later
[17:28:25] sailing`: has joined #RubyOnRails
[17:28:25] sailing: has joined #RubyOnRails
[17:28:45] shibly: Bundle install installed both: rake (11.1.2, 10.4.2) , why?
[17:28:45] yekta: has joined #RubyOnRails
[17:28:51] shibly: Why two versions?
[17:28:53] tubbo: shibly: i thought you were gonna learn about the tools later.
[17:29:54] yekta: Hello, I’m just upgrading a Rails 2 app to Rails 4 and when I say m = Model.new; m.save! I get nothing in my def before_validation or after_save callbacks, it never fires the callback, I know this because I have a debugger in them. Any thoughts on how I can debug this? It does save the new record.
[17:30:02] yekta: I’m on Rails 4.2.6
[17:30:09] shibly: Why did it install two versions of gem?
[17:30:31] arpegius: has joined #RubyOnRails
[17:31:10] tubbo: shibly: i would consult the bundler docs to see how bundler works.
[17:31:41] hello9: I'm trying to update a class that accepts nested_attributes, the attributes are getting sent back through the controller, but once it gets to update, the child params are gone. gist: https://gist.github.com/anonymous/6d69c39062ce871f69913b3e3007a384
[17:31:53] bronson: has joined #RubyOnRails
[17:31:57] shibly: tubbo, I will learn about bundler and rake later,
[17:32:06] shibly: Bye for now, thank you all for your answers.
[17:32:08] shibly: has left #RubyOnRails: ("Leaving")
[17:32:10] Yeomra: has joined #RubyOnRails
[17:32:51] smathy: That's not going to end well.
[17:32:53] tubbo: +q *!*@unaffiliated/shibly
[17:32:55] tubbo: fuck that guy
[17:33:03] shilon: has joined #RubyOnRails
[17:33:11] tubbo: good riddance.
[17:33:11] roamingdog: he was too good to be true
[17:33:20] tubbo: hence why i +q'ed him
[17:33:27] StevenNu_: has joined #RubyOnRails
[17:33:29] tubbo: he can just bother radar later if he comes back :P
[17:33:46] StevenNu_: Hey Guys! Do you mind if I ask a Rack 2.0 question?
[17:33:59] roamingdog: no need to ask to ask
[17:34:10] StevenNu_: Making sure this is the right place
[17:34:24] tubbo: StevenNu_: not at all
[17:34:25] tubbo: go for it
[17:34:45] StevenNu_: Trying to get a pry to catch when I hit a pure rack app's #call method... and it's not.
[17:35:07] StevenNu_: Same code with 1.6.4 catches
[17:35:19] StevenNu_: Control C doesn't work and I have to pkill
[17:35:31] tubbo: -q shibly!*@*
[17:35:38] tubbo: -q *!*@unaffiliated/shibly
[17:35:40] tubbo: changed my mind
[17:35:53] tubbo: chalking it up to not understanding how english works.
[17:35:55] roamingdog: tubbo: what do those mode thingies do?
[17:36:04] tubbo: roamingdog: +q is a special mode that lets you join the channel but not be able to speak
[17:36:07] petor: has joined #RubyOnRails
[17:36:15] tubbo: +b means you can't join the channel at all (banned)
[17:36:37] tubbo: even trolls can benefit from the information in #ror ;)
[17:36:41] roamingdog: pays to be polite and responsive eh
[17:36:47] tubbo: StevenNu_: !gist that pure rack app's call method
[17:36:47] helpa: StevenNu_: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[17:36:50] frem_: has joined #RubyOnRails
[17:37:10] tubbo: (with the binding.pry, just so i can see where you're trying to do this)
[17:37:15] pawnbox: has joined #RubyOnRails
[17:38:00] emachnic: has joined #RubyOnRails
[17:38:52] emachnic: has joined #RubyOnRails
[17:39:44] pawnbox: has joined #RubyOnRails
[17:40:06] StevenNunez: has joined #RubyOnRails
[17:40:21] StevenNunez: Sorry, my internet is terrible today.
[17:40:35] StevenNunez: Not sure if anyone has thoughts on the rack question
[17:42:45] hello9: I'm trying to update a class that accepts nested_attributes, the attributes are getting sent back through the controller, but once it gets to update, the child params are gone. gist: https://gist.github.com/anonymous/6d69c39062ce871f69913b3e3007a384
[17:43:06] hello9: sorry, once it gets to the "update" method
[17:43:12] hello9: the nested params disappear :)
[17:43:22] hello9: I'm assuming im doing something wrong in the whitelisting
[17:43:31] hello9: also in the gist, thanks!
[17:44:05] tubbo: StevenNunez: !gist the rack app if you could. it's not too big is it?
[17:44:05] helpa: StevenNunez: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[17:44:11] tubbo: like is this an _app_ or just middleware
[17:44:26] yardenbar: has joined #RubyOnRails
[17:46:24] cnk: hello9: please add your update method to that gist
[17:47:01] StevenNunez: https://gist.github.com/StevenNunez/d95a7fd78b74b1b1ff58e83160f33188
[17:47:10] hello9: has joined #RubyOnRails
[17:47:28] StevenNunez: Plain as can be
[17:47:42] StevenNunez: can't control+c out of it
[17:47:43] hello9: its a standard update method i.e @post.update_attributes(post_params)
[17:47:46] baweaver: has joined #RubyOnRails
[17:48:25] arup_r: has joined #RubyOnRails
[17:48:49] hello9: i think the problem is that the nested params are just being called "author" not "author_attributes"
[17:48:52] hello9: not sure why that is ;/
[17:49:40] GriffinHeart: has joined #RubyOnRails
[17:50:22] arup_r: using Rails 2.3.18 with Ruby 1.8.7 . when trying to run the rails server getting error as "`add_frozen_gem_path': undefined method `source_index' for Gem:Module (NoMethodError)" .. and this answer http://stackoverflow.com/questions/15349869/undefined-method-source-index-for-gemmodule-nomethoderror not helping at all .. any idea hot to fix this? https://gist.github.com/aruprakshit/553f7b98a0690d95b24ed2dd6624eb7a
[17:51:03] arup_r: hello9: show your form, how your made it. Also the model involved
[17:51:08] hello9: its in the gist
[17:51:19] hello9: https://gist.github.com/anonymous/6d69c39062ce871f69913b3e3007a384
[17:51:24] antgel: has joined #RubyOnRails
[17:51:33] arup_r: just came
[17:51:45] tubbo: arup_r: ugh i remember that. what version of RubyGems are you running? (run gem --version to find out)
[17:51:47] arup_r: ok also add the model
[17:52:12] hello9: the model is standard, class Post has_one :author, accepts_nested_attributes_for :author end
[17:52:13] arup_r: tubbo: 2.0.17
[17:52:23] hello9: i tested that updting nested works in console and it does
[17:52:36] quazimodo: has joined #RubyOnRails
[17:52:40] hello9: i think the problem is in form somewhere, the author_params are not being called author_attributes
[17:52:43] quazimod1: has joined #RubyOnRails
[17:53:16] tubbo: arup_r: check out http://stackoverflow.com/questions/5215981/what-is-the-stable-rubygems-version-for-rails-2-3-11, i had to basically downgrade rubygems to a specific 1.x version and then everything worked fine.
[17:53:21] tubbo: when i did this
[17:53:33] smathy: hello9, strong params
[17:54:21] agit0: has joined #RubyOnRails
[17:54:25] smathy: hello9, nevermind, actually looked at your gist now.
[17:54:32] smathy: hello9, f.fields_for
[17:54:42] hello9: smathy, ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
[17:54:45] hello9: riiiiight
[17:54:50] hello9: trying now
[17:55:00] lancejordan: has left #RubyOnRails: ()
[17:55:30] arup_r: tubbo: what is rubygems-update ?
[17:55:37] arup_r: ok let me uninstall it
[17:56:03] tubbo: arup_r: it's a gem that changes the rubygems version, because `gem update --system` hadn't been created yet
[17:56:15] tubbo: upgrades the rubygems version*
[17:56:34] baweaver: has joined #RubyOnRails
[17:56:38] arup_r: I started from 1.9.3.. so not aware of it
[17:57:09] yfeldblum: has joined #RubyOnRails
[17:57:38] netzfisch: has joined #RubyOnRails
[17:58:02] tubbo: yeah i can't even remember when it was deprecated
[17:58:13] moeabdol: has joined #RubyOnRails
[18:00:16] sailing`: has joined #RubyOnRails
[18:00:16] sailing: has joined #RubyOnRails
[18:00:35] mhoungbo: has joined #RubyOnRails
[18:00:39] arup_r: error gone.. thanks tubbo
[18:00:43] aegis3121: has joined #RubyOnRails
[18:01:14] antgel: has joined #RubyOnRails
[18:01:16] arup_r: I am not happy because they gave me rails 2 app :/ and said enjoy :D
[18:01:36] smathy: hello9, you're welcome.
[18:05:47] blackmesa: has joined #RubyOnRails
[18:05:51] thejamespinto: has joined #RubyOnRails
[18:06:25] joshkovach: has joined #RubyOnRails
[18:06:53] arup_r: Scoot, any update?
[18:06:56] arup_r: Opps, sorry!
[18:07:57] tubbo: arup_r: yeah a company did that to me once. i left that company.
[18:08:12] smathy: ACTION loves updating old apps
[18:08:28] tubbo: if you're not willing to upgrade a 10-year-old app in the face of major security issues, i don't know what positivity i can contribute to your business. :(
[18:08:48] arup_r: smathy: has many many experiences.. I love it..
[18:09:05] arup_r: tubbo: right! :)
[18:09:14] tubbo: smathy: you should join revzilla, they're working on a rails 1 app right now with zero tests..
[18:09:28] arup_r: and when it is arup_r, huuh! .. that can be a mess!
[18:15:58] agit0: has joined #RubyOnRails
[18:16:22] sp1rs: has joined #RubyOnRails
[18:17:58] tildes: has joined #RubyOnRails
[18:18:26] bradleyprice: has joined #RubyOnRails
[18:19:52] yellow5: has joined #RubyOnRails
[18:19:54] tubbo: haml question y'all
[18:19:59] tubbo: lets say i'm making an XML template with Haml
[18:20:11] tubbo: is there a way to tell Haml to make the tag self-closing if no data exists with in it?
[18:20:55] tbuehlmann: shouldn't it be self-closing per se then?
[18:21:39] joshkovach: has joined #RubyOnRails
[18:21:51] arup_r1: has joined #RubyOnRails
[18:25:26] ZerGabriel: has joined #RubyOnRails
[18:25:28] solars: has joined #RubyOnRails
[18:27:22] bradleyprice: has joined #RubyOnRails
[18:27:26] ZerGabriel: has joined #RubyOnRails
[18:29:02] antgel: has joined #RubyOnRails
[18:29:21] sypheren: has joined #RubyOnRails
[18:30:20] joshkovach: has joined #RubyOnRails
[18:33:03] bronson: has joined #RubyOnRails
[18:33:05] drbayer: has joined #RubyOnRails
[18:34:18] benlieb: has joined #RubyOnRails
[18:36:06] smathy: tubbo, you discovered that from that [Tyrant] guy?
[18:37:13] Dimik: has joined #RubyOnRails
[18:38:04] bradleyprice: has joined #RubyOnRails
[18:38:14] smathy: arup___, just to be sure I've told you, I *did* tell you the other day that I would do this upgrade by making a new 4.x app and just copying over your app/** files right?
[18:38:16] renegadeandy: has joined #RubyOnRails
[18:38:48] milesmatthias: has joined #RubyOnRails
[18:39:15] arup_r1: smathy: yes, I will do like that. That's best way. I updated the ticket same way. The app is no so big.. so i think it will take at max 3 working days to make it ready
[18:39:25] KevinMGranger: has joined #RubyOnRails
[18:39:40] arup_r1: rails 2 is folder structure is very different.. I am just waiting for their update..
[18:40:13] arup_r1: I just wanted to boot the app, so that I can see what the app is.. :)
[18:40:28] arup_r1: so that I can compare it when I will be rebuilding..
[18:41:01] KevinMGranger: Is there a way to replace a model's associations with another class if it turns out to be nil? e.g. implementing the Null Object pattern
[18:41:21] KevinMGranger: Is this the perfect place for a callback?
[18:41:31] smathy: arup___, cool.
[18:42:19] smathy: KevinMGranger, !g null object pattern in rails
[18:42:27] yellow5: has joined #RubyOnRails
[18:42:57] patrick99e99: has joined #RubyOnRails
[18:44:16] Pumukel: has joined #RubyOnRails
[18:44:17] patrick99e99: Hey everyone, I am doing a raw sql query with PG, ActiveRecord::Base.connection.raw_connection.exec_params(...), and I am noting nothing gets logged. Does anyone know of how I can make the db log the query like it does normally?
[18:44:44] apotry: has joined #RubyOnRails
[18:44:48] tvw: has joined #RubyOnRails
[18:44:53] dorje: has joined #RubyOnRails
[18:45:39] Oog: has joined #RubyOnRails
[18:45:53] Oog: i have a models/concerns ShiftWindow - ActionView::Template::Error: A copy of ShiftWindow has been removed from the module tree but is still active! in rake jobs:work....
[18:46:20] arup_r1: nice question patrick99e99 :)
[18:46:22] joshkovach: has joined #RubyOnRails
[18:47:17] arup_r: there are so many exec_* method, and I get confused always :/
[18:47:27] Oog: module tree problems :(
[18:47:30] Oog: is it rails or ruby?
[18:47:55] smathy: tubbo, re your haml question, how DOESN'T it do that? https://gist.github.com/smathy/596b256318f9b38586265a1530bea95d
[18:48:03] smathy: Oh, wait, you mean like <foo/>
[18:49:28] arup_r: Oog: restart the server, or the error comes when you delete the class/model or names are not matching as far as I remember
[18:49:41] arup_r: class/modules **
[18:49:45] joshkovach: has joined #RubyOnRails
[18:49:47] Oog: if tried everything
[18:49:57] Oog: restarted 10 times, restarted computer etc
[18:50:14] Oog: what fixes it in dev is commenting out config.cache_classes = false
[18:50:21] Oog: this didnt use to happen though i hve no idea why it started
[18:50:27] arup_r: ok.. then are you sure you have ShiftWindow class/module there in the app
[18:50:37] arup_r: your rails version is??
[18:51:11] KorriX: has joined #RubyOnRails
[18:51:20] arup_r: Last time I got the error when I had wrong file name for the class in question.
[18:51:41] Oog: has joined #RubyOnRails
[18:51:56] Oog: arup_r rails 4.2.5
[18:51:59] Oog: yes th emodule exists
[18:52:04] acovrig: has joined #RubyOnRails
[18:52:17] arup_r: show the concern code please
[18:52:27] acovrig: I’m getting an UnknownFormat error, is there any way for me to debug what the client is using as a format?
[18:52:40] arup_r: acovrig: Rails log have it
[18:53:00] arup_r: just check the params: {.. } content
[18:53:06] arup_r: in your log
[18:53:15] joshkovach: has joined #RubyOnRails
[18:53:53] Oog: https://gist.github.com/anonymous/22158427e3208a722a98d5cc52be2cdf
[18:54:03] acovrig: I may need a different logging level (I’m using the default and `rails s`), I don’t see anything about that (but I know what you’re talking about: I’ve seen it before)
[18:54:03] Oog: so i think i fixed it by making it do ::ShiftWindow everywhere in there
[18:54:17] jstransky: has joined #RubyOnRails
[18:54:36] blackmesa: has joined #RubyOnRails
[18:54:37] Oog: for some reason just ShiftWindow when it refers to itself causes the problem ::ShiftWindow seems to fix it. the crazy thing is this worked before! i swear it randomly stopped working yesterday it is crazy
[18:55:26] arup_r: yes this method to write those methods you think of class methods http://api.rubyonrails.org/classes/ActiveSupport/Concern.html#method-i-class_methods
[18:55:40] arup_r: example is inside the doc itself.. and then report back again
[18:56:54] arup_r: Oog: class_methods do ... end and put all ShiftWindow.<methods> inside it ..
[18:57:16] idefine: has joined #RubyOnRails
[18:57:18] arup_r: without ShiftWindow <~ this .. and cread the doc first
[18:57:18] Oog_: has joined #RubyOnRails
[18:57:33] Oog_: trash xfinity keeps cutting out
[18:57:33] Oog_: arup_r seems to be explained here http://stackoverflow.com/questions/29636334/a-copy-of-xxx-has-been-removed-from-the-module-tree-but-is-still-active why :: trick works
[18:57:43] draig: has joined #RubyOnRails
[18:57:45] Oog_: "then it's Object.const_missing that will be invoked not YourModule.const_missing so things should work out" dont really get what that means
[18:57:57] arup_r: yes.. loading issue I guess...
[18:57:57] Oog_: the crazy thing is this randomly started yesterday
[18:58:49] joshkovach: has joined #RubyOnRails
[18:59:07] Oog_: so a bug?
[18:59:23] anna`: has joined #RubyOnRails
[18:59:51] jenrzzz: has joined #RubyOnRails
[19:00:23] aegis3121: has joined #RubyOnRails
[19:00:47] arup_r: dunno.. did you do what I said/
[19:01:13] Oog_: sorry what did you say? i got disconnected
[19:01:29] Oog_: xfinity sucks :(
[19:01:56] sailing`: has joined #RubyOnRails
[19:01:56] sailing: has joined #RubyOnRails
[19:02:02] arup_r: Oog_: http://logs.ryanbigg.com/RubyOnRails
[19:02:07] arup_r: read there :D
[19:02:24] aegis3121: has joined #RubyOnRails
[19:05:16] kies: has joined #RubyOnRails
[19:06:29] Oog_: thats a no go
[19:06:43] KevinMGranger: smathy: Those links didn't really have much for me. My specific case is a model having a one-to-one. I guess I should go with a getter, but now for some reason the class isn't autoloading when in the model
[19:06:50] Oog_: undefined method `shift_window_keys_ordered' for ShiftWindow:Module with def shift_window_keys_ordered inside class_methods
[19:06:56] KevinMGranger: THank you for the suggestion though, they were handy for other things
[19:08:40] nickenchuggets: has joined #RubyOnRails
[19:08:44] joshkovach: has joined #RubyOnRails
[19:08:49] bradleyprice: has joined #RubyOnRails
[19:09:17] Oog_: arup_r laving it as is adding :: works so im going with that
[19:11:05] ss_much: has joined #RubyOnRails
[19:12:30] blackmesa: has joined #RubyOnRails
[19:13:18] bradleyprice: has joined #RubyOnRails
[19:13:53] roamingdog: has joined #RubyOnRails
[19:18:21] petor: has joined #RubyOnRails
[19:19:24] smathy: KevinMGranger, your question didn't even hint that you had a specific problem, maybe you want to make up a gist and show the issues you're having.
[19:21:01] phaza_: has joined #RubyOnRails
[19:21:21] siaW: has joined #RubyOnRails
[19:24:37] duderonomy: has joined #RubyOnRails
[19:26:30] renegadeandy: has joined #RubyOnRails
[19:28:48] baweaver: has joined #RubyOnRails
[19:28:53] siaW: my .coffee file looks like this https://gist.github.com/siaw23/b567642356843ccf5cd794ba0858bac5
[19:29:21] siaW: after loading my app, i get
[19:29:21] siaW: ExecJS::RuntimeError in Developers#index
[19:29:22] siaW: on line: <%= javascript_include_tag 'application', 'data-turbolinks-track' => 'reload' %>
[19:29:25] siaW: what’s that happening?
[19:29:33] itsmedun_: has joined #RubyOnRails
[19:30:20] netzfisch: has joined #RubyOnRails
[19:30:20] Devalo: has joined #RubyOnRails
[19:31:37] maxdoubt: has joined #RubyOnRails
[19:34:03] bronson: has joined #RubyOnRails
[19:35:02] arpegius: has joined #RubyOnRails
[19:35:20] VeryBewitching: has joined #RubyOnRails
[19:35:27] itsmeduncan: has joined #RubyOnRails
[19:36:19] King_Rex: has joined #RubyOnRails
[19:36:26] smathy: siaw, leading whitespace needs to be the same.
[19:38:58] bradleyprice: has joined #RubyOnRails
[19:39:30] siaW: the same?
[19:40:01] siaW: i don’t get it. lines 2 and 3 start on the same column
[19:42:03] smathy: siaw, that the non-whitespace text starts on the same column does not mean they have the same leading whitespace.
[19:42:15] smathy: siaw, you understand how a tab works I assume?
[19:42:20] Cohedrin_: has joined #RubyOnRails
[19:42:28] siaW: i think i do
[19:43:20] siaW: anyway, i can take of that
[19:43:53] siaW: what i don’t understand is why the text shows for a brief moment on pageload and hides
[19:44:03] siaW: those i have applied .hide() on page load
[19:44:13] siaW: meaning the page loads BEFORE the js kicks in
[19:44:57] wldcordeiro: has joined #RubyOnRails
[19:45:14] blackmesa: has joined #RubyOnRails
[19:46:08] roamingdog: has joined #RubyOnRails
[19:46:15] smathy: You think JS can hide something before it's loaded? Not sure you're really thinking that one though fully.
[19:48:28] jenrzzz: has joined #RubyOnRails
[19:48:38] jenrzzz: has joined #RubyOnRails
[19:48:46] joshkovach: has joined #RubyOnRails
[19:49:14] Devalo: has joined #RubyOnRails
[19:49:22] bradleyprice: has joined #RubyOnRails
[19:51:25] sypheren: has joined #RubyOnRails
[19:51:48] Jasaka: has joined #RubyOnRails
[19:52:29] Cohedrin: has joined #RubyOnRails
[19:52:33] S1kx: has joined #RubyOnRails
[19:55:00] baweaver: has joined #RubyOnRails
[19:55:19] epochwolf: smathy: yes, what's what I want.
[19:55:37] bradleyprice: has joined #RubyOnRails
[19:57:48] sp1rs: has joined #RubyOnRails
[19:58:10] bradleyp_: has joined #RubyOnRails
[19:59:37] pawnbox: has joined #RubyOnRails
[20:00:21] pawnbox: has joined #RubyOnRails
[20:00:51] Spami: has joined #RubyOnRails
[20:01:43] RegulationD: has joined #RubyOnRails
[20:02:00] RegulationD: has joined #RubyOnRails
[20:04:02] listrophy: has joined #RubyOnRails
[20:05:02] matthias_: has joined #RubyOnRails
[20:06:42] macsteps: has joined #RubyOnRails
[20:07:01] listrophy: i'm debugging a weird Mime issue. This is with Spree running as an engine inside a Rails app. Anyway, inside a response cycle, all the Mime::Types in @env["action_dispatch.request.formats"] have nil for their @symbol. This seems wrong, since a Mime Type of "text/javascript" seems like it should have a symbol of :js
[20:08:40] joshkovach: has joined #RubyOnRails
[20:08:44] finnnnnnnnnnn: has joined #RubyOnRails
[20:10:06] th0m_: has joined #RubyOnRails
[20:10:17] smathy: epochwolf, that and world peace.
[20:10:24] smathy: ...is that really too much to ask!?
[20:10:37] silverash: has joined #RubyOnRails
[20:10:48] yardenbar: has joined #RubyOnRails
[20:10:53] dionysus69: has joined #RubyOnRails
[20:11:08] epochwolf: smathy: world peace is easy, see my master plan.
[20:13:19] finnnnnnnnnnn: I have a form with that accepts_nested_attributes_for another model called Hobbies. When I try and submit that form, the validatinos for Hobbies are not being called and the fields for Hobbies are disaperainig when redirected back. Any idea how I should start to debug?
[20:16:03] smathy: finnnnnnnnnnn, looking at your code, you need to use `f.fields_for` in your view (not `fields_for`)
[20:16:10] bruno-: has joined #RubyOnRails
[20:16:52] finnnnnnnnnnn: smathy: thanks, I have that. It renders correctly on intial load.
[20:17:40] smathy: ...when subtle hints attack...
[20:17:46] bradleyprice: has joined #RubyOnRails
[20:17:52] milesmatthias: has joined #RubyOnRails
[20:18:23] joshkovach: has joined #RubyOnRails
[20:18:49] finnnnnnnnnnn: smathy: I’ll try and get a gist together
[20:21:22] kristoph: has joined #RubyOnRails
[20:21:26] roamingdog: has joined #RubyOnRails
[20:23:00] roamingdog: has joined #RubyOnRails
[20:26:00] sleungcy: has joined #RubyOnRails
[20:26:27] srinidhi: has joined #RubyOnRails
[20:28:05] roamingd_: has joined #RubyOnRails
[20:28:21] finnnnnnnnnnn: ok, think I have something here. https://gist.github.com/fionnbharra/95f5f394db240fcbcc0bdebf5aa6204d
[20:28:50] finnnnnnnnnnn: lemme know if you need any more. The problem is that validatinos on Volitility are being ignored
[20:29:11] n008f4g_: has joined #RubyOnRails
[20:29:26] stannard: has joined #RubyOnRails
[20:30:28] cnk: finnnnnnnnnnn: please show the safe params method from your school controller
[20:30:39] finnnnnnnnnnn: cnk: oh yeah, one sec
[20:30:56] cnk: and I am assuming that you see the volititlity info in the dev log params, and just not in yoru new method
[20:31:02] maxdoubt: has joined #RubyOnRails
[20:31:08] smathy: finnnnnnnnnnn, also add the snippet from your browser showing the HTML, and from your logs showing the request.
[20:31:30] bradleyprice: has joined #RubyOnRails
[20:33:15] emachnic: has joined #RubyOnRails
[20:33:24] finnnnnnnnnnn: update the controller - https://gist.github.com/fionnbharra/95f5f394db240fcbcc0bdebf5aa6204d
[20:33:46] finnnnnnnnnnn: checking logs now, I think that could be the issue. It looks like they’re not being passed as params
[20:34:46] listrophy: OK, so it's looking like Mime::LOOKUP is an empty hash, even though mime types are indeed registered
[20:36:35] finnnnnnnnnnn: added logs to same gist
[20:36:51] finnnnnnnnnnn: that’s from a blank form submission
[20:37:27] smathy: finnnnnnnnnnn, I know you know yourself, and I'm sure you're a smart guy, but we don't know you from Adam, so when you provide things like your controller can you provide either everything, or at least everything that could possibly impact your problem, eg. your create action showing the redirect and use of the permitted params, and your full params method, and the full request from your logs, and the HTML from your browser that I asked for...
[20:37:27] smathy: it's a pain to have to guess through these things.
[20:38:49] finnnnnnnnnnn: smathy: I getchya, thanks for looking at all. I’ve a strict NDA and team mates hang about in this room too so I’m having to change model names as I create gists, it’s a real pita.
[20:39:11] finnnnnnnnnnn: but you’re deead right, let me do it properly and get back to ya
[20:41:09] bronson: has joined #RubyOnRails
[20:41:34] jgrevich: has joined #RubyOnRails
[20:43:50] beilabs: has joined #RubyOnRails
[20:44:28] Technodrome: has joined #RubyOnRails
[20:45:06] StevenNunez: has joined #RubyOnRails
[20:46:56] helpa: A "Full Trace" as opposed to the default "Application Trace" is preferred.
[20:47:00] Radar: Uh, not that one.
[20:47:08] helpa: NO FAKE CODE. If you're under an NDA, we cannot help you with your problem. Go hire a consultant.
[20:47:16] _djbkd: has joined #RubyOnRails
[20:49:21] jobewan: has joined #RubyOnRails
[20:50:38] lemur: has joined #RubyOnRails
[20:50:52] Coldblackice_: has joined #RubyOnRails
[20:53:12] King_Rex: has joined #RubyOnRails
[20:55:39] aegis3121: has joined #RubyOnRails
[20:58:26] slash_ni1k: has joined #RubyOnRails
[20:59:13] itsmeduncan: has joined #RubyOnRails
[21:00:38] n008f4g_: has joined #RubyOnRails
[21:02:35] sailing: has joined #RubyOnRails
[21:05:26] smathy: finnnnnnnnnnn, just post it, then delete it, let them sue you.
[21:05:29] smathy: NDAs are a joke.
[21:05:48] smathy: Good luck subpoenaing github for a deleted gist.
[21:05:56] mrgreenfur: has joined #RubyOnRails
[21:06:59] smathy: finnnnnnnnnnn, you can PM me the gist if you like. Now, I won't promise that I won't quickly make a copy, and use it to steal your employer's market share, so you'll just have to take your chances on that score.
[21:07:55] yfeldblum: has joined #RubyOnRails
[21:08:37] itsmeduncan: has joined #RubyOnRails
[21:09:10] maxdoubt: has joined #RubyOnRails
[21:09:17] finnnnnnnnnnn: smathy: hahaha, protection money from devs is a racket I could get into
[21:10:19] smathy: I'll make you an offer you can't refuse.
[21:10:21] solars: hi, if I have repeating code to transform params, like this: https://gist.github.com/solars/03894a5b262b7adcf03616ebfd50afce how would you refactor it across actions?
[21:10:23] VeryBewitching: That could have traction
[21:11:11] smathy: solars, you mean in different controllers? Or just across different actions in the same controller?
[21:11:14] stannard: has joined #RubyOnRails
[21:11:43] solars: same controller
[21:11:53] solars: every action basically has similar params
[21:12:12] itsmeduncan: has joined #RubyOnRails
[21:12:55] VeryBewitching: before_filter :process_parameters, except: [:excluded, :actions] ?
[21:13:45] solars: and put in instance vars?
[21:14:32] VeryBewitching: Or a small PORO that contains the data so you only have one instance variable maybe.
[21:15:13] solars: that's what I thought, yeah.. but wanted to collect some ideas :)
[21:17:59] speaking1ode: has joined #RubyOnRails
[21:19:19] neanderslob_: has joined #RubyOnRails
[21:19:58] chipotle: has joined #RubyOnRails
[21:22:30] wldcordeiro: has joined #RubyOnRails
[21:22:38] ur5us: has joined #RubyOnRails
[21:23:55] blindMoe: has joined #RubyOnRails
[21:24:42] Devalo: has joined #RubyOnRails
[21:26:17] macsteps: has joined #RubyOnRails
[21:27:01] bradleyprice: has joined #RubyOnRails
[21:27:58] slash_nick: We've got a RemoteMeetup scheduled for today.. you're all welcome to join. We'll be interviewing Nick Sutterer (trailblazer author): https://twitter.com/RemoteMeetup/status/722561221501808640
[21:29:33] arup_r: slash_nick: is it recorded some where? so people can listen them to later also ?
[21:30:13] arup_r: I meant any discussions from Remote Meetup
[21:30:37] flashpoint9: has joined #RubyOnRails
[21:31:03] bradleyp_: has joined #RubyOnRails
[21:31:19] listrophy: in case anyone cares, the problem was in an initializer that I wrote in response to CVE-2016-0751. I upgraded rails to 4.2.6, which obviated the need for my patch.
[21:31:30] arup_r: ok youtube has these all.. thnx
[21:31:34] bradleyp_: has joined #RubyOnRails
[21:32:00] slash_nick: ACTION loves the word "obviate"
[21:35:23] |RicharD|: guys there is a way
[21:35:38] |RicharD|: for save dynamically a field in db ?
[21:36:09] |RicharD|: I mean something like this: user."#{params[:user]}_username" = provider
[21:36:27] |RicharD|: with public_send doesn't seems to work correctly
[21:37:04] tubbo: |RicharD|: user.update("#{params[:user]_username" => provider) as long as that key is an actual column in your table.
[21:37:23] |RicharD|: sure it's an column in table
[21:37:27] |RicharD|: btw now I give a try
[21:37:35] listrophy: has left #RubyOnRails: ()
[21:38:36] GriffinHeart: has joined #RubyOnRails
[21:43:22] workmad3: has joined #RubyOnRails
[21:43:48] sleungcy: has joined #RubyOnRails
[21:45:01] smathy: |RicharD|, btw, public_send was probably not working because the setter method actually has an = in it, ie. you'd use: user.send "#{params[:user]}_username=", "foo"
[21:45:07] htmldrum: has joined #RubyOnRails
[21:45:15] |RicharD|: btw tube, it works, thanks!
[21:45:36] |RicharD|: why you're using send and not
[21:45:41] |RicharD|: public_send ?
[21:45:53] |RicharD|: btw I had tried with user.public_send "params...", "new value"
[21:45:57] |RicharD|: but didn't worked
[21:46:02] tubbo: both send() and public_send() _should_ work.
[21:46:22] tubbo: |RicharD|: but you can also do this -> user["#{params[:user]}_username"] = provider :)
[21:46:33] smathy: |RicharD|, you can also do something like: user[... ^ that :)
[21:46:36] tubbo: you just have to user.save after that, unlike update() it doesn't implicitly save
[21:46:41] tubbo: smathy: beatcha
[21:46:42] matthias_: has joined #RubyOnRails
[21:46:45] smathy: You did :)
[21:46:49] antgel: has joined #RubyOnRails
[21:49:20] GriffinHeart: has joined #RubyOnRails
[21:52:14] s2013: has joined #RubyOnRails
[21:53:17] arBmind: has joined #RubyOnRails
[21:53:27] shilon: has joined #RubyOnRails
[21:55:07] smathy: Right now what's up is that the turbolinks progress bar ignores ESC/cancel navigation.
[21:56:35] Mia: has joined #RubyOnRails
[21:56:35] Mia: has joined #RubyOnRails
[21:57:56] flashpoint9: has joined #RubyOnRails
[21:59:34] n008f4g_: has joined #RubyOnRails
[22:02:57] baweaver: has joined #RubyOnRails
[22:03:39] _djbkd: has joined #RubyOnRails
[22:03:56] _djbkd: has joined #RubyOnRails
[22:06:07] flashpoint9: has joined #RubyOnRails
[22:08:53] flashpoint9: has joined #RubyOnRails
[22:11:04] ewilliam: anyone understand why this piece of code wont return a flash message
[22:11:14] ewilliam: https://www.irccloud.com/pastebin/wUXZlzON/
[22:11:28] ewilliam: gist: https://gist.github.com/ewilliam/caf20f5117331b4c1c02d5130be1e85a
[22:14:32] smathy: ewilliam, maybe the errors are on BankAccount not the wallet.
[22:16:37] roamingdog: has joined #RubyOnRails
[22:17:00] roamingdog: has joined #RubyOnRails
[22:17:05] ewilliam: smathy: i added the error to the wallet
[22:17:08] ewilliam: https://www.irccloud.com/pastebin/KQHa9QEk/
[22:17:12] ewilliam: shouldnt that suffice?
[22:17:25] ewilliam: i tested in pry, and the errors is in wallet
[22:17:35] jenrzzz: has joined #RubyOnRails
[22:17:35] jenrzzz: has joined #RubyOnRails
[22:17:47] ewilliam: sorry i meant this bit
[22:17:52] ewilliam: https://www.irccloud.com/pastebin/bQ7hflJI/
[22:17:58] ftj: has joined #RubyOnRails
[22:18:01] StaticVoid: has joined #RubyOnRails
[22:18:38] ewilliam: in update_account! method from StripeManagedService
[22:18:44] bruno-: has joined #RubyOnRails
[22:19:05] blindMoe: has joined #RubyOnRails
[22:19:29] diegoaguilar: has joined #RubyOnRails
[22:19:44] ewilliam: even if i tried something like 'flash.now.alert = "WTF"' it doesnt work
[22:19:57] ewilliam: nothing shows up at all
[22:21:05] superlou: has joined #RubyOnRails
[22:22:45] speaking1ode: has joined #RubyOnRails
[22:24:15] _djbkd: has joined #RubyOnRails
[22:24:48] blindMoe: has joined #RubyOnRails
[22:25:32] i4: has joined #RubyOnRails
[22:26:19] i4: how can I optimize the code: if code.to_s != 'en' or code.to_s != 'ru' or code.to_s != 'cn' into short one? with something like: if code.to_s != en|ru|cn ?
[22:26:57] emachnic: has joined #RubyOnRails
[22:27:06] dopie: has joined #RubyOnRails
[22:27:46] rbr: i4: depends on the case; is it a fixed list? Should it be dynamic?
[22:27:56] roamingdog: has joined #RubyOnRails
[22:30:58] smathy: ewilliam, add your view/layout and the HTML from your browser of the page in question.
[22:31:45] roamingdog: has joined #RubyOnRails
[22:32:08] chipotle: has joined #RubyOnRails
[22:33:00] darwingr: has joined #RubyOnRails
[22:34:02] akshat: has joined #RubyOnRails
[22:34:28] smathy: i4, you know that that conditional will never be false.
[22:36:23] smathy: i4, assuming I know what `code` is then I'd use either the `if` or `unless` version of: if code.in? %i[en ru cn]
[22:36:23] zave: has joined #RubyOnRails
[22:37:40] pawnbox: has joined #RubyOnRails
[22:41:15] rafaelfranca: has joined #RubyOnRails
[22:41:36] i4: rbr fixed
[22:43:04] bruno-_: has joined #RubyOnRails
[22:43:41] n008f4g_: has joined #RubyOnRails
[22:47:55] dopie: has joined #RubyOnRails
[22:48:25] jstransky: has joined #RubyOnRails
[22:48:37] rafaelfranca: has joined #RubyOnRails
[22:48:38] rafaelfranca: has joined #RubyOnRails
[22:48:46] renegadeandy: Does rspec run tests linearly, or does it run then at the same time?
[22:49:17] bradleyprice: has joined #RubyOnRails
[22:50:30] Radar: linearly.
[22:50:55] nickjj: has joined #RubyOnRails
[22:51:04] renegadeandy: Radar: why is that>
[22:51:05] Radar: If you want to run them in parallel, there's parallel_tests gem which will let you do it on a single machine, and knapsack which will let you do it across multiple machines.
[22:51:23] renegadeandy: would you recommend it?
[22:51:39] baweaver: has joined #RubyOnRails
[22:51:59] Radar: We are using parallel_tests but are moving to knapsack as an experiment.
[22:52:26] roamingdog: has joined #RubyOnRails
[22:52:47] renegadeandy: and another question i have is that, because my test database is cleaned before each suite, static data which is setup by means of a rake task such as categories lists are not present….how can i make sure they exist for my test environment
[22:54:43] KnownSyntax_: has joined #RubyOnRails
[22:54:57] renegadeandy: seems like a lot of overkill to have to use something like factory girl for static data like lists of categories and sub categories etc
[22:55:08] SteenJobs: has joined #RubyOnRails
[22:55:16] lemur: has joined #RubyOnRails
[22:55:29] Radar: Stop cleaning those tables before the suite?
[22:55:30] bronson: has joined #RubyOnRails
[22:55:45] Radar: DatabaseCleaner.clean_with :truncation, except: SEEDED_TABLES
[22:55:48] smathy: Set up your data once, then use transactions.
[22:55:51] Radar: That's what we have.
[22:55:58] Radar: transactions won't work with JS tests
[22:56:11] renegadeandy: ok Radar i like that idea
[22:56:17] KnownSyntax_: has joined #RubyOnRails
[22:56:29] shilon: has left #RubyOnRails: ()
[22:56:42] renegadeandy: so if i want to keep tables, categories and sub_categories then DatabaseCleaner.clean_with :truncation, except: categories sub_categories
[22:56:47] smathy: Yep, we run them separately, and it's not such a hit with those because seeding data is trivial compared to starting a browser.
[22:56:51] Radar: renegadeandy: !try
[22:56:51] helpa: renegadeandy: Why don't you try it and find out for yourself?
[22:57:29] _djbkd: has joined #RubyOnRails
[22:57:32] bruno-: has joined #RubyOnRails
[22:57:42] smathy: config.before(:each, js: true) { DatabaseCleaner.strategy = :truncation }
[22:57:55] smathy: Lets you configure your JS tests differently ^
[22:58:05] KnownSyntax_: has joined #RubyOnRails
[22:58:07] renegadeandy: hmmm, so how do i run my rake tasks against the test environment?
[22:58:13] neanderslob: has joined #RubyOnRails
[22:59:13] GodFather: has joined #RubyOnRails
[22:59:35] KnownSyntax_: has joined #RubyOnRails
[22:59:52] neanderslob_: has joined #RubyOnRails
[23:00:30] artto: has joined #RubyOnRails
[23:00:32] pawnbox: has joined #RubyOnRails
[23:01:14] KnownSyntax_: has joined #RubyOnRails
[23:03:29] sailing: has joined #RubyOnRails
[23:04:34] JohhnyQ: has joined #RubyOnRails
[23:06:45] _djbkd: has joined #RubyOnRails
[23:06:49] noobsu: has joined #RubyOnRails
[23:07:05] noobsu: has left #RubyOnRails: ()
[23:07:19] smathy: renegadeandy, require 'rake'; Rails.application.load_tasks; Rake::Task["db:seed"].invoke
[23:07:40] renegadeandy: rake my_task RAILS_ENV=test worked well
[23:08:12] egray: has joined #RubyOnRails
[23:08:12] smathy: renegadeandy, you mean you ran that on the command line first?
[23:08:28] renegadeandy: yeah, i just ran the task from the command line,
[23:08:44] smathy: renegadeandy, ok, but when you clean the DB that'll be gone.
[23:09:04] renegadeandy: but it wont…cos i added some except lines to my database cleaner?
[23:09:46] smathy: Ah ok, I misunderstood because I was telling you to run the rake tasks.
[23:09:55] smathy: ...I thought you switched to my approach.
[23:11:44] neanderslob: has joined #RubyOnRails
[23:12:17] RahulT: has joined #RubyOnRails
[23:13:25] renegadeandy: smathy: gotcha
[23:13:52] renegadeandy: Radar: im almost there, but cannot find the correct places to add in the except line…https://gist.github.com/renegadeandy/94486a32823f142264f04489bc3acafc
[23:13:53] noobsu: has joined #RubyOnRails
[23:14:43] speaking1ode: has joined #RubyOnRails
[23:15:02] KnownSyntax: has joined #RubyOnRails
[23:17:31] neanderslob_: has joined #RubyOnRails
[23:19:26] renegadeandy: its this line, but i cannot work out the syntax considering its a conditional
[23:19:43] renegadeandy: This is my best shot but its wrong :
[23:19:44] renegadeandy: DatabaseCleaner.strategy= example.metadata[:js] ? :truncation, {:except => %w[categories sub_categories]} : :transaction, {:except => %w[categories sub_categories]}
[23:20:13] quazimodo: has joined #RubyOnRails
[23:20:18] speaking1ode: has joined #RubyOnRails
[23:20:21] quazimod1: has joined #RubyOnRails
[23:20:55] shilon: has joined #RubyOnRails
[23:21:16] Cohedrin: is there a simple method to filter out the rails middle ware in a stack trace
[23:21:20] stannard: has joined #RubyOnRails
[23:21:21] Cohedrin: like on the rails error page?
[23:21:23] pawnbox: has joined #RubyOnRails
[23:21:50] smathy: renegadeandy, you really should know better than that syntax.
[23:22:39] smathy: Cohedrin, there is http://api.rubyonrails.org/classes/ActiveSupport/BacktraceCleaner.html - but last time I tried to use it it didn't work, so YMMV.
[23:22:53] Cohedrin: ah, thanks for the link smathy
[23:22:57] Cohedrin: I'll give it a shot
[23:23:11] smathy: Report back if you can, I'd be interested to know if it worksf or you.
[23:23:37] GriffinHeart: has joined #RubyOnRails
[23:24:54] emachnic: has joined #RubyOnRails
[23:25:02] mrgreenfur: has joined #RubyOnRails
[23:26:55] renegadeandy: smathy: well im still struggling with some of the oddities of blocks and have never been much use with terniary operators…please just help me?
[23:27:33] renegadeandy: I may have been around 449 days, but not many of them have been on this kinda stuff.
[23:28:06] RahulT: has joined #RubyOnRails
[23:28:59] wldcordeiro: has joined #RubyOnRails
[23:29:26] Cohedrin: smathy it removed everything for me lol
[23:30:02] benlieb: has joined #RubyOnRails
[23:31:34] renegadeandy: smathy: you can clearly see im trying - ive gone back to a normal if - which syntactically works…but resuls in all tests failing every time, no idea why… https://gist.github.com/renegadeandy/fbfad35a19021df761c42d88adf9a05a
[23:32:18] mrbubbles: has joined #RubyOnRails
[23:36:17] smathy: Cohedrin, thanks, yeah, no idea why/how it's broken so badly.
[23:37:03] speaking1ode: has joined #RubyOnRails
[23:37:05] smathy: renegadeandy, nor me, this was not my suggestion, I have no idea about the ins and outs of this approach.
[23:37:57] renegadeandy: Radar: can you help get me over this last hurdle?
[23:39:29] dezull: has joined #RubyOnRails
[23:40:03] smathy: renegadeandy, re the ternary thing, my hint there is that the only difference between the two different calls is the first symbol argument.
[23:41:17] SteenJobs: has joined #RubyOnRails
[23:41:19] dezull: has joined #RubyOnRails
[23:41:32] s2013: has joined #RubyOnRails
[23:42:00] RahulT: has joined #RubyOnRails
[23:42:08] SteenJobs: re the danger of params and send_data, is it ok to use params in this case -> send_data open(Portfolio.find(params[:id]).custom_proposal.url)?
[23:42:28] dezull: has joined #RubyOnRails
[23:43:38] dezull: has joined #RubyOnRails
[23:43:42] smathy: SteenJobs, the params[:id] there can't expose you to any attacks, if that's what you were asking.
[23:44:13] SteenJobs: ran brakeman and it flagged
[23:44:16] SteenJobs: so just wanted to make sure
[23:44:25] SteenJobs: since it’s nested in Portfolio.find it can’t do much
[23:44:50] renegadeandy: Radar: I have tried this https://gist.github.com/renegadeandy/543d2124b21913f6e673d15f9f008691 but it still deletes my seed data in categories and sub_categories between tests...
[23:44:50] SteenJobs: unless they change the :id and access someone else’s portfolio, but that’s what auth is for!
[23:51:10] speaking1ode: has joined #RubyOnRails
[23:52:04] idefine: has joined #RubyOnRails
[23:52:40] idefine: has joined #RubyOnRails
[23:52:56] RegulationD: has joined #RubyOnRails
[23:53:55] idefine: has joined #RubyOnRails
[23:55:55] idefine: has joined #RubyOnRails
[23:56:31] neanderslob_: has joined #RubyOnRails
[23:57:04] pawnbox: has joined #RubyOnRails
[23:58:20] thejamespinto: has joined #RubyOnRails
[23:58:51] roamingdog: has joined #RubyOnRails
[23:59:07] flashpoint9: has joined #RubyOnRails
[23:59:49] neanderslob_: has joined #RubyOnRails