« Back to channel list

#RubyOnRails - 22 July 2015

« Back 1 day Forward 1 day »
[00:01:37] PpPyg: has joined #RubyOnRails
[00:03:52] startupality: has joined #RubyOnRails
[00:04:14] sankaber: has joined #RubyOnRails
[00:04:54] thatkid: has joined #RubyOnRails
[00:05:46] iceyec_: has joined #RubyOnRails
[00:06:42] bruno-_: has joined #RubyOnRails
[00:06:49] dpritchett`: has joined #RubyOnRails
[00:06:56] MiracleBlue_: has joined #RubyOnRails
[00:07:13] xkickflip_: has joined #RubyOnRails
[00:08:52] codelahoma_: has joined #RubyOnRails
[00:09:02] mdel: has joined #RubyOnRails
[00:09:27] Olipro_: has joined #RubyOnRails
[00:10:48] drewdavis_: has left #RubyOnRails: ()
[00:11:13] recurrence: has joined #RubyOnRails
[00:11:47] recurrence: What???s the best rails logger? I took a look at log4r but it appears that it hasn???t been maintained in years. It has some great features however. Log4j is on version 2 and I don???t see a rails equivalent sadly.
[00:13:45] cappsio: has joined #RubyOnRails
[00:14:00] lathiat: recurrence: what functionality are you looking for? the built-in stuff works fairly well and is customisable
[00:14:14] jkamenik: has joined #RubyOnRails
[00:14:40] bricker: recurrence: lots of options here https://www.ruby-toolbox.com/categories/Logging
[00:14:51] recurrence: I really miss being able to live enable logging for certain logging codes
[00:15:20] recurrence: eg: One area of my system would have some logs flagged as ???qr??? that only print when ???qr??? is enabled
[00:15:36] chuythong: has joined #RubyOnRails
[00:16:38] eggoez: has joined #RubyOnRails
[00:18:51] theBestNunu: has joined #RubyOnRails
[00:19:09] ur5us_: has joined #RubyOnRails
[00:19:32] 18WAAAGJN: has joined #RubyOnRails
[00:19:32] merryfett: has joined #RubyOnRails
[00:19:32] silverdust: has joined #RubyOnRails
[00:20:46] chipotle: has joined #RubyOnRails
[00:21:16] mrbubbles: has joined #RubyOnRails
[00:22:46] xcesariox: has joined #RubyOnRails
[00:26:34] chipotle: has joined #RubyOnRails
[00:27:32] workmad3: has joined #RubyOnRails
[00:34:03] icaro: has joined #RubyOnRails
[00:40:36] doodleha_: has joined #RubyOnRails
[00:46:05] stantonnet: has joined #RubyOnRails
[00:46:32] xkickflip: has joined #RubyOnRails
[00:49:07] bricker: -q hd1!*@*
[00:49:18] bricker: -o bricker
[00:51:04] centrx: has joined #RubyOnRails
[00:51:51] rubyonrailed: has joined #RubyOnRails
[00:52:14] givanse: has joined #RubyOnRails
[00:52:17] fgo_: has joined #RubyOnRails
[00:52:31] mheld: has joined #RubyOnRails
[00:54:16] paulcsmith: has joined #RubyOnRails
[00:54:44] ledestin: has joined #RubyOnRails
[00:57:41] doodlehaus: has joined #RubyOnRails
[00:58:59] erich__: has joined #RubyOnRails
[00:59:05] jkamenik: has joined #RubyOnRails
[00:59:56] sonofdirt: has joined #RubyOnRails
[01:01:09] erich: has joined #RubyOnRails
[01:01:34] Sylario: has joined #RubyOnRails
[01:02:37] baweaver: has joined #RubyOnRails
[01:02:47] RegulationD: has joined #RubyOnRails
[01:02:55] shmilan: has joined #RubyOnRails
[01:08:44] Hobogrammer: has joined #RubyOnRails
[01:10:03] sonofdirt: has joined #RubyOnRails
[01:10:09] earthquake: has joined #RubyOnRails
[01:11:59] manuelmesson: has joined #RubyOnRails
[01:14:47] tsvenson_: has joined #RubyOnRails
[01:15:14] sonofdirt: has joined #RubyOnRails
[01:16:08] bmurt: has joined #RubyOnRails
[01:16:19] manuelmesson: Hey people, i'm starting to apply for junior ruby on rails jobs. What kind of skills do you think a junior should have?
[01:16:36] recurrence: has joined #RubyOnRails
[01:16:49] manuelmesson: Btw, i notice a lot of people asking for junior and then say to you, ah, we want a junior with 5 years of experience... what??? men!
[01:18:27] EminenceHC: has joined #RubyOnRails
[01:19:51] _djbkd: has joined #RubyOnRails
[01:20:12] Guest64668: has left #RubyOnRails: ()
[01:20:52] LeoDee: has joined #RubyOnRails
[01:22:30] christiandsg: has joined #RubyOnRails
[01:22:45] Papierkorb: 20 years of experience with rails, so you should've used it before it even existed. minimum wage is appreciated, thank you, teamplayer!
[01:22:45] [H]unt3r: has joined #RubyOnRails
[01:23:32] gerep: has joined #RubyOnRails
[01:25:33] Radar: manuelmesson: Do you understand the code in this PR? https://github.com/radar/forem/pull/669/files
[01:25:42] kb3ien: has joined #RubyOnRails
[01:25:48] Radar: manuelmesson: And if so, do you have any feedback on it?
[01:28:03] michael_mbp: has joined #RubyOnRails
[01:29:05] manuelmesson: @radar: yeah, what they are functions in the controller of topics
[01:29:30] shyshy: has joined #RubyOnRails
[01:29:42] Radar: manuelmesson: Can you tell what mistake this user is making? https://github.com/spree/spree/issues/6597
[01:30:38] justthisguy: has joined #RubyOnRails
[01:31:10] Radar: manuelmesson: What does this line in the controller do? https://github.com/radar/forem/pull/669/files#diff-89a9bdfd10376e02ff151ce4716f3b94R100
[01:31:18] Radar: How about this line in the model? https://github.com/radar/forem/pull/669/files#diff-8d43a3951a62c768c9c62b72f9b2573dR21
[01:31:29] Radar: (These are questions I would ask a junior applying for a job)
[01:31:59] manuelmesson: no :'( i think he wants to create a new rails app with expecific version of rails.
[01:32:13] bonhoeffer: has joined #RubyOnRails
[01:32:45] Radar: No worries on the Spree issue :) That is not a junior-style question.
[01:32:52] Radar: Just trying to gauge.
[01:33:12] Radar: How did you learn Ruby + Rails?
[01:33:28] manuelmesson: flash.alert = t("forem.topic.unsubscription_failed")
[01:33:43] Radar: yeah, what is that line doing?
[01:33:48] manuelmesson: flash.alert is a gem and it will "pass" if the unsubscription failed
[01:34:00] manuelmesson: like, i will display it
[01:34:14] Radar: a gem? can you explain what you mean by that?
[01:35:26] manuelmesson: like when you use flash[:success]
[01:35:31] Radar: What is flash?
[01:35:44] Radar: What type of object is it?
[01:35:54] manuelmesson: oh... dont know :'(
[01:35:59] webguynow: has joined #RubyOnRails
[01:36:00] manuelmesson: i just use it :)
[01:36:11] manuelmesson: well is a hash
[01:36:20] manuelmesson: flash[:success]
[01:36:26] justthisguy: has joined #RubyOnRails
[01:36:32] sonofdirt: has joined #RubyOnRails
[01:37:10] Radar: What does the [:success] at the end of flash mean?
[01:37:49] manuelmesson: will select the specific "item" inside the hash
[01:37:57] manuelmesson: like [0,1,2,3,4]
[01:38:20] manuelmesson: well success will point to some "item"
[01:38:28] manuelmesson: inside the hash
[01:38:51] Radar: what is :success in that instance? i.e. imagining the flash as a standard Hash like { success: "Good job!" } what is "success:" ?
[01:38:54] Guest6988: has joined #RubyOnRails
[01:39:06] allcentury: has joined #RubyOnRails
[01:39:42] bonhoeffer: with attr_encrypted, what is the secret_key in attr_encrypted :secret_field, key: 'your_secret_key'
[01:40:06] manuelmesson: success is well, the instance.
[01:40:11] manuelmesson: like an object.
[01:40:29] Radar: What are the objects in a hash commonly referred to?
[01:40:41] Radar: They're pairs of x and y. What is x and y?
[01:40:58] manuelmesson: this is what you are asking?
[01:41:01] Radar: manuelmesson: Yes.
[01:41:07] manuelmesson: { x => 'y' } ?
[01:41:08] Rubie: has joined #RubyOnRails
[01:41:10] Radar: bonhoeffer: something like what SecureRandom.hex(24) would generate.
[01:41:31] manuelmesson: secureRandom.hex(24) token is for auth.
[01:41:32] bonhoeffer: Radar: so it is literally the private key
[01:41:34] Radar: manuelmesson: It's more general than that. You would say that an Array is made up of elements or entries... but what makes a Hash?
[01:41:45] Radar: bonhoeffer: Not the same as your secret_token, but some other value.
[01:42:07] Radar: bonhoeffer: something sufficiently complex to use as (probably) a seed for whatever encryption it's doing.
[01:42:11] Radar: manuelmesson: How did you learn Ruby + Rails?
[01:42:45] manuelmesson: well, reading tutorials
[01:42:56] bonhoeffer: Radar: so, it is the seed ??? for the random number generator for the encyrption algorithm
[01:43:03] Radar: manuelmesson: Which ones?
[01:43:05] manuelmesson: rails 4 in action
[01:44:35] bruno-: has joined #RubyOnRails
[01:44:42] manuelmesson: also codeacademy
[01:45:02] x-light: ooh ooh is the answer to the Hash question key-value pairs (but what makes a Hash)?
[01:46:30] manuelmesson: well, i dont know... can you please tell me
[01:47:22] Radar: manuelmesson: Rails 4 in Action is the correct answer :P (I wrote it)
[01:47:28] davidconnolly: has joined #RubyOnRails
[01:47:34] Radar: manuelmesson: I think you should brush up on your general Ruby knowledge.
[01:47:35] davidconnolly: has left #RubyOnRails: ()
[01:47:39] Radar: manuelmesson: exercism.io is pretty good for that
[01:47:51] vimmer: has joined #RubyOnRails
[01:47:55] Radar: Reading the Rails guides is good too.
[01:49:05] manuelmesson: yeah, sometimes i focus in doing things work. but there is some theory that you dont understand.
[01:49:16] manuelmesson: like, i have notice that rails is like magic.
[01:49:23] manuelmesson: Or a least for me right now.
[01:50:07] manuelmesson: exercism.io is free?
[01:50:52] manuelmesson: well, hopefully in 3 month i'm able to land a job.
[01:51:07] manuelmesson: thanks for the interview xD
[01:52:25] one_zero: has joined #RubyOnRails
[01:55:34] christiandsg: has joined #RubyOnRails
[01:55:57] hfp: has joined #RubyOnRails
[01:56:27] hfp_work: has joined #RubyOnRails
[01:58:46] doodlehaus: has joined #RubyOnRails
[01:59:25] choke: has joined #RubyOnRails
[01:59:32] Rodya_: has joined #RubyOnRails
[01:59:37] justthisguy: has joined #RubyOnRails
[02:00:09] seank_: has joined #RubyOnRails
[02:01:05] VeryBewitching: has joined #RubyOnRails
[02:02:08] choke: small issue with a serializer: https://gist.github.com/ch0ke/c8497dd0d3085da7c607 when i run it like this, it tells me that my method 'from_last_day' does not exist.
[02:04:34] skkeeper: has joined #RubyOnRails
[02:04:35] paulcsmith: has joined #RubyOnRails
[02:04:38] eggoez: has joined #RubyOnRails
[02:08:19] user1138: has joined #RubyOnRails
[02:09:34] totimkopf: has joined #RubyOnRails
[02:09:35] sevenseacat: has joined #RubyOnRails
[02:10:19] totimkopf: R4iA is going live? yaay
[02:10:36] arooni-mobile: has joined #RubyOnRails
[02:10:41] Mendenhall: has joined #RubyOnRails
[02:13:57] EasyCo: has joined #RubyOnRails
[02:14:08] totimkopf: ah, nevermind...
[02:14:34] totimkopf: the 22nd revision of the MEAP looks good, though :)
[02:14:59] totimkopf: maybe I'm glossing over the errors :P
[02:15:11] Radar: totimkopf: at some point not too far awaty
[02:15:30] Radar: choke: your method is defined as an instance method, rather than a class method
[02:16:11] workmad3: has joined #RubyOnRails
[02:16:15] choke: Radar, I just caught that myself so it's fixed now ( sorta ).. Thanks
[02:19:09] manuelmesson: has joined #RubyOnRails
[02:21:13] lethjakman: has joined #RubyOnRails
[02:22:19] sonofdirt: has joined #RubyOnRails
[02:27:44] aerotus: has joined #RubyOnRails
[02:28:04] baweaver: has joined #RubyOnRails
[02:28:28] Rodya_: has joined #RubyOnRails
[02:28:44] Creeves: has joined #RubyOnRails
[02:28:57] recurrence: has joined #RubyOnRails
[02:29:26] Rubie: has joined #RubyOnRails
[02:29:27] aerotus: has left #RubyOnRails: ()
[02:30:53] mblair: has joined #RubyOnRails
[02:31:18] bungoman: has joined #RubyOnRails
[02:31:36] zorak8: has joined #RubyOnRails
[02:32:02] GnuYawk: has joined #RubyOnRails
[02:32:30] nso95: has joined #RubyOnRails
[02:33:16] hololeap: has joined #RubyOnRails
[02:33:53] hololeap|2: has joined #RubyOnRails
[02:37:15] christiandsg: has joined #RubyOnRails
[02:41:10] xkickflip: has joined #RubyOnRails
[02:41:16] aerotus: has joined #RubyOnRails
[02:44:02] jesterfraud: has joined #RubyOnRails
[02:45:19] powersurge: has joined #RubyOnRails
[02:45:42] powersurge: I've put puma in my production group but when i run bundle exec rails s it's picking up puma rather than webrick
[02:45:53] powersurge: anyone else experience this? how can I get it to default to webrick locally?
[02:49:57] Aeyrix: group :production do
[02:49:59] Aeyrix: gem 'puma'
[02:51:00] powersurge: I've done that
[02:51:23] powersurge: and if I do bundle install --without production I can again do bundle exec rails s and get webrick to run
[02:51:46] powersurge: is that what I'm meant to do? it feels as though I've misconfigured something if it's using gems in my production group by default
[02:51:47] earthquake: has joined #RubyOnRails
[02:52:20] powersurge: tried swapping puma for unicorn and can verify that unicorn doesn't run by default with rails s
[02:53:14] Casty: has joined #RubyOnRails
[02:53:51] yfeldblum: has joined #RubyOnRails
[02:55:16] michaeldeol: has joined #RubyOnRails
[02:56:21] Creeves: has joined #RubyOnRails
[03:05:39] choke: Yeah I've been using unicorn and frequently run both... I should look into Puma and Slim and see what's going to give me the best performance and concurrency for a json api
[03:05:50] choke: and by slim i mean Thin
[03:06:11] user1138: has joined #RubyOnRails
[03:11:06] arooni-mobile: has joined #RubyOnRails
[03:11:37] Supertanker2: If I have a small app I'm using for fun (like a personal home page), is webrick safe to use as a reverse proxy'd server, from a security point of view?
[03:11:44] Supertanker2: I realize it's slow but I'm not looking at dozens of hits per second here.
[03:11:48] braincrash: has joined #RubyOnRails
[03:12:55] Supertanker2: Although now that I'm looking, thin might be just as easy to use.
[03:13:08] choke: For a tiny app that is never expected to get many concurrent hits it should be fine if it's handled correctly. If you do it, I suggest creating a fail-safe that allows you to easily switch server technology if your live site gets many hits...
[03:13:48] choke: they're all easy -- i have a .launch.sh i can gist for you that'll launch a unicorn server.. i'll gist the nginx server conf for it too
[03:13:55] srinidhi: has joined #RubyOnRails
[03:15:01] hd1: ACTION is watching Barca manhandle LA on FS1 right now
[03:16:12] Mendenhall: has joined #RubyOnRails
[03:16:33] hd1: has left #RubyOnRails: ()
[03:17:33] michael_mbp: has joined #RubyOnRails
[03:17:48] Supertanker2: choke, cool, I'd appreciate it if you have time :)
[03:18:34] choke: Yeah, i'm just screwing around testing out how i can squeeze some performance out of my api ( 1 second to load 1200 places each with 3000 posts isnt fast enough )
[03:18:51] bronson: has joined #RubyOnRails
[03:22:33] LeoDee: has joined #RubyOnRails
[03:24:06] chinmay_dd: has joined #RubyOnRails
[03:25:03] choke: https://gist.github.com/ch0ke/bee624ab89be3a76163d That should do it Supertanker2
[03:25:13] Supertanker2: Thanks choke I'll check it out
[03:27:56] choke: its super basic, but it works for now.. i'll probably expand it over the weekend since i'm pushing to launch this app into production
[03:29:45] joelataylor: has joined #RubyOnRails
[03:29:57] choke: you can also install the gem unicorn-rails, and then you can do something like rails s -c unicorn ( i think that's right )
[03:31:01] Aeyrix: powersurge: what's wrong with running puma in dev?
[03:31:07] Aeyrix: i do, even
[03:33:04] mcr-credil: has joined #RubyOnRails
[03:35:13] choke: To me it makes sense too.. I often run unicorn for my api in development, because I am under the impression that it only makes sense to develop in an environment as close to your production server as possible... my benchmarking is still double on the production server than on local, but for good reason
[03:35:17] erich: has joined #RubyOnRails
[03:36:25] Scripore: has joined #RubyOnRails
[03:37:09] choke: but thats also why i have a development 'production' cluster that's a clone of my production cluster.. for benchmarking new code that's deployed with some sexy continuous integration
[03:37:30] user1138: has joined #RubyOnRails
[03:37:41] Rubie: has joined #RubyOnRails
[03:38:05] lethjakman: has joined #RubyOnRails
[03:38:26] fgo_: has joined #RubyOnRails
[03:38:46] user1138: has joined #RubyOnRails
[03:41:00] Lightsword: has joined #RubyOnRails
[03:43:01] dopie: has joined #RubyOnRails
[03:43:01] michaeldeol: has joined #RubyOnRails
[03:43:09] powersurge: I can Aeyrix I was just curious why it was picking it up
[03:43:16] powersurge: seemed like a sign that something was misconfigured
[03:43:27] powersurge: but I guess it's just puma being a little overzealous
[03:44:08] SteenJobs: has joined #RubyOnRails
[03:45:17] choke: well, like the cat -- it's probably a secretive arrogant bastard
[03:45:24] wydont: has joined #RubyOnRails
[03:45:54] bruno-: has joined #RubyOnRails
[03:52:50] mike___1234: has joined #RubyOnRails
[03:53:54] darrencauthon: has joined #RubyOnRails
[03:54:42] eggoez: has joined #RubyOnRails
[04:00:48] hd1: has joined #RubyOnRails
[04:04:53] workmad3: has joined #RubyOnRails
[04:06:14] doodlehaus: has joined #RubyOnRails
[04:06:35] hd1: https://gist.github.com/hdiwan/bbbe63d8ae98f8753976 problem in comments
[04:06:47] hd1: specifically line 8
[04:07:47] gilest: has joined #RubyOnRails
[04:12:36] lampd1: has joined #RubyOnRails
[04:14:41] gilest: Anyone have any experience serving MPEG-DASH video from a CDN?
[04:14:53] CanTonic: has joined #RubyOnRails
[04:15:24] Radar: hd1: what have you tried?
[04:18:13] chintanparikh: has joined #RubyOnRails
[04:18:30] Aeyrix: gilest: Not really a question that #ror is going to be able to help you with in-depth.
[04:19:18] gilest: Aeyrix: Yeah... if anyone could recommend a channel I'd be grateful. Apologies for off-topic :/
[04:19:54] Aeyrix: I'm honestly not sure.
[04:20:14] Aeyrix: Unless the bit you're struggling with is serving the content already on a CDN in your rails app
[04:20:19] Aeyrix: then probably there's an answer here somewhere
[04:22:10] DoctorMonocular: has joined #RubyOnRails
[04:22:32] ElSif: maybe try the #videolan channel? that's for VLC but they probably have people with experience with web video
[04:23:03] ur5us: has joined #RubyOnRails
[04:23:29] hd1: Radar: adding class: Note to the models
[04:24:06] Radar: hd1: show me
[04:24:16] SimpleString: has joined #RubyOnRails
[04:24:57] SimpleString: Can somebody tell me what the difference is between this JS regex and the Ruby regex I translated it from? http://pastie.org/10305336
[04:26:17] hd1: Radar: https://gist.github.com/hdiwan/bbbe63d8ae98f8753976 second one is what I tried
[04:26:28] Radar: SimpleString: Maybe give us a simple string of what you want? :)
[04:26:28] ElSif: the ruby one has a |\Z) in it?
[04:26:45] Radar: hd1: I'm not seeing a problem here yet.
[04:27:01] Radar: hd1: Why are you defining factories as if they were fixtures?
[04:27:04] ss_much: has joined #RubyOnRails
[04:27:08] ElSif: i am seeing 'match on 1 to 14 dots followed by any amount of whitespace?
[04:27:17] Radar: note1, note2, note3 is not clear in the tests at all
[04:27:17] ElSif: ah, 1 to 14 characters
[04:27:38] hd1: > FactoryGirl.create(:note1)
[04:27:38] SimpleString: Radar: (Aside from that, my apologies)
[04:27:39] hd1: NameError: uninitialized constant Note1
[04:27:53] hd1: Radar: i'm trying to do this from the console
[04:28:08] hd1: if that helps to diagnose
[04:28:15] SimpleString: I'm unfamiliar with the terms factories and fixtures, pardon my ignorance
[04:28:25] Radar: SimpleString: I'm having two conversations here, sorry.
[04:28:34] Radar: hd1: DId you reload the console and the factories?
[04:28:50] hd1: Radar: I restarted the console
[04:28:57] SimpleString: Radar: I see now
[04:28:58] Radar: hd1: then I have no idea
[04:29:03] hd1: that should reload the whole thing, right, Radar?
[04:29:26] girakrok: has joined #RubyOnRails
[04:30:00] Radar: hd1: probably
[04:31:25] mcr-credil: has joined #RubyOnRails
[04:32:28] gilest: ElSif: Good tip. Thanks!
[04:32:35] hd1: Radar, hmmm
[04:33:34] ElSif: gilest: yw
[04:34:24] chrishough: has joined #RubyOnRails
[04:34:38] Cache_Money: has joined #RubyOnRails
[04:34:54] SimpleString: I guess it 's really the ruby regex I don't understand
[04:35:07] Radar: SimpleString: Give us an example string of what it matches, please.
[04:35:17] ElSif: he did, its at the end of that pastie
[04:35:34] Radar: "Bottom Caption"?
[04:35:40] ElSif: i think so?
[04:35:45] ElSif: im not entirely sure :)
[04:36:11] Radar: It'd be nice to know what 1) the text is that it should match and 2) the expected result
[04:36:13] Radar: Otherwise it's just another regex
[04:36:51] chintanparikh: has joined #RubyOnRails
[04:37:03] SimpleString: http://pastie.org/10305357
[04:37:29] Lightsword: has joined #RubyOnRails
[04:37:33] SimpleString: more info incoming*
[04:37:41] gilest: has left #RubyOnRails: ("Leaving...")
[04:37:51] ElSif: are you attempting to anchor to the end of the string with the \Z?
[04:38:02] SimpleString: basically I'd like the JS one to behave exactly like the ruby one
[04:38:23] SimpleString: the Ruby one is the model
[04:38:27] SimpleString: works as desired
[04:38:51] strcmp1: has joined #RubyOnRails
[04:38:54] SimpleString: I want the JS to stick a linebreak onto the end of "Bottom Caption" and not the middle
[04:39:27] fgo_: has joined #RubyOnRails
[04:39:31] SimpleString: oh guys I'm sorry I just tried adding the end of line match option to the JS regex and it actually fixed it
[04:40:15] ElSif: no worries, glad to help :)
[04:40:27] SimpleString: sorry again* no it doesn't
[04:41:01] dented42: has joined #RubyOnRails
[04:41:07] Radar: SimpleString: Is the complete text that you're matching "Bottom Caption" and absolutely nothing else?
[04:41:16] Radar: I am so confused here about expected input + expected output.
[04:42:00] ElSif: i think he wasnt to capture the first word, insert a newline between the first and second word
[04:42:10] ElSif: SimpleString?
[04:42:18] Maletor: has joined #RubyOnRails
[04:42:23] Radar: "Bottom Caption".split(" ").join("\n")
[04:42:39] rakm: has joined #RubyOnRails
[04:43:19] SimpleString: To clarify: The ruby string is fine, adds a newline to the end of the string. I'm trying to generate a JS expression that will do the same thing.
[04:43:50] SimpleString: I've had this ruby expression in use in my application and I'm wanting to replicate its behavior in JS
[04:43:53] ElSif: i had it backwards
[04:44:10] Radar: SimpleString: Final time: input + expected output, please.
[04:44:38] ellisTAA: has joined #RubyOnRails
[04:44:51] SimpleString: Radar: Apologies; using JS: "Bottom Caption" => "Bottom Caption<br>" but this function does more than just add a newline to the end of strings
[04:45:00] chintanparikh: has joined #RubyOnRails
[04:45:58] ElSif: console.log("bottom caption".replace(RegExp("(.{1,14})(\\s+|$)", 'gi'), "$1<br>")) i think is what you want?
[04:46:06] ElSif: (without the logging or whatevs)
[04:46:42] manuelmesson: has joined #RubyOnRails
[04:46:58] lxsameer: has joined #RubyOnRails
[04:49:11] SimpleString: and thanks ELSif that is the solution!
[04:50:21] ElSif: cool, probably want to ask JS questions in JS channel next time :)
[04:53:17] SimpleString: My reasoning was that more Rubyists would know JS than JSists know Ruby
[04:54:29] ElSif: lol i have no comment
[04:55:44] pontiki: SimpleString: https://gist.github.com/tamouse/0f2fc41ce32e3036921b
[04:57:54] sp1rs: has joined #RubyOnRails
[04:58:16] mcr-credil: has joined #RubyOnRails
[04:58:18] lethjakman: has joined #RubyOnRails
[04:59:32] simplyianm: has joined #RubyOnRails
[05:00:43] simplyia_: has joined #RubyOnRails
[05:02:25] DoctorMonocular: has joined #RubyOnRails
[05:03:30] yfeldblum: has joined #RubyOnRails
[05:04:22] RegulationD: has joined #RubyOnRails
[05:04:39] srinidhi: has joined #RubyOnRails
[05:06:06] Creeves: has joined #RubyOnRails
[05:09:00] user1138: has joined #RubyOnRails
[05:12:32] Creeves: i've got to stop replacing meals with caffeine
[05:17:23] htmldrum: has joined #RubyOnRails
[05:19:26] bronson: has joined #RubyOnRails
[05:22:16] vigasdeep: has joined #RubyOnRails
[05:23:23] Lightsword: has joined #RubyOnRails
[05:24:49] earthquake: has joined #RubyOnRails
[05:26:47] riotjones: has joined #RubyOnRails
[05:27:12] user1138: has joined #RubyOnRails
[05:28:10] MarkTR: has joined #RubyOnRails
[05:28:15] rvanlieshout: has joined #RubyOnRails
[05:28:31] krz: has joined #RubyOnRails
[05:33:29] yardenbar: has joined #RubyOnRails
[05:38:35] BGuimberteau: has joined #RubyOnRails
[05:38:46] user1138: has joined #RubyOnRails
[05:38:47] tagrudev: has joined #RubyOnRails
[05:40:38] fgo_: has joined #RubyOnRails
[05:43:28] chrissonar: has joined #RubyOnRails
[05:43:58] simplyianm: has joined #RubyOnRails
[05:43:59] htmldrum: has joined #RubyOnRails
[05:45:40] sandelius: has joined #RubyOnRails
[05:47:12] simplyianm: has joined #RubyOnRails
[05:47:53] pwnz0r_: has joined #RubyOnRails
[05:49:36] simplyia_: has joined #RubyOnRails
[05:51:24] duncannz: has joined #RubyOnRails
[05:51:39] EminenceHC: has joined #RubyOnRails
[05:52:30] duncannz: has joined #RubyOnRails
[05:53:43] workmad3: has joined #RubyOnRails
[05:53:53] duncannz: has joined #RubyOnRails
[05:53:57] metus_violarium: has joined #RubyOnRails
[05:54:59] duncannz: has joined #RubyOnRails
[05:55:35] pwnz0r_: has joined #RubyOnRails
[05:56:20] duncannz: has joined #RubyOnRails
[05:56:32] Rubie: has joined #RubyOnRails
[05:56:51] xcesariox: has joined #RubyOnRails
[05:57:15] roolo: has joined #RubyOnRails
[05:58:28] eGGsha: has joined #RubyOnRails
[06:01:25] fighella: has joined #RubyOnRails
[06:02:41] solars: has joined #RubyOnRails
[06:04:33] eggoez: has joined #RubyOnRails
[06:05:58] Radar: How do I fix this error with Sidekiq?
[06:05:59] Radar: 2015-07-22T06:05:48.604Z 12637 TID-1xbpp0 WARN: could not obtain a database connection within 5.000 seconds (waited 5.074 seconds)
[06:06:11] Radar: My connection pool for my DB is 100, and MySQL's max_connections is 500
[06:06:14] Radar: I can't see why this is happening.
[06:07:02] doodlehaus: has joined #RubyOnRails
[06:08:09] simplyianm: has joined #RubyOnRails
[06:09:16] sinkensabe: has joined #RubyOnRails
[06:09:36] htmldrum: has joined #RubyOnRails
[06:09:39] rvanlieshout: able to increase mysql log level?
[06:11:11] sinkensabe: has joined #RubyOnRails
[06:12:15] linoge: has joined #RubyOnRails
[06:12:31] Radar: Probably, but I don't know if the problem lies there. The max connections is pretty high
[06:12:52] rvanlieshout: true, but it might show something more
[06:13:10] linoge: has left #RubyOnRails: ()
[06:13:11] rvanlieshout: or maybe try a simple ruby script that tries to connect (or rails runner) and run that parallel
[06:13:13] linoge: has joined #RubyOnRails
[06:13:21] linoge: has left #RubyOnRails: ()
[06:14:25] Radar: Yeah, I'm going with a simple Rails script now.
[06:14:54] choke: has joined #RubyOnRails
[06:15:23] aganov: has joined #RubyOnRails
[06:15:37] Radar: [6] pry(main)> ActiveRecord::Base.connection.pool.size
[06:15:41] Radar: Well there's your problem.
[06:15:53] rvanlieshout: that won't help no :)
[06:15:54] user1138: has joined #RubyOnRails
[06:20:39] DoctorMonocular: has joined #RubyOnRails
[06:21:26] Radar: thanks for rubber ducking rvanlieshout :)
[06:21:40] htmldrum: has joined #RubyOnRails
[06:22:02] rvanlieshout: no problem. these things help me to start my day :)
[06:22:55] yfeldblum: has joined #RubyOnRails
[06:23:15] Dopagod: has joined #RubyOnRails
[06:23:15] Dopagod: has joined #RubyOnRails
[06:24:09] michaeldeol: has joined #RubyOnRails
[06:25:56] schaerli: has joined #RubyOnRails
[06:28:37] sypheren: has joined #RubyOnRails
[06:32:49] hd1: ACTION sighs
[06:32:53] xMopxShell: has joined #RubyOnRails
[06:33:02] netzfisch: has joined #RubyOnRails
[06:38:04] Gnut: has joined #RubyOnRails
[06:41:27] schaerli: has joined #RubyOnRails
[06:44:06] alphaatom: has joined #RubyOnRails
[06:44:19] lethjakman: has joined #RubyOnRails
[06:44:45] simplyianm: has joined #RubyOnRails
[06:45:29] dideler: has joined #RubyOnRails
[06:45:31] linoge: has joined #RubyOnRails
[06:45:55] ur5us: has joined #RubyOnRails
[06:46:23] eGGsha: has joined #RubyOnRails
[06:46:36] xcesariox: has joined #RubyOnRails
[06:48:54] htmldrum: has joined #RubyOnRails
[06:49:28] quazimodo: has joined #RubyOnRails
[06:51:13] DoctorMonocular: has joined #RubyOnRails
[06:52:12] simrat: has joined #RubyOnRails
[06:52:21] cornerma1: has joined #RubyOnRails
[06:54:35] michael_mbp: has joined #RubyOnRails
[06:55:06] MaDErroR123: has joined #RubyOnRails
[06:56:24] sp1rs: has joined #RubyOnRails
[06:58:31] comrad: has joined #RubyOnRails
[06:58:33] vigasdeep: has joined #RubyOnRails
[06:59:37] netzfisch: has joined #RubyOnRails
[07:01:50] lxsameer: has joined #RubyOnRails
[07:02:12] Gnut: has joined #RubyOnRails
[07:05:21] arBmind: has joined #RubyOnRails
[07:05:31] user1138: has joined #RubyOnRails
[07:12:27] mcr-credil: has joined #RubyOnRails
[07:15:23] Iron-LV: has joined #RubyOnRails
[07:15:44] Palsson: has joined #RubyOnRails
[07:20:43] bronson: has joined #RubyOnRails
[07:23:25] arup_r: has joined #RubyOnRails
[07:23:32] Mendenhall: has joined #RubyOnRails
[07:24:49] zpe: has joined #RubyOnRails
[07:25:36] arup_r: when I am trying to precomplie asset in production getting error as Sprockets::ArgumentError: Asset logical path has no extension: easyselect-container
[07:25:50] sameerynho: has joined #RubyOnRails
[07:25:54] relix: has joined #RubyOnRails
[07:26:17] qejk: has joined #RubyOnRails
[07:27:22] arup_r: I have this //= require jquery.easyselect.min.js in my application.js file
[07:29:01] lxsameer_: has joined #RubyOnRails
[07:29:59] davidheward: has joined #RubyOnRails
[07:30:03] safeforge: has joined #RubyOnRails
[07:31:09] emilkarl: has joined #RubyOnRails
[07:31:39] emilkarl: Anyone got remote links to work with Tooltipster js (http://iamceege.github.io/tooltipster/)?
[07:32:02] emilkarl: I???ve got a remote link with just renders as html on click when link is in tooltipster-content
[07:32:18] srinidhi: has joined #RubyOnRails
[07:33:55] darutoko: has joined #RubyOnRails
[07:35:29] Radar: arup_r: RAILS_GROUPS=assets RAILS_ENV=production bundle exec rake assets:precompile
[07:35:31] Radar: arup_r: Does that fix it for you?
[07:35:39] bricker: has joined #RubyOnRails
[07:35:52] anti-freeze: has joined #RubyOnRails
[07:36:05] duncannz: has joined #RubyOnRails
[07:36:10] gremax: has joined #RubyOnRails
[07:36:40] arup_r: Radar: I have the files I checked https://gist.github.com/aruprakshit/c9d68cb958130454dcd9 .. Let me try what you said..
[07:37:08] arup_r: same error
[07:37:31] artto: has joined #RubyOnRails
[07:37:50] arup_r: https://gist.github.com/aruprakshit/c9d68cb958130454dcd9
[07:40:54] ur5us: has joined #RubyOnRails
[07:41:16] schaerli: has joined #RubyOnRails
[07:41:45] krokuz: has joined #RubyOnRails
[07:42:26] workmad3: has joined #RubyOnRails
[07:44:26] eGGsha: has joined #RubyOnRails
[07:44:51] Juanchito: has joined #RubyOnRails
[07:46:00] marr: has joined #RubyOnRails
[07:47:12] bruno-: has joined #RubyOnRails
[07:47:20] Ropeney: arup_r: In your require try remove the extension
[07:47:33] Pupeno: has joined #RubyOnRails
[07:49:17] Pupeno: has joined #RubyOnRails
[07:49:59] arup_r: Ropeney: someone put a css file without an extension.. I just figured out.. so that was causing problem..
[07:50:14] arup_r: 7 people are pushing code.. no control it seems
[07:51:39] arup_r: Ropeney: that was causing error from this line https://github.com/sstephenson/sprockets/blob/master/lib/sprockets/asset.rb#L36
[07:52:11] simplyianm: has joined #RubyOnRails
[07:54:22] IronTalk: has joined #RubyOnRails
[07:56:46] fgo_: has joined #RubyOnRails
[07:57:47] mikecmpbll: has joined #RubyOnRails
[07:59:22] bricker: has joined #RubyOnRails
[08:02:11] umo_: has joined #RubyOnRails
[08:02:48] emilkarl: has joined #RubyOnRails
[08:03:51] sameerynho: has joined #RubyOnRails
[08:05:29] schaerli: has joined #RubyOnRails
[08:07:20] Spami: has joined #RubyOnRails
[08:07:56] doodlehaus: has joined #RubyOnRails
[08:08:02] Elion: has joined #RubyOnRails
[08:08:05] michael_mbp: has joined #RubyOnRails
[08:10:47] Olipro: has joined #RubyOnRails
[08:11:10] matcouto: has joined #RubyOnRails
[08:11:21] blackhuey: has joined #RubyOnRails
[08:12:17] Guest6988: has joined #RubyOnRails
[08:15:10] jsrn_: has joined #RubyOnRails
[08:16:37] mhib: has joined #RubyOnRails
[08:17:17] user1138: has joined #RubyOnRails
[08:17:52] gaussblurinc1: has joined #RubyOnRails
[08:17:53] Guest6988: has joined #RubyOnRails
[08:27:29] hd1: has left #RubyOnRails: ()
[08:28:12] yfeldblum: has joined #RubyOnRails
[08:33:04] lethjakman: has joined #RubyOnRails
[08:34:26] dangerousdave: has joined #RubyOnRails
[08:38:36] yekta: has joined #RubyOnRails
[08:39:54] yekta: Is there a routing helper which includes the absolute path? For exmaple I might have edit_proeject_path(@project), but that doesn???t give the absolute path which is problematic in an email template. Is there a built in routing helper or an argument that can be passed which includes the aboslute URL or do I have to shimmy it in?
[08:40:07] universa1: yekta: edit_project_url
[08:40:23] yekta: Ah ha, so that???s the difference. Thanks!
[08:40:57] universa1: yekta: be aware though, that you need to set default_url_options for mails, since they have no request environment, and therefore no automagic knowledge about the root url of your site.
[08:41:18] yekta: Oh, good to know. Thanks.
[08:41:52] helpa: http://guides.rubyonrails.org/action_mailer_basics.html
[08:41:59] universa1: the guide should have info about that.
[08:43:56] theBestNunu: has joined #RubyOnRails
[08:44:18] x-light: has joined #RubyOnRails
[08:45:25] AnoHito: has joined #RubyOnRails
[08:45:43] totimkopf: has joined #RubyOnRails
[08:45:46] ruurd: has joined #RubyOnRails
[08:46:23] DEA7TH: has joined #RubyOnRails
[08:50:28] brianpWins: has joined #RubyOnRails
[08:50:45] arBmind: has joined #RubyOnRails
[08:51:43] safeforge: has joined #RubyOnRails
[08:53:45] darutoko-: has joined #RubyOnRails
[09:06:00] RegulationD: has joined #RubyOnRails
[09:06:49] xkickflip_: has joined #RubyOnRails
[09:07:11] user1138: has joined #RubyOnRails
[09:07:38] arup_r: has joined #RubyOnRails
[09:14:34] eGGsha: has joined #RubyOnRails
[09:14:36] Oog_: has joined #RubyOnRails
[09:15:38] schaerli: has joined #RubyOnRails
[09:20:32] inoter: has joined #RubyOnRails
[09:21:54] stamina: has joined #RubyOnRails
[09:26:16] Ergo: has joined #RubyOnRails
[09:29:54] Hates_: has joined #RubyOnRails
[09:30:36] user1138: has joined #RubyOnRails
[09:30:43] blackhuey1: has joined #RubyOnRails
[09:31:14] workmad3: has joined #RubyOnRails
[09:32:34] DoctorMonocular: has joined #RubyOnRails
[09:32:44] Rubie: has joined #RubyOnRails
[09:34:27] bin_005: has joined #RubyOnRails
[09:35:12] mhf: has joined #RubyOnRails
[09:35:21] dangerousdave: has joined #RubyOnRails
[09:35:52] sankaber: has joined #RubyOnRails
[09:37:35] michael_mbp: has joined #RubyOnRails
[09:38:56] infoget: has joined #RubyOnRails
[09:40:31] jokke: can i trigger other generators from generators
[09:40:58] jokke: never mind
[09:43:21] arup_r: Guys.. Wouldn't it be good if we can provide `if:` or `unless:` option while rendering partials conditionally, for eg something like.. `<%= render partial: "account", object: @buyer, as: 'user', if: <cond> %>` ..
[09:43:32] arup_r: what do you people think ?
[09:43:38] gaussblurinc1: has joined #RubyOnRails
[09:45:05] duncannz: has joined #RubyOnRails
[09:45:57] duncannz: has joined #RubyOnRails
[09:46:22] waka: has joined #RubyOnRails
[09:46:36] Mia: has joined #RubyOnRails
[09:46:45] duncannz: has joined #RubyOnRails
[09:47:40] duncannz: has joined #RubyOnRails
[09:48:35] DoctorMonocular: has joined #RubyOnRails
[09:49:35] Omilun: has joined #RubyOnRails
[09:50:52] elaptics: arup_r: you can just do that with a normal if
[09:51:18] arup_r: I know.. I am talking about if one option can be available there only..
[09:51:30] arup_r: thinking about just as an enhancement...
[09:51:41] arup_r: Would it be really helpful ?
[09:51:49] workmad3: has joined #RubyOnRails
[09:52:10] elaptics: for what purpose though? What advantage would if have over just doing <%= render partial: "foo" if some_condition_is_true %>
[09:53:15] schaerli: has joined #RubyOnRails
[09:53:55] drale2k: has joined #RubyOnRails
[09:54:56] arup_r: elaptics: mmm.. thinking about something like what we do with validations and call back ... Right now I have nothing in mind how it will improve .. but just looking for if it is there...
[09:56:10] gaussblurinc1: has joined #RubyOnRails
[09:56:41] Omilun: hello i have a problem with "rake routes" before added : ????resources :articles in config/routes.rb
[09:56:49] startupality: has joined #RubyOnRails
[09:56:49] Omilun: http://dpaste.com/2963F1M
[09:59:26] Omilun: how can i fix this error
[10:00:22] simrat: has joined #RubyOnRails
[10:02:08] elaptics: arup_r: validations and callbacks are different because you want the condition evaluated at the time the validation specified is run, which is why they're specifiable. A render line is executed as it's needed so no need to save it to be executed later
[10:02:32] elaptics: Omilun: !gist your routes file
[10:02:32] helpa: Omilun: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[10:02:43] elaptics: Omilun: my guess is that you've defined it outside of the block
[10:03:04] leslie1: has left #RubyOnRails: ()
[10:03:16] leslie: has joined #RubyOnRails
[10:03:55] nickenchuggets: has joined #RubyOnRails
[10:05:46] Palsson_: has joined #RubyOnRails
[10:06:01] GeorgesLeYeti: has joined #RubyOnRails
[10:06:26] GeorgesLeYeti: Someone already use grape for making an API. I have an issue.
[10:07:24] GeorgesLeYeti: I'm using a api and i like the way i'm using it. For sending my file i just have to make: $curl -T path_file api_url
[10:08:16] GeorgesLeYeti: And it retuns me the answer. It works well. ANd i want to do exactly the same.
[10:08:46] doodlehaus: has joined #RubyOnRails
[10:09:08] jsrn_: has joined #RubyOnRails
[10:09:13] GeorgesLeYeti: But when i try it, it returns me: {"error":"The requested content-type 'text/plain' is not supported."}
[10:09:38] livathinos: has joined #RubyOnRails
[10:09:38] Omilun: has joined #RubyOnRails
[10:12:33] Papierkorb: has joined #RubyOnRails
[10:13:31] Omilun: has left #RubyOnRails: ()
[10:13:44] Elion: has left #RubyOnRails: ()
[10:21:52] lethjakman: has joined #RubyOnRails
[10:23:00] eGGsha: has joined #RubyOnRails
[10:24:04] bonhoeffer: has joined #RubyOnRails
[10:26:29] bonhoeffer: has joined #RubyOnRails
[10:27:51] fgo_: has joined #RubyOnRails
[10:28:54] tjbiddle: has joined #RubyOnRails
[10:31:45] schaerli: has joined #RubyOnRails
[10:35:44] Skizu: has joined #RubyOnRails
[10:35:47] waka: has joined #RubyOnRails
[10:35:52] livathinos: has joined #RubyOnRails
[10:38:54] dyulax: has joined #RubyOnRails
[10:40:44] Anubix1: has joined #RubyOnRails
[10:40:54] Anubix1: has left #RubyOnRails: ()
[10:40:55] Skizu: I've got a product which has an owner and a manager, I have a nice relation on each of them columns to a user. As <User id: 1> I have to use Model.where('owner_id = 1 OR manager_id = 1') or is there a better way I can the data from the active record?
[10:43:15] EminenceHC: has joined #RubyOnRails
[10:43:18] tjbiddle: Hey all. Where should I store environment variables to be read in on system boot? I feel like putting a file in the app's root to be read in entirely defeats the purpose.
[10:43:34] tbuehlmann: Skizu, looks okay to me. you could change it to use arel instead of writing SQL and make it a user method, but that'd be it
[10:43:47] tjbiddle: Or does it not really matter since if a system is every compromised, the user can print out the environment variables? The important aspect is just so that I never risk putting keys into version control?
[10:44:53] tbuehlmann: tjbiddle, right, just don't put them into version control. after that it's up to you how to provide the information. two good ways are 1) through environment and 2) through config files that are on the remote server
[10:44:55] workmad3: tjbiddle: depends on how you're launching your service... popular choices are in an init script, in a 'defaults' file, using something like dotenv to read a .env file for your project, using an 'environment directory' with something like chpst...
[10:45:12] logik-bomb: guys, is it anti pattern to create a record on controller#new?
[10:45:38] javar: has joined #RubyOnRails
[10:45:59] javar: hey folks, someone had the trouble with devise: 'Confirmation token is invalid' when confirming after registering ?
[10:46:08] javar: I am using devise 3.5.1
[10:46:14] tjbiddle: workmad3: Ah, could I have a .env file be 600'd to root, and inside the init file (Which is also owned by root - but has a clause to run as a deploy user) have it read that .env file?
[10:46:32] Skizu: tbuehlmann: How'd I represent it in arel?
[10:46:40] workmad3: tjbiddle: you could... but if you have an init file, I'd just put the environment vars in there
[10:46:46] safeforge: has joined #RubyOnRails
[10:47:10] tjbiddle: workmad3: Awesome. Thanks!
[10:48:02] workmad3: tjbiddle: the main reason to not have things in the init script is generally to either 1) allow non-root users to modify certain values or 2) to make it easier to script deployment and setup of machines through CM systems like chef
[10:49:18] tjbiddle: workmad3: Yeah - I was leaning towards #2 as I'll be deploying via Chef. I like keeping the init script template clean and isolated just for it's sole purpose.
[10:49:27] workmad3: tjbiddle: if you were packaging up the app in a .deb or a .rpm, that would also suggest moving the env vars out of the init script, as then you can provide a mechanism to update the init script for a new version without trashing the old one... but if you're hand-crafting the script for a single deploy, I wouldn't worry about things too much
[10:49:46] tbuehlmann: something around this: https://gist.github.com/tbuehlmann/be57b2375dfa72153f66
[10:50:01] devux: has joined #RubyOnRails
[10:50:21] workmad3: tjbiddle: my preference with chef is to use runit as a process supervisor, and inside the runit script use chpst with an environment directory... that directory contains files where the name is the variable and the contents of each file is the value for that variable
[10:50:30] workmad3: tjbiddle: which makes it pretty easy to play around with in chef :)
[10:51:02] workmad3: tjbiddle: but it's a real PITA to set up manually :D
[10:51:14] mrbubbles: has joined #RubyOnRails
[10:51:26] Seich: has joined #RubyOnRails
[10:51:43] tjbiddle: workmad3: heheh :D Will read up on those and come up with something. Thanks for the advice!
[10:52:28] DEA7TH: has joined #RubyOnRails
[10:52:32] simplyianm: has joined #RubyOnRails
[10:52:54] infoget: Hi guys, I would like to ask, I'm developing bigger rails app, which includes users,roles,invitations,articles,tags,news and forum. I would like to ask, if it's better do it modular way, split those things to the modules. Second question is about forum engine - Forem, I would like to use it, but disadvantage is, that it is using separated authorization and admin namespace, I would like to integrated (admin namespace, authorization)
[10:53:42] Skizu: infoget: Nice wheel you're making that's so new :)
[10:55:13] pyemkey: has joined #RubyOnRails
[10:55:43] pyemkey: Hello guys, anyone can give me advice how can I convert pdf binary to pdf in ruby?
[10:58:31] Skizu: has left #RubyOnRails: ()
[11:06:15] bin_005_m: has joined #RubyOnRails
[11:06:58] DoubleMalt: has joined #RubyOnRails
[11:07:07] emilkarl: has joined #RubyOnRails
[11:07:16] chrissonar: My form for a nested resource generates a weird form element name. What did I screw up?
[11:07:19] chrissonar: https://gist.github.com/christianrolle/552a7b628038da29afa2
[11:08:30] sinkensabe: has joined #RubyOnRails
[11:08:37] livathinos: has joined #RubyOnRails
[11:09:01] simrat: has joined #RubyOnRails
[11:09:22] chrissonar: it is the text field name, which is unexpected.
[11:09:52] chrissonar: it is anesthesias/8/standard_operations[name] instead of standard_operations[name]
[11:10:05] diegoviola: has joined #RubyOnRails
[11:11:15] Papipo_: has joined #RubyOnRails
[11:11:38] chrissonar: mmh. when I switch to single resource, the name is as expected.
[11:11:39] Papipo_: has left #RubyOnRails: ()
[11:13:24] doodlehaus: has joined #RubyOnRails
[11:14:29] codelahoma: has joined #RubyOnRails
[11:16:12] leslie: does activejob contain anything to help with managing queued jobs? like checking their status, etc
[11:21:04] dangerousdave: has joined #RubyOnRails
[11:22:19] bruno-: has joined #RubyOnRails
[11:29:06] rustymyers: has joined #RubyOnRails
[11:29:16] rubyonrailed: has joined #RubyOnRails
[11:29:43] htmldrum: has joined #RubyOnRails
[11:30:13] bmurt: has joined #RubyOnRails
[11:31:51] erich: has joined #RubyOnRails
[11:35:12] wpp: has joined #RubyOnRails
[11:35:16] schaerli: has joined #RubyOnRails
[11:37:07] berty: has joined #RubyOnRails
[11:38:59] webguynow: has joined #RubyOnRails
[11:39:05] Scripore: has joined #RubyOnRails
[11:39:13] JeramyRR: has joined #RubyOnRails
[11:40:17] MetalMatze: has joined #RubyOnRails
[11:40:31] MetalMatze: has left #RubyOnRails: ()
[11:40:52] matcouto: has joined #RubyOnRails
[11:41:12] javar: has joined #RubyOnRails
[11:42:20] mrbubbles: has joined #RubyOnRails
[11:43:21] berty: has left #RubyOnRails: ()
[11:43:55] fgo_: has joined #RubyOnRails
[11:44:27] berty: has joined #RubyOnRails
[11:45:42] _lazarevsky: has joined #RubyOnRails
[11:45:48] _lazarevsky: a quick question if I may
[11:45:55] _lazarevsky: actually let me first give you the context
[11:46:06] _lazarevsky: we have 2 stages of our Rails App
[11:46:08] _lazarevsky: beta and prod
[11:46:22] _lazarevsky: beta is 6-7 commits ahead of prod
[11:46:43] _lazarevsky: on beta now there is the new schema, which is significantly different to prod's
[11:47:03] _lazarevsky: now my manager asked me to make a replica od prod DB and point beta to it
[11:47:10] _lazarevsky: now the problem is, all the migrations have already run on Beta
[11:47:20] rvanlieshout: _lazarevsky: they won't have if you copy the db again
[11:47:31] rvanlieshout: you might need to drop new tables yourself
[11:47:47] rvanlieshout: cause a dump of production would contain drop table things for the on production existing tables, but not for those exising in beta
[11:47:59] _lazarevsky_: has joined #RubyOnRails
[11:48:03] _lazarevsky_: aghhh! SHITE!
[11:48:08] _lazarevsky_: anyway as I was saying
[11:48:16] rvanlieshout: 13:47 < rvanlieshout> _lazarevsky: they won't have if you copy the db again
[11:48:16] rvanlieshout: 13:47 < rvanlieshout> you might need to drop new tables yourself
[11:48:17] rvanlieshout: 13:47 < rvanlieshout> cause a dump of production would contain drop table things for the on production existing tables, but not for those exising in beta
[11:48:51] _lazarevsky_: why would I wanna drop tables?
[11:48:56] tvw: has joined #RubyOnRails
[11:49:02] rvanlieshout: cause a db dump would include that
[11:49:09] Betray1st: has joined #RubyOnRails
[11:49:10] rvanlieshout: you should not point your beta to the production db
[11:49:11] logik-bomb: is it possible to ignore the parent model validations when creating a nested resource?
[11:49:13] rvanlieshout: you should copy the db
[11:49:15] Sylario: has joined #RubyOnRails
[11:49:21] _lazarevsky_: rvanlieshout: of couyrsE! :D
[11:49:25] _lazarevsky_: I create a snapshot
[11:49:29] _lazarevsky_: and start a new db out of that
[11:49:36] _lazarevsky_: but now the prob is this
[11:49:47] _lazarevsky_: I create a new DB, copy of prod and point beta to it!
[11:50:01] _lazarevsky_: however, that schema will not be congruent with the code in beta currently
[11:50:05] _lazarevsky_: the schema will be outdated
[11:50:08] rvanlieshout: _lazarevsky_: run migrations on it?
[11:50:21] _lazarevsky_: rvanlieshout: well the thing is the migrations had already run in beta
[11:50:54] _lazarevsky_: as far as I understand, rails checks the version of the schema file and and runs the migrations witha timestamp newer than the one in the schema.rb file
[11:51:17] rvanlieshout: no it doesn't
[11:51:17] _lazarevsky_: now if that's the case, the schema file in beta, currently, has the latest changes included.. it ran like 3 hours ago
[11:51:21] rvanlieshout: it checks the schema_migrations table
[11:51:27] rvanlieshout: it doesn't use schema.rb for it
[11:51:46] gaussblurinc1: has joined #RubyOnRails
[11:51:52] _lazarevsky_: ok that makes more sense.. so if I make a copy of Prod
[11:51:52] allcentury: has joined #RubyOnRails
[11:51:56] _lazarevsky_: then the migrations should run aye?
[11:52:07] _lazarevsky_: since it will also copy the schema_migrations table
[11:52:31] rvanlieshout: that schema_migrations table holds all executed migrations
[11:52:37] _lazarevsky_: I'll give it a go and will get back to you
[11:52:41] _lazarevsky_: thanks so much rvanlieshout
[11:53:10] bmurt: has joined #RubyOnRails
[11:55:37] hahuang65: has joined #RubyOnRails
[11:55:53] Cork: is there a way to get rails to show what translation key an f.label is looking for?
[11:56:19] snophey: has joined #RubyOnRails
[11:56:23] snophey: has left #RubyOnRails: ()
[11:57:19] ldnunes: has joined #RubyOnRails
[12:01:20] eGGsha: has joined #RubyOnRails
[12:04:36] Seich: has joined #RubyOnRails
[12:05:04] schaerli: has joined #RubyOnRails
[12:05:49] RegulationD: has joined #RubyOnRails
[12:07:40] lethjakman: has joined #RubyOnRails
[12:09:17] shyshy: has joined #RubyOnRails
[12:10:10] jamiely: has joined #RubyOnRails
[12:12:08] pontiki: Cork: i don't know of any in particular...
[12:13:00] pontiki: it's should be fairly easy to figure out, though
[12:13:31] Cork: ya, it is normally fine
[12:13:44] Cork: but in this case i don't have a model behinde it (i post to a third party server)
[12:13:53] Cork: and things becomes... lets say interesting :)
[12:14:23] pontiki: hmmm... how is the form_for constructed?
[12:14:47] Cork: form_for :payment do |f|
[12:15:43] leslie: how can I manually raise a 403 error?
[12:16:58] pontiki: leslie: render status: 403
[12:17:00] Tempesta: has joined #RubyOnRails
[12:17:36] Cork: that doesn't render the default error page though
[12:17:39] pontiki: Cork: i'd have to do some research on it to see how it works
[12:17:49] pontiki: nope, just a 403 response
[12:17:56] Cork: pontiki: no need
[12:18:10] Trynemjoel: has joined #RubyOnRails
[12:19:10] DoubleMalt: has joined #RubyOnRails
[12:19:22] arup_r: has joined #RubyOnRails
[12:19:40] Trynemjoel: has joined #RubyOnRails
[12:20:35] Quintasan: Are there any FTP synchronization solutions other than ftp_sync which does not work/is not maintained?
[12:21:37] leslie: so there's no way to do what
[12:21:40] leslie: rails does?
[12:21:44] christiandsg: has joined #RubyOnRails
[12:22:00] sandelius: has joined #RubyOnRails
[12:22:06] leslie: I thought there'd be some sort of HttpForbiddenError
[12:22:11] Trynemjoel: has joined #RubyOnRails
[12:23:22] Cork: leslie: in some cases you can dig up an exception that triggers a status code
[12:23:30] Cork: but most of the time, no you have to render it manually
[12:24:50] dangerousdave: has joined #RubyOnRails
[12:24:50] Cork: for example 404 can be rendered by raising a ActiveRecord::RecordNotFound
[12:28:10] rvanlieshout: a raise raises
[12:28:15] rvanlieshout: render status: 404 renders a 404
[12:28:31] Lightsword: has joined #RubyOnRails
[12:29:59] leslie: rvanlieshout, some raises automatically render certain templates though, like the 404 page
[12:30:20] leslie: although I guess that's more of a Rack thing?
[12:31:18] cac: has joined #RubyOnRails
[12:33:27] kh0d: has joined #RubyOnRails
[12:34:07] xkickflip: has joined #RubyOnRails
[12:34:49] Silox|: has joined #RubyOnRails
[12:35:33] leslie: nope, apparently it's ActionDispatch::PublicExceptions
[12:36:38] diegorv: has joined #RubyOnRails
[12:37:44] dhjondoh: has joined #RubyOnRails
[12:38:01] xcesariox: has joined #RubyOnRails
[12:38:20] Lectus: has joined #RubyOnRails
[12:38:51] k4nd4lf: has joined #RubyOnRails
[12:39:31] mikecmpbll: leslie: just render the 403 page in public/ ? :)
[12:40:17] leslie: yup, that sounds like the easiest way.
[12:40:33] leslie: or implement my own exceptions_app
[12:42:23] victortyau: has joined #RubyOnRails
[12:46:04] n1lo: has joined #RubyOnRails
[12:50:14] christiandsg: has joined #RubyOnRails
[12:51:08] sankaber: has joined #RubyOnRails
[12:53:14] rvanlieshout: render status: 403
[12:55:39] zorak8: has joined #RubyOnRails
[12:56:24] bmurt: has joined #RubyOnRails
[12:58:42] FaustVIII: has joined #RubyOnRails
[13:01:05] KamalKaur: has joined #RubyOnRails
[13:03:17] Liothen: has joined #RubyOnRails
[13:03:19] G: has joined #RubyOnRails
[13:03:20] KamalKaur: I want to disable assets pipeline in my ROR project. I tried adding config.assets.enabled = false in config/application.rb but it is still working. Do anyone has an idea about what I am missing?
[13:04:04] allcentury: has joined #RubyOnRails
[13:04:12] fryguy: KamalKaur: why do you want to disable it
[13:04:22] simplyianm: has joined #RubyOnRails
[13:04:47] KamalKaur: I am unable to debug into my CSS files
[13:04:55] theBestNunu: has joined #RubyOnRails
[13:05:17] rvanlieshout: there is an option for that
[13:05:23] rvanlieshout: for usage in development.rb
[13:05:33] KamalKaur: rvanlieshout: please let me know
[13:05:52] rvanlieshout: # Debug mode disables concatenation and preprocessing of assets.
[13:05:52] rvanlieshout: # This option may cause significant delays in view rendering with a large
[13:05:52] rvanlieshout: # number of complex assets.
[13:05:52] rvanlieshout: config.assets.debug = false
[13:06:35] Rubie: has joined #RubyOnRails
[13:06:52] gaussblurinc1: has joined #RubyOnRails
[13:07:52] KamalKaur: rvanlieshout: THat too loads the CSS into single file
[13:08:23] rvanlieshout: have you restarted your rails server?
[13:08:38] rvanlieshout: and why would the 1 file thing e a problem?
[13:08:40] KamalKaur: rvanlieshout: Two times
[13:09:06] KamalKaur: rvanlieshout: I want to see what css is coming from which file
[13:09:29] rvanlieshout: isn't that included in the comments of it?
[13:11:03] rvanlieshout: ah. i believe there is an option for that too, but don't know which one
[13:11:28] KamalKaur: rvanlieshout: for that too? That = ?
[13:11:32] arBmind: has joined #RubyOnRails
[13:11:35] Creeves: has joined #RubyOnRails
[13:11:53] davidheward__: has joined #RubyOnRails
[13:11:56] kitsuneyo: has joined #RubyOnRails
[13:12:43] rvanlieshout: are you using less or something similar?
[13:13:36] KamalKaur: rvanlieshout: Yes, to be specific "less-rails-bootstrap"...
[13:14:05] KamalKaur: But unable to see in CSS and still loads Bootstrap 2+ version
[13:14:10] rvanlieshout: isn't that the one that keeps it combined and without references?
[13:15:44] erich: has joined #RubyOnRails
[13:15:50] infoget: has left #RubyOnRails: ()
[13:15:58] KamalKaur: Oh ok. So I should not use this bootstrap?
[13:16:13] noodman: has joined #RubyOnRails
[13:16:48] _lazarevsky_: rvanlieshout: it did work!
[13:16:55] _lazarevsky_: rvanlieshout: thanks!
[13:16:59] KamalKaur: rvanlieshout: Is it that I need to place bootstrap files manually?
[13:17:15] jgpawletko: has joined #RubyOnRails
[13:18:23] rvanlieshout: KamalKaur: no, that should be ok. you'll just have to dig deeper then i guess
[13:20:31] rails663: has joined #RubyOnRails
[13:22:06] doodlehaus: has joined #RubyOnRails
[13:22:23] jkamenik: has joined #RubyOnRails
[13:22:26] erich: has joined #RubyOnRails
[13:23:23] dangerousdave: has joined #RubyOnRails
[13:23:32] bronson: has joined #RubyOnRails
[13:25:17] mrbubbles: has joined #RubyOnRails
[13:25:18] Diabolik: what is the difference in terms of namespacing between
[13:25:20] Diabolik: Resources::NewsArticle
[13:25:21] Diabolik: and ::Resources::NewsArticle
[13:25:30] mhib: has joined #RubyOnRails
[13:26:33] rvanlieshout: it's within the current namespace
[13:26:39] pontiki: nearly nothing, except if you have a Resources under the current namespace, the first form will use that one, while the second form always starts at the top
[13:27:03] Diabolik: so if im using a constant inside NewsArticle
[13:27:08] Diabolik: it would be
[13:27:17] [H]unt3r: has joined #RubyOnRails
[13:27:17] Diabolik: errors.add(:base, "Maximum number of related articles exceeded, should be #{::Resources::NewsArticle::MAXIMUM_RELATED_ARTICLES} or less.")
[13:27:32] Fire-Dragon-DoL: has joined #RubyOnRails
[13:27:33] Diabolik: because im within the newsarticle namespace
[13:27:37] pontiki: that's *very* exact
[13:27:55] ohhmaar: has joined #RubyOnRails
[13:27:59] rails663: Hey guys, I'm trying to extract info from uri. For example, I'm on shop1/section1/product1 page and would like to get object shop1 from database to use it for some queries. (it should be global, so it should work on shop1/project1 as well as shop1 ... (I'd put it into app helper)). Is this possible to do?
[13:28:00] pontiki: if you're within the NewArticle namespace, you can just use the constant bare
[13:28:10] pontiki: *but* i still recommend using it the way you have
[13:28:10] Diabolik: and then from outside it
[13:28:20] Diabolik: I would use no prepended ::
[13:28:29] Diabolik: or rather i would not use ::
[13:28:43] pontiki: i think that's backwards, Diabolik
[13:28:50] Diabolik: to access the constant from a view
[13:28:54] Diabolik: is what im asking
[13:29:07] pontiki: if you are *within* ::Resources::NewsArticle, you can just use MAXIMUM_RELATED_ARTICLES
[13:29:26] pontiki: if you are *outside*, the use the full demarcation
[13:29:29] bahar: has joined #RubyOnRails
[13:29:38] Papierkorb: has joined #RubyOnRails
[13:29:46] Diabolik: which is Resources::NewsArticle::MAXIMUM_RELATED_ARTICLES
[13:29:55] pontiki: with the :: prefix
[13:30:30] Diabolik: wait i thought the :: prefix was for within the namespace
[13:30:53] pontiki: no, it's for when you DON'T KNOW if you will have a namespace collision
[13:31:04] pontiki: and GUARANTEES you'll be starting from the root namespace
[13:31:31] Diabolik: so its the equivalent of ~/ in terminal?
[13:31:34] bungoman: has joined #RubyOnRails
[13:31:41] pontiki: if you absolutely know you will never have a collision, you can leave it off
[13:31:44] pontiki: most people do
[13:32:08] garrypolley: has joined #RubyOnRails
[13:32:13] pontiki: more like using / in the terminal to start at the top of the file system
[13:32:29] Diabolik: hmm ok thanks pontiki
[13:32:31] Diabolik: much apprecitated
[13:32:34] Diabolik: *appreciated
[13:35:17] sevenseacat: has joined #RubyOnRails
[13:35:36] paulcsmith: has joined #RubyOnRails
[13:35:45] DEA7TH: has joined #RubyOnRails
[13:38:48] a346: has joined #RubyOnRails
[13:43:37] dopie: has joined #RubyOnRails
[13:45:07] fgo_: has joined #RubyOnRails
[13:45:30] JoshL: has joined #RubyOnRails
[13:50:08] eggoez: has joined #RubyOnRails
[13:50:20] marr: has joined #RubyOnRails
[13:50:44] charleystran: has joined #RubyOnRails
[13:50:48] charleystran: has left #RubyOnRails: ()
[13:51:24] adac: has joined #RubyOnRails
[13:51:51] bruno-: has joined #RubyOnRails
[13:52:12] sankaber: has joined #RubyOnRails
[13:53:02] adac: How do I check the database connection? "ActiveRecord::Base.connected?" returns me 'false' everytime even when the database is online
[13:53:22] annlewis: has joined #RubyOnRails
[13:54:23] wydont: has joined #RubyOnRails
[13:54:48] dici: has joined #RubyOnRails
[13:56:27] lethjakman: has joined #RubyOnRails
[13:57:14] loc22: has joined #RubyOnRails
[13:59:08] RegulationD: has joined #RubyOnRails
[13:59:35] aldodelgado: has joined #RubyOnRails
[14:00:29] werelivinginthef: has joined #RubyOnRails
[14:00:53] darrencauthon: has joined #RubyOnRails
[14:01:03] loc22: Hi guys! I have been working around this problem and I cant find a solution. I have a Book model that has :author_id and :review_at(datetime). I need to get all the Book from a list of authors ids(ie: [2,3,7,8]) OR those books where :review_at is not nil. Any suggestions?
[14:01:10] norc: has joined #RubyOnRails
[14:01:59] workmad3: loc22: Book.where("author_ids IN (?) OR review_at IS NOT NULL", author_ids)
[14:02:03] norc: Hi. I have two resources "Customer" and "Number". How can I model the action of assigning a number to a customer as a RESTful action?
[14:02:25] dangerousdave: has joined #RubyOnRails
[14:02:26] norc: I mean it is kind of a property of a number to belong to the customer. so Im thinking of making it a PATCH number action.
[14:03:26] aldodelgado: Any suggestion when you have a developer on the team that does not understand Rails and go against the grain? I feel like the application gets further and further away from the rails way with his suggestions.
[14:03:36] norc: aldodelgado: Fire him.
[14:03:38] loc22: workmad3: Works great! Thanks so much for your help :)
[14:03:55] aldodelgado: norc: I would love to but I???m not lead
[14:04:14] fryguy: aldodelgado: talk to your manager then
[14:04:57] mrbubbles: Quick architecture question :) I know you love them. If I have a CSV parser that is pulling in data, doing some stuff and then writing it to the DB, I guess that doesn???t all want to be in the controller or model but a PORO??? would that constitute a service or a utility? Having a bit of trouble getting my head around the difference
[14:05:06] hahuang65: has joined #RubyOnRails
[14:05:21] broman: has joined #RubyOnRails
[14:05:53] pontiki: i've heard so many different definitions, i've given up trying to make a distinction, mrbubbles :)
[14:06:06] broman: can someone help me? i have this function http://pastie.org/10306231 ... when i pass several values to it, it works.. on the other side of the condition i get an error: "TypeError (no implicit conversion of Symbol into Integer):"
[14:07:33] schaerli: has joined #RubyOnRails
[14:07:38] christiandsg: has joined #RubyOnRails
[14:08:47] pontiki: broman: is params an Array?
[14:09:14] broman: pontiki, yes.. lots of hidden fields
[14:09:26] broman: pontiki, and could be with just one object
[14:09:40] pontiki: broman: an Array expects Integer indexes, not Symbols
[14:09:47] idd2d: has left #RubyOnRails: ()
[14:10:12] broman: pontiki, the specific line of the error is this: params[:produto_id] = produto.id
[14:10:14] symbol: has joined #RubyOnRails
[14:10:23] broman: when i receive more than one, it works
[14:10:32] griffindy: has joined #RubyOnRails
[14:10:32] pontiki: params is an Array
[14:10:34] broman: when i receive just one, it fails with that error
[14:10:45] pontiki: and you're trying index it with a Symbol
[14:11:09] broman: pontiki, hmmm :)
[14:11:18] pontiki: to do what you want, i think, you don't actually need the conditional
[14:11:18] broman: thank you
[14:11:48] pontiki: if params is of lenght = 1, the top conditional should still work in that case
[14:12:14] masscrx: can anybody help me with stron parameters for this request ? https://gist.github.com/masscrx/aac593abdedcd0f7acb5
[14:12:16] willywos: has joined #RubyOnRails
[14:12:23] masscrx: I'm trying many solutions and none works
[14:12:23] broman: pontiki, the params im passing are these: http://pastie.org/10306239
[14:12:24] pontiki: even if it's empty, it should still work okay, it just won't do anything
[14:12:51] broman: pontiki, sorry.. inside this: params[:aproveitamentos_produto]
[14:12:59] broman: that's what i pass to the function
[14:13:09] pontiki: in params?
[14:13:44] pontiki: that's a Hash, not an Array
[14:19:18] fighella: has left #RubyOnRails: ()
[14:20:06] dman777_alter: has joined #RubyOnRails
[14:21:07] anjen: has joined #RubyOnRails
[14:21:36] StanLee: has joined #RubyOnRails
[14:21:55] zeknox: whats thoughts or feedback on the rails-api gem for an API interface?
[14:22:31] fryguy: zeknox: it works
[14:22:45] pontiki: it's getting merged into rails 5 isn't it?
[14:22:51] zeknox: looking to add an API interface to an existing app and not sure if rails-api is a good fit or not
[14:23:03] pontiki: rails-api is for a new app
[14:23:16] zeknox: pontiki: ah good point, any recomendations?
[14:23:45] fryguy: zeknox: add controllers to your existing application
[14:24:10] pontiki: mostly what i've seen is namespacing a new set of controllers in /api/v1/
[14:24:11] zeknox: fryguy: yeah that is what I was considering doing, adding a namespace :api in the routes and go from there
[14:24:33] Spami: has joined #RubyOnRails
[14:24:36] pontiki: one project i worked on they didn't namespace at all
[14:24:50] pontiki: just based it on the header and request format
[14:25:08] pontiki: that was kind of hinky
[14:25:32] zeknox: is it typical to handle authorization through the url or http headers? or both?
[14:25:39] fryguy: eh, depending on how you interpret REST, it can be reasonable to do
[14:25:39] diegorv: has joined #RubyOnRails
[14:26:11] pontiki: fryguy: it *should* be reasonable; it's not a rails problem in itself; but these guys and their app....
[14:26:29] masscrx: how to allow nested hash in strong params ? assume: customer => {profile_attributes: {}}
[14:28:00] workmad3: masscrx: params.require(:customer).permit(profile_attributes: [:foo, :bar, :blah])
[14:28:17] hashrocket: has joined #RubyOnRails
[14:28:42] masscrx: but then when it is passed as "profile_attributes"=>{} it is still unpermitted
[14:28:48] workmad3: masscrx: .permit(profile_attributes: []) would work if you only needed simple types... unfortunately, the typical circumstance is that you get an array of hashes there, and so you need to specify allowed parameters
[14:28:51] dyulax93: has joined #RubyOnRails
[14:29:08] dman777_alter: If I have 'datacenters = Datacenter.options_for_select.flatten.uniq' in a controller FOO and I have controller BAR inherit FOO, should @datacenters be available?
[14:29:12] masscrx: workmad3: I;m passing nested hash instead array
[14:29:39] workmad3: masscrx: same thing applies... it's not a simple type, so you need to specify what's allowed in detail, you don't get just a pass-through
[14:29:45] masscrx: so customer has_one :profile and then request: customer => {profile_attributes: {}}
[14:29:51] BaNzounet: presence: true, should valid if the relation exist right? if I've belong_to: :user, when I save/validate, rails will verify that the user exist won't it?
[14:30:25] masscrx: workmad3: my strony params: params.require(:customer).permit(:id, :firstname, :lastname, :email, profiles_attributes: [:id, :saldo, :account_type, :_destroy, addresses_attributes: [:profile_id, :address_type, :street, :city, :postcode, :country_code]])
[14:30:38] krz: has joined #RubyOnRails
[14:31:05] workmad3: masscrx: that looks good :)
[14:31:11] hahuang65: has joined #RubyOnRails
[14:31:17] masscrx: and result:
[14:31:18] masscrx: Parameters: {"utf8"=>"", "customer"=>{"firstname"=>"", "lastname"=>"", "email"=>"", "profile_attributes"=>{"account_type"=>"free"}}, "commit"=>"Create Customer"}
[14:31:21] masscrx: Unpermitted parameter: profile_attributes
[14:31:37] workmad3: masscrx: profiles_attributes != profile_attributes
[14:31:54] masscrx: where do you see profile"s" ?
[14:32:00] workmad3: masscrx: in your strong_params method :P
[14:32:46] masscrx: ahh ok, now is error:
[14:32:48] masscrx: TypeError (no implicit conversion of Symbol into Integer):
[14:33:11] maZtah: how would i `require` a file from the /app/xx/xx/ directory within a nested controller?
[14:34:32] schaerli: has joined #RubyOnRails
[14:34:50] riotjones: has joined #RubyOnRails
[14:37:09] Scripore: has joined #RubyOnRails
[14:37:32] zeknox: how do most folks handle authorization to the API? via the http headers?
[14:38:26] pontiki: zeknox: i'm not most folks, but that's the way i see it done
[14:38:48] pontiki: using the Authorization: header
[14:38:55] kitsuneyo: I have a partial in my rails app that renders each item in an instance @story_details as <li> list items, but it's rendering them all twice. Is this a common thing with an obvious answer? I can't work out why it's doing it
[14:39:06] zeknox: pontiki: and allowing an access_token via the url is not a good practice correct? like no sense in allowing both
[14:39:21] rikkipitt: has joined #RubyOnRails
[14:39:30] pontiki: zeknox: i'm pretty sure you can do something with devise to give you authorization tokens, but i've not personally looked into that (yet)
[14:39:59] pontiki: i thought putting the token in the url was too insecure
[14:40:11] zeknox: pontiki: yeah that is what I was looking to do, allow a devise user object to add an API key and do some sort of authing based on that
[14:40:29] zeknox: pontiki: I agree token in the url is insecure because its being logged in many places including apache logs
[14:40:38] pontiki: it's also sniffable
[14:40:48] zeknox: pontiki: yes sir
[14:40:54] workmad3: pontiki: url is encrypted on https too
[14:41:04] workmad3: pontiki: and if you're not on https, then the headers are also sniffable
[14:41:29] rikkipitt: hi guys, is there a way of validating the presence of a string only once in a field? I'm using validates_format_of with a regex but only want to pass if the string is matched exactly once
[14:41:34] pontiki: as you can tell, this is not an area of expertise for me
[14:41:38] kitsuneyo: Nevermind I got it, typical dumb mistake :D
[14:42:16] workmad3: zeknox: a lot of it depends on what type of token it is (different types generally means different timespans or numbers of requests that they're active for)
[14:42:51] zeknox: workmad3: in my case its simple, if they have a valid API key they can access the API and pull stats
[14:43:00] workmad3: zeknox: e.g. there's no real issue in passing single-use tokens around in urls... even if they're logged, they're not reusable anyway...
[14:43:17] workmad3: zeknox: right, so the API token is basically a replacement for the username & password
[14:43:34] zeknox: workmad3: correct in the instance im talking about, the key will act as un and pw
[14:43:47] workmad3: zeknox: any way to revoke it?
[14:44:03] givanse: has joined #RubyOnRails
[14:44:08] zeknox: workmad3: would probably require deleting that API key or deleting that user account
[14:44:18] workmad3: (it doesn't change the advice I'd give, which is use an Authorization header, but I'd suggest thinking about it anyway)
[14:44:43] zeknox: workmad3: I was leaning towards authorization header as well, good info tho
[14:45:40] workmad3: zeknox: you may want to use `X-MyApp-Authorization` rather than `Authorization` too, just to avoid accidentally triggering (and failing) http basic- or digest-auth systems in the web server or rails itself
[14:46:04] DoubleMalt: has joined #RubyOnRails
[14:46:17] zeknox: workmad3: thats a good callout
[14:46:29] AzaToth: has joined #RubyOnRails
[14:46:59] jkamenik1: has joined #RubyOnRails
[14:48:39] chouhoulis: has joined #RubyOnRails
[14:48:47] mary5030: has joined #RubyOnRails
[14:49:38] schaerli: has joined #RubyOnRails
[14:51:50] jmimi: has joined #RubyOnRails
[14:53:12] soahccc^: has left #RubyOnRails: ()
[14:53:18] naftilos76: has joined #RubyOnRails
[14:53:43] soahccc: has joined #RubyOnRails
[14:54:22] bashusr: has left #RubyOnRails: ("Ex-Chat")
[14:54:33] lucha: has joined #RubyOnRails
[14:56:46] silverdust: has joined #RubyOnRails
[14:57:13] lethjakman: has joined #RubyOnRails
[14:57:26] inoter: has joined #RubyOnRails
[14:58:06] tenderlove: has joined #RubyOnRails
[14:58:59] f3ttX]: has joined #RubyOnRails
[14:59:01] nickenchuggets: has joined #RubyOnRails
[15:00:13] disgrntld: has joined #RubyOnRails
[15:06:35] freezevee: has joined #RubyOnRails
[15:07:49] Xiti: has joined #RubyOnRails
[15:07:56] freezevee: Hi all, I am following Hartl's rails guide and I am running some RSpec tests. I am currently running a sessions controller spec to see If users are able to log in successfully. https://gist.github.com/chrisvel/0ae589215bad4833d0a0
[15:08:40] freezevee: Unfortunately I am getting an error Failure/Error: expect(session[:user_id]).to eq(user.id) and says that expected: 1 - got: nil
[15:08:43] mhf: has joined #RubyOnRails
[15:08:59] freezevee: Does anyone have any idea what am I missing and I am getting a nil session id ?
[15:09:47] garrypolley: has joined #RubyOnRails
[15:10:46] chipotle: has joined #RubyOnRails
[15:11:38] alex88: freezevee: can you post your session controller?
[15:11:51] alex88: After creating the user, is it logged in?
[15:12:45] freezevee: alex88: https://gist.github.com/chrisvel/0ae589215bad4833d0a0
[15:13:17] alexhartley: has joined #RubyOnRails
[15:13:20] freezevee: I am setting the session[:user_id] = user.id as in the tutorial (in SessionsHelper.rb)
[15:13:49] Rubie: has joined #RubyOnRails
[15:13:50] alex88: can you paste that too?
[15:14:23] werelivinginthef: has joined #RubyOnRails
[15:14:48] alex88: unless you store the password in the database, are you sure `user.attributes` includes it?
[15:15:26] hobodave: has joined #RubyOnRails
[15:15:31] freezevee: because I did a puts user.attributes and got them all when I ran the tests
[15:15:40] alex88: email and password?
[15:15:43] freezevee: also says that expected 1 and got nil
[15:15:47] freezevee: yes, everything
[15:16:11] Gnut: has joined #RubyOnRails
[15:16:25] freezevee: could it be NOT saved to the database ?
[15:16:28] alex88: so it seems it didn't get through the auth, can you just put or log something during controller action to see if it goes through the `if user && user.authenticate(params[:session][:password])` line?
[15:16:59] freezevee: I tested it manually in development environment and it works ok
[15:17:03] freezevee: in test it fails
[15:17:04] alex88: wait, first, change build with create
[15:17:07] alex88: in the factorygirl thing
[15:17:12] thang: has joined #RubyOnRails
[15:17:53] Signum: has joined #RubyOnRails
[15:17:54] Signum: has joined #RubyOnRails
[15:18:04] freezevee: alex88: after I rspec the test, I check the database through a phpmyadmin installation (it's a mysql db) and nothing is created
[15:18:36] alex88: freezevee: even after factorygirl create? Btw it's normal that the db is cleaned after tests
[15:18:47] freezevee: yes, nothing
[15:18:49] coffeejunk: has joined #RubyOnRails
[15:19:01] freezevee: I created it manually and then ran the tests and got a message "email already exists"
[15:19:08] freezevee: so it might clean the db
[15:19:52] safeforge: has joined #RubyOnRails
[15:20:23] alex88: freezevee: try to use let! instead of let
[15:21:03] MissionCritical: has joined #RubyOnRails
[15:21:14] dman777_alter: In a rails controller, how do I initialize a instance variable outside of def index and have that variable available to children conrtollers?
[15:21:16] christiandsg: has joined #RubyOnRails
[15:21:36] alex88: try to use `user = FactoryGirl.create(:user)` inside the spec and remove the let block
[15:21:50] freezevee: dman777_alter: didn't get it !
[15:21:59] freezevee: dman777_alter: sorry I thought it was for me
[15:22:06] alex88: dman777_alter: use a before filter?
[15:22:08] zpe: has joined #RubyOnRails
[15:22:13] ruurd: has joined #RubyOnRails
[15:22:33] freezevee: alex88: still the same
[15:22:43] alex88: before_action { @something = 'something' }
[15:22:56] alex88: freezevee: can you paste the edited code?
[15:23:05] alex88: can you put User.count inside the spec?
[15:23:54] freezevee: alex88: I did a puts session.inspect after post and is nil
[15:23:56] dman777_alter: alex88: ya...I thought about that. but...then I have to place the varialble in function and call the function, correct?
[15:24:20] alex88: dman777_alter: function? with that the variable is set before every action
[15:24:29] ruurd: has joined #RubyOnRails
[15:24:35] alex88: freezevee: ok, try a response.inspect
[15:24:38] alex88: check if it's a redirect
[15:24:55] freezevee: alex88: User.count says 1
[15:24:58] freezevee: so it creates it
[15:25:49] freezevee: alex88: I got it
[15:25:57] alex88: freezevee: what was the issue?
[15:25:59] freezevee: response.inspect displays
[15:26:04] freezevee: all parameters
[15:26:08] freezevee: @filtered_parameters={"session"=>{"id"=>"1", "name"=>"
[15:26:15] freezevee: so it's right ?
[15:27:06] dman777_alter: alex88: isn't it before_filter :function?
[15:27:07] alex88: dunno, can you write some log in the controller inside the if to check if it's correctly authenticated?
[15:27:10] The_Phoenix: has joined #RubyOnRails
[15:27:25] alex88: dman777_alter: or before_action (filter is the old way) with a block
[15:27:29] freezevee: alex88: how ?
[15:27:36] annlewis: has joined #RubyOnRails
[15:27:36] freezevee: can you give an example ?
[15:27:46] alex88: Rails.logger.info 'User logged in'
[15:27:55] alex88: right after "# flash success" and check logs
[15:29:20] erich: has joined #RubyOnRails
[15:29:27] r_baron: has joined #RubyOnRails
[15:30:23] chipotle: has joined #RubyOnRails
[15:30:36] freezevee: alex88: I don't see anything in test.log
[15:30:45] alex88: freezevee: use put
[15:30:49] alex88: so you can see it directly within tests
[15:30:59] alex88: or maybe it's because the credentials are wrong
[15:31:10] simplyianm: has joined #RubyOnRails
[15:32:17] freezevee: I don't see anything
[15:32:36] freezevee: how can it authenticate in development env, manually, and not in testing ?
[15:33:52] adavia: has joined #RubyOnRails
[15:34:06] Cache_Money: has joined #RubyOnRails
[15:34:48] alex88: freezevee: because the authenticate function or find_by doesn't return a correct user
[15:35:01] ruurd: has joined #RubyOnRails
[15:35:09] alex88: dump User.first.attributes, dump params and inspect what's doing in authenticate function
[15:37:43] alex88: if you don't see anything, means it's not authenticating the user, so either the credentials are wrong or the user authentication method is wrong
[15:39:05] freezevee: alex88: both exist
[15:39:11] freezevee: alex88: check this out https://gist.github.com/chrisvel/c8194c8ec993f7f87db4
[15:39:22] FaustVIII: has joined #RubyOnRails
[15:39:33] charliesome: has joined #RubyOnRails
[15:39:36] freezevee: alex88: first is puts User.first.attributes, second one is puts params
[15:39:43] freezevee: just before the if user...
[15:39:51] alex88: https://gist.github.com/chrisvel/0ae589215bad4833d0a0#file-sessioncontroller-rb-L8
[15:40:00] alex88: you're using the password from params[:session][:password]
[15:40:02] alex88: which from your dump
[15:40:38] alex88: that's why I asked you if user.attributes includes the plain password
[15:41:05] freezevee: you believe it includes the password_digest and that's why ?
[15:41:13] freezevee: let me put this as a hash
[15:41:31] freezevee: session: { email: user.email, password: user.password }
[15:41:32] alex88: you're posting the user attributes, they don't include the plain password
[15:41:41] alex88: user.password is not there
[15:41:43] alex88: it's empty
[15:41:58] alex88: I hope you don't save plain passwords in your user models right?
[15:42:19] alex88: paste your user model and factory
[15:42:55] seank___: has joined #RubyOnRails
[15:43:05] freezevee: I did a post :create, session: { email: user.email, password: user.password } in the rspec
[15:43:09] sonofdirt: has joined #RubyOnRails
[15:43:27] freezevee: and now puts params in the controller says {"session"=>{"email"=>"someone@somewhere.com", "password"=>"12345678"}, "controller"=>"sessions", "action"=>"create"}
[15:43:33] freezevee: so I believe is right ?
[15:43:39] stas_: has joined #RubyOnRails
[15:44:13] freezevee: it passed the authentication "if"
[15:44:18] dman777_alter: http://dpaste.com/1EWP1R9 I want to use the @datacenters in the inherited controller, but the def index overwrites it. How would I get around this?
[15:45:10] freezevee: alex88: it did
[15:45:10] alex88: freezevee: that's why
[15:45:17] freezevee: God it took me 5 hours
[15:45:20] freezevee: I love Rails
[15:45:29] freezevee: I love that it took me 5 hours
[15:45:32] freezevee: am I insane ?
[15:45:37] freezevee: alex88: thanks a lot !!
[15:45:45] alex88: it's not a rails issue, you had to dump all the vars before :)
[15:45:47] tubbo: freezevee: no, you're just not experienced.
[15:46:03] tubbo: freezevee: now, you are more experienced. so you're better at rails.
[15:46:09] freezevee: tubbo: thanks
[15:46:23] stamina: has joined #RubyOnRails
[15:46:33] freezevee: I didn't know I could just puts inside the controller and get the output in test console
[15:46:39] freezevee: it does a lot now
[15:46:51] loc22: Hi guys, quick question. I have been using JBUILDER to generate json, and I found it very slow. The json structure that I have is comlpicated. Which way do you guys recommend for a better performance?
[15:47:20] alex88: dman777_alter: it's inherited, so DatacentersController is used and the DeviceListsController's index method is never called
[15:47:52] alex88: loc22: tried https://github.com/rails/jbuilder#faster-json-backends ?
[15:48:15] Surt_Q: has joined #RubyOnRails
[15:48:36] dman777_alter: alex88: ah...to keep the code dry how could I place @datacenters in DeviceListsController where it gets initialized since def index is a initializer?
[15:48:55] kh0d: has joined #RubyOnRails
[15:48:55] Trynemjoel: has joined #RubyOnRails
[15:48:58] loc22: alex88: I will try it. Thanks
[15:49:25] alex88: dman777_alter: before_action { @datacenters = Datacenter.options_for_select.flatten.uniq }, only: :index
[15:49:31] garrypolley: has joined #RubyOnRails
[15:49:39] alex88: in DeviceListsController
[15:49:46] DylanJ: has joined #RubyOnRails
[15:49:56] dman777_alter: alex88: oh, cool! thanks!
[15:49:57] alex88: or, in a protected method, called by both controllers
[15:50:03] Scient: has joined #RubyOnRails
[15:50:14] dman777_alter: naw, I don't think I want to protect it since I want it inherited, right?
[15:50:15] Dfoolz: has joined #RubyOnRails
[15:50:32] seansith: has joined #RubyOnRails
[15:50:34] EminenceHC: has joined #RubyOnRails
[15:50:44] alex88: dman777_alter: I told protected, not private ;)
[15:50:48] jhack: has joined #RubyOnRails
[15:50:54] alex88: protected can be called by subclasses
[15:50:58] loc22: alex88: I was using oj. They claim to be faster than yajl
[15:51:10] Silex: has joined #RubyOnRails
[15:51:45] soule: has joined #RubyOnRails
[15:51:53] alex88: loc22: so I've no other options, how much it takes to render?
[15:52:00] alex88: how have you profiled it?
[15:52:01] ruurd: has joined #RubyOnRails
[15:52:45] loc22: alex88: With New Relic.. sometimes take around 10 seconds :/
[15:53:03] alex88: :O how big is the json? locally have you checked debug logs?
[15:54:26] tubbo: this can happen with json processing
[15:54:46] tubbo: loc22: you may also see performance benefits by switching to active_model_serializers, but that's a bit of a leap if you have a lot of json endpoints
[15:54:55] alex88: check if you can enable caching
[15:54:58] tubbo: loc22: also, are you doing any kind of caching?
[15:55:28] Lightsword: has joined #RubyOnRails
[15:56:34] loc22: tubo, alex88: I am still using jbuilder for most of the endpoints, but for the slowest one, I changed to ".to_json" and performance was better. I am not doing caching in ".to_json"
[15:56:52] cpruitt: has joined #RubyOnRails
[15:57:19] alex88: loc22: better like? if you have a lot of data json encoding can take a while
[15:57:42] loc22: alex88: Better than using jbuilder
[15:57:56] alex88: like half timings?
[15:58:07] loc22: alex88: Yes, like 5 seconds aprox
[15:58:39] bronson: has joined #RubyOnRails
[15:58:59] alex88: so you have a lot of data, I think that even using active model serializers can be faster than to_json
[15:59:28] dopie: has joined #RubyOnRails
[16:00:00] loc22: alex88: I will try AMS and see if it gets better
[16:00:54] alex88: good luck, bbl, heading home
[16:01:08] fgo_: has joined #RubyOnRails
[16:01:43] p8m: has joined #RubyOnRails
[16:01:58] sinkensabe: has joined #RubyOnRails
[16:02:08] skroon: we would like to use a stateless rails UI as frontend, and talk to different services on the backend... however this takes away a lot of nice helpers you get from ActiveRecord right? like validations, etc
[16:02:49] tubbo: skroon: what do you mean by a "stateless rails UI"?
[16:02:55] chouhoulis: has joined #RubyOnRails
[16:03:51] garrypolley: has joined #RubyOnRails
[16:04:01] strcmp1: has joined #RubyOnRails
[16:04:18] dman777_alter: can I do a comma after a code block? before_filter { stuff }, only: :index
[16:04:32] XCMer: has joined #RubyOnRails
[16:05:24] tubbo: dman777_alter: blocks must always be the last argument to a method.
[16:05:48] tubbo: dman777_alter: make that a private method so you can do `before_action :do_stuff, only: [:index]`
[16:05:52] Gnut: has joined #RubyOnRails
[16:06:02] tubbo: whatever { stuff } is doing, so you don't need a lambda
[16:06:24] dman777_alter: tubbo: ah...ok. thanks
[16:07:05] towski_: has joined #RubyOnRails
[16:07:36] hahuang65: has joined #RubyOnRails
[16:09:03] polpak: has joined #RubyOnRails
[16:10:02] vmonteco: has joined #RubyOnRails
[16:10:56] artto: has joined #RubyOnRails
[16:12:18] dented42: has joined #RubyOnRails
[16:14:57] Trynemjoel: has joined #RubyOnRails
[16:15:45] michaeldeol: has joined #RubyOnRails
[16:16:44] wydont: has joined #RubyOnRails
[16:17:38] filipechagas: has joined #RubyOnRails
[16:18:54] luisjose: has joined #RubyOnRails
[16:19:00] luisjose: has joined #RubyOnRails
[16:19:29] yardenbar: has joined #RubyOnRails
[16:20:59] iamjarvo: has joined #RubyOnRails
[16:21:14] petersaints: has joined #RubyOnRails
[16:21:15] justthisguy: has joined #RubyOnRails
[16:21:50] paulcsmith: has joined #RubyOnRails
[16:22:00] jhack: has joined #RubyOnRails
[16:22:00] jhack: has joined #RubyOnRails
[16:22:14] DEA7TH: has joined #RubyOnRails
[16:22:24] bronson: has joined #RubyOnRails
[16:22:42] MaDErroR123: has joined #RubyOnRails
[16:23:16] HanaNix: has joined #RubyOnRails
[16:23:46] filipechagas: has joined #RubyOnRails
[16:24:55] imkj: has joined #RubyOnRails
[16:24:57] Trynemjoel: has joined #RubyOnRails
[16:25:39] filipechagas: has joined #RubyOnRails
[16:26:54] Scripore: has joined #RubyOnRails
[16:27:42] loc22_: has joined #RubyOnRails
[16:30:49] freezevee: has joined #RubyOnRails
[16:30:52] diegoviola: has joined #RubyOnRails
[16:31:10] zpe: has joined #RubyOnRails
[16:32:03] EminenceHC: has joined #RubyOnRails
[16:34:15] ArchRogem: has joined #RubyOnRails
[16:34:54] freezevee: has joined #RubyOnRails
[16:34:58] Trynemjoel: has joined #RubyOnRails
[16:35:06] Liothen: has joined #RubyOnRails
[16:35:16] Forbidden12: has joined #RubyOnRails
[16:35:57] cac_: has joined #RubyOnRails
[16:36:22] Gnut: has joined #RubyOnRails
[16:37:33] benlieb: has joined #RubyOnRails
[16:38:07] arup_r: has joined #RubyOnRails
[16:38:12] diegoviola: has joined #RubyOnRails
[16:39:07] helpa: has joined #RubyOnRails
[16:39:34] rustymyers: has joined #RubyOnRails
[16:40:26] dyulax: has joined #RubyOnRails
[16:41:48] NodeNagant: has joined #RubyOnRails
[16:42:27] n008f4g_: has joined #RubyOnRails
[16:45:08] jkamenik: has joined #RubyOnRails
[16:46:06] lethjakman: has joined #RubyOnRails
[16:46:13] NodeNaga_: has joined #RubyOnRails
[16:46:25] cac_: has joined #RubyOnRails
[16:46:57] chuythong: has joined #RubyOnRails
[16:48:13] IFrank00: has joined #RubyOnRails
[16:50:19] luisjose: has left #RubyOnRails: ("Linkinus - http://linkinus.com")
[16:50:51] IFrank00: I deploy my app as normal and get this error
[16:50:52] IFrank00: https://gist.github.com/Frank004/f13fc77ce15f240d45d6
[16:51:07] IFrank00: can anybody take a look
[16:51:19] diegoviola: has joined #RubyOnRails
[16:51:27] cac_: has joined #RubyOnRails
[16:52:08] girakrok: has joined #RubyOnRails
[16:52:27] smathy: IFrank00, did you not run your assets:precompile? (check your `public/assets` directory)
[16:52:28] nickenchuggets: has joined #RubyOnRails
[16:54:07] Scripore: has joined #RubyOnRails
[16:54:37] dyulax: has joined #RubyOnRails
[16:55:39] IFrank00: smithy I never run that before how do I do that and where do I put it so its run automatic im deploying to heroku if that make any differents
[16:57:13] rakm: has joined #RubyOnRails
[16:58:30] Trynemjoel: has joined #RubyOnRails
[16:58:47] mbd2: has joined #RubyOnRails
[16:59:50] RegulationD: has joined #RubyOnRails
[17:00:19] mikecmpbll: has joined #RubyOnRails
[17:01:17] IFrank00: smithy I was building a rake task with ffaker so I can populate the database locally when I run the run assets:precompile it got a error on the rake task file (its on development so yes ill get a error) so maybe thats the problem ???
[17:02:30] Hobogrammer: has joined #RubyOnRails
[17:02:31] ght: Question: Has anyone seen a scenario with a standard rails 4.2.x mailer where, when rendering the message's view to send...
[17:02:48] smathy: IFrank00, always with the smithy - I should add that to my IRC alert keywords. Anyway: https://devcenter.heroku.com/articles/rails-asset-pipeline
[17:02:54] ght: Rails starts indicating syntax errors with various completely normal HTML components, such as </div>?
[17:03:11] tuelz: has joined #RubyOnRails
[17:03:15] ght: It appears that rails is not interpreting the HTML and trying to process it as Ruby code, despite the filename being welcome_email.html.erb
[17:03:51] IFrank00: sorry smathy the auto correct change it not me jeje
[17:04:16] ght: Without having to dump all related code in the project, has anyone ever experienced similiar behavior?
[17:04:50] RegulationD: has joined #RubyOnRails
[17:05:05] smathy: IFrank00, doesn't bother me, just that you're lucky I noticed your comment - no alerts often means I don't check.
[17:05:51] rustymyers: has joined #RubyOnRails
[17:06:01] Trynemjoel: has joined #RubyOnRails
[17:06:33] wasp__: has joined #RubyOnRails
[17:07:11] terpo: has joined #RubyOnRails
[17:07:31] mcr-credil: has joined #RubyOnRails
[17:08:55] Scripore: has joined #RubyOnRails
[17:11:14] simplyianm: has joined #RubyOnRails
[17:12:39] Sp3d_: has joined #RubyOnRails
[17:12:43] IFrank00: smithy it works it was my rake task that was running. and the run assets:compile heroku runs it automatic , but I run it any way on my local machine
[17:13:11] Sp3d_: What's the proper way to size how much memory your rails app takes?
[17:13:33] sarink: has joined #RubyOnRails
[17:13:36] arpegius: has joined #RubyOnRails
[17:13:45] Sp3d_: I'm trying to optimize passenger
[17:13:54] srinidhi: has joined #RubyOnRails
[17:14:31] Trynemjoel: has joined #RubyOnRails
[17:16:12] arpegius: trying to test UI changes initialized over a websocket. using the websocket-rails gem. I???ve got a simple page that i can vist and fire off `WebsocketRails[:demoing].trigger 'new', {title: ???updated title???}` in the console and see ???updated title??? appear. When I try to write a spec for that page, that same line does nothing. Has anyone ever here ever written a capybara for a websocket?
[17:19:56] smathy: Sp3d_, by using the passenger-memory-stats command line tool, and tuning the passenger_max_pool_size config setting to ensure that only as many instances are started that you have spare RAM for.
[17:20:53] smathy: IFrank00, glad to hear you got it working.
[17:21:21] Maletor: has joined #RubyOnRails
[17:21:38] kitsuneyo: has joined #RubyOnRails
[17:24:27] Silox|: has joined #RubyOnRails
[17:24:36] bronson: has joined #RubyOnRails
[17:24:42] Silox|: How would one translate http://stackoverflow.com/a/3096719/1068495 in activerecord?
[17:24:58] werelivinginthef: has joined #RubyOnRails
[17:25:03] kitsuneyo: has joined #RubyOnRails
[17:26:00] dented42: has joined #RubyOnRails
[17:26:17] bungoman: has joined #RubyOnRails
[17:26:50] mhib: has joined #RubyOnRails
[17:27:45] dyulax: has joined #RubyOnRails
[17:27:53] hobodave: has joined #RubyOnRails
[17:28:03] zedro: has joined #RubyOnRails
[17:28:21] gambl0re: has joined #RubyOnRails
[17:30:15] NodeNagant: has joined #RubyOnRails
[17:33:18] nahtnam: has joined #RubyOnRails
[17:33:34] Forbidden12: has joined #RubyOnRails
[17:34:31] nahtnam: Is there a way I can cache in rails without having to host something like redis
[17:34:55] joelbrewer: has joined #RubyOnRails
[17:35:14] NodeNaga_: has joined #RubyOnRails
[17:35:20] Lightsword: has joined #RubyOnRails
[17:36:51] mike___1234: has joined #RubyOnRails
[17:37:14] joelbrewer: hey folks, I want to get your opinion on how to set up a Rails API. In the past, I've used the rails-api gem, however, I noticed that rails-api is being merged into Rails 5 (which hasn't been officially released yet). Should I continue using rails-api until Rails 5 is released, or clone the master branch of Rails from github? Or do something else?
[17:38:13] eggoez: has joined #RubyOnRails
[17:39:32] joelbrewer: Here is an article on how I could use the latest version of Rails to accomplish this: http://wyeworks.com/blog/2015/6/11/how-to-build-a-rails-5-api-only-and-backbone-application
[17:40:26] tbuehlmann: nahtnam, there are several caching strategies besides redis. like, in memory, file based and others
[17:40:39] arBmind: has joined #RubyOnRails
[17:40:42] nickenchuggets: has joined #RubyOnRails
[17:41:36] esgl: has joined #RubyOnRails
[17:44:02] NodeNagant: has joined #RubyOnRails
[17:44:02] NodeNagant: has joined #RubyOnRails
[17:44:10] kitsuneyo: has joined #RubyOnRails
[17:45:35] gorums: has joined #RubyOnRails
[17:46:50] dyulax: has joined #RubyOnRails
[17:47:30] christiandsg: has joined #RubyOnRails
[17:47:32] Lightsword: has joined #RubyOnRails
[17:47:49] maletor|home: has joined #RubyOnRails
[17:49:08] esgl: has left #RubyOnRails: ("Bye...")
[17:49:09] esgl: has joined #RubyOnRails
[17:50:02] ohhmaar: has joined #RubyOnRails
[17:50:25] yfeldblum: has joined #RubyOnRails
[17:51:10] Detch: has joined #RubyOnRails
[17:52:28] towski_: has joined #RubyOnRails
[17:52:45] michaeldeol: has joined #RubyOnRails
[17:53:07] yardenbar: has joined #RubyOnRails
[17:53:40] alphaatom: has joined #RubyOnRails
[17:54:10] centrx: has joined #RubyOnRails
[17:54:33] broman: has joined #RubyOnRails
[17:54:36] blackmesa: has joined #RubyOnRails
[17:54:47] juanpaucar: has joined #RubyOnRails
[17:54:54] pipework: has joined #RubyOnRails
[17:54:55] catcher: has joined #RubyOnRails
[17:56:28] a346: has joined #RubyOnRails
[17:56:38] catcher: What's the best way to see the schema for a particular model?
[17:56:57] ciree: Model.new
[17:57:22] ciree: theres also like... Model.column_names
[17:57:24] Forbidden12: has joined #RubyOnRails
[17:57:40] ciree: Model.columns
[17:58:10] noodman: has joined #RubyOnRails
[17:58:44] catcher: ciree, thanks. I suppose I could also connect my IDE to the DB
[17:59:03] catcher: Either is better than piecing together migrations. :)
[17:59:42] Papierkorb: catcher: just type "Model"
[18:00:12] Papierkorb: catcher: the model class inspect method is overriden to show the schema too
[18:00:21] bricker: catcher: or open schema.rb
[18:00:25] catcher: Hoping for something a bit more readable
[18:00:31] adavia: Is there any problem with private pub and rails 4.2
[18:00:43] catcher: bricker, good call, ty
[18:01:03] Casty: has joined #RubyOnRails
[18:01:19] Schalla: has joined #RubyOnRails
[18:01:19] Schalla: has joined #RubyOnRails
[18:01:24] manfrin: has joined #RubyOnRails
[18:02:07] michaeldeol: has joined #RubyOnRails
[18:02:21] kitsuneyo: has joined #RubyOnRails
[18:05:01] arup_r: Guys .. Any body used Travis CI ?
[18:05:07] arup_r: in your projects
[18:05:12] alexclark: has joined #RubyOnRails
[18:05:41] alexclark: Who would you consider a top consulting firm for rescue projects?
[18:05:57] alexclark: My company is seeking one in Boston.
[18:06:25] esgl: Hello all. I'm having some problems with ActiveRecord eager loading and caching. I wrote a simplified gist https://goo.gl/011q9l which explains things. Tl;dr associations aren't being cached.
[18:06:26] arup_r: How much times it takes for Travis integrations
[18:06:43] tbuehlmann: arup_r, minutes I'd say
[18:06:58] arup_r: ok.. I never did it.. so asking
[18:07:12] arup_r: I have been asked to do so.. that's why asking
[18:07:29] tbuehlmann: arup_r, I can only speak for public github repos, but for those it's pretty straight forward
[18:07:54] netzfisch: has joined #RubyOnRails
[18:07:54] tbuehlmann: add a repo to your travis account, add a .travis.yml file to your repo, done
[18:08:05] tbuehlmann: (+- a few steps)
[18:08:29] arup_r: Do you have any handy material regarding the settings... ?
[18:08:39] Papierkorb: arup_r: github search for .travis.yml and have a look how they're supposed to look
[18:08:46] tbuehlmann: http://docs.travis-ci.com/user/languages/ruby/
[18:09:03] bungoman: has joined #RubyOnRails
[18:10:04] mcr-credil: has joined #RubyOnRails
[18:10:22] arpegius: has joined #RubyOnRails
[18:10:57] tbuehlmann: catcher, when using pry-rails, you can also call `show-model <model>` in your console. example: https://gist.github.com/tbuehlmann/c7ff8ede926a28deaa24
[18:11:42] arup_r: tbuehlmann, if I a project don't have tests does this CI integration makes any sense ?
[18:11:57] arup_r: a project**
[18:12:33] tbuehlmann: arup_r, not really. what is travis supposed to do if not run the tests?
[18:12:39] bruno-: has joined #RubyOnRails
[18:12:48] loc22_: has joined #RubyOnRails
[18:13:55] gambl0re: has joined #RubyOnRails
[18:14:29] bricker: tbuehlmann: CI
[18:14:39] bricker: hence "travis CI"
[18:15:14] baweaver: has joined #RubyOnRails
[18:15:18] bricker: although on a rails app without tests it would basically just be an automatic deployment tool
[18:15:22] tbuehlmann: arup_r: "CI"
[18:15:22] skroon_: has joined #RubyOnRails
[18:16:33] arup_r: bricker, then what is the difference between capistrano and travis CI ?
[18:16:38] SteenJobs: has joined #RubyOnRails
[18:17:37] michaeldeol: has joined #RubyOnRails
[18:18:04] manfrin: travis is a testrunner that turned in to travis-ci, ci is a term that implies and includes running tests before autodeploying
[18:18:12] roolo: has joined #RubyOnRails
[18:18:21] arpegius: has joined #RubyOnRails
[18:18:23] bricker: arup_r: well, they are meant to do different things, but really you could use either one to do almost anything
[18:18:23] manfrin: 'ci' means: on pushing to monitored branch (master, develop, whatever), run tests and autodeploy if they pass
[18:18:36] manfrin: if you dont have tests, dont use ci
[18:18:48] manfrin: just use elasticbeanstalk or whatever
[18:18:52] werelivinginthef: has joined #RubyOnRails
[18:18:57] arup_r: yup makes sense
[18:19:14] choke: has joined #RubyOnRails
[18:19:14] arup_r: I don't have tests ... :( so capistrano is ok
[18:19:51] Axilla: hi all, we're upgrading our app from rails 3.2 to rails 4.2 and i'm migrating my resque jobs to use activejob incase we ever decide to change backends.. I am having to break down some files to work with activejob and i can't seem to require a file in ruby 2.2 so that I can access a method from it. https://gist.github.com/travisdmathis/b8153e61ed19af454d6b
[18:20:10] ruurd: has joined #RubyOnRails
[18:20:19] Axilla: both export_jobs.rb and export_keyword_sets.rb are in the same directory
[18:20:41] Axilla: which is the jobs direction in /app for activejob
[18:20:46] Axilla: directory*
[18:21:10] rhizome: do the version upgrade before you change anything like that
[18:21:16] Axilla: already did
[18:21:23] Axilla: going through and finishing up everything else now
[18:21:40] rhizome: i guess i got stuck on the "ing" part
[18:21:55] manfrin: this is probably not helpful right now, but: if you had sufficient time, you should move all that logic in to a service class, and then use the job to purely .call that service
[18:22:02] manfrin: jobs should be dumb message queues
[18:22:30] manfrin: (so that switching out the queue type like you're doing is easy)
[18:22:42] manfrin: (but this is not helpful since you're already in the mire, apologies)
[18:22:57] Axilla: hehe now worries, one step at a time, we're doing a lot of upgrades/refactoring atm
[18:23:00] bricker: manfrin: be careful, axilla might chew you and spit you out before 10am!
[18:23:12] manfrin: with his O-1
[18:23:21] Axilla: all that logic is still based on resque jobs, so i havent even gone through and done stuff like passing the object instead of the ID or whatever.. one step at a time.
[18:23:50] Axilla: i just want to get them all working with activejob atm :P
[18:24:20] Rubie: has joined #RubyOnRails
[18:24:25] kies^: has joined #RubyOnRails
[18:24:33] pixelhandler: has joined #RubyOnRails
[18:24:38] ur5us: has joined #RubyOnRails
[18:25:56] manfrin: so are you calling get_rows_obj from inside a model?
[18:27:39] zpe: has joined #RubyOnRails
[18:29:47] rails611: has joined #RubyOnRails
[18:29:56] Synthead: has joined #RubyOnRails
[18:31:36] Trynemjoel: has joined #RubyOnRails
[18:31:45] lethjakman: has joined #RubyOnRails
[18:32:13] Scriptonaut: Hey guys, I have a spreadsheet full of data, each row has some info for existing rows in my User model table. For each of these users, I need to do some db stuff. The problem I'm having, is figuring out the best way to write a task to import this data. Do I write a rake task that uses the local file? If so, that means I must upload the file to production right?
[18:32:34] choke: has joined #RubyOnRails
[18:32:43] tuelz: has joined #RubyOnRails
[18:32:43] Scriptonaut: I will eventually need to run this in production
[18:32:55] Lawjek: has joined #RubyOnRails
[18:33:04] mdcox: has joined #RubyOnRails
[18:33:39] alexclark: has joined #RubyOnRails
[18:33:50] kh0d: has joined #RubyOnRails
[18:34:09] sonofdirt: has joined #RubyOnRails
[18:35:44] manfrin: Scriptonaut you could write the task to take an argument (like a url)
[18:35:50] sonofdirt: has joined #RubyOnRails
[18:36:48] Scriptonaut: hrm, it's currently on a google doc, I suppose I could upload it to s3 or something
[18:37:16] Scriptonaut: it's private info so probably shouln't host it somewhere public
[18:37:44] simplyianm: has joined #RubyOnRails
[18:38:07] Trynemjoel: has joined #RubyOnRails
[18:39:00] Papierkorb: Scriptonaut: you could also directly access the GDocs spreadsheet through the API
[18:39:26] Scriptonaut: how much of a pain is it getting the API setup with rails?
[18:39:44] Papierkorb: No idea, last time I did that a gig in JBoss .. don't judge me D:
[18:39:45] Scriptonaut: I'll probably only run this rake task 2-3 times ever
[18:39:47] bmurt: has joined #RubyOnRails
[18:39:57] DEA7TH: has joined #RubyOnRails
[18:40:06] Scriptonaut: I think I'll just use a local file since this isn't a longterm feature
[18:40:16] Scriptonaut: Pretty soon users will enter this info themselves
[18:40:31] NodeNagant: has joined #RubyOnRails
[18:40:50] Papierkorb: But then, the most annoying temporary features are the ones being there forever
[18:41:41] DEA7TH_: has joined #RubyOnRails
[18:44:30] jsrn_: has joined #RubyOnRails
[18:44:32] Papierkorb: I want to write API stuff. Meaning, I have a RESTful endpoint on my services and the web client GETs stuff etc. Nothing fancy. But, I also want to support websockets on the long run, and of course don't want to duplicate logic here. Is it still a good idea to use a controller, or put the API logic stuff into its own classes and then have controllers which pretty much just invoke the API function and render some JSON?
[18:44:58] dman777_alter: Does the rails ORM do lazy loading? ie @datacenters = Datacenter.options_for_select.flatten.uniq won't actually do a look up until a method is used on it like count()?
[18:45:01] Papierkorb: Something just feels wrong having that logic in controllers.
[18:45:29] arpegius: has joined #RubyOnRails
[18:45:36] mikeric: has joined #RubyOnRails
[18:45:57] rhizome: dman777_alter: you can use .all in there if you really want to tidy up your logs or whatever. also, put that other stuff in your scope, too
[18:45:57] Papierkorb: dman777_alter: Well, not lazy loading in that sense, but it requests only when it needs to, yes. That's not only nice, but also required, else you wouldn't be able to build queries with.multiple.method.calls
[18:46:39] Alex-_: has joined #RubyOnRails
[18:46:51] tubbo: dman777_alter: correct, the query is only executed when you call a method on AR::Relation that would require data, like any of the Enumerable methods or count() or whatever
[18:47:18] Lawjek: has joined #RubyOnRails
[18:47:19] rehat: has joined #RubyOnRails
[18:48:48] dman777_alter: Just to make sure.... http://dpaste.com/3MS1ZWQ if I do url /datacenters only the @datacenters = Datacenter.options_for_select.flatten.uniq will actually hit the database and not the others in the before_filter of the parent controller, correct?
[18:49:31] Papierkorb: dman777_alter: queries in before_action filters are run too
[18:49:49] dman777_alter: Papierkorb: oh... I was hoping they would not due to lazy loading
[18:50:06] Papierkorb: dman777_alter: well they're needed, so the lazyness ends there
[18:50:38] sdwrage: has joined #RubyOnRails
[18:50:42] dman777_alter: Papierkorb: what makes the othe queries needed in DatacentersController since it's only render :json => {:datacenters => @datacenters } being used?
[18:51:09] mikeric: anyone familiar with actionmailer and the mail gem; is there a way to have utf-8 headers encoded without breaking it apart into 72 character chunks?
[18:51:39] mikeric: it seems to break it apart in the middle of a multibyte character, which is invalid.
[18:51:51] gerep: has joined #RubyOnRails
[18:52:16] Papierkorb: dman777_alter: you're building the complete request there, so they're sent off to the DB. How should ruby know what you actually don't need something requested later on?
[18:52:27] gerep: I have three models, Request, Item and RequestItems where Request has_many: request_items and RequestItems belongs_to :item and belongs_to :request. My doubt is the name of the model RequestItems. Should it be RequestsItem, RequestItems, RequestsItems or RequestItem?
[18:53:05] Sp3d_: All model names should be singular
[18:53:14] dman777_alter: Papierkorb: ok, thanks
[18:53:37] Papierkorb: dman777_alter: But check your logs to make sure
[18:53:40] gerep: Sp3d_, so, Request has_many :requests_items would be the relation name?
[18:54:04] gerep: Sp3d_, or Request has_many request_items ?
[18:54:22] dman777_alter: Papierkorb: cool...good idea, thanks!
[18:55:15] christiandsg: has joined #RubyOnRails
[18:56:06] simplyianm: has joined #RubyOnRails
[18:57:10] bruno-: has joined #RubyOnRails
[18:57:38] Trynemjoel: has joined #RubyOnRails
[19:02:25] bruno-: has joined #RubyOnRails
[19:02:32] georg: has joined #RubyOnRails
[19:03:21] bin_005: has joined #RubyOnRails
[19:03:57] n1lo: has joined #RubyOnRails
[19:04:08] SteenJobs: has joined #RubyOnRails
[19:04:30] cornerma1: has joined #RubyOnRails
[19:05:09] tsvenson: has joined #RubyOnRails
[19:05:09] user1138_: has joined #RubyOnRails
[19:05:36] nickfausnight: Can you have a member and collection action of the same name for the same resource?
[19:07:09] Trynemjoel: has joined #RubyOnRails
[19:07:45] bungoman: has joined #RubyOnRails
[19:07:46] iamjarvo: has joined #RubyOnRails
[19:08:12] user1138_: has joined #RubyOnRails
[19:08:30] simplyianm: has joined #RubyOnRails
[19:10:01] tubbo: nickfausnight: yes, because one of them will be routed to /resources/action and the other to /resources/$SOME_ID/action
[19:10:16] georges: has joined #RubyOnRails
[19:10:46] tubbo: though it will try to send users to the same controller action, so you either need to check for params[:id] before trying a lookup, or configure the route to go to a different action (get :foo => 'controller#action')
[19:10:47] nickfausnight: tubbo: right, but how do I declare that? Right now both go to resource#action
[19:11:06] tubbo: sometimes i would rather have them both go to the same action
[19:11:09] tubbo: it really depends
[19:11:50] fryguy: has joined #RubyOnRails
[19:16:49] Papierkorb_: has joined #RubyOnRails
[19:18:00] Maletor: has joined #RubyOnRails
[19:18:52] sonofdirt: has joined #RubyOnRails
[19:19:13] dangerousdave: has joined #RubyOnRails
[19:20:03] Eindoofus: has joined #RubyOnRails
[19:20:26] Rubie: has joined #RubyOnRails
[19:20:29] qejk: has joined #RubyOnRails
[19:21:13] _djbkd: has joined #RubyOnRails
[19:21:19] Eindoofus: hi, hoping someone here uses Rally. if so, do you happen to know how to multitask in it? is it possible to switch between incompleted tasks?
[19:21:28] eggoez: has joined #RubyOnRails
[19:22:40] Trynemjoel: has joined #RubyOnRails
[19:23:59] annlewis: has joined #RubyOnRails
[19:26:26] ruurd: has joined #RubyOnRails
[19:27:28] baweaver: has joined #RubyOnRails
[19:28:01] juanpaucar: has joined #RubyOnRails
[19:28:10] shinnya: has joined #RubyOnRails
[19:30:05] baweaver: has joined #RubyOnRails
[19:30:18] Axilla: i got everything working ><
[19:30:40] Axilla: remember to restart the damn server after moving job files :(
[19:31:01] gambl0re: has joined #RubyOnRails
[19:32:19] alyyy: has joined #RubyOnRails
[19:32:33] yardenbar: has joined #RubyOnRails
[19:32:51] EminenceHC: has joined #RubyOnRails
[19:36:07] sonofdirt: has joined #RubyOnRails
[19:36:16] alyyy: Is it possible to have a virtual attribute that writes to an attribute of the same name in a model?
[19:36:43] Rinzlit1: has joined #RubyOnRails
[19:36:45] alyyy: I have a model with a name that I want to add a side effect to when it's changed.
[19:37:16] tubbo: alyyy: a much cleaner way of doing that would be to do some kind of before_create :massage_the_name, if: :name_changeD?
[19:37:27] manfrin: def virtual_attribute=()
[19:37:40] manfrin: actual_attribute = whatever; end
[19:37:41] Trynemjoel: has joined #RubyOnRails
[19:37:43] x-light: has joined #RubyOnRails
[19:37:54] alyyy: that recalls the = function though
[19:38:07] tubbo: alyyy: you can use dirty attribute checking to accomplish this
[19:38:13] tubbo: because that's not a perfect solution
[19:38:37] tubbo: you'd have to do write_attribute to actually write the attr
[19:38:43] manfrin: = is real, real basic, using it twice isn't going to add anything
[19:38:48] tubbo: you can't do def attribute=(); self.attribute = whatever; end;
[19:39:02] tubbo: you'd have to do @attribute = whatever but that's still not correct
[19:39:07] tubbo: manfrin: in Ruby, '=' is a method
[19:39:10] manfrin: I've used that a bunch of times
[19:39:16] tbuehlmann: you could override attribute= and call super
[19:39:25] manfrin: whenever your virtual attr gets assigned, it's usually within a block of otehr thigns being assigned
[19:39:39] manfrin: so writing is not necessary
[19:39:45] manfrin: since saving will happen elsewhere
[19:39:45] tubbo: manfrin: does your team happen to deal with stack overflow errors a lot? ;)
[19:40:13] manfrin: [12:38:46] <tubbo> you can't do def attribute=(); self.attribute = whatever; end;
[19:40:15] manfrin: can you explain this/
[19:40:18] tubbo: the code i described basically defined a method that called itself
[19:40:24] manfrin: because I am 90% certain that's wrong
[19:40:26] tubbo: which will cause a stack overflow
[19:40:35] Rinzlit1: has left #RubyOnRails: ()
[19:40:36] manfrin: you misread what I wrote
[19:40:51] givanse: has joined #RubyOnRails
[19:40:52] manfrin: def virtual_attribute=(attr); self.actual_attribute = attr; end
[19:41:04] manfrin: you define the setter for what you want the virtual attribute to be
[19:41:08] manfrin: and have that set the actual attribute
[19:41:14] Rinzlit: has joined #RubyOnRails
[19:41:20] tubbo: manfrin: https://gist.github.com/tubbo/4cea9d19b595eeca3cce
[19:41:25] tubbo: manfrin: that's true
[19:41:31] tubbo: what you said will work
[19:41:38] broman: has joined #RubyOnRails
[19:42:00] Rinzlit: Ermm so I have this weird website in ruby I'm playing with, and when i finally got it working after 10 hours it say this : Migrations are pending. To resolve this issue, run: bin/rake db:migrate RAILS_ENV=development
[19:42:06] romdi: has joined #RubyOnRails
[19:42:13] Rinzlit: I don't really know ruby stuff at all .-.
[19:42:25] manfrin: copy that bit after run: and paste it in to your console
[19:42:32] manfrin: (while in your app directory)
[19:42:41] tubbo: Rinzlit: lol did you try doing exactly what the error told you to do? ;)
[19:42:43] Rinzlit: I did, and I got (1 sec make a link)
[19:43:07] tubbo: Rinzlit: gist is our favorite, thanks for reading/following the rules!
[19:43:20] Axilla: manfrin: so ummm yea problem turned out to be, restart server since it was working with jobs :( an hour of troubleshooting for nothing! haha
[19:43:35] gorums: has joined #RubyOnRails
[19:43:38] manfrin: that happens
[19:43:39] Axilla: i moved a bunch of files around and never restarted my server =/
[19:43:56] manfrin: that is a lesson that gets pounded in to you after a while
[19:44:15] manfrin: 'something isn't working right? maybe i should restart again'
[19:44:16] Rinzlit: https://gist.github.com/anonymous/e45546a21439f4aca96a
[19:44:21] Rinzlit: I got that disaster .-.
[19:44:43] manfrin: I can't count the amount of full days I've wasted to issues that were solved with restarts
[19:45:23] NodeNagant: has joined #RubyOnRails
[19:45:39] manfrin: Rinzlit [12:38:46] <tubbo> you can't do def attribute=(); self.attribute = whatever; end;
[19:45:50] tubbo: manfrin: still on about that huh ;)
[19:45:54] Axilla: i was in IT before i became a full time dev.. been doing it for the last year and half now and its definatley not the first time haha
[19:45:55] DEA7TH_: has joined #RubyOnRails
[19:46:08] manfrin: was in my clipboard D:
[19:46:11] manfrin: /home/rinzlit/catarse/db/migrate/20121226120921_initial_schema.rb:5:in `up'
[19:46:14] Axilla: i have a degree in electrical engineering though =/
[19:46:18] manfrin: that's the line that's breaking
[19:46:40] Rinzlit: Okay thats the 5th line in that right?
[19:46:51] tubbo: Rinzlit: it looks like postgresql doesn't have an extension on disk that you're trying to install
[19:46:56] Axilla: oh wells, i hated all those.. i like development(have always loved it.. have been coding since i was a tyke..) but i went into the military and they made me a EE and I kept getting job offers when I got out, until I just couldn't stand working for the government anymore.
[19:46:59] tubbo: with those CREATE EXTENSION lines
[19:47:03] IFrank00: has joined #RubyOnRails
[19:47:21] manfrin: Rinzlit what is your os?
[19:47:25] skroon: has joined #RubyOnRails
[19:47:40] Rinzlit: Ubuntu 14.0.4
[19:47:51] Rinzlit: This is the line of code where it seems to be breaking
[19:47:52] Rinzlit: class InitialSchema < ActiveRecord::Migration
[19:47:52] Rinzlit: execute <<-SQL
[19:48:39] Rinzlit: tubbo how can I fix that btw?
[19:48:51] tubbo: Rinzlit: figure out what that extension is and install it?
[19:48:52] jgpawletko: has joined #RubyOnRails
[19:49:14] Rinzlit: -facepalm-
[19:49:14] manfrin: sudo apt-get install postgresql-contrib-X-X
[19:49:14] tubbo: Rinzlit: this looks like the error you're getting: "PG::UndefinedFile: ERROR: could not open extension control file "/usr/share/postgresql/9.3/extension/pg_trgm.control": No such file or directory"
[19:49:22] manfrin: figure out what your PG version is
[19:49:23] tubbo: i dunno what pg_trgm is though :)
[19:49:27] hobodave: has joined #RubyOnRails
[19:49:29] manfrin: and replace the X-X with the version number
[19:49:50] Rinzlit: PG? version?
[19:50:05] mike___1234: has joined #RubyOnRails
[19:50:10] Rinzlit: and that pg_trgm is one of the gem's that broke durring the install of the bundle .-.
[19:50:24] manfrin: sudo apt-get install postgresql-contrib
[19:50:27] manfrin: try just that
[19:50:28] tubbo: Rinzlit: that's your first issue
[19:50:33] choke: has joined #RubyOnRails
[19:50:35] michaeldeol: has joined #RubyOnRails
[19:50:45] tubbo: you should not continue work if your Gemfile doesn't work
[19:50:52] tubbo: err, if your bundle doesn't work*
[19:51:03] tubbo: figure out why the dependencies failed to load
[19:52:22] Rinzlit: I fixed them
[19:52:30] Rinzlit: Its just they were being weird and breaking durring the mass install
[19:52:38] Rinzlit: They had to be done one at a time randomly
[19:52:55] treehug88: has joined #RubyOnRails
[19:53:20] SteenJobs: has joined #RubyOnRails
[19:53:29] Rinzlit: I have version 9.3.9
[19:54:20] Diabolik: can anyone here help me with a data migration?
[19:54:28] Diabolik: i want to randomly assign one object to another
[19:54:31] Diabolik: in a migration
[19:54:38] Diabolik: so for example
[19:55:21] Diabolik: assign 3 related guides to each parent guide
[19:55:44] Rinzlit: tubbo, manfrin, I love you both O_o
[19:55:49] Rinzlit: Thank you <3
[19:55:57] manfrin: glad it worked
[19:56:04] Rinzlit: I haven't slept in 2 days
[19:56:04] iamjarvo: has joined #RubyOnRails
[19:56:09] Rinzlit: once I finish this website I'm done :D
[19:56:10] alyyy: has joined #RubyOnRails
[19:56:17] Rinzlit: I will sleep for ever xD
[19:56:36] Rinzlit: And by forever I mean until I want to play videogames
[19:56:39] tubbo: Diabolik: why would you want to do that?
[19:57:25] Diabolik: tubbo because i was told to by work :P
[19:57:35] annlewis_: has joined #RubyOnRails
[19:57:49] tubbo: Diabolik: not sure if you were doing some kind of testing...was like "there's gems for that!"
[19:57:52] bricker: Diabolik: You can use your dbms's random function, it varies between databases
[19:57:55] alyyy: tubbo, manfrin, thanks for the help, I think I'll look into using dirty attributes
[19:58:01] cac_: has joined #RubyOnRails
[19:58:09] manfrin: dirty attributes, interesting, didnt know they had a name :D
[19:58:09] platosha: has joined #RubyOnRails
[19:58:16] Diabolik: bricker Postgres
[19:58:22] Rinzlit: I know im tired but
[19:58:25] Rinzlit: jquery rails?
[19:58:41] manfrin: it's a gem that just puts jquery in your vendor lib
[19:58:48] alex88: https://github.com/rails/jquery-rails
[19:58:56] manfrin: no advantage of using that over simply including, other than ease of use
[19:59:08] tubbo: one big advantage is jquery_ujs
[19:59:11] tubbo: if you uset hat
[19:59:12] Rinzlit: I am using someone elses stuff .-.
[19:59:13] tubbo: use that*
[19:59:19] Rinzlit: I'm not smart enough to make my own >.<
[19:59:26] bricker: Diabolik: It would probably be better to fetch all of the records up-front, then use Ruby to get random records. Otherwise you're hitting the database unnecessarily for every iteration
[19:59:38] tubbo: Rinzlit: what are you doing exactly? just trying to run a rails app locally and poke around at it?
[19:59:50] Rinzlit: Pretty much
[19:59:52] manfrin: usually [javascriptframework]-rails gems are just convenience gems
[19:59:57] Mendenhall: has joined #RubyOnRails
[19:59:58] tubbo: that's cool
[20:00:16] Rinzlit: Yeah, except its for a crowdfunding template
[20:00:25] tubbo: oh selfstarter? :)
[20:00:27] Rinzlit: And if it works nicely I'll set it up for a company
[20:00:46] Rinzlit: Nah, a MLM company wanted an over night website
[20:00:56] tubbo: Rinzlit: no...i mean...you're using selfstarter?
[20:00:57] simplyianm: has joined #RubyOnRails
[20:00:58] Rinzlit: So I'll throw them someone elses open source website
[20:01:05] Rinzlit: Whats selfstarter?
[20:01:17] tubbo: Rinzlit: never mind. what's the app you're using?
[20:01:19] tubbo: now i'm curious :)
[20:01:37] tubbo: selfstarter is a rails app made by lockitron for this purpose, crowdfunding but not hosted by kickstarter
[20:01:44] Rinzlit: well I'll share because you helped me xD
[20:01:54] Rinzlit: Its a brazial crowdfunding script
[20:02:02] tubbo: it's...open source though? :P
[20:02:04] Rinzlit: https://github.com/catarse/catarse
[20:02:04] tubbo: i mean i could just find it
[20:02:07] Rinzlit: Yes it is my friend
[20:02:24] Rinzlit: Yeah its called cat arse xD
[20:02:24] tubbo: are you serious
[20:02:28] tubbo: i was wondering
[20:02:38] tubbo: if that was just a weird pronunication
[20:02:54] Rinzlit: its portuguez
[20:03:03] Rinzlit: I'm having all these weirds problems Q_Q
[20:03:06] tubbo: "how to ensure no one uses your app", a lightning talk by "Team Cat Arse"
[20:03:16] Rubie: has joined #RubyOnRails
[20:03:20] Rinzlit: http://162.217.248.39:3000/
[20:04:00] tubbo: wow that was surprisingly fast
[20:04:03] Rinzlit: I had to buy another VPS just to set this thing up
[20:04:12] Rinzlit: I started working on it last night at 2AM
[20:04:15] tubbo: oh it's a VPS
[20:04:17] Rinzlit: its 1PM now
[20:04:23] Rinzlit: I need sleep soon...
[20:04:27] Rinzlit: But I need to get this done...
[20:04:37] alyyy: that's a long time
[20:04:40] Rinzlit: Everyone was like its soo simple .-.
[20:04:47] Rinzlit: Every turn ruby gives me trouble
[20:04:54] tubbo: if you're a rails dev it's probably pretty easy
[20:04:57] Rinzlit: I don't think ruby likes the way I'm bad with linux
[20:05:06] tubbo: Rinzlit: let me guess, did you apt-get install ruby? :)
[20:05:17] Rinzlit: I used bitnami dev stacks
[20:05:39] Rinzlit: For Ruby :D
[20:05:54] Rinzlit: I actually started on Centos
[20:06:02] Rinzlit: Then I spent 5 hours trying to get it working on centos
[20:06:09] Rinzlit: gave up and started getting it running on ubuntu
[20:06:16] Rinzlit: While learning not to use root for everything on linux
[20:06:25] Rinzlit: and to actually use linux properly .-.
[20:06:27] garrypolley: has joined #RubyOnRails
[20:07:00] Rinzlit: Any chance you could help me figure out whats going wrong with it now .-.
[20:07:41] baweaver: has joined #RubyOnRails
[20:08:10] postmodern: has joined #RubyOnRails
[20:08:13] Trynemjoel: has joined #RubyOnRails
[20:08:25] postmodern: how would i force session_store, to not set Path or Domain attributes on a cookie?
[20:08:31] kimegede: has joined #RubyOnRails
[20:10:21] kimegede: Should I have 1 or 2 migrations if: Want to create a table and make a relation field for it, for an existing table.
[20:10:31] kimegede: Should I create 1 migration to make the new table?
[20:10:44] kimegede: And another for the adding the field?
[20:11:18] sonofdirt: has joined #RubyOnRails
[20:11:19] tubbo: it all ends up being a db/schema.rb anyway, so you might as well just add one migration
[20:11:38] tubbo: having migrations just for making small schema changes are only necessary if the table has already been defined in a deployed app
[20:12:24] kimegede: tubbo: Wouldn't you make migrations for each feature as well=
[20:12:34] kimegede: Under development
[20:12:52] tubbo: kimegede: not really, i only make migrations when i created a db/schema.rb already, so like when i need to make changes after the db has initially been created
[20:13:04] kadoppe: has joined #RubyOnRails
[20:13:47] a346: has joined #RubyOnRails
[20:14:12] bahar: has joined #RubyOnRails
[20:15:54] kimegede: Okay could make sense as well.
[20:18:22] chadwtaylor: has joined #RubyOnRails
[20:18:27] _djbkd: has joined #RubyOnRails
[20:18:30] tubbo: i just feel like db/migrate/ gets a little huge after a few years of active development (or even just one year) so i try to do as few migrations as i can
[20:20:26] jmimi: has joined #RubyOnRails
[20:20:35] lethjakman: has joined #RubyOnRails
[20:21:24] Aswebb_: has joined #RubyOnRails
[20:21:42] kimegede: I just felt it was the right way, and as the generator made it for me :D
[20:22:56] simplyianm: has joined #RubyOnRails
[20:23:18] mike___1234: has joined #RubyOnRails
[20:24:36] bronson: has joined #RubyOnRails
[20:24:56] blackmesa: has joined #RubyOnRails
[20:26:23] nfk: has joined #RubyOnRails
[20:27:18] alvaro_o: has joined #RubyOnRails
[20:27:27] user1138: has joined #RubyOnRails
[20:29:35] ascarter: has joined #RubyOnRails
[20:32:42] cac_: has joined #RubyOnRails
[20:32:43] joelbrewer: has joined #RubyOnRails
[20:32:46] jenrzzz: has joined #RubyOnRails
[20:33:51] werelivinginthef: has joined #RubyOnRails
[20:34:15] Trynemjoel: has joined #RubyOnRails
[20:35:09] Breno_p: has joined #RubyOnRails
[20:36:32] benlieb: has joined #RubyOnRails
[20:37:26] bronson: has joined #RubyOnRails
[20:37:47] Lightsword: has joined #RubyOnRails
[20:39:27] paulcsmith: has joined #RubyOnRails
[20:41:42] mcr-credil: has joined #RubyOnRails
[20:41:47] xkickflip: has joined #RubyOnRails
[20:42:25] NodeNagant: has joined #RubyOnRails
[20:43:09] Scripore: has joined #RubyOnRails
[20:43:37] Frem: has joined #RubyOnRails
[20:44:37] christiandsg: has joined #RubyOnRails
[20:47:21] Lightsword: has joined #RubyOnRails
[20:47:50] bricker: tubbo: just delete old migrations
[20:47:59] A-ron: has joined #RubyOnRails
[20:48:59] DEA7TH_: has joined #RubyOnRails
[20:49:00] choke: has joined #RubyOnRails
[20:51:36] Wolland: has joined #RubyOnRails
[20:51:40] crdpink: has joined #RubyOnRails
[20:53:19] bricker: tubbo: that is... if you're man enough to handle it!
[20:54:05] Lightsword: has joined #RubyOnRails
[20:54:50] cccc: has joined #RubyOnRails
[20:55:31] fighella: has joined #RubyOnRails
[20:57:46] cccc: why does rails sometimes not execute a update query in the order that is written in the method? is this some kind of lazy query execution? where can I find out more?
[20:58:32] umo: has joined #RubyOnRails
[20:58:39] Papierkorb_: cccc: what do you mean?
[20:58:44] cccc: e.g. book.update(title: '1') was not executed until I reloaded book object
[20:58:47] bricker: cccc: we'd need to see code and proof to answer that question
[20:59:27] bricker: cccc: proof please
[20:59:48] manfrin: ccc, it executes -- but your model is stale (reload will pull from db, not push to it)
[21:00:58] bricker: yeah cccc you're probably referencing two different ruby objects
[21:02:05] umo: has left #RubyOnRails: ()
[21:02:47] garrypolley: has joined #RubyOnRails
[21:03:51] drale2k: has joined #RubyOnRails
[21:04:01] charliesome: has joined #RubyOnRails
[21:04:33] Papierkorb_: has joined #RubyOnRails
[21:04:39] yfeldblum: has joined #RubyOnRails
[21:06:53] eggoez: has joined #RubyOnRails
[21:09:04] x-light: has joined #RubyOnRails
[21:09:39] user1138: has joined #RubyOnRails
[21:10:38] givanse: has joined #RubyOnRails
[21:11:35] EminenceHC: has joined #RubyOnRails
[21:13:13] Lightsword: has joined #RubyOnRails
[21:13:13] xcesariox: has joined #RubyOnRails
[21:13:17] freeUmo: has joined #RubyOnRails
[21:14:05] fighella: has joined #RubyOnRails
[21:15:05] NodeNagant: has joined #RubyOnRails
[21:17:02] Sypheren_: has joined #RubyOnRails
[21:18:34] NodeNaga_: has joined #RubyOnRails
[21:18:53] dopie: has joined #RubyOnRails
[21:20:11] pixelhandler: has joined #RubyOnRails
[21:22:11] ruurd: has joined #RubyOnRails
[21:22:27] cccc: Thanks guys, I realised I was updating a fixture record that didn't have the attribute that I was updating, my guess is that this was the reason it remained 0, problem solved when I added the attribute to all the models in my fixture file.
[21:22:36] iamjarvo_: has joined #RubyOnRails
[21:22:56] iamjarvo_: has joined #RubyOnRails
[21:23:39] Scripore: has joined #RubyOnRails
[21:24:10] VeryBewitching: has joined #RubyOnRails
[21:24:14] hobodave: has joined #RubyOnRails
[21:24:18] simplyianm: has joined #RubyOnRails
[21:25:19] A-ron: has joined #RubyOnRails
[21:25:41] tvw: has joined #RubyOnRails
[21:25:56] code1o6: has joined #RubyOnRails
[21:26:51] pixelhan_: has joined #RubyOnRails
[21:28:04] ur5us: has joined #RubyOnRails
[21:30:33] ur5us_: has joined #RubyOnRails
[21:31:15] mhf: has joined #RubyOnRails
[21:31:48] mary5030: has joined #RubyOnRails
[21:33:26] NodeNagant: has joined #RubyOnRails
[21:34:08] paulcsmith: has joined #RubyOnRails
[21:34:15] xcesariox: good morning everyone.
[21:34:29] Lightsword: has joined #RubyOnRails
[21:35:44] blackmesa: has joined #RubyOnRails
[21:36:34] iamjarvo: has joined #RubyOnRails
[21:37:12] jamgood96: has joined #RubyOnRails
[21:37:22] sar1nk: has joined #RubyOnRails
[21:38:34] Janno: has joined #RubyOnRails
[21:39:15] jamgood96: I'm using the "redis-rb" gem, and have called `$redis = Redis.new` in an initializer. All works well when I access $redis from my controllers, but for some reason I've been receiving a lot of Redis Timeouts from my AWS ElastiCache Redis instance. This is causing all sorts of issues with my app. The gem recommends using a begin/rescue block, but I'm finding my code is starting to get littered with these. Is there
[21:39:15] jamgood96: a better way to handle Redis errors besides a begin/rescue with a retry command?
[21:39:27] rubyonra_: has joined #RubyOnRails
[21:39:40] simplyianm: has joined #RubyOnRails
[21:40:07] mcr-credil: has joined #RubyOnRails
[21:40:24] blackmes1: has joined #RubyOnRails
[21:41:35] fighella: has joined #RubyOnRails
[21:42:01] rubyonrailed: has joined #RubyOnRails
[21:42:40] helpa: has joined #RubyOnRails
[21:42:47] tubbo: maybe you could turn it into REDIS_CLIENT or something
[21:44:05] kitsuneyo: has joined #RubyOnRails
[21:46:29] Mweshi: has joined #RubyOnRails
[21:46:30] Scripore: has joined #RubyOnRails
[21:47:56] rubyonra_: has joined #RubyOnRails
[21:49:09] zorak8: has joined #RubyOnRails
[21:50:41] freeUmo: has joined #RubyOnRails
[21:50:51] NodeNagant: has joined #RubyOnRails
[21:51:34] bricker: tubbo: I think there was some documentation somewhere that used $redis in an example and now every freaking app in the world has $redis and they don't even know why they're doing it.
[21:52:08] michaellippold: has joined #RubyOnRails
[21:52:31] bungoman: has joined #RubyOnRails
[21:52:36] ProLoser: has joined #RubyOnRails
[21:53:57] thoraxe_: has left #RubyOnRails: ()
[21:55:55] shathoma: has joined #RubyOnRails
[21:56:12] SteenJobs: has joined #RubyOnRails
[21:57:58] jmimi: has joined #RubyOnRails
[21:58:15] shathoma: I am seeking information in my new rails app if anyone has some time. It is probably a dumb question but not sure what the best way forward is.
[21:58:59] smathy: shathoma, just ask.
[21:59:39] shathoma: I am building a webapp and after some more design realized the database I have is just wrong. I want to basically start over with the database, but not all the stuff I got done setting up bootstrap, getting the css looking okay, getting the datatable stuff there and some of my controllers and views are the same with the exception of the different data members of course.
[21:59:41] rubyonrailed: has joined #RubyOnRails
[22:00:01] manfrin: what do you mean database
[22:00:20] shathoma: well i know the rails way is to sort of build the database as you go by building the models
[22:00:23] manfrin: you mean how you have modeled things, or do you mean the data, or do you mean what kind of database you've used (litesql, mysql, pg, etc)
[22:00:33] gilest: has joined #RubyOnRails
[22:00:39] bruno-: has joined #RubyOnRails
[22:01:02] shathoma: mostly how I modeled things. I am new to rails and was humming along you know with the rails generate model...that was okay. Then I realized the data was way more complex and I resorted to my crutch of drawing it out how I used to way back when.
[22:01:06] richipargo: has joined #RubyOnRails
[22:01:18] htmldrum: has joined #RubyOnRails
[22:01:31] shathoma: So now I like what I have sketched out and want to change all the models, migrations and schemas etc. Though again generating migrations seems tedious
[22:02:09] noodman: has joined #RubyOnRails
[22:02:18] smathy: shathoma, nothing wrong with sketching it out. So now you have it? Just delete your old DB and your migrations and start again.
[22:02:22] user1138_: has joined #RubyOnRails
[22:02:23] pixelhandler: has joined #RubyOnRails
[22:02:28] arooni-mobile: has joined #RubyOnRails
[22:02:40] roolo_: has joined #RubyOnRails
[22:02:53] shathoma: When you say the old db does t hat depend where that is by what i am using? I think it is an sqlite database for now... so that should mean its a flatfile to kill yes?
[22:02:58] shathoma: and the migrations folder i can nuke?
[22:03:08] smathy: shathoma, yes and yes.
[22:03:34] smathy: shathoma, then either make a single big migration with all the schema updates in it that you want, or just do it in SQL and start from there.
[22:03:52] shathoma: okay I see it, there is a migrate folder, i can take out everything there. and the development.sqlite3 and the schema.rb i kill too? just making sure before i start nuking (though it is all in git)
[22:04:02] wethu: has joined #RubyOnRails
[22:04:09] garrypolley: has joined #RubyOnRails
[22:04:20] shathoma: Ohhh when you say do it in SQL what do you mean exactly? like have a .sql file with create statements etc?
[22:04:21] bronson: has joined #RubyOnRails
[22:04:32] erik_p: has joined #RubyOnRails
[22:04:35] jenrzzz: has joined #RubyOnRails
[22:04:35] smathy: The schema.rb will be regenerated, but you can delete it too if you want, and yes - just: rm db/migrate/*
[22:04:45] smathy: shathoma, yeah, if you want.
[22:05:00] smathy: (just that you said something above which made me think you don't like the migration DSL)
[22:05:31] shathoma: no i dont mind it, i just have to admit last i touched rails was in like 1.0 and so much i feel is changed i am walking on egg shells around it. Trying to get into the "rails way" frame of mind.
[22:05:42] smathy: shathoma, if you've removed any models then you'll have some files in app/models and test (or spec) / models to clean up too.
[22:05:57] smathy: shathoma, if you used fixtures then clean up those in spec or test too.
[22:06:00] shathoma: yah. Nope the models if anything will be the same with the new data members in them
[22:06:08] user1138: has joined #RubyOnRails
[22:06:35] smathy: shathoma, you can use the model generator to make new migration files if you like (it'll skip the existing model/test/fixture files that are already created).
[22:07:13] smathy: shathoma, like: bin/rails g model Foo name:string age:integer etc.
[22:07:25] smathy: That can be easier than creating the migration file by hand.
[22:08:23] shathoma: okay. I can try that too, some tables are big and would rather use an editor but either way. I will say, for asscoiations can you use that rails g model CustomerInvoices customer_id:int ??or is that done later once you set up in the models the associations?
[22:09:18] lethjakman: has joined #RubyOnRails
[22:09:23] Mweshi: has joined #RubyOnRails
[22:11:40] ruurd: has joined #RubyOnRails
[22:11:42] Obfuscate: has joined #RubyOnRails
[22:11:56] lucha: has joined #RubyOnRails
[22:12:35] startupality: has joined #RubyOnRails
[22:12:40] smathy: or customer:references for foreign_key in the migration and belongs_to in the model :)
[22:12:57] mrbubbles: has joined #RubyOnRails
[22:13:09] smathy: shathoma, run `rails g model` for help.
[22:13:10] shathoma: ahhh :references is the way to get that in there :)
[22:13:22] shathoma: okay cool rails g model. This is awesome stuf fthanks.
[22:13:25] shathoma: *stuff ugh.
[22:13:58] smathy: shathoma, you're welcome.
[22:14:07] shathoma: I had another question, not quick and really just need to know what its called so I can google tuts on it is. Is dealing with that data on the UI side.
[22:14:16] shathoma: Like suppose customers have many invoices.
[22:14:30] shathoma: you create a customer, and then want to get taken to a webpage that lets you create an invoice or add one already created.
[22:14:53] smathy: shathoma, you're probably looking for: accepts_nested_attributes_for
[22:15:49] smathy: shathoma, it doesn't do precisely what you just asked about, ie. not a separate page, and to create new nested objects you need to do some JS stuff - but that's the right path nonetheless.
[22:16:08] shathoma: So the way I thought to do it was in the Customers create action let it save the newly created to the customer and then call an action to the Invoices create that some how passes the customer just saved to it so it has the id when it creates an invoice.
[22:16:14] jmimi: has left #RubyOnRails: ()
[22:16:22] shathoma: Okay. that is fine as long as I know what to look for.
[22:16:48] shathoma: I figured JS stuff cause that sort of nesting would be nice to have like a table pop up for the invoices that you can select or add new and then have it all be put into the right customer.
[22:17:05] shathoma: Without having a reload, all ajaxy and stuff is nice.
[22:17:15] ur5us: has joined #RubyOnRails
[22:17:16] shathoma: this is good info for me to start figuring all this stuff out.
[22:17:19] shathoma: thanks smathy
[22:17:25] smathy: shathoma, yeah, you can do that too - in which case you'd just store the customer_id in the session or something.
[22:17:40] shathoma: is that a common practice storing the customer_id?
[22:18:09] shathoma: and if its a many to many (invoices are a bad example as im guessing thats many to one) but in some cases. you could create an invoice and not have a customer id connected to it, I think this is a join table? or a has many through yes?
[22:18:15] shathoma: many to many that is
[22:18:15] smathy: No, the common practice is to create both things in the same form.
[22:18:39] shathoma: so on things that are a many to many... that is still common practice both things in the same form?
[22:19:05] smathy: shathoma, yes, there are two ways of implementing many-many in Rails: has_and_belongs_to_many or has_many :through.
[22:19:24] shathoma: I will read up on the difference.
[22:19:25] smathy: shathoma, read this to inform your decision: http://guides.rubyonrails.org/association_basics.html
[22:19:46] shathoma: slick I will do that.
[22:19:46] nickenchuggets: has joined #RubyOnRails
[22:19:57] shathoma: As far as the UI goes many to many, same form? or different?
[22:20:02] smathy: ...and yes, still common to do both in the same form, although very often you'd just create one pairing in one form, and then add one or the other depending on the use case.
[22:20:31] pixelhandler: has joined #RubyOnRails
[22:20:35] shathoma: are there any good tutorials out there that show these kinds of forms?
[22:20:43] shathoma: and are they called nested forms? or something else? (many to many forms? )
[22:21:06] shathoma: tutorial or guide, learning vocabulary is very helpful now I know what im looking for sorta.
[22:21:19] Lightsword: has joined #RubyOnRails
[22:21:27] smathy: shathoma, it really depends on how your user experience is to go. For example, for an invoice/customer pairing I can imagine many businesses where you'd only create the customer when creating their first invoice, and many other businesses where you'd have a customer record long before the first invoice (perhaps because of a long sales process).
[22:22:02] simplyianm: has joined #RubyOnRails
[22:22:30] shathoma: good point. I can come up with the use cases later though after some scrum-esque sprints and intereations and talking with the customer.
[22:23:01] shathoma: in my head I see how this works but translating that to functioning code is a whole different story :)
[22:24:23] shathoma: thanks for the help smathy I have a ton to research it looks like but at least I can get my database rebuilt.
[22:24:45] smathy: shathoma, I'm not sure of anything that covers this sort of stuff in depth - once you start playing it'll become fairly clear.
[22:24:52] smathy: shathoma, you're welcome.
[22:25:00] shathoma: Yah i just gotta dig in and get busy doing and learning. Thanks again.
[22:25:46] Radar: GOOD MORNING
[22:25:56] Radar: !botsnack
[22:25:56] helpa: Nom nom. Thanks, Radar!
[22:26:23] simplyianm: has joined #RubyOnRails
[22:28:35] nilay: has joined #RubyOnRails
[22:29:22] werelivinginthef: has joined #RubyOnRails
[22:30:53] jenrzzz: has joined #RubyOnRails
[22:30:57] elia: has joined #RubyOnRails
[22:32:59] euphoriaa: has joined #RubyOnRails
[22:36:18] baweaver: has joined #RubyOnRails
[22:37:21] MrWharfsnort: has joined #RubyOnRails
[22:37:26] VeryBewitching: has joined #RubyOnRails
[22:37:32] MrWharfsnort: has left #RubyOnRails: ()
[22:37:42] Papierkorb: Radar: OOHAYOOO
[22:38:01] Papierkorb: I guess you don't get why I yell that, but that's not stopping me from continuing doing so
[22:38:17] VeryBewitching: Radar: Did using .isc work the other day with icalendar?
[22:38:25] Radar: VeryBewitching: .ics, yes
[22:38:33] VeryBewitching: Radar: er.. yes :D
[22:38:38] Radar: Papierkorb: M.A.S.H reference?
[22:38:44] NodeNagant: has joined #RubyOnRails
[22:41:48] Papierkorb: Radar: My search for the most annoying YouTube video of some person yelling it failed. Meh. TL;DR: Short form of "Good Morning" in JPN
[22:41:59] Radar: Papierkorb: haha :)
[22:43:11] jenrzzz: has joined #RubyOnRails
[22:45:38] nickenchuggets: has joined #RubyOnRails
[22:47:34] skroon: has joined #RubyOnRails
[22:49:30] FernandoBasso: has joined #RubyOnRails
[22:49:46] Fernando-Basso: has joined #RubyOnRails
[22:50:14] jamgood96: How do people handle Redis failures in their apps? I see very few examples of people using begin/rescue for their redis calls
[22:50:37] jamgood96: I ask because my app didn't use begin/rescue anywhere, and now that redis is behaving poorly (aws) the app is crumbling
[22:51:00] bricker: jamgood96: The same way you handle MySQL failures
[22:51:17] sloggerkhan: My app pretty much can't run is Redis and MySQL aren't working.
[22:51:29] smathy: jamgood96, I've only ever run redis locally, to avoid problems getting to it.
[22:52:05] bricker: jamgood96: that is to say, your app isn't responsible for managing failures, you instead need to make your db/cache clusters resilient to failure
[22:52:17] bricker: with load balancers, failover, sentinels, etc.
[22:52:38] eggoez: has joined #RubyOnRails
[22:53:03] jamgood96: bricker: so I should not be adding in begin/rescue blocks around my redis calls? the problem with that is that we have seen redis timeout, and this has created issues with the app because it didn't fail gracefully
[22:53:38] jenrzzz_: has joined #RubyOnRails
[22:53:59] bricker: jamgood96: you should be trying to stop Redis from timing out, that's not normal and you can't be running a redis server in production that randomly times out
[22:54:16] nickenchuggets_: has joined #RubyOnRails
[22:54:29] jamgood96: bricker: any suggestions on how to determine why it is timing out? It's an ElastiCache instance on AWS (i've reached out to them)
[22:54:39] AnoHito_: has joined #RubyOnRails
[22:55:39] nym: has joined #RubyOnRails
[22:55:56] smathy: jamgood96, if you need to, just make your own class that handles all your redis interaction, and make it rescue failures and do something sensible.
[22:56:22] bricker: jamgood96: you can check the redis monitor to see if there is any info there
[22:56:25] smathy: (ie. don't put `rescue`s all through your code)
[22:56:38] bricker: perhaps you're hitting max connections
[22:56:58] jamgood96: smathy: that's what I was thinking i should do, but am somewhat struggling to figure out how to implement something like that. any examples that would be helpful?
[22:57:36] jamgood96: bricker: it's possible, but what is weird is that i got a timeout first thing in the morning after the server sat there overnight with nearly zero load
[22:57:57] WillAmes: has joined #RubyOnRails
[22:58:02] jamgood96: bricker: so i don't know how that could be too many connections, unless i've totally configured it wrong within rails and it's not dropping connections ever
[22:58:23] bricker: I have no idea
[22:58:27] jenrzzz: has joined #RubyOnRails
[22:58:36] Radar: !debug-proxy
[22:58:36] helpa: This kind of issue is hard to debug remotely. You should hire someone who can look at your code and figure it out. We are most likely unable to help you in this situation.
[23:00:11] christiandsg: has joined #RubyOnRails
[23:00:43] smathy: jamgood96, you're making a single connection at some point in time to a redis DB and expecting it to remain connected forever?
[23:01:16] ur5us: has joined #RubyOnRails
[23:01:36] martinbjeldbak: has joined #RubyOnRails
[23:01:46] quazimodo: has joined #RubyOnRails
[23:02:11] towski__: has joined #RubyOnRails
[23:02:15] jamgood96: i'm initializing the connection in `initializers/redis.rb` like nearly all the documentation i've seen says to do
[23:02:32] jamgood96: smathy: something like `$redis = Redis.new()`
[23:02:57] ur5us_: has joined #RubyOnRails
[23:02:58] jamgood96: smathy: then i'm calling `$redis.hget(....)` or similar in my controllers
[23:04:28] sloggerkhan: has left #RubyOnRails: ()
[23:04:37] sloggerkhan: has joined #RubyOnRails
[23:04:50] baweaver: has joined #RubyOnRails
[23:05:51] noodman: has joined #RubyOnRails
[23:07:27] gentle_giant: has joined #RubyOnRails
[23:11:02] a346: has joined #RubyOnRails
[23:11:35] iamjarvo: has joined #RubyOnRails
[23:13:51] smathy: jamgood96, ok, so yeah I'd use a simple class like this: https://gist.github.com/smathy/61f405853f7b5270d209
[23:14:33] Ropeney: has joined #RubyOnRails
[23:14:50] jamgood96: smathy: that makes sense. so do that instead of using the initializer?
[23:14:52] smathy: jamgood96, it's probably still going to fail, but at least it'll try to reconnect (although I'd be surprised if whatever redis driver you're using doesn't already do this) - and you can do something in the rescue.
[23:15:18] jamgood96: smathy: i'm using `redis-rb` for connecting
[23:15:52] jamgood96: smathy: i've also been looking at the `connection_pool` gem. i wonder if this would be a good solution? https://github.com/mperham/connection_pool
[23:17:40] smathy: jamgood96, that solves a different problem - you'd still want to do something when you get these exceptions.
[23:17:42] christiandsg: has joined #RubyOnRails
[23:18:17] smathy: jamgood96, is there a good reason that you're running redis on a separate host to your app?
[23:18:27] jamgood96: smathy: but i was thinking that maybe using something like that gem would better handle the connections, instead of me initializing the connection once in the initializer
[23:19:00] drale2k: has joined #RubyOnRails
[23:19:36] jamgood96: smathy: because we're running around 4 separate servers for the app, a very large DB instance and a very large redis instance
[23:19:45] jamgood96: smathy: expecting 5k/sec requests
[23:20:33] smathy: ...and you're using the ruby driver, and not using sentinel?
[23:20:52] smathy: jamgood96, do you have a systems/ops guy?
[23:21:11] jamgood96: smathy: correct, i'm using the ruby driver
[23:21:20] jamgood96: smathy: i'm wearing all the hats for this project, unfortunately
[23:21:24] smathy: jamgood96, you may want to rethink that.
[23:21:27] smathy: ...both of those.
[23:21:36] jamgood96: smathy: i know. too late unfortunately at this point
[23:21:41] smathy: Anyone expecting 5k/sec can afford to hire a second hat wearer.
[23:22:04] Radar: 5k/sec? dayumn
[23:22:27] Radar: although it's expected numbers, which are almost always bullshit
[23:22:40] mike___1234: has joined #RubyOnRails
[23:22:41] smathy: So anyway, that's a long winded way of saying bricker was right, half an hour ago. This is not the app dev responsibility.
[23:22:49] jamgood96: we've already hit 1500/sec without much of an issue
[23:23:11] workmad3: has joined #RubyOnRails
[23:23:13] Radar: Across all our sites we're receiving only ~1k requests per minute.
[23:23:15] smathy: Seriously, hire an systems guy.
[23:23:18] ur5us: has joined #RubyOnRails
[23:23:20] urlgrey: has joined #RubyOnRails
[23:23:20] jamgood96: smathy: i appreciate it a ton
[23:23:27] Radar: i can't imagine that being 300x more load
[23:23:56] jamgood96: smathy: we have a resource that i've tapped for looking into this issue. unfortunately he said it'd be most helpful to ditch elasticache and spool up our own redis server so that he could see exactly what is going on
[23:24:16] smathy: ...and seriously consider using hiredis
[23:24:39] jamgood96: Radar: thank god the peak loads are known occurrences and are short
[23:24:43] jamgood96: it's not sustained
[23:24:44] Radar: jamgood96: So maybe you should follow his advice? What's wrong with spinning up another service to run Redis on it?
[23:24:44] martinbjeldbak: has joined #RubyOnRails
[23:24:52] smathy: jamgood96, well, there's not a lot of point getting a systems guy unless you trust him to architect your systems.
[23:24:57] Radar: If elasticache isn't working...
[23:25:29] jamgood96: Radar: yeah, it's been a thought as of recently
[23:25:43] smathy: (although, the reasoning that he can't see exactly what's going on smells fishy)
[23:25:47] Radar: Seems like a good start imo
[23:25:59] bungoman: has joined #RubyOnRails
[23:28:45] simplyianm: has joined #RubyOnRails
[23:29:00] user1138: has joined #RubyOnRails
[23:29:29] smathy: I hate how the rescue-without-begin-end syntax is only available in methods, not in all blocks.
[23:30:16] GeissT: has joined #RubyOnRails
[23:32:14] nfk: has joined #RubyOnRails
[23:36:28] filipechagas: has joined #RubyOnRails
[23:37:04] benlieb: has joined #RubyOnRails
[23:37:39] JeramyRR: has joined #RubyOnRails
[23:42:36] mdcox: smathy: Never realized that...wonder if that simplifies or complicates the parser/lexer.
[23:42:50] quazimodo: has joined #RubyOnRails
[23:43:31] arooni-mobile: has joined #RubyOnRails
[23:43:31] stantonnet: has joined #RubyOnRails
[23:43:41] superlou: has joined #RubyOnRails
[23:43:51] waka: has joined #RubyOnRails
[23:43:55] smathy: mdcox, I'm sure there's a good reason for it - but meh! Oh, you can also use that syntax in a module or class definition.
[23:45:30] pontiki: has joined #RubyOnRails
[23:49:03] charliesome: has joined #RubyOnRails
[23:52:35] Papipo: has joined #RubyOnRails
[23:53:26] Papipo: Anybody knows if there is a gem to generate javascript models from ActiveRecord ones? for angular, backbone, whatever. I want to use something like that to generate a JS admin UI automatically
[23:53:37] Radar: don't be lazy
[23:54:35] Papipo: My models are dynamic :)
[23:55:00] pontiki: i thought that's what AR::Serializers were for...
[23:55:23] Aeyrix: > generate a JS admin UI automatically
[23:55:45] Aeyrix: I can't imagine that being even half as good as ActiveAdmin.
[23:55:47] nickenchuggets_: has joined #RubyOnRails
[23:55:55] Aeyrix: And we all know how much this channel loves ActiveAdmin.
[23:56:06] Papipo: ActiveAdmin is fine for lots of projects, not this one
[23:56:07] NodeNagant: has joined #RubyOnRails
[23:56:18] Aeyrix: Neither is your proposal.
[23:56:19] Papipo: I use it, actually
[23:56:22] Aeyrix: Your proposal is good for no projects.
[23:56:26] Radar: !activeadmin
[23:56:26] helpa: *makes a cross with fingers and says a prayer*
[23:56:29] Aeyrix: Except maybe those that use MongoDB.
[23:56:36] Aeyrix: Because they're doomed for equal failure anyway.
[23:56:51] Papipo: Aeyrix: you know nothing about my project, what are you talking about
[23:57:04] pontiki: real railser do it in the console
[23:57:06] webguynow: has joined #RubyOnRails
[23:57:14] Aeyrix: pontiki: :^)
[23:57:36] Aeyrix: Shit I left this coffee for like one minute too long.
[23:57:39] Aeyrix: It's no longer ideal temp.
[23:57:44] pontiki: don't sweat it, Papipo
[23:57:52] pontiki: but do look at Serializers
[23:58:03] pontiki: they do everything i've needed
[23:58:04] lethjakman: has joined #RubyOnRails
[23:58:06] Papierkorb: How are you supposed to use params.require()? I have multiple required parameters, but it only accepts a single one. Should I just call it multiple times?
[23:58:25] Papipo: Sure, I might just end up writing some custom JS code to handle DTOs coming from serializers
[23:58:29] hansv: has joined #RubyOnRails
[23:58:39] Papipo: I was just wondering if there was something already out there
[23:59:07] hansv: has left #RubyOnRails: ()
[23:59:14] drale2k: has joined #RubyOnRails
[23:59:45] waka: has joined #RubyOnRails