« Back to channel list

#RubyOnRails - 12 April 2016

« Back 1 day Forward 1 day »
[00:02:25] ramfjord: has joined #RubyOnRails
[00:02:55] PJonestown: has joined #RubyOnRails
[00:03:50] rahult_: has joined #RubyOnRails
[00:07:44] macsteps: has joined #RubyOnRails
[00:11:14] Logico: has joined #RubyOnRails
[00:11:46] flashpoint9: has joined #RubyOnRails
[00:13:31] flashpoi_: has joined #RubyOnRails
[00:15:52] DLSteve: has joined #RubyOnRails
[00:17:33] daveomcd: whats the equivalent of "where" on a record that hasn't yet been saved?
[00:17:37] YourManCJ: smathy: fixed it
[00:17:43] FailBit: daveomcd: uh?
[00:17:49] smathy: YourManCJ, well done.
[00:17:49] cpruitt: has joined #RubyOnRails
[00:18:09] smathy: daveomcd, if ?
[00:18:09] YourManCJ: smathy: thanks, ended up having to precompile assets
[00:18:27] daveomcd: FailBit, like if i did... report.evaluations << Evaluation.new(is_delete: false)
[00:19:04] daveomcd: ahhh i see thanks smathy :)
[00:19:07] ascarter: has joined #RubyOnRails
[00:19:26] FailBit: if you do what I think you're gonna do that will perform really badly
[00:20:22] cpruitt: has joined #RubyOnRails
[00:20:47] kies: has joined #RubyOnRails
[00:20:55] smathy: daveomcd, btw, assuming evaluations is a has_many type association on Report, then << *does* save to the DB.
[00:21:16] baweaver: has joined #RubyOnRails
[00:21:51] daveomcd: smathy, what if report hasn't been saved?
[00:24:15] smathy: daveomcd, oh, sorry - yes, in that case it'll wait.
[00:27:41] jaequery: has joined #RubyOnRails
[00:28:13] zeel: has joined #RubyOnRails
[00:28:56] owenjones: has joined #RubyOnRails
[00:29:10] hervie: has joined #RubyOnRails
[00:32:35] flashpoint9: has joined #RubyOnRails
[00:32:37] FailBit: https://i.imgur.com/zzJhdxZ.png
[00:32:37] jheathco: has joined #RubyOnRails
[00:33:15] owenjones: has joined #RubyOnRails
[00:34:34] P4Titan`: has joined #RubyOnRails
[00:35:42] Cache_Money: How do I get an updated list of ruby versions within rbenv. I'd like to use 2.3.0 but that's not an option when I run $ rbenv install --l.
[00:36:47] stannard: has joined #RubyOnRails
[00:37:59] Ropeney: Cache_Money, did you install with git? do a git pull and a git pull in ruby-build (under .rbenv/plugins iirc)
[00:38:36] Cache_Money: Ropeney: I checked and I don't hae a .rbenv/plugins directory, so I don't think I used git to install it.
[00:38:43] Cache_Money: It's been so long, not sure how I installed it.
[00:38:51] Ropeney: are you on a mac?
[00:38:54] Cache_Money: I think I used homebrew
[00:39:07] FailBit: I don't even know what to do on a mac
[00:39:21] eljimbo: has joined #RubyOnRails
[00:39:35] FailBit: read its manpages and you're led to think "oh hey bsd"
[00:39:43] FailBit: then you go "wait where's the ports"
[00:39:43] Ropeney: Cache_Money: brew upgrade --HEAD ruby-build
[00:40:12] Ropeney: FailBit, mac best laptop to work on imo
[00:40:19] hervie_: has joined #RubyOnRails
[00:40:21] Cache_Money: Ropeney: $ brew upgrade ruby-build produced: "Error: ruby-build HEAD already installed"
[00:40:36] FailBit: Ropeney, as long as you BYAK
[00:41:25] Ropeney: FailBit, I never use cloud services so I don't know
[00:41:29] King_Rex: has joined #RubyOnRails
[00:41:45] FailBit: bring your own keyboard?
[00:41:47] Ropeney: Cache_Money, your gunna have to google that
[00:41:55] FailBit: mac keyboards are literally evil
[00:42:03] _Tariq: has joined #RubyOnRails
[00:42:14] Ropeney: FailBit, i googled BYOK and found it said "bring your own key" haha
[00:42:36] Ropeney: FailBit, but yes, for long term typing i BYOK (I think i have 3 of the same mech keyboards)
[00:42:44] FailBit: what switch
[00:42:57] Ropeney: browns, I use blacks around 1am - 5am though
[00:43:00] RegulationD: has joined #RubyOnRails
[00:44:19] Sawbones: has joined #RubyOnRails
[00:44:47] Cache_Money: Ropeney: I just installed ruby-build using git https://github.com/rbenv/ruby-build#installing-as-an-rbenv-plugin-recommended
[00:44:58] Ropeney: Cache_Money coolio :D
[00:46:15] Ropeney: did u remove from brew first?
[00:47:04] chagel: has joined #RubyOnRails
[00:47:29] Cache_Money: Ropeney: No, I didn't. But when I ran $ rbenv install -l I saw a different list of ruby versions (e.g. 2.3.0)
[00:47:51] Ropeney: Cache_Money, I'd still look at removing it... for sanities sake when you forget it's there
[00:49:03] Cache_Money: Ropeney: So $ brew uninstall ruby-build ?
[00:49:47] Ropeney: Cache_Money, i believe so... then brew cleanup
[00:49:51] FailBit: has left #RubyOnRails: ("WeeChat 0.4.2")
[00:50:14] diegoaguilar: has joined #RubyOnRails
[00:51:08] Cache_Money: Ropeney: Cool. So, if I want to set the ruby verion to 2.3.0 for a new project (but leave the global version at 2.2.2, since I have old projects using that), would you recommend I just use $ rbenv local 2.3.0 within the new project directory?
[00:51:40] jenrzzz: has joined #RubyOnRails
[00:51:45] eggoez: has joined #RubyOnRails
[00:52:25] pawnbox: has joined #RubyOnRails
[00:52:40] Cache_Money: okay. thanks for the help!
[00:53:08] Ropeney: Cache_Money, enjoy :D
[00:54:44] Cache_Money: Ropeney: I just opened a new terminal tab and now it looks like it's using RVM instead of rbenv. Do you think it's because I uninstalled ruby-build from homebrew?
[00:55:32] crystal77: has joined #RubyOnRails
[00:55:48] Cache_Money: Ropeney: Nevermind, that looks like a freak incident. I just quit and opened up iTerm again and it's using rbenv
[00:55:51] Ropeney: Cache_Money, did you put the correct stuff in your .bashrc || .zshrc ?
[00:56:01] Ropeney: and you probably don't want both rvm and rbenv
[00:56:04] kadoppe: has joined #RubyOnRails
[00:57:01] Cache_Money: Ropeney: It looks like when I try to navigate to the directory where I put $ rbenv local 2.3.0 it's saying "ruby-2.3.0 is not installed. To install do: 'rvm install ruby-2.3.0'"
[00:57:27] Ropeney: Cache_Money, as above; you probably don't want both
[00:58:11] Cache_Money: Ropeney: How should I uninstall RVM? I tried $ brew uninstall rvm but got "Error: No such keg"
[00:58:27] flashpoint9: has joined #RubyOnRails
[00:58:34] eyeamaye: has joined #RubyOnRails
[00:58:37] Ropeney: Cache_Money, getting out of the time I'm able to commit to help you sorry; your gunna have to google some of these questions
[00:59:24] Cache_Money: No worries. Thanks for all of the help!
[01:00:24] workmad3: has joined #RubyOnRails
[01:02:08] bruno-: has joined #RubyOnRails
[01:05:36] zave: has joined #RubyOnRails
[01:06:50] marcules: has joined #RubyOnRails
[01:11:30] sevenseacat: has joined #RubyOnRails
[01:12:38] edwinvdgraaf: has joined #RubyOnRails
[01:12:56] maxdoubt: has joined #RubyOnRails
[01:15:01] jheathco1: has joined #RubyOnRails
[01:15:20] Sawbones: has joined #RubyOnRails
[01:18:26] stannard: has joined #RubyOnRails
[01:20:33] kadoppe: has joined #RubyOnRails
[01:21:26] deur-: has joined #RubyOnRails
[01:26:29] GodFather: has joined #RubyOnRails
[01:28:48] diegoaguilar: has joined #RubyOnRails
[01:30:00] petor: has joined #RubyOnRails
[01:31:18] emachnic: has joined #RubyOnRails
[01:33:39] Radar: Darmani: hi again,.
[01:33:52] Radar: Darmani: I would prefer it if you would follow my instructions when I give them.
[01:34:03] Darmani: ACTION apologies for being difficult
[01:34:15] Radar: It's a reocurring theme which is now going to stop.
[01:34:26] Radar: Otherwise, I won't be hearing from you.
[01:34:39] Darmani: Radar: As you wish.
[01:35:37] Darmani: Radar: I suppose it's not wise to bite the hand that feeds you haha
[01:36:24] emachnic: has joined #RubyOnRails
[01:37:07] Radar: hooray you're learning
[01:37:32] Radar: "Radar please help me" "<basic instructions>" But I just need this help" "<basic instructions, again>"
[01:37:44] Radar: I don't do it to frustrate. I do it because it helps to point to actual code to explain how it works.
[01:38:23] Darmani: Radar: Right right I get it.
[01:38:27] Darmani: Are we good? Lol
[01:38:47] Radar: Yes. Please don't let it happen again.
[01:38:55] sevenseacat: until the next time it happens, most likelt
[01:39:10] Radar: I'll just put Darmani on ignore for a month then.
[01:40:43] Radar: It is disrespectful of my time to not follow my instructions.
[01:41:30] Darmani: Radar: I understand. Can we move on now?
[01:41:41] RubyJedi-ing: has joined #RubyOnRails
[01:50:25] cabargas: has joined #RubyOnRails
[01:50:53] quazimodo: has joined #RubyOnRails
[01:50:54] quazimod1: has joined #RubyOnRails
[01:52:02] ascarter: has joined #RubyOnRails
[01:55:23] Technodrome: has joined #RubyOnRails
[01:58:00] hinbody: has joined #RubyOnRails
[01:59:59] stannard: has joined #RubyOnRails
[02:00:08] ascarter: has joined #RubyOnRails
[02:00:21] jenrzzz: has joined #RubyOnRails
[02:01:48] eljimmy: has joined #RubyOnRails
[02:05:51] pawnbox: has joined #RubyOnRails
[02:05:51] jheathco1: has left #RubyOnRails: ()
[02:05:52] twilling: has joined #RubyOnRails
[02:06:03] urkle: has joined #RubyOnRails
[02:06:58] joeytwiddle: has joined #RubyOnRails
[02:07:37] chouhoulis: has joined #RubyOnRails
[02:15:04] ur5us: has joined #RubyOnRails
[02:15:18] helpa: has joined #RubyOnRails
[02:15:23] P4Titan: No luck...
[02:15:46] mclee: has joined #RubyOnRails
[02:18:16] scrooloose: has joined #RubyOnRails
[02:18:23] P4Titan: Any thoughts? I feel like this second manifest I made isn't getting loaded
[02:19:06] smathy: P4Titan, require_tree evidently doesn't work outside of app/assets/javascripts
[02:19:28] sevenseacat: you feel, or you verified? :/
[02:19:29] P4Titan: I don't think that that's the issue
[02:20:04] P4Titan: 'cause my empty application.js in the app dir shows up in my webpage inspect as its comments
[02:20:10] P4Titan: w/o the //= lines
[02:20:25] P4Titan: but my index.js in the vendor dir doesn't show up anywhere
[02:20:48] _Tariq: has joined #RubyOnRails
[02:21:23] P4Titan: I could reference this index file from my application.js using a bunch of ../../ etc, but I feel like that's messy and generally bad
[02:21:53] sevenseacat: so where is this index.js in the vendor dir? whats the path of it?
[02:22:05] P4Titan: vendor/assets/javascripts
[02:22:07] sevenseacat: can you put together a gist showing us all of the relevant information?
[02:22:12] royvandermeij: has joined #RubyOnRails
[02:24:07] P4Titan: https://gist.github.com/anonymous/756af7471007f8eaab1e80b6aeb8ac5b
[02:24:42] sevenseacat: there's no require tree of vendor there
[02:24:51] P4Titan: what do u mean?
[02:25:07] sevenseacat: "and then I do a require_tree ./DIR_NAME" thats not in that code
[02:25:21] P4Titan: smathy: recomended I get rid of the ./
[02:25:28] sevenseacat: so? its still not there
[02:25:32] P4Titan: but it didn't work w/ ./fbootstrap-js
[02:25:50] sevenseacat: thats irrelevant if its that index.js that isnt getting loaded
[02:25:58] sevenseacat: which you said it is
[02:26:13] sevenseacat: you need to load that index.js in your application.js manifest
[02:26:14] P4Titan: I think that's the root issue
[02:26:25] P4Titan: using a bunch of ../
[02:26:37] sevenseacat: by loading the file
[02:26:47] P4Titan: //= require index.js?
[02:27:02] sevenseacat: without the js... have you read any of the asset pipeline guide?
[02:27:33] sevenseacat: can you show me where it says to load files with their js extension
[02:29:18] cabargas: has joined #RubyOnRails
[02:29:26] P4Titan: my css files didn't load when I only put their name
[02:29:30] smathy: What js extension?
[02:29:36] P4Titan: so I put the full rbootstrap.min.css
[02:29:40] smathy: P4Titan, you can't do the require_tree for vendor.
[02:29:49] sevenseacat: they havent even tried to
[02:31:28] smathy: That's not where fbootstrap-js is?
[02:31:30] stannard: has joined #RubyOnRails
[02:31:40] sevenseacat: it is, but its the index.js thats not loading
[02:31:53] sevenseacat: as far as I can tell
[02:31:54] smathy: That's not in the app/assets/javascripts tree somewhere?
[02:32:02] sevenseacat: no, its in vendor
[02:32:34] P4Titan: ahh, got it to work
[02:32:46] P4Titan: I had to //= require index in application.js
[02:33:03] P4Titan: and then in index.js, I had the require_tree
[02:33:17] P4Titan: now, any ideas on my css extension issue?
[02:33:20] smathy: Right yeah, from within the same dir. Makes sense now.
[02:33:55] smathy: I think sevenseacat is much better at working out what you actually mean than me. Good luck.
[02:34:00] sevenseacat: what css extension issue?
[02:34:21] P4Titan: actually, ignore that
[02:34:32] P4Titan: there's no issue after all
[02:34:41] sevenseacat: P4Titan: we're not all guys here, so you know.
[02:35:06] pawnbox: has joined #RubyOnRails
[02:36:02] P4Titan: I generalized using coloquial english; Im sorry, guyz + galz
[02:36:54] chagel: has joined #RubyOnRails
[02:37:07] sevenseacat: can we try to not use gender-specific language at all? :)
[02:37:23] sevenseacat: there's not much point to it, really
[02:37:40] _Tariq_: has joined #RubyOnRails
[02:37:50] P4Titan: from a linguist's perspective
[02:38:11] P4Titan: much more heavily gender languages that attach genders to all nouns
[02:38:16] P4Titan: tend to be warmer
[02:38:23] sevenseacat: thats cool. english isnt one of them.
[02:38:36] P4Titan: tho German is hella cold in my opinion
[02:38:41] P4Titan: and its gender stuff is a mess
[02:39:01] P4Titan: but Romance and Slavic languages, ya
[02:41:35] lyoshajapan: has joined #RubyOnRails
[02:41:58] Chagel_: has joined #RubyOnRails
[02:43:44] zeel: has joined #RubyOnRails
[02:45:16] rails356: has joined #RubyOnRails
[02:45:30] owenjones: has joined #RubyOnRails
[02:47:39] Darmani: has joined #RubyOnRails
[02:50:09] idefine: has joined #RubyOnRails
[02:52:01] Technodrome: has joined #RubyOnRails
[02:52:58] StaticVoid: has joined #RubyOnRails
[02:54:05] sleungcy: has joined #RubyOnRails
[02:54:20] bahar: has joined #RubyOnRails
[02:54:20] bahar: has joined #RubyOnRails
[02:54:23] stannard: has joined #RubyOnRails
[02:56:02] pawnbox: has joined #RubyOnRails
[02:58:23] bronson: has joined #RubyOnRails
[03:00:11] rake_db_migrate: has joined #RubyOnRails
[03:03:15] DoctorMonocular: has joined #RubyOnRails
[03:07:41] macsteps: has joined #RubyOnRails
[03:08:34] chagel: has joined #RubyOnRails
[03:14:07] braincrash: has joined #RubyOnRails
[03:14:37] cabargas: has joined #RubyOnRails
[03:15:04] flashpoint9: has joined #RubyOnRails
[03:16:06] Chagel_: has joined #RubyOnRails
[03:23:02] spaghetti-o: If model A is self-referential (has_many children that keeps going down)
[03:23:09] spaghetti-o: and model A belongs to Model Cat
[03:23:22] spaghetti-o: how can Model Cat access has_many model A and all the children
[03:23:42] spaghetti-o: has_many will just grab all the immediate model A's that have the fk set to Cat id
[03:24:10] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[03:27:14] baweaver: has joined #RubyOnRails
[03:28:32] audy: has joined #RubyOnRails
[03:29:05] audy: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[03:29:52] Arcaire: s/Sometimes/Often/
[03:31:09] petor: has joined #RubyOnRails
[03:32:07] havenwood: ACTION ponders whether to prefer real logic or fake values
[03:32:30] lyoshajapan: has joined #RubyOnRails
[03:33:21] havenwood: I guess fake logic isn't a thing.
[03:34:28] todd: has joined #RubyOnRails
[03:38:58] theery: has joined #RubyOnRails
[03:41:08] Inside: has joined #RubyOnRails
[03:41:18] lyoshajapan: has joined #RubyOnRails
[03:41:35] Inside: Hey guys. What's a decent javascript package that works well with rails to make single page applications?
[03:41:49] joshkovach: has joined #RubyOnRails
[03:42:37] sevenseacat: *hey everyone
[03:42:54] Inside: hi sevenseacat o/
[03:42:56] Inside: ACTION sits on sevenseacat 
[03:44:11] sevenseacat: not... much... just working away o.O
[03:44:27] Inside: any thoughts on something like react.js.. or ember.. or angular?
[03:44:37] sevenseacat: ACTION still not quite sure how to respond to being sat on for suggesting a grammar change
[03:45:37] Inside: it was a friendly sitting
[03:45:43] sypheren: has joined #RubyOnRails
[03:45:45] Inside: and "guys" is asexual :D
[03:45:51] sevenseacat: Inside: I'd stop digging if I were you
[03:46:13] Inside: ACTION shrugs.
[03:47:12] Radar: Hey michael_mbp
[03:48:20] michael_mbp: finally got around to doing that resume mate RT317795474HK
[03:48:27] michael_mbp: https://www.desilva.io/
[03:48:47] michael_mbp: Inside: shipping code lol.
[03:48:48] Radar: well it's not your nickserv password, so I dunno what that was.
[03:49:00] michael_mbp: package at customs :p
[03:49:11] michael_mbp: bloody paste buffer... how rude. Seriously.
[03:54:31] DLSteve: has joined #RubyOnRails
[03:57:46] treaki__: has joined #RubyOnRails
[03:59:16] chagel: has joined #RubyOnRails
[04:03:20] bronson: has joined #RubyOnRails
[04:04:24] bruno-: has joined #RubyOnRails
[04:04:42] lele: has joined #RubyOnRails
[04:05:49] dopie: .menu-featured-image{:style => "background-image: url('pie.jpg');"}
[04:06:03] emachnic: has joined #RubyOnRails
[04:06:03] dopie: how would i insert ruby code where 'pie.jpg' is?
[04:06:24] lyoshajapan: has joined #RubyOnRails
[04:07:01] dopie: i need to link to the image in the assets directory
[04:08:06] lyoshajapan: I love microservices, but what can I do if I need a factory of 1 microservice in another?
[04:08:38] scott_o: dopie: can't you just do `...url('#{some_ruby_method_or_var}');"}`?
[04:09:12] dopie: scott_o: actually I need to link pie.jpg to the asset called pie in app/assets/images
[04:09:15] dopie: how would i do that?!
[04:10:11] baweaver: Dopie, you've been here long enough you should know to look things up first.
[04:10:18] dopie: baweaver: i am
[04:10:24] dopie: im not sure what to look up...
[04:10:40] helpa: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[04:10:53] dopie: ummm I have that book
[04:10:55] baweaver: I would go back over a book to as one thing
[04:11:13] baweaver: as far as the url, what do you think you should look up?
[04:12:15] dopie: .class { background-image: url(<%= asset_path 'image.png' %>) }
[04:12:17] dopie: i see that
[04:12:45] Radar: !assets also mentions this
[04:12:45] helpa: http://guides.rubyonrails.org/asset_pipeline.html - The Asset Pipeline Guide by Ryan Bigg, Richard Hulse & Mohammad Typaldos
[04:12:46] baweaver: and they're in public/images?
[04:13:00] dopie: Radar: thanks reading down
[04:14:52] dopie: thanks :)
[04:15:10] duncannz: has joined #RubyOnRails
[04:15:49] duncannz: has joined #RubyOnRails
[04:23:06] emchamp-dt: has joined #RubyOnRails
[04:23:56] djbkd: has joined #RubyOnRails
[04:25:16] Technodrome: has joined #RubyOnRails
[04:28:38] pawnbox: has joined #RubyOnRails
[04:32:34] merida: has joined #RubyOnRails
[04:33:28] joshkovach: has joined #RubyOnRails
[04:34:59] Regulati_: has joined #RubyOnRails
[04:35:45] emachnic: has joined #RubyOnRails
[04:43:29] Inside: what do you guys think of react.rb?
[04:44:03] sevenseacat: Inside: again, still not all guys here
[04:44:50] Inside: Usually, guys. Informal. persons of either sex; people:
[04:44:50] Inside: Could one of you guys help me with this?
[04:45:55] Inside: english is descriptive, not prescriptive
[04:46:14] sevenseacat: I'm not going to start going into debates, just letting you know my thoughts.
[04:46:36] Inside: you certainly seemed like you were up for one
[04:46:40] htmldrum: has joined #RubyOnRails
[04:48:20] sevenseacat: well if you think you have a good reason why you simply must alienate people, sure.
[04:48:55] Inside: I'm curious - not trying to be combative about this - but are you trans?
[04:49:13] sevenseacat: my gender, orientation, etc. is completely irrelevant from the discussion
[04:49:17] lyoshajapan: has joined #RubyOnRails
[04:49:42] Inside: not really
[04:52:21] Inside: I'm reading up on react.rb
[04:52:31] Inside: and it seems so unholy
[04:53:07] njero: has joined #RubyOnRails
[04:53:32] baweaver: then don't use it?
[04:53:37] tetraktys: has joined #RubyOnRails
[04:54:36] Inside: I mean it looks enticing
[04:54:50] Inside: but something about generating javascript from ruby just seems so.... wrong
[04:54:52] Inside: beautiful, but wrong.
[04:55:38] lyoshajapan: has joined #RubyOnRails
[04:56:08] macsteps: has joined #RubyOnRails
[04:57:28] jenrzzz: has joined #RubyOnRails
[04:57:43] fedexo: has joined #RubyOnRails
[04:59:52] eyeamaye: has joined #RubyOnRails
[05:03:41] zeel: has joined #RubyOnRails
[05:03:41] Devalo: has joined #RubyOnRails
[05:05:05] bruno-: has joined #RubyOnRails
[05:05:19] crameth: has joined #RubyOnRails
[05:15:59] sp1rs: has joined #RubyOnRails
[05:19:43] DoctorMonocular: has joined #RubyOnRails
[05:20:37] rvanlieshout: has joined #RubyOnRails
[05:22:59] Technodrome: has joined #RubyOnRails
[05:23:54] tildes: has joined #RubyOnRails
[05:28:33] tildes: I've tried to read more about testing, and I found some terminology things confusing. In particular what is meant by 'mocks'. Martin Fowlert likes a quite tight definition "mocks use behavior verification", so that you use a 'mock' object, if you want to verify that the mock has received a particular method call. But then in Rails Antipatterns mock seems to equal a factorygirl object, which in Fowler's parlance is probably a stub, since
[05:29:20] tildes: So which is which? Should I in RoR context just forget about defining mock in Fowlerian terms, and go with the 'every fake object is a mock' flow?
[05:29:46] tildes: (http://martinfowler.com/articles/mocksArentStubs.html, http://www.amazon.com/Rails-AntiPatterns-Refactoring-Addison-Wesley-Professional/dp/0321604814)
[05:29:48] rvanlieshout: tildes: i would suggest to only use mock objects if they involve something external
[05:30:11] rvanlieshout: if you mock stuff that's just in your application you're a) not testing the real deal and b) have to maintain the behavior of the mock
[05:30:33] tildes: rvanlieshout: you mean mock by which definition now :)
[05:31:10] rvanlieshout: i don't know the exact defenition but 'every fake object is a mock' would do i guess :)
[05:31:25] sevenseacat: my explanation is - a mock is a stub with an expectation
[05:31:28] tildes: rvanlieshout: even every stubbed method call? because technically that could also be called a 'mock'
[05:31:46] sevenseacat: which I guess lines up with fowler's explanation
[05:32:12] tildes: rvanlieshout: so your definition is probably the widest possible, and you use them maybe only with external services / apis you don't want to call during testing
[05:32:21] tildes: sevenseacat: yes, I think so
[05:32:25] petor: has joined #RubyOnRails
[05:32:28] rvanlieshout: tildes: exactly
[05:33:31] tildes: can a factorygirl object answer the methods of the object it is presenting? I think it can, otherwise, how could you save it?
[05:33:52] sevenseacat: factorygirl has nothing to do with presenters
[05:33:56] tildes: if it can, it really shouldn't be called a 'mock', because nothing is being mocked?
[05:33:58] sevenseacat: it just instantiates objects for you
[05:34:12] tildes: except it's not real data
[05:34:13] sevenseacat: though I guess if you use the stub functionality it does
[05:34:20] rvanlieshout: tildes: it's real data
[05:34:23] rvanlieshout: but most likely random
[05:34:27] sevenseacat: I dont see that very often though
[05:34:46] tildes: yes, I mean 'real data' as in 'production data', which probably is not a useful definition, because with factorygirl you can persist
[05:34:50] tildes: so it is data allright
[05:35:04] rvanlieshout: it should persist. the idea of the factory pattern is that you don't care about how it's created
[05:35:08] rvanlieshout: you just need that thing
[05:35:20] rvanlieshout: it's not about stubbing, mocking or anything other fake
[05:35:53] tildes: the case from rails antipatterns I mentioned explains testing a controller, where you test that an action actually saves an object, and then they stub the save call. and I was thinking how useful it is, and wouldn't this case best be covered in feature tests
[05:36:02] rvanlieshout: it's an answer to 'i just need an order, created by a user who represents two customers and i don't care how that's created for this context'
[05:36:03] tildes: where you most likely would want to test the happy case of saving an object
[05:36:15] rvanlieshout: tildes: don't stub if you want to test your application
[05:36:17] tildes: rvanlieshout: right, makes sense :)
[05:36:23] tildes: (the previous part)
[05:36:48] tildes: rvanlieshout: I find recommendations to do it, and right now, recommendations not to. :)
[05:36:50] rvanlieshout: if you want to test if your controller saves something on a particular call, make that call and verify it's saved
[05:37:26] rvanlieshout: if you really really desire you could check if the save method is called from your controller action
[05:37:29] rvanlieshout: and stop there
[05:37:29] ur5us: has joined #RubyOnRails
[05:37:34] rvanlieshout: but then it would fail if you switch to an other method in the controller
[05:37:43] tildes: rvanlieshout: technically you could verify save is called, and then on object level check that the save call does what it should. but I'm not sure in this particular case if it really saves any time or effort. you can clean up the db afterall
[05:37:50] rvanlieshout: where in this case it's not really relevant how the controller saves it
[05:38:03] rvanlieshout: what if it uses .create
[05:38:16] rvanlieshout: db cleanup is part of the test suite
[05:38:16] Cohedrin: anyone highly experienced in rendering asci art
[05:38:17] sevenseacat: most controller tests in rails are a waste of time becuase the controller is supposed to be thin and dumb
[05:38:19] Cohedrin: ¯\_(ツ)_/¯
[05:38:23] Cohedrin: isn't rendering properly :(
[05:38:30] sevenseacat: looks fine here.
[05:38:33] Cohedrin: getting the question mark with the box around it
[05:38:38] Cohedrin: yeah, but not on the rails app
[05:38:39] rvanlieshout: Cohedrin: i think it's a local issue then
[05:38:52] sevenseacat: then you dont have a font that can render the Japanese character in the middle?
[05:38:55] tildes: what was interesting about the rails antipatterns case was highlighting the fact that if you need to use a lot of mocks and stubs to test the controller in case, you a re probably doing things too complicated in the controller anyway
[05:39:17] tildes: but if seeing that requires you to do a lot of brittle and unnecessary stuff in the tests, the tradeoff doesn't seem worth it
[05:39:53] mosez: has joined #RubyOnRails
[05:39:54] rvanlieshout: tildes: do you have a particular case?
[05:39:58] IceBear: has joined #RubyOnRails
[05:39:58] Macaveli: has joined #RubyOnRails
[05:40:03] Cohedrin: oh its using roboto
[05:40:05] Cohedrin: how did that happen
[05:40:15] Cohedrin: thanks for pointing me in the right direction sevenseacat
[05:40:28] tildes: rvanlieshout: I left the book at home, otherwise I could take a picture of the page in particular
[05:40:39] tildes: it's in rails antipatterns, 'mock suffocation' :)
[05:40:49] tildes: (a cool name for a sub-chapter :D )
[05:40:51] rvanlieshout: tildes: ok, but that means no :) there is no single best strategy
[05:41:20] rvanlieshout: so just inhale that info and leave it at that for now :) you'll have to see what methods to use in a real case each time
[05:41:54] tildes: rvanlieshout: sure I will. thanks for the conversation
[05:42:06] rvanlieshout: cause there is something to say for both
[05:42:26] sp1rs: has joined #RubyOnRails
[05:46:30] nodejunkie: has joined #RubyOnRails
[05:47:06] tildes: sevenseacat: actually the title "mocks aren't stubs" seems to imply Fowler would not go with "mock is a stub with expectation" definition. Just saying. Then again, to my ear the latter is easier to remember.
[05:47:52] sevenseacat: i didnt read the article, but it matched the description you gave of mocks having behaviour verification
[05:48:06] arup_r: has joined #RubyOnRails
[05:48:06] sandelius: has joined #RubyOnRails
[05:48:14] djbkd: has joined #RubyOnRails
[05:48:22] sevenseacat: you can of course place expectations on non-stubs
[05:51:00] krz: has joined #RubyOnRails
[05:51:24] tildes: I think any expect/assert/should is behaviour verification in some sense of the word. But can you make a non-stub object expect a method to be called, without a separate assertion? (which is what I think was meant in the article... in any case, this probably needs a bit more time to sink in :) )
[05:51:37] htmldrum: has joined #RubyOnRails
[05:53:52] lxsameer: has joined #RubyOnRails
[05:59:33] conta: has joined #RubyOnRails
[06:01:18] Palsson: has joined #RubyOnRails
[06:07:28] bruno-: has joined #RubyOnRails
[06:09:07] Ropeney: anyone know how to do a send with multiple method chains without eval? similar to https://gist.github.com/Ropeney/9fa0a0b709d58d5579fb6f360d0ce2c4 just trying to prototype. Yes i agree the whole idea is horrible.
[06:11:42] rvanlieshout: Ropeney: person&.car&.color
[06:12:05] RubyJedi-ing: has joined #RubyOnRails
[06:12:43] Ropeney: rvanlieshout, can that become a method so the string can be "name" || "car.color"
[06:13:32] rvanlieshout: what exactly are you trying to do?
[06:13:55] Ropeney: take a string, and send it to a object. The string can be a single method so send works, or a nested method.
[06:14:25] Ropeney: I tried to be as clear as possible in the spec
[06:14:38] rvanlieshout: i don't think there is a safe way of doing that
[06:15:12] Ropeney: that's what I've found so far and only eval seems to work. Thats why I thought i'd ask :(
[06:15:20] rvanlieshout: and in what context do you want to use this?
[06:15:23] rvanlieshout: eval is never a good thing
[06:15:26] sp1rs: has joined #RubyOnRails
[06:16:14] Ropeney: just playing with some code, seeing what kind of dynamic magic i can do
[06:16:50] pawnbox: has joined #RubyOnRails
[06:19:25] solars: has joined #RubyOnRails
[06:20:16] lyoshajapan: has joined #RubyOnRails
[06:20:25] srinidhi: has joined #RubyOnRails
[06:20:59] Ropeney: rvanlieshout, https://gist.github.com/Ropeney/9fa0a0b709d58d5579fb6f360d0ce2c4 I think thats safest I can get if you were interested
[06:21:55] rvanlieshout: yeah. something like that
[06:23:54] darutoko: has joined #RubyOnRails
[06:26:12] qejk: has joined #RubyOnRails
[06:27:10] rodfersou: has joined #RubyOnRails
[06:29:05] bronson: has joined #RubyOnRails
[06:34:36] sypheren: has joined #RubyOnRails
[06:35:11] aganov: has joined #RubyOnRails
[06:37:48] PedramT: has joined #RubyOnRails
[06:38:39] yfeldblum: has joined #RubyOnRails
[06:41:16] yfeldblum: has joined #RubyOnRails
[06:41:51] jenrzzz: has joined #RubyOnRails
[06:44:13] macsteps: has joined #RubyOnRails
[06:46:03] arup_r: has joined #RubyOnRails
[06:48:35] PedramT: has joined #RubyOnRails
[06:49:23] petertretyakov: has joined #RubyOnRails
[06:53:00] sp1rs: has joined #RubyOnRails
[06:54:35] petertretyakov: has joined #RubyOnRails
[06:55:16] stannard: has joined #RubyOnRails
[06:57:22] FreddieFresh: has joined #RubyOnRails
[06:58:54] mark3: has joined #RubyOnRails
[06:58:56] yfeldblum: has joined #RubyOnRails
[06:59:04] sypheren: has joined #RubyOnRails
[07:01:13] PedramT: has joined #RubyOnRails
[07:02:04] bmf: has joined #RubyOnRails
[07:04:38] chagel: has joined #RubyOnRails
[07:08:31] diegoaguilar: has joined #RubyOnRails
[07:08:31] bruno-: has joined #RubyOnRails
[07:09:20] tvw: has joined #RubyOnRails
[07:14:12] theery: has joined #RubyOnRails
[07:14:42] lyoshajapan: has joined #RubyOnRails
[07:19:44] PedramT: has joined #RubyOnRails
[07:20:21] czerasz: has joined #RubyOnRails
[07:21:33] krz: has joined #RubyOnRails
[07:24:12] edwinvdgraaf: has joined #RubyOnRails
[07:25:02] smoitra: has joined #RubyOnRails
[07:32:37] zpe: has joined #RubyOnRails
[07:33:23] antgel: has joined #RubyOnRails
[07:33:39] petor: has joined #RubyOnRails
[07:35:00] Dimik: is there alternative to 'sleep' in ror ?
[07:35:26] Dimik: something that doesn't hang the session perhaps
[07:37:18] PedramT: has joined #RubyOnRails
[07:38:06] soahccc: Dimik: what are you trying to do?
[07:38:13] sevenseacat: and what exactly do you want it to do, if not 'hang the session'?
[07:38:27] soahccc: is it normal that my etag contains quotes? :S
[07:38:42] srinidhi: has joined #RubyOnRails
[07:38:52] Ropeney: has joined #RubyOnRails
[07:39:48] soahccc: apparently it's normal. interesting
[07:40:00] Dimik: well ideally i wanted to apply a before filter to at least have the countdown of some sort
[07:40:11] Dimik: and that's in sinatra
[07:40:38] sevenseacat: countdown to... what?
[07:40:52] sevenseacat: why wouldnt you do that in JavaScript?
[07:41:06] Dimik: i have a nokogiri session that scrapes movie titles and it requires for poltergeist to load a page couple of seconds here and there of sleep time
[07:41:46] Dimik: so knowing before it goes to sleep to wait for poltergeist to load the page i wanted to display a jquery time countdown
[07:41:55] soahccc: Dimik: Sounds like you want to put this into a background job and short poll for results.
[07:42:10] sevenseacat: i'm glad you can make heads or tails of this soahccc
[07:42:18] sevenseacat: i'll leave it to you :)
[07:42:33] Dimik: sevenseacat i'm sorry if i'm not making much sense to you
[07:43:35] petor: has joined #RubyOnRails
[07:43:43] soahccc: sevenseacat: I know this stuff ;) We have a setup in which you can start compile&rsync tasks and see the console output (transmitted via memcache >.>)
[07:46:21] Dimik: it's not easy
[07:46:54] Dimik: i tried before do without any luck though
[07:47:18] soahccc: Dimik: tried what? background jobs?
[07:48:17] Dimik: well i tried system exec that also hung the session for sleep time in .rb script
[07:48:41] Dimik: i tried the 'before do' filters in class that didn't help either
[07:49:18] soahccc: the one time I wanna link it, it's down... Thanks ruby-toolbox :(
[07:49:30] soahccc: https://webcache.googleusercontent.com/search?q=cache:UuYJkBfnssgJ:https://www.ruby-toolbox.com/categories/Background_Jobs+&cd=1&hl=de&ct=clnk&gl=us
[07:49:42] Dimik: would that help me you think? http://blog.markwatson.com/2011/11/ruby-sinatra-web-apps-with-background.html
[07:49:43] soahccc: Dimik: you want something from there
[07:50:03] Dimik: thank you kindly
[07:51:48] soahccc: Dimik: Also sinatra is not rails, I don't know whats different there :) But with worker setups you don't want "slow requests" because they block your workers.
[07:52:04] Dimik: yeah it's just sinatra channel is dead
[07:53:01] quazimodo: has joined #RubyOnRails
[07:53:13] quazimod1: has joined #RubyOnRails
[07:53:31] soahccc: well but don't expect that many sinatra professionals here :) But I guess the principle applies here. Background processing + client side polling for results
[07:53:42] Palsson: has joined #RubyOnRails
[07:54:28] Dimik: yeah i'm going to slowly and surely migrate to rails
[07:55:04] sevenseacat: "is there alternative to 'sleep' in ror" it wouldnt matter if there was because you're not using it then
[07:55:20] Dimik: well actually I DID try it in ror
[07:55:33] Dimik: that's why i moved on to sinatra thinking i'd get a different result
[07:55:33] Ergo: has joined #RubyOnRails
[07:55:51] Dimik: but the outcome was the same
[07:56:02] Ryzokuken: has joined #RubyOnRails
[07:56:09] Ryzokuken: i needed help
[07:56:14] krz: has joined #RubyOnRails
[07:56:18] Ryzokuken: i was thinking of a project
[07:56:31] sevenseacat: ryzokuken: !guys
[07:56:31] helpa: ryzokuken: We're not all guys here - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[07:56:42] Ryzokuken: which required fetching and returning files from github
[07:56:47] Ryzokuken: helpa: mates!
[07:57:14] Ryzokuken: first i made the whole project on a javascript single-page framework.
[07:57:30] Ryzokuken: but i decided we needed user authentication and stuff
[07:57:41] Ryzokuken: so i decided to switch to rails
[07:57:51] marcules: has joined #RubyOnRails
[07:58:11] Ryzokuken: what i want to achieve, is to be able to view and edit stuff using urls
[07:58:18] sp1rs: has joined #RubyOnRails
[07:58:24] Ryzokuken: and the file path in the repository
[07:58:29] Palsson_: has joined #RubyOnRails
[07:58:36] Ryzokuken: get ':path' => 'application#index'
[07:58:46] Ryzokuken: and rendered the text just to make sure
[07:59:00] Ryzokuken: while app/readme works
[07:59:07] Ryzokuken: app/js/readme won't
[07:59:20] Ryzokuken: i doesn't accept slashes
[07:59:24] Ryzokuken: what do i do?
[07:59:49] Ryzokuken: i want something like app/.../.../whatever/folder/readme.md/edit
[08:00:06] Ryzokuken: how do i make the two kind of slashes NOT conflict with each other?
[08:01:26] dannyguk: has joined #RubyOnRails
[08:04:08] Ryzokuken: its not even accepting dots
[08:04:23] Ryzokuken: although i figured out a work-around for the slash
[08:04:32] Ryzokuken: people, anyone?
[08:09:21] tildes: I wrote a short test case which works ok, but I wonder about style and best practices. I will just share it here in case somebody would like to take a look and give some feedback http://pastie.org/private/pihsrt1lxaoulhc7yw6huq Comments included
[08:09:23] baweaver: has joined #RubyOnRails
[08:09:26] bruno-: has joined #RubyOnRails
[08:09:26] dANOKELOFF: has joined #RubyOnRails
[08:09:45] tildes: (rspec with ActiveRecord)
[08:10:56] sevenseacat: it looks nasty to me, but i dont know the context or how the example group is getting called
[08:11:28] sevenseacat: far too much coupling to all the "defined elsewheres"
[08:11:56] tildes: so you would rather have all in the same file?
[08:12:04] matthias_: has joined #RubyOnRails
[08:12:08] sevenseacat: no, i'd rather it be arranged in a way that makes sense
[08:12:11] Sn0wy: has joined #RubyOnRails
[08:12:19] sevenseacat: having everything in one file does not reduce coupling
[08:12:35] tildes: defined elsewhere means defined in the spec where this is called
[08:12:35] xhoy: hi!, i have a routing question that doesn't seem to be listed in the docs...
[08:12:38] xhoy: https://gist.github.com/xhoy/a9586ca97ddbc8e03d82ceb409430d19 <<
[08:12:51] xhoy: why doesnt a nested resources work with only: :preview?
[08:12:54] tildes: sevenseacat: I appreciate the feedback anyway, thanks
[08:13:21] sevenseacat: tildes: thats even worse
[08:13:42] sevenseacat: you have a spec, which calls a shared example group, which then calls functions back in the spec?
[08:13:55] tildes: well, the whole existing set is defined like that
[08:14:20] tildes: it was even more nested, which I have tried to reduce
[08:14:47] tildes: all shared examples make a lot of assumptions on where they are called
[08:14:56] tildes: but I realize this could be an issue. they know too much
[08:15:11] moep: has joined #RubyOnRails
[08:16:31] tildes: is the ideal case NOT passing any parameters to shared_examples?
[08:17:05] sevenseacat: you're not passing any parameters at the moment
[08:17:32] Chagel_: has joined #RubyOnRails
[08:17:37] tildes: well, no, but the example calls methods of the spec
[08:17:50] tildes: so I would rather not do that, instead pass a parameter if need be
[08:18:20] sevenseacat: the problem here is you've shown us half a spec of what looks to be a complex system, and expected to get meaningful criticism of it
[08:18:26] sevenseacat: with no other information
[08:18:32] sevenseacat: like, what is this even testing
[08:19:09] tildes: It tests that attributes that were not present before running the service with canned data will be updated
[08:19:49] sevenseacat: i'll have to take your word for it
[08:20:09] sevenseacat: why is this a shared example? what is it shared with?
[08:20:13] AzaToth: has joined #RubyOnRails
[08:20:18] tildes: naturally I thought it might be possible to say something meaningful about this sample, otherwise why post it. if it looks 'nasty' or 'complex' I take it as valid feedback, and then I am asking questions to understand the principles I should follow
[08:20:43] tildes: I made it a shared example to make the calling spec look prettier
[08:21:00] sevenseacat: tildes: yet we could remove 90% of the back and forward if you just provided the full set of information in the first place
[08:21:11] sevenseacat: to save everyone time and effort
[08:21:18] gss: has joined #RubyOnRails
[08:21:19] tildes: I have certainly tried
[08:21:34] tetraktys: has joined #RubyOnRails
[08:21:49] tildes: (the code is not mine, and there is a lot of it, and would be uncomfortable to share everything, not to mention long to read)
[08:21:56] marr: has joined #RubyOnRails
[08:22:07] tildes: (not sure if I'm allowed to do that either)
[08:22:24] soahccc: I use ARGF.each_line for a parser script so that I can pipe it in (I don't pass filenames to the script). Some grep constellations will cause each_line to not do anything. removing my last pipe into the script gives output though. Am I doing it wrong with ARGF?
[08:22:39] sevenseacat: well you've got my critique, and you've also mildly irritated me
[08:22:49] tildes: I am very sorry about that
[08:22:54] sevenseacat: i'm sure you are.
[08:22:55] tildes: Thanks for taking the time
[08:23:06] tildes: I am not a sarcastic person.
[08:24:17] soahccc: Wow, it does work but it appears that the "chunk size" is very huge. I need dozens of lines for some to make it to my script
[08:24:36] ch01: has joined #RubyOnRails
[08:25:37] arup_r: has joined #RubyOnRails
[08:25:53] tildes: So basically a shared example should not call methods defined in the spec that calls it?
[08:26:31] pawnbox: has joined #RubyOnRails
[08:26:38] jenrzzz: has joined #RubyOnRails
[08:27:51] jsrn: has joined #RubyOnRails
[08:28:12] doge__: has joined #RubyOnRails
[08:29:06] arBmind: has joined #RubyOnRails
[08:29:40] bronson: has joined #RubyOnRails
[08:31:33] tetraktys: has joined #RubyOnRails
[08:32:32] yfeldblum: has joined #RubyOnRails
[08:38:49] PedramT: has joined #RubyOnRails
[08:41:51] zeel_: has joined #RubyOnRails
[08:49:57] tetraktys: has joined #RubyOnRails
[08:50:15] AlexJakeGreen: has joined #RubyOnRails
[08:50:27] srinidhi: has joined #RubyOnRails
[08:55:47] sp1rs: has joined #RubyOnRails
[08:56:03] akkmaxon: has joined #RubyOnRails
[08:57:38] dangerousdave: has joined #RubyOnRails
[08:58:22] Macaveli: has joined #RubyOnRails
[09:01:20] PedramT: has joined #RubyOnRails
[09:03:28] merida: has joined #RubyOnRails
[09:03:50] duderonomy: has joined #RubyOnRails
[09:04:36] SeanLazer: has joined #RubyOnRails
[09:08:52] crdpink2: has joined #RubyOnRails
[09:11:15] workmad3: has joined #RubyOnRails
[09:11:15] arBmind1: has joined #RubyOnRails
[09:12:03] PedramT: has joined #RubyOnRails
[09:13:19] b0un7y: has joined #RubyOnRails
[09:14:58] nobitanobi: has joined #RubyOnRails
[09:16:11] nobitanobi: workmad3: I found a reason why using the singleton_class approach can be problematic :)
[09:16:55] rvanlieshout: because you need multiple instances? :)
[09:16:58] aurum_infide_: has joined #RubyOnRails
[09:17:52] Dbugger: has joined #RubyOnRails
[09:17:55] Dbugger: Hello everyone
[09:18:37] Dbugger: Does anybody know if there is anyway to know if a Item.new has been modified? I want to create a Item.new with every page request, but only persist it, if the action makes changes on it...
[09:18:44] sp1rs: has joined #RubyOnRails
[09:18:49] tetraktys: has joined #RubyOnRails
[09:19:00] rvanlieshout: dbugger: Item.new is always a new one?
[09:19:25] rvanlieshout: or are you assigning other stuff ater that statement?
[09:19:50] n008f4g_: has joined #RubyOnRails
[09:20:07] Dbugger: rvanlieshout, yes. it is new.
[09:20:09] sevenseacat: errr, what are you trying to do dbugger?
[09:20:15] Dbugger: Let me explain
[09:20:54] rvanlieshout: and gist the code
[09:22:51] nobitanobi: workmad3: here is the issue with singleton approach: http://pastie.org/10794577
[09:23:16] Dbugger: I have an e-shop, where people do not need to register as user to buy. But I do not want to create a "Basket.create" for every user that simple opens the front page. I want to persist it only if they actually put an item in the basket. But I still want to show a "Basket (0 items)" in the header when they start at the front page. So I thought, on every visit I create before_action where a "Basket.new" is created. And then an
[09:23:16] Dbugger: "after_action" where if the basket as some articles inside, it gets persisted. So I would like to know if there is a way that the "Basket.new" has been altered in some way.
[09:25:40] rvanlieshout: nobitanobi: what are you trying to do? ruby has other methods of using a singleton
[09:26:05] rvanlieshout: dbugger: well.. after that action it's not Basket.new anymore
[09:26:07] nobitanobi: rvanlieshout: I wanted that anyone trying to access a phone name through a user object, get an error.
[09:26:08] rvanlieshout: it's stored in an instance var
[09:26:12] rvanlieshout: dbugger: you can call .changed? on that
[09:26:17] skislak: has joined #RubyOnRails
[09:26:26] nobitanobi: but if I try to access a phone name with a straight phone object, not error out
[09:26:32] ferr: has joined #RubyOnRails
[09:26:46] rvanlieshout: nobitanobi: so have user.phone return something that fails?
[09:27:07] nobitanobi: I still want to be able to access other methods of phone
[09:27:15] rvanlieshout: and it's certainly not a singleton
[09:27:20] rvanlieshout: cause you have multiple phone instances
[09:27:35] nobitanobi: sure, but with this approach I am accessing the singleton_class of the AR object
[09:27:47] nobitanobi: or at least, that was my assumption
[09:28:09] rvanlieshout: where would you expect that to happen?
[09:28:52] rvanlieshout: and wouldn't it be way easier to raise DeprecationError in phone if it has as user?
[09:28:52] Dbugger: rvanlieshout, let me see.
[09:29:20] nobitanobi: rvanlieshout: I expect that if I do: user = User.find(1); puts user.phone.name; # Here I get error - If I do phone = Phone.find(1); phone.name # Here I don't get an error.
[09:29:25] b0un7y: hi guys, I'm new to ruby on rails, so far I've had a lot of fun with it even though it messes with my brain a little bit
[09:29:50] rvanlieshout: nobitanobi: but wouldn't it be wrong that Phone.find(1).name doesn't throw an error even though it relates to a user?
[09:30:19] daytime: has joined #RubyOnRails
[09:30:25] aurum_infide: has joined #RubyOnRails
[09:30:29] rvanlieshout: b0un7y: good to hear you're having fun :)
[09:30:30] nobitanobi: rvanlieshout: nopes. I'm working on a refactor, and I want to avoid making the assumption that you can get a user name through a phone
[09:31:13] rvanlieshout: so then you don't want Phone.find(1).name to give a name if it belongs to a user
[09:31:27] syahdeini: has joined #RubyOnRails
[09:32:03] syahdeini: has joined #RubyOnRails
[09:32:47] Dbugger: In the end, I think im just gonna make a filter on the methods that actually update the basket, to persist them
[09:33:44] rvanlieshout: dbugger: what's wrong with calling .changed?
[09:34:06] tagaulap: has joined #RubyOnRails
[09:34:33] tagaulap: has joined #RubyOnRails
[09:34:33] tagaulap: has joined #RubyOnRails
[09:34:34] nobitanobi: rvanlieshout: yes, I do want. Just want to error out if I try to access the phone name through a user. THat is user.phone.name
[09:34:36] Dbugger: rvanlieshout, nothing, works great. Thanks for the tip. Im just wondering what is the easiest one to mantain
[09:35:03] rvanlieshout: nobitanobi: so forget about the user model
[09:35:08] rvanlieshout: solve it purly in the phone model
[09:35:20] nobitanobi: rvanlieshout: care to explain how?
[09:36:39] FooMunki: has joined #RubyOnRails
[09:36:43] rvanlieshout: nobitanobi: def name \n raise DepcrecationStuff if user.present?\nsuper\nend
[09:38:03] nobitanobi: rvanlieshout: I don't follow sorry. A phone can always have a user.
[09:38:25] rvanlieshout: but if it has a user you don't want to access the name?
[09:38:47] yfeldblum: has joined #RubyOnRails
[09:39:23] nobitanobi: if it has a user and I access the name through it directly its fine. Is just a matter of accessing the name through a User instance. phone.name should work regardless of it is associated with a user or not. But doing user.phone.name should break
[09:39:37] rvanlieshout: something like https://gist.github.com/rvanlieshout/0619b78c7491119170ef96e9a71043bc
[09:39:53] rvanlieshout: why the difference between user.phone.name and phone.name if the phone is the same?
[09:40:20] nobitanobi: because I want to avoid consumers of user instances to have the assumption that they can access phone name.
[09:41:01] dANOKELOFF: has joined #RubyOnRails
[09:41:02] M-shine: has joined #RubyOnRails
[09:41:02] rvanlieshout: because the phone's name is not valid for the case where it belongs to a user?
[09:41:22] nobitanobi: no, because the consumers of users are in a domain that should not care about some of the phone's attributes
[09:41:48] rvanlieshout: then it's not possible
[09:41:55] rvanlieshout: phone = user.phone
[09:41:59] rvanlieshout: user.phone == phone
[09:42:06] rvanlieshout: so user.phone.name == phone.name
[09:43:14] rvanlieshout: and there is no sane case in changing that
[09:43:39] PedramT: has joined #RubyOnRails
[09:43:55] arBmind: has joined #RubyOnRails
[09:45:45] lyoshaja_: has joined #RubyOnRails
[09:46:12] soahccc: What could cause incompatible character encoding errors when it's not the URL (I can call it just fine) and it's not related to "Accept */*"? The backtrace is useless since apparently safebuffer concat is lazy
[09:47:15] bmf: has joined #RubyOnRails
[09:48:10] soahccc: The utf8=✓ parameter is screwed up but that doesn't seem to affect anything :/
[09:48:17] PedramT_: has joined #RubyOnRails
[09:48:24] rvanlieshout: is that all the info?, soahccc :)
[09:48:50] soahccc: rvanlieshout: well I can show you the trace but it doesn't help I'm afraid
[09:49:25] rvanlieshout: it'll always help
[09:52:43] soahccc: rvanlieshout: https://gist.github.com/2called-chaos/c1db48b5fbd1a19c73218f61b6430da7
[09:53:12] PedramT: has joined #RubyOnRails
[09:53:34] soahccc: the last backtrace in app trace is a render call to some static buttons, no user (or request) input whatsoever
[09:53:52] rvanlieshout: soahccc: what ruby version and what's on app/views/account/sessions/_form.html.erb:33 ?
[09:53:57] rvanlieshout: cause that's where the failure is triggered
[09:54:04] blackhuey: has joined #RubyOnRails
[09:54:10] soahccc: rvanlieshout: one second but I think it's lazy concat
[09:54:19] udiudi: has joined #RubyOnRails
[09:54:50] rvanlieshout: the trace shows you what it is
[09:55:16] Sn0wy: has joined #RubyOnRails
[09:55:48] soahccc: rvanlieshout: https://gist.github.com/2called-chaos/c1db48b5fbd1a19c73218f61b6430da7#file-gistfile1-html-erb
[09:56:09] soahccc: because I don't understand why it should fail _there_
[09:56:31] rvanlieshout: let's verify first. it works if you leave out that render?
[09:57:07] soahccc: rvanlieshout: I can't reproduct :) Hence my original question: what request based variable can cause this
[09:57:33] rvanlieshout: there are tons of reasons
[09:57:37] rvanlieshout: howcome you can't reproduce?
[09:57:49] rvanlieshout: you have the request_uri?
[09:58:13] soahccc: rvanlieshout: this is from the exception tracker. I tried with the same accept and accept_encoding headers but I can't trigger the error :)
[09:59:41] soahccc: rvanlieshout: the only weird thing of all those request values there is that the utf8 parameter looks ugly but I call it the same way
[09:59:48] owenjones: has joined #RubyOnRails
[10:00:30] rvanlieshout: soahccc: i suppose the request actually just contains invalid characters
[10:00:52] soahccc: but where? It's not the url or not only that
[10:01:08] rvanlieshout: that utf8-param is there for a reason
[10:01:54] soahccc: But when I do the same GET request (with that broken utf8 param) it should reproducible, no?
[10:02:05] rvanlieshout: if you can use the exact same encoding, yes
[10:02:49] djbkd: has joined #RubyOnRails
[10:02:49] soahccc: I could but I guess it's not accept_encoding then :)
[10:03:01] rvanlieshout: well.. the exception tracker could already have broken it
[10:03:54] soahccc: you mean the symbol?
[10:04:57] soahccc: it can also store the correct one, I had (unrelated) exceptions with the correct symbol
[10:05:54] ql6wlld: has joined #RubyOnRails
[10:06:20] rvanlieshout: the issue is the encoding and it's kinda hard to copy paste stuff in the right encoding if it went through other services
[10:08:07] PedramT: has joined #RubyOnRails
[10:08:36] soahccc: I hate encodings :(
[10:08:39] tetraktys: has joined #RubyOnRails
[10:08:47] arup_r: has joined #RubyOnRails
[10:09:07] rvanlieshout: don't we all :)
[10:09:45] soahccc: and how do you deal with that? catch and render bad request?
[10:10:16] soahccc: As far as I can tell it's only spiders causing that
[10:10:25] baweaver: has joined #RubyOnRails
[10:12:18] rvanlieshout: i don't think you can do anything about invalid requests
[10:12:20] kadoppe: has joined #RubyOnRails
[10:13:34] soahccc: well we did a few things to block malicious requests (which often also cause exceptions flooding our nice empty exception tracker)
[10:17:48] sp1rs: has joined #RubyOnRails
[10:20:16] macsteps: has joined #RubyOnRails
[10:27:34] lyoshajapan: has joined #RubyOnRails
[10:28:13] PedramT: has joined #RubyOnRails
[10:28:56] Balzrael: has joined #RubyOnRails
[10:29:30] PedramT_: has joined #RubyOnRails
[10:29:55] jenrzzz: has joined #RubyOnRails
[10:31:33] bronson: has joined #RubyOnRails
[10:33:22] b0un7y: has joined #RubyOnRails
[10:34:02] kailido: has joined #RubyOnRails
[10:34:18] xhoy: i have a helper that converts decimal (1.00) to € 1.00 (adding the € sign), can i use this in liquid?!?
[10:34:26] xhoy: hi kailido
[10:35:14] kailido: value = params[:type] == "accept" ? 1 : -1
[10:35:27] kailido: what does the ? 1 : -1 means
[10:35:46] kailido: im parsing a value that increments or decrements
[10:35:50] sevenseacat: its a ternary conditional
[10:36:08] sevenseacat: means value will either be set to 1 or -1 depending on if params[:type] == "accept"
[10:36:14] kailido: it is increment +1 well, but decremententing -2 idk why
[10:36:18] xhoy: kailido: you could write if params == "accept" then 1 else -1
[10:36:57] gmas: has joined #RubyOnRails
[10:37:24] kailido: but this "1" will add to the previous value ?
[10:39:55] rvanlieshout: xhoy: why did you create a helper for that?
[10:40:04] xhoy: rvanlieshout: are there seperated liquid helpers?
[10:40:13] xhoy: can't find anything about that
[10:40:15] rvanlieshout: dunno about liquid, but rails has built in support for that
[10:40:26] xhoy: rvanlieshout: yeah the rails helper is there :P
[10:40:31] xhoy: and i like to use that in liquid :)
[10:40:33] yfeldblum: has joined #RubyOnRails
[10:40:40] rvanlieshout: kailido: if foo then 1 else -1 == foo ? 1 : -1
[10:40:48] lyoshajapan: has joined #RubyOnRails
[10:40:55] rvanlieshout: xhoy: aren't you passing in the locals to be used in liquid?
[10:41:30] kailido: but why is decrementing 2 and incrementing 1 ?
[10:41:48] rvanlieshout: show me that it's doing that
[10:41:49] ur5us: has joined #RubyOnRails
[10:41:51] xhoy: rvanlieshout: i pass an object to liquid, that is use as a local (invoice in this case) invoice has a price (decimal) and for display reasons i like to display it with €. in erb/haml etc i would use my " money" helper
[10:42:08] xhoy: i can now do invoice.price and that works great :)
[10:42:40] rvanlieshout: pass in a decorated invoice
[10:43:02] xhoy: mm they are cold filters in liquid
[10:43:19] renegadeandy: has joined #RubyOnRails
[10:43:26] xhoy: called filters
[10:43:33] andya_: has joined #RubyOnRails
[10:43:57] tetraktys: has joined #RubyOnRails
[10:44:29] GodFather: has joined #RubyOnRails
[10:44:53] xhoy: rvanlieshout: thanks i think i found it (no clue how to use it but going to find it :))
[10:45:44] rvanlieshout: iirc filters are pied
[10:45:52] rvanlieshout: invoice.price|filter
[10:46:13] xhoy: rvanlieshout: yeah, but how do i define my own filter, and where do i place the file
[10:46:38] xhoy: https://github.com/Shopify/liquid/wiki/Liquid-for-Programmers <<< class < liquid::block ....
[10:48:01] rvanlieshout: oh hehe :) dunno
[10:48:23] xhoy: so they removed the rails support (for .liquid files) wich i don't need
[10:48:28] xhoy: first lunch!
[10:48:40] workmad3: xhoy: `Liquid::Template.register_filter(...)` in an initializer maybe?
[10:49:31] mikeiniowa: has joined #RubyOnRails
[10:50:06] xhoy: workmad3: in my config/initlizers ?
[10:50:22] xhoy: workmad3: but i should then load some module in stead of create all tags there?
[10:51:04] udiudi: has joined #RubyOnRails
[10:51:05] srinidhi: has joined #RubyOnRails
[10:51:05] Jasaka: has joined #RubyOnRails
[10:52:16] pawnbox: has joined #RubyOnRails
[10:52:47] xhoy: workmad3: http://code.runnable.com/Up0zXTHu834vAAEX/how-to-use-filters-in-liquid-templates-for-ruby-on-rails <<< :P
[10:52:57] xhoy: oke i create a filter in initializers ;)
[10:53:35] pawnbox: has joined #RubyOnRails
[10:53:37] dvinciguerra_: has joined #RubyOnRails
[10:54:05] kailido: https://gist.github.com/luisamaro0/1a92e19bbbf04f440065a1c7e2174021
[10:55:22] kailido: the value starts at 0, if I click accept goes to 1, reject goes to -1. but If it is on 2, if i accept goes to 3, reject goes to 0
[10:55:41] Detch: has joined #RubyOnRails
[10:56:02] stannard: has joined #RubyOnRails
[10:56:47] norc: has joined #RubyOnRails
[10:57:10] antgel: has joined #RubyOnRails
[10:57:38] norc: So I have the need to generate parameterised URLs to external resources. Where do you generally place these URLs? I18n was an obvious candidate, but it does not feel right there, since its not about localisation really.
[10:58:24] norc: I could also just store them as constants in my decorators..
[11:00:43] aloneintheworld: has joined #RubyOnRails
[11:00:53] workmad3: norc: I'd normally start by considering either constants or loading them from a YAML file
[11:01:30] workmad3: norc: depending on how many there were and how often they changed, I'd also consider if the list should be stored in the database
[11:01:48] diegoaguilar: has joined #RubyOnRails
[11:01:49] norc: workmad3: It is fairly static, YAML seems like an obvious choice then.
[11:02:35] nfk|laptop: has joined #RubyOnRails
[11:05:41] owenjones: has joined #RubyOnRails
[11:05:43] trinaldi: has joined #RubyOnRails
[11:05:54] adlerdias: has joined #RubyOnRails
[11:07:07] PedramT: has joined #RubyOnRails
[11:07:54] sp1rs: has joined #RubyOnRails
[11:10:26] merida: has joined #RubyOnRails
[11:10:49] Fernando-Basso: has joined #RubyOnRails
[11:10:53] petor: has joined #RubyOnRails
[11:11:08] petor: has joined #RubyOnRails
[11:12:13] PedramT: has joined #RubyOnRails
[11:12:25] emachnic: has joined #RubyOnRails
[11:13:02] sevenseacat: has joined #RubyOnRails
[11:13:31] dANOKELOFF: has joined #RubyOnRails
[11:13:38] WebDevB: has joined #RubyOnRails
[11:13:54] WebDevB: Hey guys, I'm wondering if anyone can help me...
[11:14:56] WebDevB: I've never used Ruby and a client of ours is having an issue when saving records their getting error 500... But I can't see it in the apache2 logs.
[11:15:12] moei: has joined #RubyOnRails
[11:15:38] RegulationD: has joined #RubyOnRails
[11:17:16] WebDevB: Anyone around?
[11:17:27] theery: has joined #RubyOnRails
[11:19:23] tildes: WebDevB: http://guides.rubyonrails.org/debugging_rails_applications.html#what-is-the-logger-questionmark
[11:19:35] tildes: you will probably find it in the rails log
[11:20:17] WebDevB: Thanks tildes, I'll take a look.
[11:20:36] tildes: helpa !guy
[11:20:48] Palsson: has joined #RubyOnRails
[11:20:55] tildes: ok it doesn't work like that. I just wanted to get the 'not everyone is a guy or wants to be called a guy' message out...
[11:21:05] tildes: WebDevB: no worries, hope you find it!
[11:21:38] Skelz0r: has joined #RubyOnRails
[11:24:07] sp1rs: has joined #RubyOnRails
[11:24:55] PedramT: has joined #RubyOnRails
[11:24:58] bruno-: has joined #RubyOnRails
[11:27:36] DoubleMalt: has joined #RubyOnRails
[11:28:51] Macaveli: has joined #RubyOnRails
[11:30:26] arup_r: has joined #RubyOnRails
[11:31:27] PedramT: has joined #RubyOnRails
[11:31:37] jenrzzz: has joined #RubyOnRails
[11:32:05] Macaveli: has joined #RubyOnRails
[11:32:26] workmad3: tildes: !guys
[11:32:26] helpa: tildes: We're not all guys here - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[11:32:54] tildes: workmad3: ok thanks :)
[11:33:58] tildes: how can I get a list of all things this chatbot can do?
[11:36:29] workmad3: built-in commands, check the source
[11:36:33] workmad3: !tips otherwise :)
[11:36:33] helpa: Just the tips: http://logs.ryanbigg.com/tips
[11:37:05] workmad3: also, helpa needs an introduction before he'll listen to you :)
[11:37:21] htmldrum: has joined #RubyOnRails
[11:37:47] PedramT: has joined #RubyOnRails
[11:38:11] tetraktys: has joined #RubyOnRails
[11:40:17] nobitanobi: norc: workmad3 if it's of your interest, I have found a solution for the instance_eval problem: http://pastie.org/10794753
[11:44:05] workmad3: nobitanobi: first - the amount of time you're spending on this trying to solve edge cases, it really does seem like you'd be best off reconsidering the data modelling around this area... having to adjust a class on-the-fly because of where you're accessing it from is a major design smell IMO
[11:44:06] norc: nobitanobi: Let me take a look at it. The .dup seems wrong.
[11:44:48] nfk|laptop: a question to angular users, what do you use for RESTful API support?
[11:45:12] workmad3: nobitanobi: second - you probably don't want to be doing `@phone ||= ...` in your override... that's not how rails stores things internally, and you should ideally be trying to let rails keep its own stuff as much as possible
[11:45:16] nfk|laptop: i'm using ngResource for now but quickly feeling like i don't like it
[11:45:29] sevenseacat: nfk|laptop: whats that got to do with rails?
[11:45:42] nobitanobi: workmad3: good points for sure.
[11:45:59] nfk|laptop: sevenseacat, you don't want to know
[11:46:07] workmad3: nobitanobi: third - because of how you're passing the phone to a new user, the deprecation error seems correct... by doing `User.new(phone: phone)` you're basically setting up the `user.phone` link but the long way around
[11:46:13] sevenseacat: nfk|laptop: well if the answer is 'nothing' then you'reasking in the wrong channel.
[11:46:24] sevenseacat: nfk|laptop: so yes, i do want to know.
[11:46:40] workmad3: nobitanobi: of course, that's assuming there's logic to be had at any point is this setup ;)
[11:46:54] norc: nobitanobi: Your "solution" completely annulled the entire code, since you first duplicate the phone object, modify it, but return the original self, effectively rendering all that code useless.
[11:47:03] ldnunes: has joined #RubyOnRails
[11:47:21] nobitanobi: norc: that's true. shut.
[11:48:26] nfk|laptop: sevenseacat, the answer is that angular users mostly write it by hand
[11:48:28] nobitanobi: I thought by returning self, I would be returning the super.dup self
[11:48:32] norc: workmad3: I dont see how it should raise that error though.
[11:48:41] nobitanobi: norc: because the object_ids are the same
[11:48:59] sevenseacat: nfk|laptop: great. #angular is that way --->
[11:49:09] gregf_: has joined #RubyOnRails
[11:49:20] workmad3: nobitanobi: `self` at the end of an instance_eval doesn't become the return value
[11:49:23] norc: nobitanobi: Even if they were, that does not matter. You never call User#phone, so the method should not be masked.
[11:49:56] nobitanobi: workmad3: what is it then?
[11:50:06] norc: nobitanobi: Im going out on a limb and assume that you did not share the entire code you punched into pry.
[11:50:22] workmad3: nobitanobi: pretty sure the return value of `instance_eval` will always be the instance you called it on... similar to `tap`
[11:50:41] dionysus69: has joined #RubyOnRails
[11:50:42] srinidhi: has joined #RubyOnRails
[11:51:01] nobitanobi: workmad3: gotcha. Then, why is that self necessary?
[11:51:02] skislak: has joined #RubyOnRails
[11:51:02] norc: workmad3: Nope, instance_eval returns the last expression from the block.
[11:51:07] nobitanobi: norc: been playing on rails console.
[11:51:11] norc: workmad3: http://ruby-doc.org/core-1.9.3/BasicObject.html#method-i-instance_eval
[11:51:30] workmad3: norc: ah, fair enough... in which case, `self` will be the duplicated instance (seeing as that's the context for the call to `instance_eval`)
[11:51:33] norc: And whops, accidentally linked you the old 1.9.3 docs, but that behavior should not have changed.
[11:52:28] nobitanobi: I would say self is the dup instance, because it raises the error
[11:52:57] norc: nobitanobi: Okay your code looks more or less fine, but drop the @phone ||= part. It will hunt you if you use your own caching mechanis,.
[11:52:58] workmad3: nobitanobi: btw, you probably want to do `def self.name` inside that block
[11:53:18] nobitanobi: norc: remove the memoization alltogether?
[11:53:23] norc: nobitanobi: Yes.
[11:53:43] arup_r: In this *basic example* http://api.rubyonrails.org/classes/ActionController/HttpAuthentication/Basic.html .. I see `http_basic_authenticate_with name: "dhh", password: "secret", except: :index`, and my question is how it works. any pointer please. I never used it
[11:54:06] norc: nobitanobi: If you have some use case where you need it cache, cache it explicitely in the caller
[11:54:12] nobitanobi: norc: makes sense
[11:54:17] nfk|laptop: sevenseacat, despite your strong opinions, it's a valid question and it's a question that's more important to rails rather than angular users
[11:54:43] nobitanobi: workmad3: trying to understand why would I want to do def self.name instead of def name
[11:54:45] IrishGringo: has joined #RubyOnRails
[11:54:49] sevenseacat: nfk|laptop: thats why i asked you how it related to rails, which you didnt answer
[11:54:52] sevenseacat: nfk|laptop: last chance.
[11:55:27] workmad3: nobitanobi: hmm... it seems to be the same in this case... basically `def foo.bar` is ruby syntax for defining the `bar` method on the singleton_class of `foo`
[11:55:42] nfk|laptop: i already did, rails is RESTful, angular is whatever you make it and i want the opinion of someone who actually uses restufl APIs
[11:55:48] Ropeney: has joined #RubyOnRails
[11:56:03] workmad3: nobitanobi: so I'm essentially suggesting you make it absolutely explicit that you're adding a method to the singleton class of your object :)
[11:56:18] nobitanobi: yep, the self will help with that :)
[11:56:21] nobitanobi: thanks workmad3
[11:56:36] nobitanobi: btw, I need to place the self at the end
[11:56:53] sevenseacat: "what do you use for restful support in angular"
[11:56:57] nobitanobi: otherwise, the return of instance_eval is :name
[11:57:09] arup_r: nvm, I got it
[11:57:20] ChanServ: +q *!*@unaffiliated/nfk
[11:57:23] workmad3: nobitanobi: yeah, norc pointed out that `instance_eval` evals to the last statement :)
[11:57:26] sevenseacat: come back in an hour when you're willing to talk about rails.
[11:57:34] nobitanobi: opps, miss that :)
[11:57:38] futilegames: has joined #RubyOnRails
[11:58:44] norc: nobitanobi: One reason why not memoizing it like that is things like #reload
[11:59:00] King_Rex: has joined #RubyOnRails
[11:59:00] norc: nobitanobi: Some code might rely on reload correctly refreshing all cached associations.
[11:59:20] nobitanobi: norc: I was playing with that hehe, yeah is a good point
[12:00:27] augcesar: has joined #RubyOnRails
[12:00:38] krz: has joined #RubyOnRails
[12:02:08] workmad3: nobitanobi: now, back to norc's other question... does it alter the passed-in `phone` immediately after calling `User.new(phone: phone)`? (I have a suspicion of what's happening if that's the case, but wouldn't mind knowing that it's definitely happening :) )
[12:02:29] nobitanobi: yes, it does
[12:02:35] nobitanobi: it seems that on initializing, it goes through the attributes
[12:02:41] nobitanobi: and overwrites the singleton class
[12:02:54] nobitanobi: otherwise I fail to see an explanation :)
[12:03:39] workmad3: nobitanobi: well, it's an association... so when you pass it in, I'm betting it plays around with setting the association and then access it in order to set `user_id` :)
[12:03:55] norc: workmad3: Thinking about it, it *has* to change the object in fact.
[12:04:34] nobitanobi: workmad3: I assume so
[12:04:36] norc: workmad3: Simply because when you define that association between the two objects, AR has to make sure that the phone knows about the user too.
[12:04:51] norc: Or rather the User knows about the Phone.
[12:04:57] workmad3: norc: that doesn't mean it has to go through the custom accessor
[12:05:07] workmad3: but it appears that it does :)
[12:05:26] norc: workmad3: well in reality there is no accessor there
[12:05:32] norc: Because its done with method_missing.
[12:05:34] sevenseacat: nfk|laptop: " as long as you were willing to listen to what they were saying" indeed, which is why I got ticked off when you didnt listen to me.
[12:05:48] workmad3: norc: rails defines the methods in an anonymous module after first-access
[12:05:59] norc: Ah, things I learn.
[12:06:05] workmad3: norc: so it's not method missing very often... and even if it was, it's still an accessor, just a dynamic one ;)
[12:06:10] solars: has joined #RubyOnRails
[12:06:22] nobitanobi: so if I do: user = User.new; user.phone = phone; phone.name #-> This blows up
[12:06:27] nobitanobi: without persisting the user
[12:06:28] owenjones: has joined #RubyOnRails
[12:06:35] norc: nobitanobi: persisting has nothing to do with it.
[12:07:22] conta: has joined #RubyOnRails
[12:07:35] workmad3: norc: and defining your own definitely means there's an accessor... and that's also unrelated to the point I was making, which is that the association code for setting the inverse association could potentially do it with the passed-in object without calling the getter :)
[12:08:21] nobitanobi: workmad3: norc will play with it. Thanks for your thoughts.
[12:08:35] norc: norc will do no such thing.
[12:09:01] macsteps: has joined #RubyOnRails
[12:09:55] workmad3: nobitanobi: I still stand by saying that you should revisit the data modeling in this area btw... having an object act in two different ways depending on the path you access it is a major sign that you're trying to keep a single class instead of two separate ones :)
[12:10:09] workmad3: and it's not like you're gonna run out of classes...
[12:10:38] rickmasta: has joined #RubyOnRails
[12:10:51] norc: And I still stand by saying that you should simply document the change. Implementing this wonky stuff will increase the burden of someone in the long run.
[12:11:07] norc: Make a note in the change log and move on.
[12:11:25] baweaver: has joined #RubyOnRails
[12:11:31] nobitanobi: workmad3: norc I really appreciate your guys' thoughts.
[12:11:41] nobitanobi: inclined to go with the changelog
[12:11:54] nobitanobi: at this point I was trying to figure out the internals of rails a little bit more
[12:12:04] norc: nobitanobi: Go buy a debugger then.
[12:12:17] workmad3: or `git clone https://github.com/rails/rails`
[12:12:23] norc: I hear byebug has a good one.
[12:13:45] norc: Though demystifying rails is great, because overall it is so much smaller than it really appears at first glance.
[12:15:20] crystal77: has joined #RubyOnRails
[12:16:27] norc: So when Rails is sitting behind a proxy, do you guys feel the default logger should log request.remote_ip rather than request.ip?
[12:17:13] sp1rs: has joined #RubyOnRails
[12:17:37] norc: For the regular 'Started GET "/..." for 1.2.3.4' messages in the application log I mean.
[12:18:25] rickmasta: has joined #RubyOnRails
[12:19:41] Jameser: has joined #RubyOnRails
[12:20:13] norc: Im thinking of a small PR for this trivial change: https://gist.github.com/norc/05fcb3fd6fa3e8440884a85fe317f736 because I feel if Rails sits behind a proxy server, the IP address of the proxy is rarely if ever interesting in the log.
[12:20:17] norc: Any opinions?
[12:20:18] rvanlieshout: norc: i would expect to see the external ip
[12:20:31] rvanlieshout: and agreed on that rarely if ever part
[12:20:32] norc: rvanlieshout: Mmm.
[12:22:45] rodfersou: has joined #RubyOnRails
[12:24:28] diegoaguilar: has joined #RubyOnRails
[12:26:03] bruno-: has joined #RubyOnRails
[12:30:39] pawnbox: has joined #RubyOnRails
[12:32:19] jenrzzz: has joined #RubyOnRails
[12:33:44] _Tariq: has joined #RubyOnRails
[12:37:16] theery: has joined #RubyOnRails
[12:38:46] nobitanobi: has joined #RubyOnRails
[12:40:38] ChanServ: -q *!*@unaffiliated/nfk
[12:41:20] nfk|laptop: what? not going to be permanent? there, i'll help you myself, sevenseacat
[12:41:24] nfk|laptop: has left #RubyOnRails: ("yawn")
[12:41:31] sevenseacat: no, I said an hour.
[12:41:39] tetraktys: has joined #RubyOnRails
[12:42:28] sevenseacat: though it was a bit less that that. I'll mute you for another 15min if you like.
[12:44:37] augcesar[2]: has joined #RubyOnRails
[12:47:09] petor: has joined #RubyOnRails
[12:48:55] chagel: has joined #RubyOnRails
[12:51:02] tetraktys: has joined #RubyOnRails
[12:52:15] joshkovach: has joined #RubyOnRails
[12:52:53] User458764: has joined #RubyOnRails
[12:53:05] kadoppe: has joined #RubyOnRails
[12:53:39] epochwolf: hmm... doesn't seem to work for me.
[12:53:47] epochwolf: !muzzle sevenseacat
[12:53:56] User458764: has joined #RubyOnRails
[12:55:04] PedramT: has joined #RubyOnRails
[12:55:29] pawnbox: has joined #RubyOnRails
[12:55:48] ramortegui: has joined #RubyOnRails
[12:56:30] jmignault: has joined #RubyOnRails
[12:57:12] pawnbox: has joined #RubyOnRails
[13:00:08] fox_mulder_cp: hi, anyone knows about 'panic' near Yellowstone national park?
[13:00:34] htmldrum: has joined #RubyOnRails
[13:00:47] sevenseacat: fox_mulder_cp: maybe wrong channel?
[13:00:53] fox_mulder_cp: russian news make warning about Vuncanic activity last months
[13:01:12] d0nn1e: has joined #RubyOnRails
[13:01:33] fox_mulder_cp: sevenseacat: hm. if u know geo' channel ir freenode i go to it
[13:05:08] fox_mulder_cp: in my shool my teacher says some stories about seismological weapons
[13:05:15] aegis3121: has joined #RubyOnRails
[13:05:26] _Tariq: has joined #RubyOnRails
[13:06:41] b0un7y: has joined #RubyOnRails
[13:07:23] owenjones: has joined #RubyOnRails
[13:07:54] owenjones: has joined #RubyOnRails
[13:08:01] Malgorath: has joined #RubyOnRails
[13:08:37] JakFrist: has joined #RubyOnRails
[13:10:37] M-shine: has joined #RubyOnRails
[13:11:14] dblessing: has joined #RubyOnRails
[13:11:48] stannard: has joined #RubyOnRails
[13:12:26] kadoppe: has joined #RubyOnRails
[13:13:10] Macaveli: has joined #RubyOnRails
[13:15:29] sp1rs: has joined #RubyOnRails
[13:15:34] PedramT: has joined #RubyOnRails
[13:15:36] nzst: has joined #RubyOnRails
[13:17:02] nzst: Hi, are there any good gems or write-ups about keeping data in-sync, e.g. i have events data behind an api, i have another app that needs to query this api and sync the data to it's own database, likely with the necessity for mapping
[13:17:17] tetraktys: has joined #RubyOnRails
[13:18:53] rafaelfranca: has joined #RubyOnRails
[13:18:55] yellow5: has joined #RubyOnRails
[13:20:59] eljimbo: has joined #RubyOnRails
[13:21:29] rvanlieshout: nzst: consider using replication of your db engine?
[13:21:46] context: or webhooks for TELLING the 'slave' application when changes are made
[13:22:03] nzst: rvanlieshout: What do you mean?
[13:22:12] solars: has joined #RubyOnRails
[13:22:18] rvanlieshout: nzst: have your database keep it in sync
[13:22:53] nzst: ah, i hadn't thought of that yet, i'll add it to the list of things to try
[13:23:12] nzst: context: hm, i'm unsure if I can do anything with webhooks, but i'll look into it
[13:23:25] Kus: has joined #RubyOnRails
[13:24:14] flashpoint9: has joined #RubyOnRails
[13:25:45] epochwolf: There's a number of ways to do it but it basically comes down to polling or pushing.
[13:25:58] IrishGringo: has joined #RubyOnRails
[13:26:25] Jameser: has joined #RubyOnRails
[13:26:40] epochwolf: You either have the application making the changes tell the other app you need to update, or you have the other app periodically refresh it's copy of the data and compare changes.
[13:26:56] rvanlieshout: or have the database do that for you :)
[13:27:06] bruno-: has joined #RubyOnRails
[13:27:23] epochwolf: rvanlieshout: using database replication is pushing. :P
[13:27:49] rvanlieshout: true, but not on the app layer
[13:28:03] epochwolf: rvanlieshout: things can have at any layer you have.
[13:28:05] drbayer: has joined #RubyOnRails
[13:28:48] GodFather: has joined #RubyOnRails
[13:29:06] epochwolf: My company likes to do "Layer 8 Replication" (CSRs enter data into multiple systems, manually)
[13:32:28] macsteps: has joined #RubyOnRails
[13:32:36] girlydev: has joined #RubyOnRails
[13:33:08] nzst: hah, it might come to that
[13:33:31] nzst: one of those requests thrown over the wall without much thought behind it
[13:34:22] bronson: has joined #RubyOnRails
[13:34:32] epochwolf: nzst: syncing data can get really complicated... even if it should be simple.
[13:34:50] epochwolf: Even if you have one system that's considered authoriative.
[13:35:19] fmcgeough: has joined #RubyOnRails
[13:36:19] context: its better when no one can tell you what system is authoritative or they tell you what they want to be authoritative but anytime ther eis a change in another system to update "their" authoritative one
[13:36:30] context: ACTION works with a bunch of idiots
[13:37:11] epochwolf: context: unfortunately, I'm the only idiot here.
[13:37:20] dionysus69: has joined #RubyOnRails
[13:37:28] epochwolf: I get to fix all my own mistakes.
[13:37:29] context: oh. sorry. i must've triggered feelings just now
[13:37:48] context: epochwolf: at least they are your own and not someone elses
[13:40:31] epochwolf: nzst: If you want to talk about details, we can. It's a slow day.
[13:42:28] Malgorath: when I do a <%= @log.text %> I forgot how to do a newline to BR conversion... *punches brain with a Q-Tip*
[13:42:53] context: simple_format
[13:43:06] context: http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-simple_format
[13:43:14] Malgorath: Thanks context
[13:43:33] arup_r: has joined #RubyOnRails
[13:44:05] sp1rs: has joined #RubyOnRails
[13:44:47] nzst: epochwolf: well, I think I need to use a polling solution from the app layer, because I need to sync and map data from a neon crm instance into my custom rails application, GET only, so neon crm is authoritative. I have access to a 'last modified date' that I can use to check if anything needs updated. if it needs updated, then update. I guess my major concern is viability, wrong data, and failure to sync handling
[13:45:02] gormandy: has joined #RubyOnRails
[13:45:20] nzst: epochwolf: I plan on using HTTPparty and a model or concern, poll every hour or so, and have a manual button to refresh
[13:45:34] gormandy: how do I test class methods in rspec? I get nomethod error when I run "Class.method"
[13:45:47] tbuehlmann: gormandy: wanna gist the code?
[13:45:56] gormandy: yep doing that now, 1 sec :)
[13:47:01] gormandy: https://gist.github.com/stuffandthings/513dc26b59be37a468d76da8c9b108fc the spec
[13:47:22] macsteps: has joined #RubyOnRails
[13:47:37] gormandy: the code: https://gist.github.com/stuffandthings/cdf2996f0f8aadb85d2264964f3c7fb0
[13:48:13] tbuehlmann: you defined work as an instance method, so it's not available as a class method
[13:48:30] gormandy: darn, instance method*
[13:48:37] gormandy: so I need to test the instance method then
[13:48:49] quazimodo: has joined #RubyOnRails
[13:48:51] quazimod1: has joined #RubyOnRails
[13:49:22] tbuehlmann: right, or define it as a class method, whatever you want
[13:49:50] epochwolf: nzst: yeah, neon looks like a hosted service, your only option is going to be scrapping the frontend or using their api.
[13:50:35] epochwolf: It doesn't look like they do webhooks so you'll just have to using polling.
[13:50:45] gormandy: can't change that code much since the gem im using expects it to be like that
[13:51:47] gormandy: im on betterspecs.org but it doesn't show how to test an instance method that accepts a parameter
[13:53:50] arup_r: gormandy: relish app docs has more examples and very detailed..
[13:54:19] tbuehlmann: gormandy, what's the problem really?
[13:54:37] gormandy: I just want to test my work method and confirm that its creating the model
[13:54:56] gormandy: the work method will end up doing some more complicated stuff which I'd want to test but for now just that
[13:55:42] gormandy: I don't know how to call that method with a parameter in a before do block
[13:57:10] tbuehlmann: does it have to be a before block?
[13:58:28] tbuehlmann: start with something like this: https://gist.github.com/tbuehlmann/d73245545cb4ff273b2fd10d759fcecb
[13:59:00] tbuehlmann: subject is per default `described_class.new`, described_class is ListenerWorker
[13:59:55] arup_r1: has joined #RubyOnRails
[14:00:05] sergio__: has joined #RubyOnRails
[14:00:46] silverdust: I added unique:true to a table and it's not what I expected. I'll like it to only be unique to a user_id
[14:01:17] gormandy: oh okay, didn't know about that
[14:01:35] silverdust: i.e userA can't have slug 'stuff' twice but another user can have slug 'stuff'
[14:01:49] silverdust: but with what I have other users can't have slug 'stuff'
[14:02:31] silverdust: How can I fix this to behave as expected?
[14:02:55] Ropeney: silverdust, validates :class, uniqueness { scope [:user_id, :slug] }
[14:03:05] tbuehlmann: silverdust: and you want that constraint in the database, right?
[14:03:17] stannard: has joined #RubyOnRails
[14:03:20] Ropeney: am i wrong?
[14:03:26] lele: has joined #RubyOnRails
[14:03:31] silverdust: tbuehlmann: yes
[14:03:36] Ropeney: i freehanded it thought that was how you did it :(
[14:04:07] sevenseacat: ropeney: where did :class come from?
[14:04:23] Ropeney: i didnt know model name
[14:04:34] sevenseacat: you dont validate model names
[14:04:37] tbuehlmann: silverdust: what RDBMS do you use?
[14:05:27] Ropeney: add_index :users [:user_id, :slug], unique: true ?
[14:06:13] silverdust: I have this: add_index :favgroups, :slug, unique: true
[14:06:24] Ropeney: and its validates :slug, uniqueness { scope: :user_id } sevenseacat ?
[14:06:34] Ropeney: ypi wamt tjat om a array
[14:06:35] sevenseacat: without the syntax errors
[14:06:44] Ropeney: you want that in an array
[14:06:49] Ropeney: I'm doing bad tonight :(
[14:07:21] tbuehlmann: silverdust: you can add a constraint or an unique index for this
[14:07:41] tbuehlmann: they both have pros and cons, that's up to you
[14:08:26] silverdust: so I should create a migration to remove unique on the table index then what ropeney said?
[14:08:49] silverdust: By unique index you mean what I already have right?
[14:09:03] Ropeney: silverdust, we can't see what you have
[14:09:38] silverdust: I just said this -> add_index :favgroups, :slug, unique: true
[14:09:48] silverdust: I didn't think it was much enough for a paste
[14:09:53] tbuehlmann: yeah, something around `add_index(:accounts, [:branch_id, :party_id], unique: true)`
[14:09:57] chandlerbing: has joined #RubyOnRails
[14:10:13] Ropeney: where's the slug, user_id on that constraint
[14:11:02] Ropeney: you dont want a unique true on slug, if u want to use the same slug more then once
[14:11:12] leksster: has joined #RubyOnRails
[14:11:29] conta: has joined #RubyOnRails
[14:11:47] silverdust: I don't think I get your point
[14:12:03] sp1rs: has joined #RubyOnRails
[14:12:23] sevenseacat: tbuehlmann has it right
[14:12:32] Ropeney: you can do the add_index i pasted above, after removing yours or the model validation after removing your index
[14:12:36] sevenseacat: use your own field names obviously
[14:13:08] silverdust: add_index(:favgroups, :slug, unique: true)
[14:13:47] sevenseacat: yes, thats what you have
[14:13:51] silverdust: That's what it'll be with my own fields and the only difference here is the parentheses
[14:13:54] Ropeney: add_index(:favgroups, [:slug, :user_id], unique: true)
[14:14:26] sp1rs: has joined #RubyOnRails
[14:14:43] lele: has joined #RubyOnRails
[14:15:37] Ropeney: enjoy, that was so much harder then it should have been - my bad :)
[14:15:47] tbuehlmann: +1 for adding that to the database and not only as a rails validation
[14:17:10] RegulationD: has joined #RubyOnRails
[14:21:43] tetraktys: has joined #RubyOnRails
[14:24:28] akshat: has joined #RubyOnRails
[14:27:06] JesseH: has joined #RubyOnRails
[14:27:34] bruno-: has joined #RubyOnRails
[14:27:51] KensoDev: has joined #RubyOnRails
[14:28:16] diegoaguilar: has joined #RubyOnRails
[14:28:28] LastWhisper____: has joined #RubyOnRails
[14:28:45] silverdust: what's the rails validation like?
[14:29:01] Ropeney: sevenseacat, did u stop the writers challenge?
[14:29:36] Ropeney: :( dam life and getting in the way of more important things :P
[14:30:18] silverdust: validates :slug, uniqueness { scope: :user_id } right ropeney ?
[14:30:41] Ropeney: you need a : after uniqueness
[14:31:03] mvpxiv: has joined #RubyOnRails
[14:32:10] mvpxiv: has joined #RubyOnRails
[14:32:56] Ropeney: silverdust, probably read http://guides.rubyonrails.org/active_record_validations.html#uniqueness before using it in your app though :)
[14:33:39] jenrzzz: has joined #RubyOnRails
[14:33:39] jenrzzz: has joined #RubyOnRails
[14:34:57] merida: has joined #RubyOnRails
[14:35:24] quazimodo: has joined #RubyOnRails
[14:35:27] quazimod1: has joined #RubyOnRails
[14:36:07] emachnic: has joined #RubyOnRails
[14:38:30] xhoy: Is there a way to display example output for a method?
[14:39:00] context: yeah in the documents, if its documented
[14:39:08] context: otherwise not without executing it...
[14:39:12] xhoy: oke but Object.method_example?
[14:39:20] xhoy: yeah i have liquid methods
[14:39:27] xhoy: but for the liquid docs i like some sample output :)
[14:39:27] context: i dont know what that is
[14:39:36] context: so make examples.
[14:39:41] context: and put them in the docs.
[14:39:47] xhoy: context: i could create method_example :P
[14:39:52] xhoy: yeah there are a lot of them :P
[14:40:02] context: and im sure people will use that so often..
[14:40:04] xhoy: so i hoped i could add some automatic stuff or something :)
[14:40:32] morenoh149: has joined #RubyOnRails
[14:42:51] smatico: has joined #RubyOnRails
[14:46:11] someish: has joined #RubyOnRails
[14:47:19] rickmasta: has joined #RubyOnRails
[14:49:41] cpruitt: has joined #RubyOnRails
[14:50:33] n008f4g_: has joined #RubyOnRails
[14:50:38] reckoner: has joined #RubyOnRails
[14:53:16] Ergo: has joined #RubyOnRails
[14:53:26] Devalo: has joined #RubyOnRails
[14:54:40] merida: has joined #RubyOnRails
[14:57:15] smathy: has joined #RubyOnRails
[15:01:33] aegis3121: has joined #RubyOnRails
[15:03:46] merida: has joined #RubyOnRails
[15:05:06] lyoshajapan: has joined #RubyOnRails
[15:06:36] adavia: has joined #RubyOnRails
[15:10:12] PedramT: has joined #RubyOnRails
[15:10:31] nickenchuggets: has joined #RubyOnRails
[15:10:44] User458764: has joined #RubyOnRails
[15:11:13] htmldrum: has joined #RubyOnRails
[15:11:34] jhack: has joined #RubyOnRails
[15:11:36] jsrn: has joined #RubyOnRails
[15:12:21] bmf: has joined #RubyOnRails
[15:12:32] petor: has joined #RubyOnRails
[15:14:13] Ergo^: has joined #RubyOnRails
[15:14:53] Nuck: has joined #RubyOnRails
[15:16:45] kadoppe: has joined #RubyOnRails
[15:18:03] lyoshajapan: has joined #RubyOnRails
[15:19:25] merida_: has joined #RubyOnRails
[15:20:00] pawnbox: has joined #RubyOnRails
[15:20:46] agent_white: has joined #RubyOnRails
[15:24:31] fox_mulder_cp: i want make backup of user's data. how to deserialize to xml, as example, now i see, that my class objects is a '0x00558bd09e8048' hash
[15:25:41] merida: has joined #RubyOnRails
[15:25:55] fox_mulder_cp: create to_xml method for my model?
[15:26:01] agent_white: has left #RubyOnRails: ()
[15:26:24] smathy: fox_mulder_cp, explain? Usually to back up a user's data you take a dump of your DB, or a snapshot of your volume. What are YOU doing!?
[15:27:36] fox_mulder_cp: smathy: as example, send to user it's payments history, in readable mode
[15:27:59] artto: has joined #RubyOnRails
[15:28:08] RegulationD: has joined #RubyOnRails
[15:32:52] PedramT: has joined #RubyOnRails
[15:33:59] WebDevB: has joined #RubyOnRails
[15:34:21] PedramT_: has joined #RubyOnRails
[15:34:55] qejk: has joined #RubyOnRails
[15:35:06] jenrzzz: has joined #RubyOnRails
[15:35:22] tsherman: has joined #RubyOnRails
[15:35:34] bronson: has joined #RubyOnRails
[15:36:43] PedramT__: has joined #RubyOnRails
[15:37:58] ZerGabriel: has joined #RubyOnRails
[15:38:37] lyoshajapan: has joined #RubyOnRails
[15:38:47] Zackio: has joined #RubyOnRails
[15:40:29] VeryBewitching: has joined #RubyOnRails
[15:42:10] adu: has joined #RubyOnRails
[15:42:54] smathy: fox_mulder_cp, so more an audit log than a backup.
[15:42:57] [Butch]: has joined #RubyOnRails
[15:43:11] lyoshajapan: has joined #RubyOnRails
[15:43:17] artto: has joined #RubyOnRails
[15:46:00] yaymukund: has joined #RubyOnRails
[15:48:18] artto: has joined #RubyOnRails
[15:51:24] baweaver: has joined #RubyOnRails
[15:51:45] disgrntld: has joined #RubyOnRails
[15:56:55] King_Rex: has joined #RubyOnRails
[15:57:26] sp1rs: has joined #RubyOnRails
[15:59:03] harrymoreno: has joined #RubyOnRails
[16:00:07] njero: has joined #RubyOnRails
[16:01:12] lyoshajapan: has joined #RubyOnRails
[16:02:20] FreddieFresh: has joined #RubyOnRails
[16:02:50] artto: has joined #RubyOnRails
[16:03:18] tsherman: has joined #RubyOnRails
[16:04:34] tsherman: has joined #RubyOnRails
[16:06:10] conta: has joined #RubyOnRails
[16:07:55] bronson: has joined #RubyOnRails
[16:10:19] diegoviola: has joined #RubyOnRails
[16:10:57] dionysus69: has joined #RubyOnRails
[16:12:33] sleungcy: has joined #RubyOnRails
[16:16:17] stannard: has joined #RubyOnRails
[16:17:24] lyoshajapan: has joined #RubyOnRails
[16:17:35] eshea: has joined #RubyOnRails
[16:21:50] arBmind: has joined #RubyOnRails
[16:23:52] bruno-: has joined #RubyOnRails
[16:27:51] aldodelgado: has joined #RubyOnRails
[16:28:26] Cache_Money: has joined #RubyOnRails
[16:28:36] King_Rex: has joined #RubyOnRails
[16:29:11] Macaveli: has joined #RubyOnRails
[16:31:21] lyoshajapan: has joined #RubyOnRails
[16:32:47] baweaver: has joined #RubyOnRails
[16:35:21] lele: has joined #RubyOnRails
[16:36:14] DragonPunch: has joined #RubyOnRails
[16:36:16] Maletor: has joined #RubyOnRails
[16:36:37] jenrzzz: has joined #RubyOnRails
[16:38:22] macsteps: has joined #RubyOnRails
[16:38:48] harrymoreno: has joined #RubyOnRails
[16:39:22] Cache_Money: Yesterday I upgraded rbenv to use ruby-build from Github. I also deleted RVM. I noticed afterwards I didn't have rails installed. I then ran $ gem install rails -v 4.2.4. However, one of my older project is using rails 4.2.1. Now I can't start my rails server in that project. What's the best way to handle this?
[16:40:19] Macaveli: has joined #RubyOnRails
[16:40:39] Ergo: has joined #RubyOnRails
[16:41:10] yaymukund: has joined #RubyOnRails
[16:42:14] Cache_Money: I guess what I'm wondering is the best way to manage multiple versions of Rails for different projects...
[16:42:17] artto: has joined #RubyOnRails
[16:44:13] smathy: Cache_Money, bundler.
[16:44:22] Fernando-Basso: has joined #RubyOnRails
[16:44:23] michael_mbp: anyone here had issues with guard-livereload and Rails 5 beta 3?
[16:47:41] benlieb: has joined #RubyOnRails
[16:47:42] Akuma: has joined #RubyOnRails
[16:50:28] daytime: has joined #RubyOnRails
[16:50:39] dopie: has joined #RubyOnRails
[16:51:31] lyoshajapan: has joined #RubyOnRails
[16:51:45] myntcake: has joined #RubyOnRails
[16:53:14] epochwolf: Cache_Money: how are you running your rails 4.2.1 project?
[16:53:16] Akuma: Hello, I have a rails application running on heroku, roughly 2800 registered users, I am currently experiencing a lot of delayed jobs which are causing request timeouts for the web workers
[16:53:24] yaymukund: has joined #RubyOnRails
[16:53:38] Cache_Money: epochwolf: what do you mean?
[16:53:45] Akuma: The delayed jobs are ActiveRecord jobs
[16:54:01] epochwolf: Cache_Money: what's the command you used to start the server?
[16:54:16] epochwolf: And the resulting error message.
[16:54:49] Cache_Money1: has joined #RubyOnRails
[16:54:58] smathy: Akuma, might just be a bit of confusion there, there's a queue back-end called "delayed job" - that's not what you mean right?
[16:55:13] davidw: has joined #RubyOnRails
[16:55:42] Akuma: smathy: I am not entirely sure, I am basing myself on the log information: "Delayed::Backend::ActiveRecord::Job Load (7.0ms) "
[16:55:47] Cache_Money1: epochwolf: I had to $ bundle config --delete bin; rake rails:update:bin in order to be able to run $ rails s successfully again
[16:56:05] davidw: Hi, I have: has_many :business_listings, -> { BusinessListing.only_active_listings } - is there any way to disable that via unscoped or something like that ?
[16:56:13] epochwolf: Cache_Money_: and now it's working?
[16:56:17] [Butch]: has joined #RubyOnRails
[16:56:57] Cache_Money1: epochwolf: yeah, it's working now. I'm just learning how to manage various ruby versions for different projects using rbenv, but still unclear how to handle different rails versions
[16:57:21] smathy: Akuma, ok. So why would you think those jobs would cause request timeouts?
[16:57:44] Akuma: because I am flooded by them
[16:57:56] Akuma: I have 12 workrers going through them
[16:58:02] Akuma: and they keep on appearing
[16:58:02] epochwolf: Cache_Money_: bundler manages those, use the rails bins or use bundle exec.
[16:58:09] tsherman: has joined #RubyOnRails
[16:58:29] trinaldi: has joined #RubyOnRails
[16:58:31] Akuma: smathy: adding workers actually alliviated the issue in terms of the request timeouts
[16:58:43] Akuma: I was using 2 workers and the application was unusabe
[16:58:47] Akuma: *unusable
[16:58:58] artto_: has joined #RubyOnRails
[16:59:06] Cache_Money: epochwolf: Okay, thanks
[16:59:20] epochwolf: Akuma: are you waiting for something to become available in the controller?
[17:00:02] smathy: Akuma, ok, so something must be wrong. The whole idea of a job queue is to push jobs off onto the queue so that they can be handled asynchronously, and then your web app can respond. It shouldn't have anything to do with your web responses (except to make them quicker).
[17:00:17] User458764: has joined #RubyOnRails
[17:00:41] Akuma: Here's a video of the loging process through papertrail: http://screencast-o-matic.com/watch/cDflDK1B0g
[17:00:51] Akuma: showing what I mean
[17:01:13] smathy: That's not going to illuminate anything.
[17:02:01] Akuma: fair enough... ok, in that case, how are delayed jobs typically started?
[17:02:22] Akuma: or what would normally send a request for it?
[17:02:27] smathy: Akuma, if your web app is dependent on your workers in order to send the response back to the browser then you've made a horrible error in your architecture.
[17:02:45] ramfjord: has joined #RubyOnRails
[17:02:52] Akuma: We've picked up the application... Agreed, somebody messed up big time
[17:02:55] michael_mbp: smathy: have you used livereload?
[17:03:16] Akuma: the whole design is a disaster; that being aside, I have to find a solution for the active users
[17:03:47] epochwolf: Akuma: a crapload of workers until you untangle the mess.
[17:04:02] epochwolf: Well no kidding.
[17:04:04] smathy: Akuma, this is really not a "typical" situation, this is the *only viable* situation: a process that needs to have snappy response has something that would take a long time to do and so instead of doing it synchronously it creates a job in the queue and then gets back to it's snappy response. That job in the queue is processed some time later by a worker.
[17:04:30] Akuma: is there any way to find out the source of the delayed job?
[17:04:38] Akuma: as in who is requesting it?
[17:04:50] epochwolf: Look at the code?
[17:04:52] michael_mbp: calls to DJ or look for the Job class.
[17:04:57] smathy: Akuma, yes, read up http://guides.rubyonrails.org/active_job_basics.html and look for the code that's creating the job.
[17:05:06] michael_mbp: you can ack for .deliver or .deliver_later (irrc)
[17:05:17] smathy: michael_mbp, no, I've not used livereload.
[17:05:20] michael_mbp: (replace . with #)
[17:05:37] michael_mbp: smathy: strange, I've just cloned the same setup from Rails 4 to 5 and guard no longer reloads the browser
[17:05:47] michael_mbp: smathy: what about CSS injection into the pipeline?
[17:06:03] Akuma: Thank you all, I'll further investigate this
[17:06:07] Akuma: I appreciate the help
[17:06:17] norc: has joined #RubyOnRails
[17:06:40] smathy: michael_mbp, I tell you that I've not used it, and you proceed with questions about it?
[17:08:23] michael_mbp: well CSS injection isn't directly related to livereload
[17:08:26] michael_mbp: livereload, reloads the browser
[17:08:27] michael_mbp: (not a big fan of it, but it's better than nothing).
[17:08:47] michael_mbp: forgot to setup the middleware
[17:08:48] Technodrome: has joined #RubyOnRails
[17:08:55] michael_mbp: ACTION smacks himself.
[17:11:01] epochwolf: ACTION smacks michael_mbp as well.
[17:11:05] hypnosb: I'm trying to accepts_nested_attributes_for with a has_many through on a *multi select* , but I get: "no implicit conversion of String into Integer" ... here is my code https://gist.github.com/brylor/d7175dd6d2eb235ebfeaba56826a0377
[17:11:14] thezanke: has joined #RubyOnRails
[17:11:21] lyoshajapan: has joined #RubyOnRails
[17:12:10] smathy: ACTION presents hypnosb with the "Best Question of The Day" award
[17:12:41] theery: has joined #RubyOnRails
[17:13:06] thezanke: has joined #RubyOnRails
[17:13:31] theery: Can anyone help me get a local ssl cert working for development on OSX? I tried several things, most recently this: https://gist.github.com/trcarden/3295935 -- but it's not working
[17:13:55] petor: has joined #RubyOnRails
[17:14:54] artto: has joined #RubyOnRails
[17:15:49] aegis3121: has joined #RubyOnRails
[17:16:01] epochwolf: hypnosb: system_components_attributes needs to be an array, not a hash.
[17:16:12] mwcmitchell: has joined #RubyOnRails
[17:16:33] smathy: hypnosb, yeah, the incoming hash is not in the expected format, each `fields_for` loop is meant to create an integer key and the values are the form attributes for that iteration. Add the `edit` action - and just the rest of the controller actually.
[17:16:47] smathy: epochwolf, I think a hash, but with integer keys.
[17:16:59] epochwolf: smathy: something like that.
[17:17:33] epochwolf: hypnosb: try :"system_components_attributes[]" instead of :system_components_attributes
[17:17:38] lyoshajapan: has joined #RubyOnRails
[17:17:54] smathy: ...but it should be working as is.
[17:17:54] epochwolf: and add , [] as the second parameter.
[17:18:25] smathy: ACTION suspects @system.system_components isn't being set properly in the edit action.
[17:18:54] bruno-: has joined #RubyOnRails
[17:18:55] epochwolf: ... it's 13:18 and I'm way past my lunch break.
[17:19:02] epochwolf: ACTION scampers off to feast.
[17:19:51] eshea: has joined #RubyOnRails
[17:20:19] shinnya: has joined #RubyOnRails
[17:22:31] hypnosb: epochwolf: how should I change the _attributes again
[17:22:53] epochwolf: hypnosb: um... I think I screwed up. Talk to smathy.
[17:22:59] Begi: has joined #RubyOnRails
[17:23:55] arup_r: has joined #RubyOnRails
[17:24:04] hypnosb: smathy: do what again?
[17:27:33] hypnosb: smathy: oh do I need @system.system_components.build in edit?
[17:28:38] hypnosb: no joy... same error
[17:29:04] alyyy: has joined #RubyOnRails
[17:30:14] alyyy: this is more of a ruby question but #ruby didn't respond. I'm trying to replace "'" in a string with the "\'" but am getting some weird results: https://gist.github.com/anonymous/fa5a05d4f41991f40422223e2c53b6d2
[17:31:31] epochwolf: hypnosb: keep @system.system_components.build in the controller and try fields_for :system_components_attributes, @system.system_components do ... in the view
[17:31:46] michael_mbp: really weird day
[17:31:53] michael_mbp: smathy: it's working just fine now
[17:32:01] michael_mbp: seems I had some guard processed that had gone nuts
[17:32:09] michael_mbp: a ps aux | grep ruby helped
[17:36:22] hypnosb: epochwolf: ok if I set @system.system_components.build in the controller for edit.. it works...but... If I go back to edit it... there are now TWO .. duplicate select fields
[17:36:48] jenrzzz: has joined #RubyOnRails
[17:37:15] conta: has joined #RubyOnRails
[17:37:27] epochwolf: hypnosb: is build being called twice?
[17:37:39] yaymukund: has joined #RubyOnRails
[17:38:05] lyoshajapan: has joined #RubyOnRails
[17:38:33] epochwolf: maybe you dn't need to call build in the edit action?
[17:39:50] cosmicfires: does ruby use short circuit evaluation of boolean expressions?
[17:39:59] hypnosb: epochwolf: without the .build ... the select does not show up at all (given 0 rows in system_components)
[17:40:16] stannard: has joined #RubyOnRails
[17:40:22] emachnic: has joined #RubyOnRails
[17:41:02] petor: has joined #RubyOnRails
[17:41:23] michael_mbp: hey epochwolf nice to see you here mate o/
[17:42:17] emachnic: has joined #RubyOnRails
[17:42:33] smathy: cosmicfires, yes.
[17:43:35] aegis3121: has joined #RubyOnRails
[17:44:42] PedramT: has joined #RubyOnRails
[17:45:17] baweaver: has joined #RubyOnRails
[17:45:56] tsherman: has joined #RubyOnRails
[17:45:59] yellow5: has joined #RubyOnRails
[17:46:30] edwinvdgraaf: has joined #RubyOnRails
[17:46:53] King_Rex: has joined #RubyOnRails
[17:48:07] rodfersou: has joined #RubyOnRails
[17:48:08] wolfravenous: has joined #RubyOnRails
[17:48:17] cosmicfires: thanks smathy
[17:48:32] ducklobster: has joined #RubyOnRails
[17:48:37] mat-svol: has joined #RubyOnRails
[17:49:06] adaedra: speak louder, I can't hear you.
[17:49:55] Megamos: has joined #RubyOnRails
[17:51:59] czerasz: has joined #RubyOnRails
[17:53:39] hypnosb: select option nested attribute does not show :/
[17:54:24] jenrzzz: has joined #RubyOnRails
[17:54:30] trinaldi: has joined #RubyOnRails
[17:54:47] lyoshajapan: has joined #RubyOnRails
[17:56:30] beingjohnm: wicked wizard sets steps like this: "steps :first, :second, :third". That doesn't seem to be a string or an array? What is that called and how to I dynamically edit it?
[17:57:31] tsherman: has joined #RubyOnRails
[18:00:35] djellemah_: has joined #RubyOnRails
[18:00:54] djbkd: has joined #RubyOnRails
[18:01:05] barajasfab: has joined #RubyOnRails
[18:01:16] tsherman: has joined #RubyOnRails
[18:01:20] sypheren: has joined #RubyOnRails
[18:03:22] flashpoint9: has joined #RubyOnRails
[18:04:41] stannard: has joined #RubyOnRails
[18:06:33] yaymukun1: has joined #RubyOnRails
[18:06:54] tpendragon: has joined #RubyOnRails
[18:07:23] Dimik: has joined #RubyOnRails
[18:07:31] aegis3121: has joined #RubyOnRails
[18:08:09] wolfravenous: has joined #RubyOnRails
[18:11:26] valetudo: has joined #RubyOnRails
[18:12:30] bronson: has joined #RubyOnRails
[18:18:52] baweaver: has joined #RubyOnRails
[18:19:43] lyoshajapan: has joined #RubyOnRails
[18:19:56] ekinmur: has joined #RubyOnRails
[18:21:39] skinofstars: has joined #RubyOnRails
[18:21:39] ekinmur: has joined #RubyOnRails
[18:22:20] smathy: beingjohnm, they're just arguments to the `steps` method, you can turn an array into arguments with the splat operator.
[18:22:59] _3by8: has joined #RubyOnRails
[18:24:09] n008f4g_: has joined #RubyOnRails
[18:24:22] sp1rs: has joined #RubyOnRails
[18:24:58] beingjohnm: smathy: thanks!
[18:25:39] jenrzzz: has joined #RubyOnRails
[18:26:36] djellemah_: has joined #RubyOnRails
[18:27:09] dblessing: has joined #RubyOnRails
[18:27:20] lyoshajapan: has joined #RubyOnRails
[18:28:01] manfrin: has joined #RubyOnRails
[18:29:06] hutchy: has joined #RubyOnRails
[18:30:22] _3by8: So I had this idea I'm trying to protect meaning I don't want any clients having direct access to the code so that they can't distribute it freely. My idea was to host the code on one server to serve multiple sites but I'm not sure how I'd do that... I have a feeling that when the server gets a request to serve a page that the domain information is passed along, is that true? In that case, I'm sure there's a way to extract that in
[18:31:56] epochwolf: michael_mbp: do I know you?
[18:32:20] pipework: epochwolf: Probably!
[18:33:01] tubbo: _3by8: zero idea what you're talking about.
[18:33:22] tubbo: _3by8: how exactly would clients have "direct access to the code"? why would you need to give them access to your git repo?
[18:33:43] tubbo: are you just asking how to host multiple sites with the same rails app? :)
[18:34:13] pipework: _3by8: So you want to execute private code on another server elsewhere?
[18:34:27] _3by8: tubbo: yeah that's basically my question and I'm not saying give them access to the repo but I've had clients who pay for their own hosting after I tell them what they need and then they essentially have control over the code that I've written, does that make sense?
[18:34:53] _3by8: pipework: no, I'm just trying to serve multiple domains from the same server with different databases based on the domain that user is coming from.
[18:35:22] epochwolf: _3by8: that's easy enough to do...
[18:35:24] tubbo: _3by8: well you sold them the code, didn't you? it's theirs, not yours.
[18:35:30] pipework: _3by8: So, you can have multiple domains point to a single address.
[18:35:37] pipework: tubbo: Depends on the contract.
[18:35:43] tubbo: there are various ways to license your code so they aren't allowed to use it elsewhere..
[18:35:46] _3by8: tubbo: thanks for the reminder but it's not retroactive.
[18:35:54] pipework: Though most stipulate that the code is theirs when you write it, not when you get paid.
[18:36:53] _3by8: pipework: yeah, I'm not sure what I said to make you guys think that this has to do with some project I've already completed. I'm going to sell a service.
[18:36:56] tubbo: _3by8: so the way we do it here is by hosting each client on a separate AWS account, so that we can give them "the keys to the castle" if they ever want to break their hosting agreement. but their licensing agreement *can't* be broken without legal issues. they have to pay us $Xk/month just for the right to use the software.
[18:37:29] pipework: _3by8: Because when you're talking about deploying software, you generally have to speak in the context of the software having existed at all. :)
[18:37:55] _3by8: No, like I was saying, I have an idea I'm trying to protect.
[18:38:07] _3by8: But I understand.
[18:39:31] _3by8: tubbo: I'm trying to avoid giving them the keys to the castle. This software is valuable to me and I don't want people copying it. I understand that licensing exists but I don't trust people enough to honor that license.
[18:39:32] ramfjord: has joined #RubyOnRails
[18:39:57] tubbo: _3by8: also what gave me the idea that you were working with clients was you started talking about clients who pay for their own hosting :D
[18:40:13] _3by8: epochwolf: that's what I thought too, I just don't know how to do it. I figure if all of the domains are pointing to the same server then I can extract the domain from the request and serve up content accordingly, right?
[18:40:14] pipework: _3by8: So build it on your own or convince someone to pay you to build something so they can pay you to use it?
[18:40:26] epochwolf: _3by8: request.domain?
[18:40:26] pipework: _3by8: Yeah, that's been a thing a long time.
[18:40:43] tubbo: _3by8: yeah you're talking about something called "multi-tenancy"
[18:40:49] pipework: _3by8: The last question was a lot easier to approach than the prior.
[18:40:57] _3by8: That's the only question.
[18:41:26] pipework: good luck out there!
[18:41:34] tubbo: !multitenancy
[18:41:38] tubbo: !apartment
[18:41:41] tubbo: well fuck this bot
[18:41:49] tubbo: https://github.com/influitive/apartment
[18:42:20] epochwolf: tubbo: you are not allowed to fuck the bot.
[18:42:29] epochwolf: Even though we all want to.
[18:42:38] tubbo: speak for yourself
[18:43:52] eyeamaye: has joined #RubyOnRails
[18:44:28] _3by8: tubbo: apartment looks perfect.
[18:45:35] _3by8: Radar: you wrote a book on multitenancy, eh?
[18:46:45] tsherman: has joined #RubyOnRails
[18:48:08] lyoshajapan: has joined #RubyOnRails
[18:50:02] pawnbox: has joined #RubyOnRails
[18:50:44] User458764: has joined #RubyOnRails
[18:51:04] tsherman: has joined #RubyOnRails
[18:51:58] SeanLazer: has joined #RubyOnRails
[18:54:35] DoctorMonocular: has joined #RubyOnRails
[18:55:16] arup_r: I have 7-8 models.. where I need to import data from CSV, sometimes also need to update also from backend.. And CSV is quite big. So I am thinking to create a factory class for each model to upload.. Can you give me some better ideas of to organize these ? I will upload finally using Rake task. So, should I make 1 parser class for each model CSV? Will that be a good Idea?
[18:55:43] Aherin: has joined #RubyOnRails
[18:55:45] tsherman: has joined #RubyOnRails
[18:56:13] jfelchner: has joined #RubyOnRails
[18:57:27] Cooooo: has joined #RubyOnRails
[18:57:36] lyoshajapan: has joined #RubyOnRails
[18:58:22] bronson: has joined #RubyOnRails
[18:58:35] diegoaguilar: has joined #RubyOnRails
[18:58:59] dopie: has joined #RubyOnRails
[19:00:54] leksster: has joined #RubyOnRails
[19:01:03] hervie: has joined #RubyOnRails
[19:04:45] bob434: has joined #RubyOnRails
[19:04:49] wolfravenous: has joined #RubyOnRails
[19:08:30] alaing: has joined #RubyOnRails
[19:09:36] alaing: has joined #RubyOnRails
[19:10:08] Devalo: has joined #RubyOnRails
[19:10:39] alaing: I have an image I want to use on a webpage of mine and it but its located in node_modules how do i reference that in my html
[19:10:41] aegis3121: has joined #RubyOnRails
[19:11:24] duderonomy: has joined #RubyOnRails
[19:11:35] dopie: has joined #RubyOnRails
[19:11:37] Megamos: has joined #RubyOnRails
[19:13:25] manfrin: has joined #RubyOnRails
[19:13:50] skinofstars: has joined #RubyOnRails
[19:14:20] flashpoint9: has joined #RubyOnRails
[19:15:24] dopie: has joined #RubyOnRails
[19:15:46] pipework: alaing: node_modules/path/to/image?
[19:16:11] maxdoubt: has joined #RubyOnRails
[19:16:15] pipework: Ignore me though, I'm still recovering from people's ideas to mix these tools in increasingly amusing ways.
[19:16:48] maxdoubt: i switched jasmine over to selenium and am having some issues with - rake jasmine:ci - can yall help me troubleshoot where to dig into this - https://gist.github.com/maxdoubt/430334b4ef752939ba9e651c96af4144
[19:17:00] alaing: I'm still learning server side js
[19:17:01] smathy: beingjohnm, you're welcome.
[19:17:16] capin: alaing: are you even using rails?
[19:17:45] alaing: i used too but moving to a different project
[19:17:59] capin: i think your question may be better suited for the channel of the JS framework your using ;)
[19:18:14] bronson: has joined #RubyOnRails
[19:18:27] alaing: i'm using node.js now
[19:18:35] smathy: alaing, this is #RubyonRails
[19:20:52] beauby: has joined #RubyOnRails
[19:23:24] macsteps: has joined #RubyOnRails
[19:23:44] lyoshajapan: has joined #RubyOnRails
[19:25:01] Cohedrin: has joined #RubyOnRails
[19:26:39] yfeldblum: has joined #RubyOnRails
[19:27:37] dopie: has joined #RubyOnRails
[19:30:43] hypnosb: Still stuck trying to get nested attributes working...If in my edit action I add @system.system_components.build, the select shows up but its duplicated and there are two select fields on the edit page https://gist.github.com/brylor/d7175dd6d2eb235ebfeaba56826a0377
[19:32:09] stannard: has joined #RubyOnRails
[19:32:17] polishdub: has joined #RubyOnRails
[19:33:22] yellow5: has joined #RubyOnRails
[19:34:08] baweaver: has joined #RubyOnRails
[19:34:23] Devalo: has joined #RubyOnRails
[19:36:16] Begi: has left #RubyOnRails: ()
[19:36:18] sonofdirt: has joined #RubyOnRails
[19:37:43] conta: has joined #RubyOnRails
[19:37:48] hutchy: has joined #RubyOnRails
[19:39:50] pawnbox: has joined #RubyOnRails
[19:39:53] skinofstars: has joined #RubyOnRails
[19:39:57] Malgorath: Is there a way to have your engine's app/layouts/application.html.erb inherit from the main application?
[19:41:16] netzfisch: has joined #RubyOnRails
[19:42:56] dopie: has joined #RubyOnRails
[19:43:39] DoctorMonocular: has joined #RubyOnRails
[19:43:46] Begi1: has joined #RubyOnRails
[19:43:48] stannard: has joined #RubyOnRails
[19:43:49] lyoshajapan: has joined #RubyOnRails
[19:46:28] skinofstars: has left #RubyOnRails: ()
[19:46:57] dopie: has joined #RubyOnRails
[19:46:59] jessemcgilallen: has joined #RubyOnRails
[19:47:24] [Butch]_: has joined #RubyOnRails
[19:47:50] lemur: has joined #RubyOnRails
[19:48:46] zpe: has joined #RubyOnRails
[19:48:55] flopsec: has joined #RubyOnRails
[19:49:23] jfelchner: has joined #RubyOnRails
[19:51:50] dopie: has joined #RubyOnRails
[19:53:47] epochwolf: hypnosb: there's literally hundreds of tutorials on how to make nested attributes work.
[19:54:35] norc: Malgorath, what you asked made no sense.
[19:55:00] epochwolf: And since you've apparently made no effort to help yourself in the last 3 hours, I'm not all that interested in helping.
[19:56:00] n008f4g_: has joined #RubyOnRails
[19:56:41] DoctorMonocular: has joined #RubyOnRails
[19:56:43] Begi1: has joined #RubyOnRails
[19:57:20] mdel: has joined #RubyOnRails
[19:59:28] dopie: has joined #RubyOnRails
[19:59:57] jenrzzz: has joined #RubyOnRails
[20:01:00] Frem: has joined #RubyOnRails
[20:03:44] dopie: has joined #RubyOnRails
[20:03:58] stannard: has joined #RubyOnRails
[20:04:57] jenrzzz: has joined #RubyOnRails
[20:05:21] dopie: has joined #RubyOnRails
[20:06:05] lyoshajapan: has joined #RubyOnRails
[20:08:42] stannard: has joined #RubyOnRails
[20:08:48] rickmasta: has joined #RubyOnRails
[20:11:14] eshear: has joined #RubyOnRails
[20:11:33] leksster: has joined #RubyOnRails
[20:13:06] [Butch]_: has joined #RubyOnRails
[20:13:22] dopie: has joined #RubyOnRails
[20:14:39] duderonomy: has joined #RubyOnRails
[20:14:55] hervie: has joined #RubyOnRails
[20:16:03] lyoshajapan: has joined #RubyOnRails
[20:16:07] User458764: has joined #RubyOnRails
[20:17:01] dopie: has joined #RubyOnRails
[20:18:43] Megamos: has joined #RubyOnRails
[20:18:59] dopie: has joined #RubyOnRails
[20:19:30] duderono_: has joined #RubyOnRails
[20:19:54] smathy: 88 IRC windows?!
[20:20:44] adaedra: For better idling.
[20:23:55] vasilakisFiL: has joined #RubyOnRails
[20:24:56] vasilakisFiL: how can I override a column read by an AR model? I can override the getter by defining a method with the same name as the column but that doesn't work all the times (for instance it will work if you do user.column but not when you do User.first)
[20:25:23] bruno-: has joined #RubyOnRails
[20:26:38] lyoshajapan: has joined #RubyOnRails
[20:27:00] baweaver: has joined #RubyOnRails
[20:29:49] FreddieFresh: has joined #RubyOnRails
[20:31:40] polyidus: has joined #RubyOnRails
[20:32:55] arup_r: has joined #RubyOnRails
[20:33:08] djbkd: has joined #RubyOnRails
[20:33:36] akkmaxon: has joined #RubyOnRails
[20:33:47] futilegames: has joined #RubyOnRails
[20:33:53] bronson: has joined #RubyOnRails
[20:34:45] leksster: has joined #RubyOnRails
[20:34:52] tsherman: has joined #RubyOnRails
[20:35:00] dopie: has joined #RubyOnRails
[20:37:54] dopie: has joined #RubyOnRails
[20:40:00] dopie: has joined #RubyOnRails
[20:40:05] bruno-: has joined #RubyOnRails
[20:40:40] dopie: has joined #RubyOnRails
[20:40:53] wldcordeiro: has joined #RubyOnRails
[20:41:31] tlaxkit: has joined #RubyOnRails
[20:42:25] djbkd: has joined #RubyOnRails
[20:43:10] macsteps: has joined #RubyOnRails
[20:43:42] epochwolf: vasilakisfil: overriding the getter should work
[20:44:11] vasilakisFiL: unfortunately AMS reads the .attributes method so it doesn't always work
[20:44:26] dopie: has joined #RubyOnRails
[20:46:17] jenrzzz: has joined #RubyOnRails
[20:47:04] ur5us: has joined #RubyOnRails
[20:48:04] njero: has joined #RubyOnRails
[20:48:31] lyoshajapan: has joined #RubyOnRails
[20:51:05] Radar: Active model serializers I assume
[20:51:16] Begi: has left #RubyOnRails: ()
[20:52:57] macsteps: has joined #RubyOnRails
[20:53:20] vasilakisFiL: but I am stuck in a commit from February so maybe it has been fixed now
[20:53:41] vasilakisFiL: epochwolf in any case if you do User.first.attributes it gets the attributes straight from db
[20:53:50] vasilakisFiL: no matter what you override
[20:53:54] theunraveler: has joined #RubyOnRails
[20:55:20] LowLifePerv: has joined #RubyOnRails
[20:55:21] lyoshajapan: has joined #RubyOnRails
[20:56:23] sonofdirt: has joined #RubyOnRails
[20:56:49] FooMunki: has joined #RubyOnRails
[20:58:54] FooMunki: has joined #RubyOnRails
[21:00:18] leksster: has joined #RubyOnRails
[21:01:18] jenrzzz: has joined #RubyOnRails
[21:01:24] zpe: has joined #RubyOnRails
[21:02:04] sonofdirt: has joined #RubyOnRails
[21:02:20] lyoshajapan: has joined #RubyOnRails
[21:02:58] benlieb: has joined #RubyOnRails
[21:03:01] zpe: has joined #RubyOnRails
[21:03:46] ogpastaling: has joined #RubyOnRails
[21:05:24] eshea: has joined #RubyOnRails
[21:06:49] eshea: has joined #RubyOnRails
[21:06:54] artmann: I'm using devise and want the user to be able to integrate with google analytics. But when I get the oauth callback current_user is nil. Anyone know why?
[21:07:22] wmoxam: has joined #RubyOnRails
[21:08:17] diegoaguilar: has joined #RubyOnRails
[21:08:49] DragonPunch: has joined #RubyOnRails
[21:09:18] Silox|: has joined #RubyOnRails
[21:09:23] workmad3: has joined #RubyOnRails
[21:11:31] theery: has joined #RubyOnRails
[21:12:01] theery: Any brilliant mind in here able to lend a hand? http://stackoverflow.com/questions/36580035/getting-ssl-working-locally-with-rails-on-osx-for-development
[21:15:18] srinidhi: has joined #RubyOnRails
[21:15:33] polyidus: has joined #RubyOnRails
[21:15:56] DragonPunch: has joined #RubyOnRails
[21:17:57] mdw: has joined #RubyOnRails
[21:18:16] FernandoBasso: has joined #RubyOnRails
[21:20:53] flashpoint9: has joined #RubyOnRails
[21:23:39] Sawbones: has joined #RubyOnRails
[21:23:40] duderonomy: has joined #RubyOnRails
[21:25:01] duderonomy: has joined #RubyOnRails
[21:25:46] smathy: theery, well, right outta the gate you're using the wrong hostname.
[21:25:59] manfrin: has joined #RubyOnRails
[21:26:02] meoblast001: has joined #RubyOnRails
[21:26:17] arBmind: has joined #RubyOnRails
[21:26:21] smathy: theery, also wrong protocol, http vs https
[21:26:54] smathy: ...and you haven't indicated whether you completed step 7 or not.
[21:28:04] DragonPunch: has joined #RubyOnRails
[21:28:59] jenrzzz: has joined #RubyOnRails
[21:29:18] Jasaka: has joined #RubyOnRails
[21:30:05] Kus: has joined #RubyOnRails
[21:31:17] benlieb: has joined #RubyOnRails
[21:35:00] Jasaka: has joined #RubyOnRails
[21:36:34] lyoshajapan: has joined #RubyOnRails
[21:36:48] GodFather: has joined #RubyOnRails
[21:37:00] beingjohnm: anybody know of a good simple introduction to writing my first test? The rails guide making my eyes glaze over a bit.
[21:38:20] n008f4g_: has joined #RubyOnRails
[21:38:31] hotpancakes: has joined #RubyOnRails
[21:39:31] amortimer: has joined #RubyOnRails
[21:39:54] smathy: I know of nothing better than the guide.
[21:40:06] smathy: ...maybe you need to have a rest, come back at it some other time beingjohnm
[21:40:23] yfeldblum: has joined #RubyOnRails
[21:42:26] eshea: has joined #RubyOnRails
[21:42:30] speakingcode: has joined #RubyOnRails
[21:43:02] dopie: has joined #RubyOnRails
[21:43:27] beingjohnm: smathy: probably
[21:43:29] eshea: has joined #RubyOnRails
[21:44:36] hotpancakes: has joined #RubyOnRails
[21:44:56] pawnbox: has joined #RubyOnRails
[21:49:23] baweaver: has joined #RubyOnRails
[21:51:26] diegoviola: has joined #RubyOnRails
[21:51:30] hotpancakes: has joined #RubyOnRails
[21:52:29] Sawbones: has joined #RubyOnRails
[21:53:07] leksster: has joined #RubyOnRails
[21:53:48] leksster: has joined #RubyOnRails
[21:54:03] gmas: has joined #RubyOnRails
[21:54:20] leksster: has joined #RubyOnRails
[21:54:48] lyoshajapan: has joined #RubyOnRails
[21:55:21] leksster: has joined #RubyOnRails
[21:57:00] greengriminal: has joined #RubyOnRails
[21:59:21] speakingcode: has joined #RubyOnRails
[21:59:23] siaW: has joined #RubyOnRails
[21:59:24] theery: @smathy The url was a type, I tried https://localhost:3001 and https://localhost.ssl:3001 -- And yes I did all the steps including #7
[21:59:34] theery: *typo, hah
[22:00:05] robbyoconnor: has joined #RubyOnRails
[22:00:11] smathy: Pretty critical typo. So what's the error your browser is showing?
[22:00:58] theery: In Chrome, when it asks If I want to proceed, it pops up a list of certificates to choose from, and it doesn't list the one I've added to the system, though I've confirmed the cert is in the system keychain and trusted
[22:01:33] gmas: has joined #RubyOnRails
[22:03:31] smathy: Have you restarted Chrome?
[22:06:51] jenrzzz: has joined #RubyOnRails
[22:06:51] jenrzzz: has joined #RubyOnRails
[22:06:58] smathy: The only thing that ever worked for me is this: https://www.accuweaver.com/2014/09/19/make-chrome-accept-a-self-signed-certificate-on-osx/ Adding the cert itself and trusting it should work, but this whole drag-from-Chrome thing is the only way I could ever get it to work.
[22:07:49] DoctorMonocular: has joined #RubyOnRails
[22:08:05] FailBit: has joined #RubyOnRails
[22:08:16] FailBit: irb(main):009:0> Benchmark.ms { Rails.application.routes.url_helpers}
[22:08:19] FailBit: => 2.321828156709671
[22:08:53] akkmaxon: has joined #RubyOnRails
[22:09:02] claytonzaugg: has joined #RubyOnRails
[22:09:25] FailBit: is it recalculating the helpers every time or something
[22:12:11] e-r-a: has joined #RubyOnRails
[22:12:35] lyoshajapan: has joined #RubyOnRails
[22:14:09] dopie: has joined #RubyOnRails
[22:15:41] siaW: in my rails app i have an “images” folder which contains an example image, “image.png”. i’m trying to access this image in my app by doing something like <%= image_tag("image.png") %>. but rails can’t find my image even though the image exist in APP FOLDER > images > image.png
[22:15:51] hervie_: has joined #RubyOnRails
[22:15:57] baweaver: has joined #RubyOnRails
[22:15:58] siaW: how can i fix this.
[22:17:11] beingjohnm: siaw: you need to include it in assets.rb
[22:17:31] smathy: siaw, you have an images folder in the root of your Rails app?
[22:18:04] siaW: smathy: right
[22:18:40] smathy: siaw, why?
[22:19:01] siaW: ok i can keep it in app>assets>images
[22:19:46] conta: has joined #RubyOnRails
[22:19:46] smathy: Good plan.
[22:19:51] polyidus: has joined #RubyOnRails
[22:19:54] siaW: which means
[22:19:58] siaW: this line in my assets.rb
[22:20:00] siaW: # Rails.application.config.assets.paths << Emoji.images_path
[22:20:04] smathy: #protip - / is a much more commonly understood path separator than >
[22:20:25] siaW: should become # Rails.application.config.assets.paths << “assets/images”
[22:20:39] smathy: siaw, nope, no need to worry about it, it's commented out.
[22:21:05] siaW: so then how can i load images from my assets>images folder?
[22:21:30] smathy: siaw, you're really going to persist with using > instead of / ?
[22:21:33] jottr: has joined #RubyOnRails
[22:21:58] siaW: so then how can i load images from my assets/images folder?
[22:22:36] smathy: siaw, why don't you just put your file into app/assets/images and see how you go, you can read more about it here: http://guides.rubyonrails.org/asset_pipeline.html
[22:22:55] Sawbones: has joined #RubyOnRails
[22:23:02] smathy: #protip - if Rails creates the directory for you, it probably already knows about it
[22:23:18] fox_mulder_cp: somebody use rails-money gem? i have 'undefined method `summ_cents' for #' my object. in required params i add this field
[22:23:34] smathy: fox_mulder_cp, sure it's two "m"s there?
[22:23:53] fox_mulder_cp: smathy: field named as summ
[22:24:36] smathy: fox_mulder_cp, that's just weird, anyway, make a gist. Include your db/schema.rb
[22:25:09] siaW: thanks :)
[22:25:18] smathy: siaw, you're welcome.
[22:25:25] dgncn: has joined #RubyOnRails
[22:25:48] leksster: has joined #RubyOnRails
[22:27:07] capin: afternoon
[22:27:50] creature: has joined #RubyOnRails
[22:27:50] creature: has joined #RubyOnRails
[22:30:09] workmad3: has joined #RubyOnRails
[22:30:15] fox_mulder_cp: https://gist.github.com/foxmuldercp/9ff4cfd2b39946d4399f1fa93d02e7e4
[22:30:49] fox_mulder_cp: undefined method `summ_cents' for #<MoneyOperation:0x007fef443e7250> Did you mean? summ_cents=
[22:31:02] fox_mulder_cp: seems as conversion bug?
[22:31:52] fox_mulder_cp: kopiyka - it's a subunit of my country currency
[22:33:36] smathy: fox_mulder_cp, !gist-usage - for next time please, that gist is ugly!
[22:33:36] helpa: fox_mulder_cp: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[22:33:44] iwada: has joined #RubyOnRails
[22:34:21] Cohedrin: Is it possible to preload an assoication that is defined in a method, and not with has_many or belongs_to?
[22:34:35] iwada: Getting an undefined method `id' for #<ActiveRecord::Associations::CollectionProxy []>
[22:34:54] fox_mulder_cp: Cohedrin: Class.joins(:subclass)...
[22:35:02] baweaver: iwada: does ActiveRecord::Associations::CollectionProxy have an id?
[22:35:03] iwada: Would appreciate any assistance with that - https://gist.github.com/anonymous/90f20bb74b4a4b131f97d588e5896814
[22:35:06] fox_mulder_cp: Cohedrin: Class.joins(:subclass, :sub2class)...
[22:35:16] Cohedrin: fox_mulder_cp I don't think I've explained what I'm doing well
[22:35:19] Cohedrin: I'll gist it
[22:35:25] manfrin: has joined #RubyOnRails
[22:36:09] iwada: baweaver, Yes
[22:36:20] smathy: fox_mulder_cp, the argument to monetize has to be a field in your model, for you it might need to be `monetize :summ_kopiykas` instead of _cents
[22:36:41] fox_mulder_cp: smathy: oh, really. thanks
[22:36:45] baweaver: iwada: it does not
[22:37:10] Cohedrin: https://gist.github.com/Cohedrin/f721796b3671493fde2c26c8dcfca407
[22:37:15] Cohedrin: something along the lines of that
[22:37:24] fox_mulder_cp: smathy: non-default lang|country has a problems :)
[22:37:26] dgncn: has joined #RubyOnRails
[22:37:57] smathy: Cohedrin, if you used .where instead of .find then it would work.
[22:38:05] iwada: beweaver, Please anything wrong on line 20?
[22:38:05] Cohedrin: smathy no it wouldn't
[22:38:13] baweaver: iwada: think about it
[22:38:15] FailBit: https://github.com/rails/rails/blob/4-2-stable/actionpack/lib/action_dispatch/routing/route_set.rb#L490
[22:38:18] Cohedrin: all find does diferently is return an array
[22:38:18] FailBit: all my wtf
[22:38:20] smathy: Cohedrin, `find` returns an Array, whereas `where` will return an ActiveRecord relation.
[22:38:33] baweaver: iwada: you're calling id on an ActiveRecord::Associations::CollectionProxy
[22:38:37] Cohedrin: Trade.preload(:items) will still not work though
[22:38:42] baweaver: iwada: which does not have that method
[22:38:49] baweaver: iwada: what about a single item?
[22:39:04] Cohedrin: I want to preload them, not return a relation
[22:39:08] jfelchner: has joined #RubyOnRails
[22:39:50] iwada: beweaver, Yea, Im trying to get all Payments that belongs to a customer's Orders
[22:40:03] iwada: On a Single Item, i've got no issues
[22:40:07] FailBit: Cohedrin: here sec
[22:40:09] baweaver: then get a single item
[22:40:15] FailBit: I think I have what you want
[22:40:18] baweaver: iwada: instead of an array of arrays
[22:40:36] FailBit: https://raw.githubusercontent.com/derpibooru/derpibooru/master/lib/has_array_field.rb?token=AJNg6CuEKZKpn51NhIe-MBgaWR8RY41Eks5XFrPfwA%3D%3D
[22:40:42] sypheren: has joined #RubyOnRails
[22:40:44] SteenJobs: has joined #RubyOnRails
[22:40:54] FailBit: require this in your app somewhere and then use has_array_field :items
[22:41:27] ramfjord: has joined #RubyOnRails
[22:41:39] Cohedrin: FailBit is that repo not accessable?
[22:41:41] iwada: baweaver, let me look at that
[22:41:49] FailBit: it's private
[22:41:55] hypnosb: I'm so confused on this nested attributes... I can't build on edit because that will create duplicates, and if there are no nested attributes the field does not show up :/
[22:42:04] SteenJobs: i have this really odd error i can’t seem to figure out, hope it’s not something really stupid
[22:42:07] SteenJobs: although usually is
[22:42:07] FailBit: just copy out the file
[22:42:08] Cohedrin: interesting method
[22:42:09] SteenJobs: https://gist.github.com/jesiegel1/36e9951a099b269c77ea2b7df28649be#file-navbar-html-erb-L3
[22:42:29] FailBit: Cohedrin: I haven't found anything else to make postgres arrays pleasant
[22:42:39] SteenJobs: my url helper is saying no route matches, because :id is nil
[22:42:44] Cohedrin: yeah, was hoping postgres_ext might have something to help out
[22:42:49] Cohedrin: no such luck
[22:43:00] FailBit: postgres_ext is also missing set behavior
[22:43:03] FailBit: https://raw.githubusercontent.com/derpibooru/derpibooru/master/lib/postgres_set.rb?token=AJNg6KY0LC3lWldtZWV-DrPBWwR_qhTYks5XFrRhwA%3D%3D
[22:43:08] Cohedrin: this looks to be just about the best way, thanks for that
[22:43:14] SteenJobs: the thing is, right before i follow my edit_profile link, the user has a profile, but after i click it, the user’s profile is suddenly nil
[22:43:24] Cohedrin: have you considered gemifying this?
[22:43:42] FailBit: but it's so hackish :X
[22:43:44] fox_mulder_cp: how to create field for enter money in 'xxx.xx' format?
[22:44:00] Cohedrin: true, but not much of a better way :/
[22:44:05] Cohedrin: worst part about rails + postgres
[22:44:17] Cohedrin: is postgres is so powerful, but held back by the other databases rails has to support
[22:44:26] polyidus: has joined #RubyOnRails
[22:44:52] hotpancakes: has joined #RubyOnRails
[22:45:29] Puffball: has joined #RubyOnRails
[22:46:00] jfelchner_: has joined #RubyOnRails
[22:47:00] SteenJobs: why in the world would this fix my problem?? “profile_path(current_user.profile.id.to_i)”
[22:47:52] SteenJobs: and yet current_user.profile is nil in console
[22:48:00] SteenJobs: aright nvrm, this is ridiculous
[22:49:24] siaW: i have a model that looks like this. on line 12 i want to save some images so they take the name of the “snapchat_username” attributes of each user. i set “id” on line 11. but my images are saved at #{ id }.png which is not what i want. any help please? https://gist.github.com/siaw23/11747902ea11d7c1517aa2a8dd6ea3cc
[22:50:42] Tref: has joined #RubyOnRails
[22:50:52] dopie: has joined #RubyOnRails
[22:50:57] benlieb: has joined #RubyOnRails
[22:51:35] crystal77: has joined #RubyOnRails
[22:53:53] theery: has joined #RubyOnRails
[22:58:59] barajasfab: has joined #RubyOnRails
[23:00:01] Cohedrin: FailBit what version of rails is that for?
[23:01:00] FailBit: I am not sure if it will work in 3
[23:01:05] FailBit: you may have to modify it
[23:01:25] Cohedrin: no, I'm on 4. The reason I asked was as far as I know, in rails 4 if you need class methods you need to do module ClassMethods
[23:01:36] Cohedrin: rather than class_methods do
[23:01:56] FailBit: uh, no, AS lets you use class_methods in r4
[23:02:04] Cohedrin: module classMethods works for me, but not class_methods do
[23:02:28] FailBit: it takes the block it's passed and does Module.new(&block)
[23:02:43] FailBit: ruby is full of magic constructs
[23:02:57] Cohedrin: hm, weird rails 4.1.6 throws errors whenever I try to use class_methods do
[23:03:03] Cohedrin: but totally fine when I do module ClassMethods
[23:03:07] FailBit: I'm on 4.2.6
[23:03:13] Cohedrin: yeah, just tried it on a 4.2 app
[23:03:16] FailBit: perhaps activesupport changed
[23:03:17] Cohedrin: seems to work fine
[23:03:39] zpe: has joined #RubyOnRails
[23:04:06] Cohedrin: w/e. Only thing I noticed is this doesn't seem to work for classes that have more than one word, in my case GameItem
[23:04:25] Cohedrin: changed line 6, where its klass ||= accessor_name.to_s.singularize.capitalize.constantize
[23:04:27] Cohedrin: to klass ||= accessor_name.to_s.singularize.camelize.constantize
[23:04:31] Cohedrin: and everything is good now
[23:04:39] Cohedrin: thanks again for the link man, appreciate it
[23:05:32] jenrzzz: has joined #RubyOnRails
[23:05:47] FailBit: keep in mind you can't eager load it, but it is memoized
[23:06:25] Cohedrin: yeah was just about to ask that actually
[23:06:34] Cohedrin: what was the limitation that stopped you from being able to do that?
[23:10:41] macsteps: has joined #RubyOnRails
[23:10:56] FailBit: it's pointless
[23:11:15] FailBit: it will never ever be able to load n+1 style by design
[23:11:19] FailBit: always all at once
[23:11:56] FooMunki: has joined #RubyOnRails
[23:14:56] macsteps: has joined #RubyOnRails
[23:16:59] DragonPunch: has joined #RubyOnRails
[23:17:25] eljimmy: has joined #RubyOnRails
[23:18:19] mdw: has joined #RubyOnRails
[23:18:46] smathy: fox_mulder_cp, either just store cents and always convert to/from dollar amounts, or use a decimal field type.
[23:23:19] bob434: has joined #RubyOnRails
[23:23:46] Tref: What’s the quickest way you guys have found to determine where an asset is actually being served from? For example when you see something like ``` Started GET "/assets/truncate.self-cc52a8f.js?body=1” ```
[23:24:20] Tref: I feel like searching through all the dirs in the load path isnt the best way
[23:24:30] _Tariq: has joined #RubyOnRails
[23:25:17] quazimodo: has joined #RubyOnRails
[23:25:18] quazimod1: has joined #RubyOnRails
[23:25:33] polyidus: has joined #RubyOnRails
[23:26:43] Tref: the fact that the console outputs that its being served from /assets is also confusing
[23:28:01] banisterfiend: has joined #RubyOnRails
[23:31:50] Sawbones: has joined #RubyOnRails
[23:32:00] twilling: has joined #RubyOnRails
[23:32:38] akshat: has joined #RubyOnRails
[23:32:47] sleungcy: has joined #RubyOnRails
[23:33:56] smathy: tref, this is not something I spend a lot of time "determining", it's from public/assets if it exists there, otherwise app/assets/*
[23:37:27] Sawbones: has joined #RubyOnRails
[23:37:43] Arcaire: 9:26 AM <tref> the fact that the console outputs that its being served from /assets is also confusing
[23:37:49] Arcaire: If this is confusing you, you may need to read more rails basics guides.
[23:38:38] Tref: Arcaire: yeah I’ve read all of them a number of times but the asset pipeline guide doesnt seem to address this. If I’m missing something please point it out
[23:38:53] lyoshajapan: has joined #RubyOnRails
[23:39:30] cabargas: has joined #RubyOnRails
[23:39:51] Arcaire: Are you sure?
[23:39:53] DLSteve: has joined #RubyOnRails
[23:40:08] smathy: tref, being confused by that would be like being confused that the /users/23 file doesn't exist in your filesystem.
[23:40:39] duderonomy: has joined #RubyOnRails
[23:41:18] Arcaire: I mean, I know for a fact that section 4 of the pipeline guide mentions the config.assets.prefix directive, which is by default "/assets"/
[23:41:30] Arcaire: So, I feel like you may be missing sections of that guide.
[23:41:46] Tref: smathy: good point, I guess I’m just not as familiar with the way the routing & rendering inside the asset pipeline works as I am the rest of the framework
[23:42:30] sbarg: has joined #RubyOnRails
[23:42:37] Tref: Arcaire: yeah but that just specifies the location where your asset pipeline lives and clearly not all the files reside in that dir
[23:42:38] sbarg: has left #RubyOnRails: ()
[23:42:48] Arcaire: tref: I...
[23:43:05] pwnd_nsfw`: They should...
[23:43:34] Tref: What about all the assets being served by gems?
[23:43:55] smathy: tref, right, and unfamiliarity is fine, you can just use "some magic stuff" as a placeholder for what happens, like: the browser requests a URL of /assets/something... and Rails does [some magic stuff] and the file is served from either public/assets or app/assets...
[23:44:26] smathy: tref, no more magical than anything else being done by gems, Rails allows a gem to inject its path into Rails's lookup paths for those sorts of things.
[23:44:41] edwinvdgraaf: has joined #RubyOnRails
[23:45:10] lyoshajapan: has joined #RubyOnRails
[23:45:14] Sawbones: has joined #RubyOnRails
[23:45:31] ramfjord: has joined #RubyOnRails
[23:45:45] emachnic: has joined #RubyOnRails
[23:45:59] smathy: tref, I mean how does "gem 'foo'" in your Gemfile know where to look? How does `require "fileutils"` know where to look? It's nothing complex, there's just an array of paths for various things, and Rails/ruby/whatever looks through the paths. Just like running a command in a shell.
[23:46:39] smathy: This all gets filed under: "If you had to guess how it works, how would it work?"
[23:47:22] FernandoBasso: has joined #RubyOnRails
[23:47:53] Tref: smathy: yes this is the point that im getting at I understand how the load path works. For example the affix plugin is provided by bootstrap-sass but its being “served” at "/assets/bootstrap/affix.self-5eceb.js?body=1"
[23:48:08] SteenJobs: has joined #RubyOnRails
[23:48:29] Tref: If im trying to debug something in that file I have to track it down from within my entire load path which can be somewhat of a pain in the ass
[23:48:42] smathy: tref, the one primary function of a web server is to map URLs to resources. How is THAT part what's confusing you here ;)
[23:49:20] Tref: Was just wondeirng if there was a way to trace that lookup more easily
[23:49:22] Tref: thats all
[23:50:14] lemur: has joined #RubyOnRails
[23:50:19] wolfravenous: has joined #RubyOnRails
[23:50:22] smathy: Ahhh, ok. I just look in the browser, find something I think is unique in the source code, and `ag that_thing $(bundle list --paths)`
[23:51:23] Tref: smathy: see, I knew we would get there…
[23:52:18] smathy: tref, also Rails.application.config.assets.paths in your console are the actual paths.
[23:52:46] Tref: smathy: yeah I know that its just kind of a pain in the ass to use that
[23:52:56] Tref: Which is what i was doing so hence my question
[23:53:09] smathy: ...just write a method to iterate over it doing a Dir.glob for the filename
[23:53:13] banisterfiend: given: has_many :foos, through: :bar, dependent: :destroy <--- does the 'dependent: :destroy' have any effect?
[23:55:04] smathy: Put the method in your ~/.pryrc as a Pry::Commands.block_command - easy.
[23:55:11] Sawbones: has joined #RubyOnRails
[23:58:13] Sawbones: has joined #RubyOnRails