« Back to channel list

#RubyOnRails - 22 February 2016

« Back 1 day Forward 1 day »
[00:02:46] mrbubbles: has joined #RubyOnRails
[00:03:22] Kryptonical: has joined #RubyOnRails
[00:03:53] ElFerna: has joined #RubyOnRails
[00:04:03] ur5us: has joined #RubyOnRails
[00:04:05] KensoDev: has joined #RubyOnRails
[00:07:31] chipotle: has joined #RubyOnRails
[00:08:57] DEA7TH: I'm transforming my data for visualization - this code is only tied to the visualization pages. It's a fair amount of code. Should it go in a controller, since there is no logic building up on it?
[00:09:26] sudoubuntu: has joined #RubyOnRails
[00:15:30] pyemkey: has joined #RubyOnRails
[00:15:36] ppinkerton: has joined #RubyOnRails
[00:16:25] allcentury: has joined #RubyOnRails
[00:16:33] fedexo: has joined #RubyOnRails
[00:17:05] urbanmonk: has joined #RubyOnRails
[00:18:13] urbanmonk: has left #RubyOnRails: ()
[00:18:36] urbanmonk: has joined #RubyOnRails
[00:19:56] fedexo: has joined #RubyOnRails
[00:20:24] urbanmonk: has left #RubyOnRails: ()
[00:20:46] urbanmonk: has joined #RubyOnRails
[00:21:00] nerium: Is there a way to include a concern into all models?
[00:21:37] Radar: nerium: ActiveRecord::Base.send :include, Concern
[00:21:46] Radar: nerium: are you 100% sure you want it for all models?
[00:21:51] Radar: explicit includes are better than implicit.
[00:22:05] Trynemjoel: has joined #RubyOnRails
[00:22:06] Radar: DEA7TH: Why shouldn't it go into a controller?
[00:22:57] DEA7TH: Radar: It feels unintuitive because I'm used to putting large-ish amounts of code, and code for transforming my models, into models.
[00:23:37] nerium: Radar: I’ve this concern that sets the correct time zone on custom columns https://gist.github.com/oleander/cfdae21612c6e82c2348 The problem is that the code you posted (which I tried before) adds a class method to ActiveRecord::Base, not the model
[00:23:44] shilon: has joined #RubyOnRails
[00:24:12] Radar: nerium: Which method is added as a class method?
[00:24:21] Radar: nerium: Could it be this method https://gist.github.com/oleander/cfdae21612c6e82c2348#file-time-rb-L4-L9
[00:24:33] Radar: DEA7TH: Then abstract it out to a class if it's bothering yuo.
[00:24:44] nerium: Radar: Yes, that’s correct
[00:25:12] nerium: Radar: i need to add include Concern; columns_to_timezone to all of my models
[00:27:03] nerium: It should be ”timezone_columns”, not ”columns_to_timezone”
[00:29:12] Radar: nerium: Might it being added as a class method because it's inside the class_methods block?
[00:30:05] Radar: And so if you don't want it to be a class method, what should you do
[00:30:11] droptone: I've deployed active_model_serializers and its at 0.9.4, and yet in my controller code when I leverage ACtiveMOdel::ArraySerializer.new I get uninitialized constant ActiveModel::ArraySerializer
[00:30:41] Jasaka: has joined #RubyOnRails
[00:30:49] droptone: And yes it's in my gemfile and I've bundle installed, on the web people who have this issue find out they don't have the gem in their Gemfile.
[00:30:57] droptone: I of course have deployed the gem properly.
[00:31:09] n1lo: has joined #RubyOnRails
[00:31:21] jtong: has joined #RubyOnRails
[00:31:48] monque: hey guys, is there a way to visualize queries in rails console in some table like format ?
[00:32:00] Radar: droptone: Did you restart your server?
[00:32:16] Radar: monque: Do you have an example?
[00:32:29] droptone: lol, Jesus, yes that's it.
[00:32:37] nerium: Radar: Why dont I want it as a class method? I’m not sure you understand my problem
[00:32:39] droptone: Thank you Radar, apparently I had a stroke.
[00:32:49] Radar: The problem is that the code you posted (which I tried before) adds a class method to ActiveRecord::Base, not the model
[00:32:54] Radar: nerium: and I quote.
[00:33:04] monque: Radar: when i query via User.all it outputs all in a single line, i want something like each item in a line
[00:33:08] Radar: nerium: If it's included into ActiveRecord::Base then the method will be available on all subclasses.
[00:33:15] monque: i saw that somewhere before
[00:33:54] Radar: monque: perhaps pry-rails might give you the output you're looking for?
[00:34:07] nerium: Radar: That make sense, but `columns_to_timezone` is always null as it looks like each class is overriding the value
[00:34:29] nerium: I’ll create a smaller example, hold on
[00:34:55] Radar: nerium: Wouldn't it only be set if https://gist.github.com/oleander/cfdae21612c6e82c2348#file-time-rb-L6-L9 this method was called?
[00:35:48] nerium: Radar: It is called. I created a concern that calls it and includes it into AR::Base
[00:36:06] Radar: nerium: small reproducible example would be great. I'm not understanding something.
[00:36:15] nerium: Radar: I’m on it
[00:38:06] monque: Radar: i found what i looked for - no gem needed
[00:38:16] Radar: monque: oh yeah? What did you end up with?
[00:38:16] monque: just need to put a y before: example: y User.all
[00:38:29] monque: just wanted to share with u ;)
[00:39:07] Radar: Aha :) That's a similar output to pry. Pry has less !ruby/object... through it though.
[00:39:15] one_zero: has joined #RubyOnRails
[00:39:17] bronson: has joined #RubyOnRails
[00:39:31] Trynemjoel: has joined #RubyOnRails
[00:39:48] nettoweb: has joined #RubyOnRails
[00:40:17] monque: thx 4 info : )
[00:42:34] nerium: Radar: https://gist.github.com/oleander/52e87d345b0b19e82886
[00:43:27] monque: Radar: awesome_print is even better - using that from now on !
[00:44:37] Radar: nerium: this method isn't being called https://gist.github.com/radar/ad486807f756a4936e88#file-say-rb-L5-L7
[00:44:41] Radar: nerium: Oh sorry, yes it is. Line 24.
[00:45:32] Radar: nerium: I think you might want to use cattr_accessor or class_attribute (I can never remember which)
[00:45:37] Radar: https://gist.github.com/radar/ad486807f756a4936e88#file-say-rb-L10-L12
[00:45:46] elementz: Hi all. Could someone be so awesome and help me figure out a rather pressing issue?
[00:45:55] elementz: https://gist.github.com/jottr/d3d772c3be70aa149fad
[00:46:13] elementz: I am trying to upload a file to S3 via carrierwave
[00:47:04] elementz: I am not sure I am doing it corrctly though, since the files never show up on S3.
[00:47:18] nerium: Radar: That sort of works, but I’m getting some output, but it’s the same output for all classes
[00:47:28] ppinkerton: has joined #RubyOnRails
[00:47:32] nerium: Comment.first.say prints the same as User.first.say
[00:47:43] elementz: Here's where I try and store the file: https://gist.github.com/jottr/d3d772c3be70aa149fad#file-clock-rb-L38
[00:47:54] nerium: Which from the looks if it means that the message is being to AR::Base, not the model
[00:47:55] Radar: nerium: right. Are you using cattr_accessor or class_attribute for that?
[00:48:00] nerium: cattr_accessor
[00:48:36] nerium: It’s the samething with class_attribute
[00:48:42] Radar: Hm, I am not sure then sorry.
[00:49:01] maxdoubt: has joined #RubyOnRails
[00:50:04] maxdoubt: i’m trying to figure out AREL + AR, i have an AREL select statement, but am trying to figure out if I can include that with an AR query. eg: MyModel.select(arel_query.to_sql) ?
[00:51:19] Radar: elementz: !rule10
[00:51:19] helpa: elementz: Do not beg / plead with people to help you. This includes asking questions like "Any ideas?" after posting your original question.
[00:51:21] maxdoubt: or would i have to do… MyModel.find_by_sql(arel_query.to_sql) … ideally i’d like to chain other things into this query, MyModel.select(arel_query.to_sql).where(field: params).order(field: ASC). etc.
[00:51:24] Radar: elementz: If it's pressing, hire a consultant.
[00:51:37] elementz: Radar: ok. My bad. Sorry
[00:52:13] Radar: elementz: Do your logs have any information about it?
[00:52:18] Radar: What does storage.store! return when it's called?
[00:53:04] Tokenizer: has joined #RubyOnRails
[00:53:06] elementz: Radar: This is running on heroku, sadly there is nothing in the logs...
[00:53:20] Radar: elementz: Can you run it locally and try to reproduce it?
[00:53:34] ppinkerton: has joined #RubyOnRails
[00:53:42] matthewd: maxdoubt: If you definitely need to use a full arel query, and not just fragments, you might try MyModel.from(..)
[00:54:34] elementz: Radar: I would like to. Any suggestions, how I can properly set up the paths at the top of my file? I am currently hard coding it for use on heroku, which is most likely not the correct way of doing it: https://gist.github.com/jottr/d3d772c3be70aa149fad#file-clock-rb-L4
[00:54:46] sevenseacat: has joined #RubyOnRails
[00:54:51] maxdoubt: matthewd: yeah, i’ve been trying to think about how to break my arel query into smaller parts… but i think its such a bizarre complicated query that it would be challenging
[00:55:17] Radar: elementz: what in that file requires Rails' boot and environment files to be loaded?
[00:55:25] Radar: elementz: is it just StorageUploader?
[00:55:51] matthewd: maxdoubt: Does it involve complex grouping and/or window functions?
[00:55:53] elementz: No, There's more stuff in there, which I left out to make the script more readable
[00:56:06] Radar: elementz: I would recommend removing those two lines and then run it through "rails runner clock.rb""
[00:56:34] cabargas: has joined #RubyOnRails
[00:57:01] jonjoe: "bundle" ... goes and makes coffee
[00:58:13] maxdoubt: matthewd: http://paste.ofcode.org/vmaRyUmEQBeEFCFJV2Cgdj
[00:59:11] elementz: Radar: Ok. Ran it locally. It seems it's not writing the json file at all.
[00:59:25] Radar: elementz: That'd be a good reason for it to not upload it.
[00:59:54] Radar: elementz: with rails runner you'd need to strip out these lines: https://gist.github.com/jottr/d3d772c3be70aa149fad#file-clock-rb-L10-L16
[01:00:02] Radar: elementz: Just run it without the Clockwork wrapping
[01:01:02] elementz: Radar Hm. Not true. It did create the json and populate it.
[01:03:23] elementz: Radar: https://gist.github.com/jottr/6e5ebf1579da00e0e620
[01:03:46] Radar: elementz: that seems to be you running clockwork
[01:04:13] Radar: require './config/boot'
[01:04:13] Radar: require './config/environment'
[01:04:15] elementz: Hold on. So I'll have to extract it, and then run the rails runner.
[01:04:46] elementz: I'm a bit slow. It's quite late over here.
[01:04:53] fedexo: has joined #RubyOnRails
[01:10:28] IFrank00: has joined #RubyOnRails
[01:14:24] elementz: Radar: Getting closer: https://gist.github.com/jottr/c8e512b324d433d610af
[01:14:57] Radar: Pass the upload method a File object instead of a String one.
[01:15:15] Dreamer3: has joined #RubyOnRails
[01:15:18] Radar: quazimodo: yes my son?
[01:15:29] quazimodo: daddy, idon't wanna go to school today
[01:15:59] Radar: oh dear looks like you've come down with the dunwannas. Dr. Radar prescribes a cup of concrete.
[01:16:11] quazimodo: i need to hire a new monkey
[01:16:35] quazimodo: a senior would be a welcome, welcome,weeeelllllcome addition
[01:16:36] nerium: Radar: This doesn’t seam to work either https://gist.github.com/oleander/625681f715ccb1e95abd
[01:16:53] nerium: Radar: set_timezone is never fired :/
[01:17:06] Ropeney: quazimodo, a monkey?
[01:17:28] sevenseacat: seniors are monkeys?
[01:17:31] Maletor: has joined #RubyOnRails
[01:19:03] Trynemjoel: has joined #RubyOnRails
[01:19:56] Ropeney: sevenseacat, juniors are monkeys?
[01:20:04] sevenseacat: devs are monkeys?
[01:20:14] Radar: being called a monkey makes me feel great
[01:20:27] maxdoubt: matthewd: thanks, the MyModel.from appears to be working perfectly!
[01:21:10] sevenseacat: whew, good thing I'm not a junior or senior!
[01:26:57] quazimodo: nah, i'll probably get a junior but we need a senior
[01:27:26] quazimodo: ya juniors are monkeys they throw poop all over the place
[01:27:42] quazimodo: it's cute you nurture them
[01:27:48] quazimodo: still monkeys tho
[01:28:12] Ropeney: quazimodo, seems a bit arrogant
[01:29:25] quazimodo: Ropeney: nah it's not like that
[01:30:00] batasrki: has joined #RubyOnRails
[01:31:07] Scripore: has joined #RubyOnRails
[01:32:08] quazimodo: anyway it's not like I don't program too for a living
[01:33:06] sevenseacat: just because you're insulting yourself too, i dont think that makes it okay
[01:33:28] sevenseacat: batasrki: morning
[01:33:34] batasrki: sevenseacat: evening
[01:34:02] batasrki: I need some help with Devise mailers and Mandrill
[01:34:22] batasrki: firstly, anyone know if those two jive?
[01:34:43] quazimodo: batasrki: seem to work fine for us
[01:34:46] quazimodo: what's wrong?
[01:34:59] sevenseacat: don't see why they should have any immediate issues
[01:35:25] SteenJobs: has joined #RubyOnRails
[01:35:31] batasrki: I'm just trying to get a reset password e-mail sent through Mandrill's SMTP settings, but am unable to confirm that within the dev environment
[01:35:45] robbyoconnor: has joined #RubyOnRails
[01:36:11] duderono_: has joined #RubyOnRails
[01:36:21] batasrki: it is just a matter of setting Mandrill's SMTP info as config.action_mailer settings, right?
[01:38:33] batasrki: yeah, it's so weird that I'm not seeing the e-mails coming through
[01:38:56] batasrki: Within the dev environment setup, do you use a test API key or a production one?
[01:39:36] flashpoint9: has joined #RubyOnRails
[01:41:04] sevenseacat: within dev, i dont use external mail services
[01:41:38] quazimodo: batasrki: i use letter_opener
[01:41:54] quazimodo: as sevenseacat said it's fairly uncommon to hook up the mailer
[01:42:05] Trynemjoel: has joined #RubyOnRails
[01:42:08] sevenseacat: i tend to use mailcatcher, but letter_opener is similar
[01:42:15] quazimodo: although if you set it up properly there's no reason it wouldn't just work
[01:42:23] quazimodo: unless you have weird port/address stuff going on?
[01:42:26] bronson: has joined #RubyOnRails
[01:42:34] quazimodo: any errors?
[01:44:48] sled: has joined #RubyOnRails
[01:45:10] batasrki: using port 587 instead of 25, but I set start_tls to true
[01:45:15] sevenseacat: gist the logs of what happens when you send an email?
[01:45:20] batasrki: mandrill's docs say that's cool
[01:45:49] SteenJobs: has joined #RubyOnRails
[01:46:15] quazimodo: hey by chance does anyone here use Rally fro their project management?
[01:46:31] quazimodo: can't figure out a nice workflow with it
[01:47:19] batasrki: https://gist.github.com/batasrki/040d09a65399177f54b2
[01:48:14] Brando753: has joined #RubyOnRails
[01:48:53] sevenseacat: batasrki: do you have raise_delivery_errors set to true in your development.rb ?
[01:49:38] batasrki: nope, turning that on. Thanks, sevenseacat
[01:50:12] batasrki: the thing is that when I use Mandrill, I make standalone Ruby classes that use the API objects
[01:50:14] quazimodo: batasrki: might be worth investing in a mailer only logger too
[01:50:26] quazimodo: to keep your logs a bit more readable, email logs take up heaps of space
[01:50:38] quazimodo: batasrki: what's wrong with that?
[01:52:03] batasrki: quazimodo: nothing, I just don't want to rewrite Devise mailers, because customizing Devise things is always fraught with peril
[01:52:22] batasrki: I would prefer to rip Devise out completely, but for this particular project, that's wasted effort
[01:52:45] quazimodo: yeah that's fine
[01:52:55] _djbkd: has joined #RubyOnRails
[01:53:20] quazimodo: i agree generally, though I've never had too many issues with devise
[01:53:40] batasrki: the issues, for me, come when I need to customize what it does
[01:54:25] batasrki: oh, there we go
[01:55:48] sevenseacat: now to fix and everyine is happy
[01:55:54] batasrki: probably the TLS thing, trying with unencrypted setup
[01:58:32] chipotle: has joined #RubyOnRails
[01:58:55] Bloomer: has joined #RubyOnRails
[02:00:30] aloneintheworld: has joined #RubyOnRails
[02:04:50] nachoman: why habtm is still in rails?
[02:05:29] chipotle: has joined #RubyOnRails
[02:05:31] mikeiniowa: has joined #RubyOnRails
[02:06:25] unforgiv3n: has joined #RubyOnRails
[02:07:05] sevenseacat: because its useful?
[02:07:06] Trynemjoel: has joined #RubyOnRails
[02:07:16] arBmind: has joined #RubyOnRails
[02:07:36] nachoman: I think is unnecesary, has_many through can do the same
[02:08:35] sevenseacat: with extra unnecessary cruft, sure
[02:09:18] fryguy: nachoman: you should take a look at the source code for what habtm does
[02:09:34] monque_: has joined #RubyOnRails
[02:10:09] maxx88: has joined #RubyOnRails
[02:10:50] maxdoubt: has joined #RubyOnRails
[02:13:19] rubyonrails364: has joined #RubyOnRails
[02:14:40] jeanlinux: has joined #RubyOnRails
[02:14:55] sled: has joined #RubyOnRails
[02:15:04] eljimmy: has joined #RubyOnRails
[02:15:48] quazimodo: nachoman: is ok?
[02:15:57] nachoman: ok I think it is a little more efficient :)
[02:16:03] sevenseacat: you don't have to use it if you don't want :) though I'll grumble at you if you define a bunch of little models for the sake of it, just to use HMT instead of HABTM
[02:16:23] sevenseacat: i once ripped a dozen of those out of a single app
[02:17:21] blackmesa: has joined #RubyOnRails
[02:17:36] pyemkey: has joined #RubyOnRails
[02:18:17] nachoman: ok I understood :)
[02:19:00] rakm: has joined #RubyOnRails
[02:19:09] Bloomer: has joined #RubyOnRails
[02:24:13] ensyde_: has joined #RubyOnRails
[02:24:59] Guest34101: has joined #RubyOnRails
[02:39:19] Dreamer3: has joined #RubyOnRails
[02:41:42] cabargas: has joined #RubyOnRails
[02:45:02] bronson: has joined #RubyOnRails
[02:47:38] sheepman: has joined #RubyOnRails
[02:47:55] Dreamer3: has joined #RubyOnRails
[02:48:17] GriffinHeart: has joined #RubyOnRails
[02:55:20] JenElizabeth: has joined #RubyOnRails
[02:56:08] sudoubuntu: has joined #RubyOnRails
[02:56:10] GriffinHeart: has joined #RubyOnRails
[03:05:20] swistak35: has joined #RubyOnRails
[03:05:55] Maletor: has joined #RubyOnRails
[03:06:02] _Tariq: has joined #RubyOnRails
[03:06:56] jeanlinux: has joined #RubyOnRails
[03:08:34] Technodrome: has joined #RubyOnRails
[03:09:22] aDigitalDrwin: has joined #RubyOnRails
[03:10:02] aDigitalDrwin: has joined #RubyOnRails
[03:11:57] duncannz: has joined #RubyOnRails
[03:12:24] sudoubuntu: has joined #RubyOnRails
[03:13:48] zworks: has joined #RubyOnRails
[03:19:26] blackmesa: has joined #RubyOnRails
[03:20:47] scribbles_: has joined #RubyOnRails
[03:24:32] rogue_koder: has joined #RubyOnRails
[03:26:51] akshat: has joined #RubyOnRails
[03:31:00] chouhoulis: has joined #RubyOnRails
[03:31:54] akshat: has joined #RubyOnRails
[03:34:28] Toledo|gone: has left #RubyOnRails: ()
[03:35:20] nattyPablo: has joined #RubyOnRails
[03:35:56] DmitryBochkarev: has joined #RubyOnRails
[03:36:08] akshat_: has joined #RubyOnRails
[03:38:20] akshat_: has joined #RubyOnRails
[03:41:32] akshat: has joined #RubyOnRails
[03:43:36] _Tariq: has joined #RubyOnRails
[03:44:17] maxdoubt: has joined #RubyOnRails
[03:44:48] akshat_: has joined #RubyOnRails
[03:45:33] pawnbox: has joined #RubyOnRails
[03:46:23] _Tariq: has joined #RubyOnRails
[03:51:35] akshat: has joined #RubyOnRails
[03:57:40] pawnbox: has joined #RubyOnRails
[03:59:20] Dreamer3: has joined #RubyOnRails
[04:01:30] GriffinHeart: has joined #RubyOnRails
[04:02:06] ElSif: has joined #RubyOnRails
[04:03:59] malcolmva: has joined #RubyOnRails
[04:04:41] rohit: has joined #RubyOnRails
[04:04:59] Dreamer3: has joined #RubyOnRails
[04:06:43] safetypin: has joined #RubyOnRails
[04:07:16] chagel: has joined #RubyOnRails
[04:10:50] FlyingChicken: has joined #RubyOnRails
[04:12:24] braincrash: has joined #RubyOnRails
[04:12:36] Dreamer3: has joined #RubyOnRails
[04:13:34] IrishGringo: has joined #RubyOnRails
[04:13:42] arup_r: has joined #RubyOnRails
[04:13:44] droptone: Does anyone here have Angular experience?
[04:14:00] nerium: Is there a way to merge all migration files into one?
[04:14:15] droptone: I'm got my Rails 4.2 API successfully returningj json, I'm trying to write a factory that executes a get fan profile via the fan profile show controller action
[04:14:29] droptone: And then uses the values returned as the placholders for the form to edit the fan profile
[04:14:35] nerium: droptone: Try #angularjs
[04:15:17] arup_r: nerium: Why you want to merge all them? That is really a worst idea, but I would like to hear the reasons..
[04:15:38] rohit_: has joined #RubyOnRails
[04:15:53] nerium: arup_r: Everytime the db is flushed compications arises like missing tables, columns, indexes and so froth
[04:16:25] droptone: lol, thanks.
[04:17:04] _Tariq: has joined #RubyOnRails
[04:17:14] nerium: arup_r: I’m also not doing any rollbacks, so I dont need them. One snapshot from now on and beoynd is enough
[04:18:12] nerium: I currently have 1091 files in my db/migrate folder, so I think it’s time
[04:18:16] sevenseacat: droptone: factories don't access conroller actions
[04:18:19] sevenseacat: droptone: factories don't access controller actions
[04:18:28] sevenseacat: this isnt slack where I can edit messages, derp
[04:18:42] Scripore: has joined #RubyOnRails
[04:18:57] droptone: Factories / Services contain http calls to back end APIs that can acces then return json data
[04:19:01] droptone: Can contain*
[04:19:30] droptone: The project is simple, I've been working with guys in here and in #angularjs for the past week off and on. The issue is, specifically
[04:19:58] sevenseacat: ok, you're not using the word factory in the traditional rails usage
[04:20:09] droptone: I'm porting a Rails 4.2.x site to an SPA, and I've got auth working via AngularDevise, and I've got it so when the user auths, they're redirected from the home state to the proper state based on User.type
[04:20:26] pyemkey: has joined #RubyOnRails
[04:20:50] blackmesa: has joined #RubyOnRails
[04:20:55] droptone: In this situation, the User.type is "Fan", and so it loads the fan_profile state, which injects the view partial which simply contains a form
[04:21:12] sevenseacat: not sure how this relates to rails
[04:21:49] droptone: lol, yes sevenseacat, various aspects of it relate to Rails, and it's worth a shot asking in here since at various points over the past week or more someonein here has been knowledgable at this type of thing.
[04:21:58] _Tariq: has joined #RubyOnRails
[04:21:59] droptone: So I ask and I kind of let the passive aggressiveness slide by
[04:22:16] droptone: But obviously at this specific time no one in here is familiar with such type of activity, so I'll wait
[04:22:22] krz: has joined #RubyOnRails
[04:22:47] sevenseacat: feel free. you will get warned every time you stray totally off-topic though.
[04:22:57] ppinkerton: has joined #RubyOnRails
[04:27:48] pawnbox: has joined #RubyOnRails
[04:32:09] chouhoulis: has joined #RubyOnRails
[04:33:00] maxdoubt: has joined #RubyOnRails
[04:33:13] Dreamer3: has joined #RubyOnRails
[04:33:36] baweaver: ACTION raises eyebrow
[04:34:10] pawnbox: has joined #RubyOnRails
[04:38:03] indikator: has joined #RubyOnRails
[04:41:47] Arcaire: Anyone know why I'm getting chruby shitting out random errors when I'm not even actively using it?
[04:41:56] Arcaire: I get things like "chruby: unknown Ruby: 2.1.8" when I run `ls`
[04:42:06] sevenseacat: because the ruby is unknown?
[04:42:09] rakm: has joined #RubyOnRails
[04:42:14] Arcaire: Except .ruby-version is ruby-2.3.0, which is installed.
[04:42:44] braincra-: has joined #RubyOnRails
[04:42:47] sevenseacat: well, somewhere you're specifying 2.1.8, either in your .bashrc, or a more specific .ruby-version
[04:43:07] Arcaire: # cat ~/.ruby-version
[04:43:07] Arcaire: ruby-2.3.0
[04:43:22] Arcaire: # grep "ruby" /etc/zsh/zshrc
[04:43:22] Arcaire: source /usr/local/share/chruby/chruby.sh
[04:43:22] Arcaire: source /usr/local/share/chruby/auto.sh
[04:43:40] Arcaire: Also it's not always 2.1.8. It kind of arbitrarily picks a number. It's pissed out 2.2.4 and 2.2.0 at me as well.
[04:43:43] Palsson: has joined #RubyOnRails
[04:43:48] Graphettion: has joined #RubyOnRails
[04:43:49] bronson: has joined #RubyOnRails
[04:44:13] sevenseacat: you're sure you don't have projects configured to use those versions? :)
[04:44:28] Arcaire: Given that it's picking a number at random, I'd say not really.
[04:44:35] sevenseacat: i dont think it's random.
[04:44:40] Arcaire: Same folder.
[04:44:43] Arcaire: All I'm doing is typing 'ls'.
[04:45:26] timmmaaaayyy: has joined #RubyOnRails
[04:45:34] sevenseacat: i suggest filing a bug then, with hopefully more information than you've provided here
[04:45:53] sevenseacat: because 'i run ls and get an error' doesn't help diagnose anything
[04:46:05] Arcaire: It's not an error so much as a warning.
[04:46:07] SteenJobs: has joined #RubyOnRails
[04:46:16] Arcaire: But then it proceeds to function relatively fine. `which ruby` still returns the correct version and path.
[04:46:21] timmmaaaayyy: does anyone know if a production environment hides sitemap.xml for some reason? i can access it just fine in my dev environment but not production.
[04:47:00] sevenseacat: timmmaaaayyy: uh, no
[04:47:17] timmmaaaayyy: lol. that's kind of what i thought. but i sure can't figure out why its not working
[04:47:41] sevenseacat: define 'not working'
[04:48:12] timmmaaaayyy: also i should not i'm not a ruby developer by any means. just a server guy helping out a friend. the rails environment confuses me. i can't seem to find a route for sitemap.xml either, but since its working in dev i assume a route isn't needed for some reason
[04:48:18] timmmaaaayyy: i get a 404 error
[04:48:46] sevenseacat: so what URL are you accessing, and where is this sitemap.xml located in your app?
[04:49:04] chi6rag: has joined #RubyOnRails
[04:49:36] timmmaaaayyy: sitemap.xml is un the public folder. and the url is just www.blah.com/sitemap.xml
[04:49:59] timmmaaaayyy: the dev environment is on another server..... dev.blah.com/sitemap.xml loads fine
[04:50:09] sevenseacat: is your production server set up to serve static assets from public ?
[04:50:23] timmmaaaayyy: would that be in the nginx config? or the app config?
[04:50:34] Arcaire: mfh chruby doesn't apply half its paths if it's running as the root user.
[04:50:50] timmmaaaayyy: dev and prod are identical, with the exception of the certs. but let me verify again jsut in case
[04:51:15] sevenseacat: i'm not familiar with nginx config but there should be something pointing / to public/
[04:51:31] Arcaire: root /path/to/application/public;
[04:51:40] JenElizabeth: has joined #RubyOnRails
[04:51:53] sevenseacat: Arcaire: will that serve static assets? i thought that needed extra config
[04:52:13] droptone: Question: If I'm specifically declaring a get route that expects a parameter in 4.2.x, What is the syntax of such? right now I simply have get 'get_fan_profile' => 'fan_profiles#get_fan_profile', defaults: { format: :json }
[04:52:17] Arcaire: Are we talking about actually static or compiled?
[04:52:27] sevenseacat: Arcaire: either, they all end up in public/
[04:52:31] droptone: But when I rake routes I see it's not expecting the /:id like the stock resources show route, which is the behavior I want.
[04:52:38] Arcaire: Actually static, yes. exploit.im/sitemap.xml would map to /path/to/application/public/sitemap.xml
[04:52:43] Arcaire: Also don't click that link.
[04:53:13] timmmaaaayyy: well this is kind of interesting.... my root is actually incorrect on both prod and dev. "root /var/www/BLAH/public/;" when its actually /var/www/blah/public
[04:53:16] droptone: When explicitly setting a route, what is the syntax for a get that expects params like :id?
[04:53:39] sevenseacat: droptone: http://guides.rubyonrails.org/routing.html#bound-parameters
[04:54:00] Eswar: has joined #RubyOnRails
[04:54:01] droptone: hmm, I see, so simply /:id
[04:54:05] droptone: after the controller#action
[04:54:11] Arcaire: >which ruby, fine
[04:54:14] arup_r: has joined #RubyOnRails
[04:54:15] Arcaire: >cd to a dir with no .ruby-version
[04:54:21] Arcaire: >which ruby again, 'no ruby'
[04:54:28] Arcaire: Thank you so much, Trump
[04:54:36] Radar: wb Arcaire.
[04:54:40] timmmaaaayyy: if the root is incorrect, how could it possible be working?
[04:54:42] Arcaire: I hate this language.
[04:54:46] Arcaire: It's official.
[04:54:57] droptone: That's odd, this is specifying I enter get ':controller/:action', normally I separate the controller and action with a hash.
[04:54:58] timmmaaaayyy: becuase of the way it uses upstream servers?
[04:54:59] sevenseacat: chruby has nothing to do with ruby itself
[04:55:04] sevenseacat: its all shell
[04:55:10] treaki_: has joined #RubyOnRails
[04:55:15] Arcaire: 2016 and I still need these workarounds though.
[04:55:19] droptone: haha, holy crap, there are far, far more annoying languages than Ruby.
[04:55:20] Arcaire: >le current year meme
[04:55:23] sevenseacat: but again, file a bug and you'll probably be told 'don't use root'
[04:55:33] Arcaire: droptone: I know, fluently, approximately eight. Maybe more.
[04:55:34] Radar: droptone: Don't do get ':controller/:action` EVER
[04:55:48] baweaver: using root for much of anything is a horrible idea
[04:55:50] droptone: Radar: Ok, well, that's exactly what the guide says to do?
[04:55:57] Arcaire: I modded chruby.sh to work for me as root. It's all good.
[04:56:00] droptone: The one sevenseacat sent me to?
[04:56:01] Arcaire: 3mucheffort5me
[04:56:08] Radar: droptone: It uses it as an example.
[04:56:12] sled: has joined #RubyOnRails
[04:56:23] Radar: droptone: it isn't saying that you should 100% do it.
[04:56:26] droptone: So it probably would have been easier to directly answer the question.
[04:56:39] sevenseacat: who's being passive aggressive now?
[04:56:52] droptone: So when specifically altering this route to allow for params: get 'get_fan_profile' => 'fan_profile#get_fan_profile', defaults: {format: :json }
[04:56:54] Kryptonical: has joined #RubyOnRails
[04:57:07] droptone: sevenseacat: MINASWAPA
[04:57:25] Arcaire: That's actually probably more accurate than the original.
[04:57:28] droptone: Well that's because instead of answering it you providing me a link to documentation that apparently instructs you to do something you should "NEVER" do
[04:57:41] sevenseacat: droptone: !rule8
[04:57:41] helpa: droptone: Treat people in a considerate manner, as they are volunteering their time to help you. If you're helping, do so in a kind and considerate manner; you were a newbie once too. If you're being annoying or rude you may be muted by one of the channel ops.
[04:57:42] droptone: So should I separate these by a hash then?
[04:57:47] sevenseacat: second warning.
[04:58:04] droptone: Well, that's the thing, I always do.
[04:58:09] Arcaire: droptone: That bit was a theoretical.
[04:58:17] droptone: Or at least 98% of the time.
[04:58:26] Arcaire: The bit you're looking at, that is. It's just a theoretical to explain the concepts of :controller and :action.
[04:58:34] droptone: That's an ironic rule. But if I need to switch shells that's fine.
[04:58:37] sevenseacat: and using placeholders in rules
[04:58:48] droptone: Got it, I'll test it out, thank you.
[04:59:02] Radar: droptone: get "fan_profile/:id" => "fan_profile#get_fan_profile"
[04:59:07] sevenseacat: if you have questions with the advice you're given, ask them, don't start trolling as a first response.
[04:59:17] sevenseacat: or you will get told off every time.
[04:59:26] droptone: Yup, I got it, so slashes for the ID but continue to use hashes for the controller / action separation.
[05:00:07] jarray52: has joined #RubyOnRails
[05:00:35] Arcaire: Fun With Bundler, Episode 2: This Time It's Personal
[05:00:36] catcher: has joined #RubyOnRails
[05:01:24] catcher: I'm starting with mongo / mongoid. I have a json tweet response from twitter, which I'd like to store in its entirety in my mongodb. What's the best way?
[05:01:33] Arcaire: The best way is not using Mongo.
[05:01:47] sevenseacat: trollish, but accurate
[05:02:00] catcher: despite the fact that it's straight json?
[05:02:16] ppinkerton: has joined #RubyOnRails
[05:02:46] catcher: Arcaire: are you of the opinion that mongo isn't ever the best choice?
[05:02:48] Arcaire: sevenseacat Radar : can you upload a sample database.yml pls
[05:02:56] Arcaire: I need it for something and don't have a copy of an original
[05:03:03] sevenseacat: Arcaire: rails new test_app
[05:03:08] Arcaire: I don't have rails installed.
[05:03:09] Arcaire: Seriously.
[05:03:15] Arcaire: catcher: It's the best choice for when you need plausible deniability with regards to data loss.
[05:04:36] hcnewsom: has joined #RubyOnRails
[05:04:46] sevenseacat: Arcaire: https://github.com/rubysherpas/r4ia_examples/blob/master/ticketee/config/database.yml
[05:04:56] Arcaire: This thing is failing to use peer auth.
[05:05:08] jarray52: has left #RubyOnRails: ()
[05:05:38] trosborn: has joined #RubyOnRails
[05:05:46] catcher: Okay, I'll take the bait. I need to store a bunch of tweets. Could turn into a few thousand per day pretty soon. suggestions?
[05:06:05] Arcaire: PostgreSQL.
[05:06:38] droptone: Postgres is certainly the hip option.
[05:06:47] catcher: and deal with scaling problems later if I have them?
[05:07:11] srinidhi: has joined #RubyOnRails
[05:07:20] droptone: Tell me Arcaire, when I was researching whether to migrate our MySQL DBs to Postgres due to the whole Oracle purchase of Sun, one caveat was that Postgres' HA / DR options were limited in comparison
[05:07:24] droptone: have they made progress on that front?
[05:07:46] Arcaire: but I handle that stuff out of band.
[05:07:46] droptone: That's good.
[05:07:49] baweaver: With a rate of 1000/day, you won't need to worry about it for long enough to come up with better solutions if it ever gets there.
[05:08:12] catcher: baweaver: I'm expecting a few thousand per day, but < 10k.
[05:08:16] greenride: has joined #RubyOnRails
[05:08:26] Arcaire: catcher: Scaling issues with PostgreSQL where you can't just throw hardware at the problem would kick in at approximately one million or more per minute.
[05:08:29] Radar: Arcaire: If it's failing peer auth then I'm guessing you didn't enable local auth
[05:08:33] baweaver: Yeah, PSQL will cover most of your usecases on there.
[05:08:41] GriffinHeart: has joined #RubyOnRails
[05:08:42] Arcaire: Radar: Nah it appears the issue is that I am a dickhead.
[05:08:46] Arcaire: I forgot what peer auth is.
[05:08:53] Radar: catcher: what are you doing with the tweets once you have them
[05:09:07] Eswar: has joined #RubyOnRails
[05:09:10] catcher: Radar: mostly 1-off reads
[05:09:15] catcher: very few joins
[05:09:35] Radar: catcher: searching?
[05:09:49] timmmaaaayyy: has left #RubyOnRails: ("Leaving...")
[05:10:00] catcher: Radar: potentially; indexing at first, probably text searching later
[05:10:20] Arcaire: Set it to `trust`. Meh.
[05:10:36] Radar: catcher: Have you considered elasticsearch?
[05:10:49] Radar: ACTION knows nothing of your usecase, so is just throwing it out there
[05:10:49] pawnbox: has joined #RubyOnRails
[05:10:54] Arcaire: sevenseacat is the channel's resident elasticsearch guru.
[05:10:56] baweaver: http://www.datastax.com/nosql-databases/benchmarks-cassandra-vs-mongodb-vs-Hbase
[05:11:39] catcher: Radar: elasticsearch for primary storage? Is that difficult to relate to other models in a rails / postgres app?
[05:11:51] baweaver: We use Cassandra, but we also have about a gigabyte of data a second
[05:12:39] Radar: catcher: If you're using other models then I would use psql as the primary store and then index the data separately in ES for searching
[05:12:40] catcher: baweaver: wow.
[05:12:44] baweaver: at that level we broke elasticsearch something awful
[05:13:08] Radar: baweaver: oh rly?
[05:13:08] Arcaire: catcher: baweaver works at reddit
[05:13:12] catcher: Radar: that's what I was thinking too. Maybe I'll roll with postgres for now and introduce elasticsearch when the searches get slow
[05:13:19] baweaver: Playstation
[05:13:27] Arcaire: You had to go and ruin it.
[05:13:52] baweaver: Radar: they had to get Splunk and ran out of data on multi-terabyte licenses within a few hours
[05:14:20] baweaver: I just know that if you asked our Op lead in that area he would eye-murder you for mentioning ES now
[05:14:41] baweaver: then again our scale is ridiculous compared to most standard companies so we find all the fun little bugs.
[05:15:05] baweaver: Then again I just hear the debates on it from the Principle engineers across the way from me.
[05:15:19] Arcaire: Splunk is great if you are worried you so much money you may accidentally deflate the dollar.
[05:15:33] Arcaire: s/you so/you have so/
[05:15:37] emachnic: has joined #RubyOnRails
[05:15:45] baweaver: Yep, we're good there
[05:16:14] Arcaire: Run into that a few times with clients.
[05:16:18] baweaver: I think I heard the licenses ran north of a few million
[05:16:23] Arcaire: Basically DoS their monitoring.
[05:16:46] Arcaire: THEN we do the fun stuff after they get no more alerts. B)
[05:17:01] baweaver: heh, sounds par.
[05:17:18] smoitra: has joined #RubyOnRails
[05:17:55] duderono_: has joined #RubyOnRails
[05:19:26] krz: has joined #RubyOnRails
[05:19:55] Arcaire: I'm torn between FreeBSD and Ubuntu Server now for hosting my stuff.
[05:20:04] Arcaire: FreeBSD is cleaner but finicky in about six million ways.
[05:20:12] Arcaire: Ubuntu is easier but looking too far under the hood makes me cringe.
[05:21:19] duncannz: has joined #RubyOnRails
[05:21:34] IrishGringo_: has joined #RubyOnRails
[05:22:07] Radar: Arcaire: I thought you would be 100% Gentoo
[05:22:14] blackmesa: has joined #RubyOnRails
[05:22:31] Arcaire: Radar: I have never used it in my life.
[05:22:56] Arcaire: I sit on the installgentoo IRC network, but that's just /g/'s IRC channel plus some people we tricked into thinking we're Gentoo technical support.
[05:24:05] jeanre: has joined #RubyOnRails
[05:24:45] ppinkerton: has joined #RubyOnRails
[05:25:46] zworks: has joined #RubyOnRails
[05:25:54] jeanre: has joined #RubyOnRails
[05:28:08] catcher: Thanks for the feedback guys.
[05:28:42] catcher: has left #RubyOnRails: ()
[05:34:06] nachoman: has joined #RubyOnRails
[05:34:13] chouhoulis: has joined #RubyOnRails
[05:34:34] Arcaire: is Github down for anyone from Aus?
[05:36:05] chagel: has joined #RubyOnRails
[05:36:40] Eswar: has joined #RubyOnRails
[05:41:26] mices: does github git down?
[05:42:13] Arcaire: wtf github pls
[05:42:15] Arcaire: i need to download things
[05:42:57] Arcaire: https://twitter.com/majofi/status/701642731408461825
[05:42:59] Arcaire: ayy lmao, i'm not alone
[05:43:47] sevenseacat: suspect the problem is in your link to github, not github itself
[05:44:07] Eswar: has joined #RubyOnRails
[05:45:04] Arcaire: potentially, idk if they still host in Rackspace or not
[05:46:55] Arcaire: They don't, it appears. Gone straight over the international link.
[05:46:57] Arcaire: I blame XO.
[05:47:23] GriffinHeart: has joined #RubyOnRails
[05:50:45] neilfse: has joined #RubyOnRails
[05:51:08] indikator: has left #RubyOnRails: ()
[05:51:47] rickmasta: has joined #RubyOnRails
[05:52:43] Arcaire: https://status.github.com/graphs/past_day
[05:52:44] Arcaire: There we go.
[05:54:30] htmldrum: has joined #RubyOnRails
[05:56:48] worknick: has joined #RubyOnRails
[05:57:39] worknick: i have a pop up notification div and on click i am trying to append new notification page to it by $("<%=j #{render(:partial=>'shared/notification', :locals=>{:notification=>@notifications})}%>").appendTo('#notificationsBody'); which appends this code itself instead of result
[05:59:56] ppinkerton: has joined #RubyOnRails
[06:00:38] zworks: has joined #RubyOnRails
[06:03:19] apotry: has joined #RubyOnRails
[06:04:04] Arcaire: is that erb embedded in jQuery
[06:04:35] sevenseacat: don't we all just love js.erb
[06:04:36] worknick: yes. application.js
[06:04:58] worknick: sevenseacat: its not a sperate .html.erb its just a div inside application.html.erb.
[06:05:07] worknick: i have append to thav "div" not to "page"
[06:06:06] Arcaire: sevenseacat: Wait js.erb is a thing?
[06:06:14] Radar: Arcaire: yes
[06:06:14] worknick: js.erb for application.html.erb is application.js!! right?
[06:06:15] sevenseacat: it sure is, it's a template type.
[06:06:18] Arcaire: I've never attempted to go that far.
[06:06:24] Radar: Arcaire: You never go full js.erb
[06:06:30] sevenseacat: it's hideous and we recommend no-one use it, ever.
[06:06:33] Radar: For this kind of thing I'm using React now.
[06:06:51] Arcaire: For this kind of thing I put projects aside and do something else now.
[06:07:00] sevenseacat: i don't mix js and erb.
[06:07:36] Radar: yeah, good recipe for disaster
[06:07:45] Radar: The alternative is ... tedious to setup.
[06:07:53] Radar: worknick: For exactly the reason that you're seeing now.
[06:08:05] worknick: Radar: but in this specific case i am not using js.erb?
[06:08:07] Radar: worknick: It's client-side code generated from the server.
[06:08:26] Radar: worknick: It looks like JS with ERB... so how is it not js.erb?
[06:08:29] Dreamer3_: has joined #RubyOnRails
[06:08:43] worknick: Radar: cause its not inside any .js.erb file? its anside application.js?
[06:08:56] barhum2013: has joined #RubyOnRails
[06:09:19] Radar: worknick: Ok, but it's still JS + ERB, which is exactly what I'm talking about.
[06:09:33] worknick: so, how do i append the next page of kaminari to that div?
[06:09:39] worknick: whats the recommended way?
[06:09:57] worknick: ok. let me check.
[06:11:02] Arcaire: You're not making real UI elements in 2016 unless your library is <something>.js and requires at LEAST one other <something else>.js as a dependency.
[06:11:48] Radar: I don't even know where I'd begin with a tutorial that would implement notifications.
[06:11:56] Radar: (using React)
[06:12:51] Arcaire: Everyone looks at you like “what, you DON’T already use <something else>.js? Jeez say goodbye to your Hacker News karma. Just apt-get install npm && npm install bower && bower install-” NO STOP IT THIS ISN’T WHAT TIM BERNERS-LEE WANTED.
[06:13:09] Radar: Arcaire: quoted from an article recently on HN frontpage
[06:13:14] Arcaire: Yeah one of my m80s
[06:13:28] Arcaire: I happened to have the tab pinned. B)
[06:13:54] Radar: you tracking when I go to sleep and wake up?
[06:13:57] Arcaire: https://defaultnamehere.tumblr.com/post/139351766005/graphing-when-your-facebook-friends-are-awake if anyone is wondering. Good read. Similar concept also works for Steam but I didn't write about it.
[06:14:00] Arcaire: I don't have you on Facebook.
[06:14:07] Radar: p.s. melbourne Ruby this Wednesday
[06:14:47] worknick: Arcaire: your point is to , recommend to , not use every other js ? or use it?
[06:14:56] worknick: i dotn get what that quote means.
[06:15:03] Arcaire: worknick: I was being facetious, I dislike JS as a whole. That quote was just from a friend.
[06:15:32] Arcaire: Radar: I'll turn up, forget to bring my laptop (or bring it and have material evidence that I'm working on absolutely nothing), and stand in the corner of one table awkwardly due to knowing NOBODY and not being good at meeting new people.
[06:16:00] Radar: Arcaire: ok see you there
[06:16:20] Arcaire: What time is it?
[06:16:26] jeanre: has joined #RubyOnRails
[06:16:26] jeanre: has joined #RubyOnRails
[06:16:30] worknick: Arcaire: ok
[06:16:34] Radar: 520 Bourke Street, Level 1.
[06:16:37] Arcaire: I haven't been for months due to forgetting about Ruby in general.
[06:16:44] Arcaire: At least you're in the city.
[06:17:11] Arcaire: Wait THIS building
[06:17:12] IFrank00: has joined #RubyOnRails
[06:17:52] arup_r1: has joined #RubyOnRails
[06:18:27] sevenseacat: you're both in the same building?
[06:18:38] Radar: Arcaire: yes, that building
[06:18:45] Radar: Arcaire: Is that your building now?
[06:18:52] Arcaire: No, but it's the building of a mutual acquaintance.
[06:19:03] Arcaire: I'm still in the building on the harbour. I never left. I got a pay rise instead.
[06:19:27] Radar: Where have you been last few months anyway
[06:20:39] Arcaire: Mostly working a lot, as well as starting and immediately quitting new personal projects.
[06:21:00] rakm: has joined #RubyOnRails
[06:21:44] Radar: typical 20-something tech youth then
[06:22:10] pyemkey: has joined #RubyOnRails
[06:22:21] dionysus69: has joined #RubyOnRails
[06:22:45] Arcaire: Saving for a house tbh.
[06:22:50] Arcaire: Gotta do the yards.
[06:22:59] sevenseacat: been there, done that
[06:23:06] Arcaire: Never gonna get paid in dev what I get paid atm.
[06:23:32] Radar: you might
[06:23:38] blackmesa: has joined #RubyOnRails
[06:23:56] sevenseacat: jeepers, how much do you get paid if being a devwon't match it?
[06:24:04] sevenseacat: where do i sign up?
[06:24:29] Radar: ACTION is also interested in this newsletter
[06:24:37] slash_nick: ACTION listens in
[06:25:00] arup_r1: what is going on here? :p
[06:25:22] Arcaire: sevenseacat: The uh
[06:25:25] Arcaire: interviews I had
[06:25:27] sevenseacat: Arcaire: is apparently making millions
[06:25:28] Arcaire: were very, very uninspiring.
[06:25:38] Arcaire: The packages offered were also subpar.
[06:25:41] sevenseacat: and making us all jealous
[06:25:59] Arcaire: The issue is that I won't get paid *now* if I were to move.
[06:26:09] Arcaire: Dropping on the salary ladder is a bad move no matter how you slicei t.
[06:26:19] sevenseacat: well, not always
[06:26:26] intrigueD: has joined #RubyOnRails
[06:26:26] intrigueD: has joined #RubyOnRails
[06:26:28] sevenseacat: if the ceiling moves higher
[06:26:40] Arcaire: Given my experience I'm not willing to take the risk that the company "might" give me a raise.
[06:26:49] Arcaire: They "might" also fuck me around for a year on a lower salary and me have zilch to show for it
[06:27:08] crdpink2: has joined #RubyOnRails
[06:28:59] Radar: Finally contacted by a recruiter who has done their fucking research. *holds on to this precious unicorn*
[06:29:39] aa3113: has joined #RubyOnRails
[06:29:58] zworks: removing all the non alpha numeric characters including spaces from the user input (params) , will be a good idea to safe guard against injection ?
[06:30:01] Radar: They included my secret phrase _and_ quoted from my recruiter writeup. omfg.
[06:30:19] Radar: zworks: what kind of injection?
[06:30:31] zworks: sql injection
[06:30:49] Radar: zworks: http://guides.rubyonrails.org/security.html#sql-injection\
[06:30:55] Radar: plz to be of the reading that section
[06:30:56] zworks: also command injection
[06:31:33] Radar: zworks: Good way to stop command injection is to NEVER CALL SYSTEM COMMANDS :O
[06:31:50] Radar: ACTION is a revolutionary
[06:31:56] Radar: thought-leading all up in here
[06:32:31] Arcaire: Radar: The offers from the places that came up were p avg in the end.
[06:32:43] Arcaire: It was basically like super low level stuff that was far removed from the Rails aspect.
[06:32:45] Guest34101: has joined #RubyOnRails
[06:32:45] Radar: Arcaire: as a junior dev they are
[06:32:56] Arcaire: not even touching rails tho
[06:33:00] Arcaire: not really worth
[06:33:01] aa3113_: has joined #RubyOnRails
[06:33:21] baweaver: zworks: most of sql injection is guarded against by strong attributes and activerecord
[06:33:53] baweaver: command injection though, never let a user get anywhere close to that.
[06:34:41] baweaver: if any part of a user input is directly interpolated into a command, you're done
[06:35:10] chouhoulis: has joined #RubyOnRails
[06:35:14] Radar: :wave: gnight
[06:37:45] nattyPablo: has joined #RubyOnRails
[06:39:26] GriffinHeart: has joined #RubyOnRails
[06:40:24] adgtl: has joined #RubyOnRails
[06:41:41] jeanre: has joined #RubyOnRails
[06:41:41] jeanre: has joined #RubyOnRails
[06:41:47] barhum2013: has joined #RubyOnRails
[06:42:23] jetpack_joe: has joined #RubyOnRails
[06:44:51] Technodrome: has joined #RubyOnRails
[06:45:26] bronson: has joined #RubyOnRails
[06:48:10] worknick: can i have kaminary to give random pages on each click?
[06:48:32] sevenseacat: sure, but that sounds like a terrible idea
[06:48:57] sevenseacat: would you want google to give you a random page of results?
[06:49:18] worknick: no. but i would like my users to give random suggestions.
[06:49:30] sevenseacat: thats not what kaminari is for
[06:49:44] worknick: so its done inside .wher clause only and not at kaminari level+
[06:49:54] worknick: .order i mean
[06:49:56] jonjoe: has joined #RubyOnRails
[06:50:17] chagel: has joined #RubyOnRails
[06:50:28] jonjoe: hey dudes
[06:50:43] worknick: sevenseacat: shall i do order by radnom?
[06:50:51] jonjoe: whats the best way to impliment array searching and filtering in your opinion?
[06:50:57] sevenseacat: jonjoe: we're not all dudes here, so you know.
[06:51:16] sevenseacat: worknick: if you want to return random results, that would make sense.
[06:51:21] worknick: right. thanks.
[06:51:24] sevenseacat: however, that's completely separate from kaminari.
[06:51:55] jonjoe: @sevenseacat the context i was using dude in was an endearment and gender agnostic
[06:52:12] sevenseacat: jonjoe: I see. please don't, because it isn't.
[06:52:54] jonjoe: Wsevenseacat thats your opinion, and tho i respect your opnion and appologise for offending you i reserve the right to use any term i like as long as i dont have malicious intent
[06:53:05] jonjoe: so anyway
[06:53:13] jonjoe: anyone have an opinion on search?
[06:53:24] sevenseacat: and i reserve the right to give you a second warning for violating the channel rules
[06:53:32] sevenseacat: third is a muting.
[06:53:53] jonjoe: how can you warn someone a second time for something they did once?
[06:54:25] jonjoe: where in the rules does it say we have to bow down to someone whom infers privilage?
[06:54:38] baweaver: jonjoe: enough, drop it
[06:54:56] srinidhi: has joined #RubyOnRails
[06:55:13] ChanServ: +o baweaver
[06:55:16] sevenseacat: all I asked was that you not use gender-specific language.
[06:55:34] sevenseacat: its exclusionary, and you basically said you didn't care about that becuase it 'wasnt malicious'
[06:55:40] sevenseacat: well, we *do* care about that here.
[06:56:28] sled: has joined #RubyOnRails
[06:56:53] baweaver: what type of array and what type of search/filter?
[06:57:03] baweaver: and are you sure you can't do it with an AR query?
[06:57:13] jonjoe: If you wanna play the "im offended game" I can do the same. I already explained my use of the term and appologised. I cant be held accountable for how different people take slang terminology. The fact you are enforcing your viewpoint on a term is in itself exclusionary. I dont appriciate that.
[06:57:35] baweaver: I want to play the "I said drop it" game
[06:58:33] smoitra: has joined #RubyOnRails
[06:59:41] chipotle: has joined #RubyOnRails
[07:00:30] GriffinHeart: has joined #RubyOnRails
[07:01:00] baweaver: now, back to the problem
[07:02:03] IFrank00: has joined #RubyOnRails
[07:02:28] lxsameer: has joined #RubyOnRails
[07:03:49] Dreamer3: has joined #RubyOnRails
[07:04:25] baweaver: or are we only interested in etymology now
[07:04:34] baweaver: ACTION shrugs
[07:04:37] jonjoe: meh, ill google. wouldnt wanna offend anyone here ...
[07:04:46] jonjoe: has left #RubyOnRails: ("Linkinus - http://linkinus.com")
[07:05:50] ChanServ: -o baweaver
[07:07:43] Chagel_: has joined #RubyOnRails
[07:08:10] korzybski: has joined #RubyOnRails
[07:08:12] qejk: has joined #RubyOnRails
[07:08:12] pyemkey: has joined #RubyOnRails
[07:10:03] baweaver: ACTION sighs
[07:14:11] chagel: has joined #RubyOnRails
[07:14:12] dionysus69: has joined #RubyOnRails
[07:16:06] Dreamer3: has joined #RubyOnRails
[07:16:31] mhoungbo: has joined #RubyOnRails
[07:18:38] rvanlieshout: has joined #RubyOnRails
[07:19:05] chagel: has joined #RubyOnRails
[07:22:03] woo: has joined #RubyOnRails
[07:24:13] chagel: has joined #RubyOnRails
[07:25:02] blackmesa: has joined #RubyOnRails
[07:25:30] agit0: has joined #RubyOnRails
[07:27:26] rohit_: has joined #RubyOnRails
[07:29:30] chagel: has joined #RubyOnRails
[07:33:25] ppinkerton: has joined #RubyOnRails
[07:34:31] chagel: has joined #RubyOnRails
[07:35:55] chouhoulis: has joined #RubyOnRails
[07:37:44] zworks: has joined #RubyOnRails
[07:39:31] chagel: has joined #RubyOnRails
[07:39:58] moeabdol1: has joined #RubyOnRails
[07:40:40] comrad: has joined #RubyOnRails
[07:42:26] mrbubbles: has joined #RubyOnRails
[07:42:56] moeabdol2: has joined #RubyOnRails
[07:44:01] aganov: has joined #RubyOnRails
[07:45:39] smoitra_: has joined #RubyOnRails
[07:47:46] chagel: has joined #RubyOnRails
[07:52:06] arup_r: has joined #RubyOnRails
[07:52:47] chagel: has joined #RubyOnRails
[07:54:08] wldcordeiro: has joined #RubyOnRails
[07:57:43] janno_: has left #RubyOnRails: ()
[07:57:46] chagel: has joined #RubyOnRails
[07:58:17] Janno: has joined #RubyOnRails
[08:01:13] ewnd9: has joined #RubyOnRails
[08:02:47] chagel: has joined #RubyOnRails
[08:02:47] darutoko: has joined #RubyOnRails
[08:03:10] jeanlinux: has joined #RubyOnRails
[08:03:57] zworks: has joined #RubyOnRails
[08:05:28] worknick: where to put the pluck? current_user.notifications.pluck(:id).order('created_at DESC').page(params[:page]).per(3)
[08:05:57] rvanlieshout: worknick: pluck immeadiatly returns an array
[08:06:03] rvanlieshout: so at the end
[08:06:11] rvanlieshout: and why would you want to pluck?
[08:06:33] worknick: i want single column. not all columns.
[08:07:58] chagel: has joined #RubyOnRails
[08:11:25] pawnbox: has joined #RubyOnRails
[08:11:35] rvanlieshout: worknick: it all depends on what you're going to do with it
[08:11:46] rvanlieshout: but the use case for pluck is totally diferent
[08:11:58] rvanlieshout: and also selecting less columns but still using instances is not done using pluck
[08:12:58] chagel: has joined #RubyOnRails
[08:16:10] svoi: has joined #RubyOnRails
[08:16:29] worknick: rvanlieshout: it was just for test. now i removed it.
[08:16:43] ziyadb: has joined #RubyOnRails
[08:17:12] The_Phoenix1: has joined #RubyOnRails
[08:17:58] chagel: has joined #RubyOnRails
[08:18:17] nattyPablo: has joined #RubyOnRails
[08:19:40] svoi: has left #RubyOnRails: ()
[08:21:00] shilon: has joined #RubyOnRails
[08:21:10] shilon: has left #RubyOnRails: ()
[08:22:04] chooky87: has joined #RubyOnRails
[08:23:17] smoitra: has joined #RubyOnRails
[08:24:36] BtcBen: has joined #RubyOnRails
[08:25:30] BtcBen: anyone wanna help with this? https://www.upwork.com/jobs/Ruby-Rails-email-reminder-cron-job_~017ff809b35713f9c7
[08:26:03] Ergo: has joined #RubyOnRails
[08:27:21] chagel: has joined #RubyOnRails
[08:27:56] blackmesa: has joined #RubyOnRails
[08:31:08] tvw: has joined #RubyOnRails
[08:31:16] FooMunki: has joined #RubyOnRails
[08:32:31] chagel: has joined #RubyOnRails
[08:33:57] baweaver: has joined #RubyOnRails
[08:36:37] chouhoulis: has joined #RubyOnRails
[08:37:21] chagel: has joined #RubyOnRails
[08:37:59] zworks: has joined #RubyOnRails
[08:38:30] The_Phoenix: has joined #RubyOnRails
[08:42:15] snowy: has joined #RubyOnRails
[08:42:27] chagel: has joined #RubyOnRails
[08:43:43] rohit_: has joined #RubyOnRails
[08:44:46] agit0: has joined #RubyOnRails
[08:45:57] woo: has joined #RubyOnRails
[08:46:49] banister: has joined #RubyOnRails
[08:47:21] chagel: has joined #RubyOnRails
[08:47:59] bronson: has joined #RubyOnRails
[08:48:52] kmckelvin: has joined #RubyOnRails
[08:49:11] kitsuneyo: has joined #RubyOnRails
[08:51:12] moeabdol: has joined #RubyOnRails
[08:52:27] chagel: has joined #RubyOnRails
[08:54:18] jeanre: has joined #RubyOnRails
[08:54:19] jeanre: has joined #RubyOnRails
[08:57:21] chagel: has joined #RubyOnRails
[09:00:02] Eswar: has joined #RubyOnRails
[09:00:11] DmitryBochkarev: has joined #RubyOnRails
[09:01:41] jeanlinux: has joined #RubyOnRails
[09:02:27] chagel: has joined #RubyOnRails
[09:04:20] artto: has joined #RubyOnRails
[09:05:13] duderonomy: has joined #RubyOnRails
[09:06:24] gregf_: has joined #RubyOnRails
[09:07:04] elementz: has joined #RubyOnRails
[09:07:21] kitsuneyo: has joined #RubyOnRails
[09:08:47] ppinkerton: has joined #RubyOnRails
[09:09:10] AzaToth: has joined #RubyOnRails
[09:09:12] mrbubbles: has joined #RubyOnRails
[09:09:36] arup_r: has joined #RubyOnRails
[09:10:13] agoldboi: has joined #RubyOnRails
[09:11:55] chagel: has joined #RubyOnRails
[09:14:46] jsrn_: has joined #RubyOnRails
[09:16:49] chagel: has joined #RubyOnRails
[09:21:55] chagel: has joined #RubyOnRails
[09:22:40] artto: has joined #RubyOnRails
[09:26:30] herpless: has joined #RubyOnRails
[09:26:48] chagel: has joined #RubyOnRails
[09:27:16] FooMunki: has joined #RubyOnRails
[09:29:19] blackmesa: has joined #RubyOnRails
[09:31:10] jeanlinux: has joined #RubyOnRails
[09:31:55] chagel: has joined #RubyOnRails
[09:32:05] nT4BR: has joined #RubyOnRails
[09:32:19] nT4BR: hey guys, i have a doubt
[09:32:33] nT4BR: how can i select only rows with one association in has_many?
[09:33:28] nT4BR: for example, i have a order model, and a has_many association to itens, and i want to select all orders that has only one item on association
[09:33:40] rohit_: has joined #RubyOnRails
[09:34:02] gr1m_: has joined #RubyOnRails
[09:35:33] gr1m_: has left #RubyOnRails: ()
[09:35:48] shilon: has joined #RubyOnRails
[09:36:07] shilon: has left #RubyOnRails: ()
[09:37:08] gr1m_: has joined #RubyOnRails
[09:37:25] chouhoulis: has joined #RubyOnRails
[09:37:30] gr1m_: hi. i have weird issue with rails/mongo. if i try to access mongoid models through the rails console everything works fine. however the environment ran through unicorn doesnt work. keep getting `Moped::Errors::ConnectionFailure` error. any ideas how i can debug why it doesnt work through unicorn?
[09:38:24] arup_r: nT4BR: Order.joins(:items).group(:order_id).having("count(:order_id) = 1")
[09:40:01] nettoweb: has joined #RubyOnRails
[09:40:08] ianfleeton: has joined #RubyOnRails
[09:41:17] ppinkerton: has joined #RubyOnRails
[09:44:12] nT4BR: arup_r: thanks man!
[09:44:14] chagel: has joined #RubyOnRails
[09:44:20] djellemah_: has joined #RubyOnRails
[09:47:15] Glyphik: has joined #RubyOnRails
[09:48:18] defsdoor: has joined #RubyOnRails
[09:48:52] FooMunki: has joined #RubyOnRails
[09:49:14] chagel: has joined #RubyOnRails
[09:49:25] bronson: has joined #RubyOnRails
[09:49:39] srinidhi: has joined #RubyOnRails
[09:50:38] aaronr: has joined #RubyOnRails
[09:54:14] chagel: has joined #RubyOnRails
[09:57:27] marr: has joined #RubyOnRails
[09:58:25] bruce_lee: has joined #RubyOnRails
[09:58:25] bruce_lee: has joined #RubyOnRails
[09:59:14] chagel: has joined #RubyOnRails
[10:00:38] kitsuneyo: has joined #RubyOnRails
[10:00:59] laith: has joined #RubyOnRails
[10:04:13] chagel: has joined #RubyOnRails
[10:05:09] moeabdol1: has joined #RubyOnRails
[10:05:50] awea: has joined #RubyOnRails
[10:06:21] awea: has joined #RubyOnRails
[10:08:56] jeanre: has joined #RubyOnRails
[10:08:57] jeanre: has joined #RubyOnRails
[10:11:21] krzkrz: has joined #RubyOnRails
[10:12:00] ferr: has joined #RubyOnRails
[10:13:37] chagel: has joined #RubyOnRails
[10:14:21] mark2: has joined #RubyOnRails
[10:18:36] chagel: has joined #RubyOnRails
[10:19:28] arBmind: has joined #RubyOnRails
[10:19:42] laith: has joined #RubyOnRails
[10:19:46] ElFerna: has joined #RubyOnRails
[10:22:23] laith: has joined #RubyOnRails
[10:22:40] ferr: has joined #RubyOnRails
[10:24:03] chagel: has joined #RubyOnRails
[10:25:04] adre_: has joined #RubyOnRails
[10:25:49] rodfersou: has joined #RubyOnRails
[10:26:36] zworks: has joined #RubyOnRails
[10:27:15] embasbm: has joined #RubyOnRails
[10:28:59] kitsuneyo: has joined #RubyOnRails
[10:29:28] ppinkerton: has joined #RubyOnRails
[10:29:42] blackmesa: has joined #RubyOnRails
[10:33:22] pydave6367: has joined #RubyOnRails
[10:34:35] arup_r: has joined #RubyOnRails
[10:36:35] adre_: has joined #RubyOnRails
[10:37:05] laith: has joined #RubyOnRails
[10:38:11] chouhoulis: has joined #RubyOnRails
[10:38:12] Ropeney: has joined #RubyOnRails
[10:38:22] worknick: how can i troubleshoot if <%= link_to link click does nothing? if i go to source and from there click on the lirk it gives source of the new page (mean opens the new page)
[10:38:31] worknick: i even manually provided method=get
[10:39:15] kh0d: has joined #RubyOnRails
[10:39:38] sevenseacat: worknick: !debug
[10:39:38] helpa: worknick: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[10:45:14] worknick: sevenseacat: this is the code concerning this div https://gist.github.com/wrknck/e1c82cc78a2a0d7adddc
[10:46:04] worknick: sevenseacat: when user click on the glyphicon this div appears as popup. there are <%= link_to inside it. which dont do anything. i tried to put a test link <%= link_to user_path(currentuuser) there without partial and that simple link also wont do anything
[10:47:14] arup_r: worknick: one trick. open the browser devtool console. Hit the url and see any error there..
[10:47:23] smoitra: has joined #RubyOnRails
[10:47:25] arup_r: this is where you will start first debuggong..
[10:47:32] sevenseacat: so you have a normal link in your application layout, no js or anything, and clicking it does nothing?
[10:47:47] worknick: arup_r: there is nothingh. no error in firebug.
[10:47:52] worknick: sevenseacat: right.
[10:48:28] arup_r: you are clicking here https://gist.github.com/wrknck/e1c82cc78a2a0d7adddc#file-application-html-erb-L7 ?
[10:48:48] worknick: i am click on "nt.desc" which is inside _notification.html.erb
[10:49:05] sevenseacat: thats not what you said before
[10:49:16] worknick: sevenseacat: ???
[10:49:25] sevenseacat: you said a link without js in your layout file
[10:50:01] worknick: "without partial" is what i said
[10:50:22] sevenseacat: "so you have a normal link in your application layout, no js or anything, and clicking it does nothing?" but okay
[10:50:38] worknick: i have a normal link -> yes.
[10:50:49] arup_r: worknick: link_to by default does GET, no need to mention.
[10:50:50] sevenseacat: is this code on github so we can clone and check it out?
[10:50:52] worknick: its jusst <%= link_to i am not manipulating that link from js.
[10:51:01] worknick: sevenseacat: its not there.
[10:51:04] sevenseacat: you said the link is in a modal window!
[10:51:08] sevenseacat: now you're saying its not?
[10:51:15] worknick: arup_r: since it was not working i thought to give it manually
[10:51:18] arup_r: first remove that. Ofcourse that will not solve the issue, but still
[10:51:39] worknick: sevenseacat: this div is not a dialog box.
[10:52:19] sevenseacat: "this div appears as popup. there are <%= link_to inside it. which dont do anything."
[10:52:42] worknick: yes. pop up which i created manuly. not using jquery ui dialog.
[10:54:08] moeabdol2: has joined #RubyOnRails
[10:54:30] arup_r: worknick: I am sure there is somewhere in JS event.preventDefault() for anchors. Which is causing to stop .
[10:54:32] Eswar: has joined #RubyOnRails
[10:54:49] gr1m_: has joined #RubyOnRails
[10:55:03] worknick: arup_r: some js might be causing trouble i will check it. but its not preventdefault.
[10:55:10] arup_r: search your codebase with that keyword to ensure if you really have that or not. Well I am not SURE, i am suspecting so. :)
[10:55:45] arup_r: worknick: it can be stopImmediatePropagation() or there is one more method I forgot the name
[10:56:40] worknick: it was click event on the main div of that notificaiton which was returning false!
[10:57:29] arup_r: worknick: \o/
[10:57:41] arup_r: you should give me a hug!!! :p
[10:57:48] worknick: ACTION hugs arup_r
[10:58:01] sled: has joined #RubyOnRails
[10:58:58] smoitra: has joined #RubyOnRails
[10:59:31] ppinkerton: has joined #RubyOnRails
[11:00:02] _djbkd: has joined #RubyOnRails
[11:04:01] jottr: Hi all. Does anyone have experience with carrierwave? I have created an Uploader like so. https://gist.github.com/jottr/b096d1e221fef5db6d6c
[11:04:02] trinaldi: has joined #RubyOnRails
[11:04:24] jottr: I am using this on heroku. Trying to debug this, I started an irb session on heroku
[11:04:59] arup_r: jottr: and your issue is ?
[11:05:10] jottr: Still writing... :)
[11:05:29] krzkrz: has joined #RubyOnRails
[11:05:43] aub: has joined #RubyOnRails
[11:06:00] kitsuneyo: has joined #RubyOnRails
[11:06:40] aub: has joined #RubyOnRails
[11:07:32] jottr: Inside the irb session I try to upload the file to S3 as follows: https://gist.github.com/jottr/b096d1e221fef5db6d6c#file-irb-md
[11:08:24] jottr: `puts storage` yields https://mge-rails.s3.amazonaws.com/storage/news.json
[11:08:43] jottr: And, no file inside S3
[11:09:11] jottr: I am not sure how I could debug this issue...
[11:09:33] adre_: has joined #RubyOnRails
[11:10:46] jottr: This is the apps repo https://git.io/v2qOp
[11:11:42] jottr: I've been pulling my hair out over this issue since yesterday with a deadline just an hour away...
[11:11:45] jottr: ACTION headdesks
[11:12:28] Dbugger: has joined #RubyOnRails
[11:12:32] Dbugger: Hello everyone
[11:13:33] ElFerna: has joined #RubyOnRails
[11:13:50] jottr: arup_r: Weirdly its available via the url
[11:14:13] arup_r: ok let me see
[11:17:09] arup_r: jottr: then how are you saying not stored in s3 ?
[11:17:49] jottr: arup_r: Hm. It seems it DID store the file. S3 just did not update the directory listing properly when on aws console.
[11:18:03] defsdoor: has joined #RubyOnRails
[11:18:46] jottr: arup_r: thx for helping out though!
[11:19:58] artto: has joined #RubyOnRails
[11:23:34] ldnunes: has joined #RubyOnRails
[11:26:22] arup_r: has joined #RubyOnRails
[11:27:05] quazimodo: has joined #RubyOnRails
[11:27:21] chipotle: has joined #RubyOnRails
[11:28:06] ppinkerton: has joined #RubyOnRails
[11:30:29] nachoman: has joined #RubyOnRails
[11:33:45] sudoubuntu: has joined #RubyOnRails
[11:34:04] jottr: arup_r: Hm. It still does not properly display the news.json. The view used to simply render news.json from a local file. I just updated it to read from the cloudfront url, and strangely that does not work: https://github.com/jottr/meingrundeinkommen/commit/6b83d7a2ae5fb0791dbb5c107b5da57008f27f7a
[11:37:36] jeanre: has joined #RubyOnRails
[11:37:36] jeanre: has joined #RubyOnRails
[11:37:46] AnoHito_: has joined #RubyOnRails
[11:39:00] chouhoulis: has joined #RubyOnRails
[11:40:24] Y_Ichiro: has joined #RubyOnRails
[11:40:24] Y_Ichiro: has joined #RubyOnRails
[11:40:43] adre_: has joined #RubyOnRails
[11:41:23] borkdude: has joined #RubyOnRails
[11:41:28] hoodow: has joined #RubyOnRails
[11:41:28] hoodow: has joined #RubyOnRails
[11:41:51] alxndr: has joined #RubyOnRails
[11:42:18] Somnius: has joined #RubyOnRails
[11:42:21] c355E3B: has joined #RubyOnRails
[11:42:34] BBHoss: has joined #RubyOnRails
[11:42:35] benlakey: has joined #RubyOnRails
[11:42:45] podman: has joined #RubyOnRails
[11:42:45] jlyndon: has joined #RubyOnRails
[11:42:50] neanderslob: has joined #RubyOnRails
[11:42:59] many: has joined #RubyOnRails
[11:43:42] jlpeters: has joined #RubyOnRails
[11:43:57] dmcc: has joined #RubyOnRails
[11:44:21] laith: has joined #RubyOnRails
[11:44:41] wmdrossard: has joined #RubyOnRails
[11:45:28] sdn90: has joined #RubyOnRails
[11:45:42] FooBarWidget: has joined #RubyOnRails
[11:46:07] cschneid: has joined #RubyOnRails
[11:46:13] Seich: has joined #RubyOnRails
[11:46:13] LBRapid: has joined #RubyOnRails
[11:47:05] dustinm`: has joined #RubyOnRails
[11:47:53] markelite: has joined #RubyOnRails
[11:48:42] Meow-J: has joined #RubyOnRails
[11:49:55] bronson: has joined #RubyOnRails
[11:50:51] bauruine: has joined #RubyOnRails
[11:52:01] artto: has joined #RubyOnRails
[11:52:11] skarn: has joined #RubyOnRails
[11:53:13] gr1m_: has joined #RubyOnRails
[11:53:32] doge__: has joined #RubyOnRails
[11:53:34] dionysus69: has joined #RubyOnRails
[11:54:13] Majadon: has joined #RubyOnRails
[11:54:26] Eswar: has joined #RubyOnRails
[11:56:22] mcr-credil: has joined #RubyOnRails
[11:57:46] jds: has joined #RubyOnRails
[11:59:12] sled: has joined #RubyOnRails
[12:00:20] The_Phoenix1: has joined #RubyOnRails
[12:01:21] kameleon83: has joined #RubyOnRails
[12:01:38] ElFerna: has joined #RubyOnRails
[12:01:50] tvw: has joined #RubyOnRails
[12:03:17] adre_: has joined #RubyOnRails
[12:05:59] jeanre: has joined #RubyOnRails
[12:05:59] jeanre: has joined #RubyOnRails
[12:07:40] WizJin: has joined #RubyOnRails
[12:10:01] laith: has joined #RubyOnRails
[12:10:51] adre_: has joined #RubyOnRails
[12:15:41] nachoman: has joined #RubyOnRails
[12:19:09] chipotle: has joined #RubyOnRails
[12:19:20] ppinkerton: has joined #RubyOnRails
[12:20:42] quazimodo: has joined #RubyOnRails
[12:24:25] xhoy: hi! i have an asset pipeline question. i set the assets onfig.assets.prefix to /staging-assets
[12:24:34] xhoy: when i run the rake compile tasks this works like a charm
[12:24:51] xhoy: but when staring unicorn its keeps request /assets
[12:25:26] BlazeBoy: has joined #RubyOnRails
[12:27:08] xhoy: so it seems that the application isn't aware of the 'different' location
[12:28:36] arup_r: xhoy: what web server you are using ?
[12:28:46] xhoy: just looking in to that
[12:28:50] arup_r: may be there you need to configure something
[12:29:06] arup_r: xhoy: I meant Nginx or Apache ?
[12:29:17] xhoy: every single post i find says add config.assets.prefix :P
[12:29:26] xhoy: arup_r: unicorn :) that is an webserver :>
[12:29:31] chagel: has joined #RubyOnRails
[12:29:52] arup_r: lol .. let me google :p
[12:29:54] jeanre: has joined #RubyOnRails
[12:29:54] jeanre: has joined #RubyOnRails
[12:30:11] xhoy: and the issue is not the assets it self
[12:30:14] matthewd: xhoy: Where did you set the prefix? In the environment config?
[12:30:16] xhoy: but the requested url
[12:30:26] xhoy: matthewd: yes i environments/production.rb
[12:30:37] chipotle: has joined #RubyOnRails
[12:31:00] matthewd: You're setting it to /staging-assets in production.rb ? :/
[12:31:05] arup_r: Unicorn is an app server, not webserver or I am stupid ? . hehehe
[12:31:18] xhoy: arup_r: it is but you can browse directly to it
[12:31:22] xhoy: matthewd: yes
[12:32:24] xhoy: and i can see my assets in public/staging-assets so they are generated correctly but when i now brows to my staging it likes to fetch css files from /assets instead of /staging-assets
[12:32:36] xhoy: ow extra complication factor, i deploy to /staging
[12:32:39] matthewd: xhoy: Might I therefore infer there's a conditional in there?
[12:32:49] artto: has joined #RubyOnRails
[12:32:53] xhoy: matthewd: how do you mean that?
[12:33:13] matthewd: xhoy: Surely you don't want "/staging-assets" on your real production deployment
[12:33:43] matthewd: So, do you have a conditional in the config?
[12:33:53] xhoy: my production is on /assets (since i havent got a clue how to change that :>)
[12:34:04] xhoy: conditional? a condition if x then y?
[12:34:07] helpa: http://i.imgur.com/m9m3wr9.gif
[12:34:15] xhoy: no i have 2 configs one for staging and one for production
[12:34:27] matthewd: And they're both called production.rb?
[12:34:34] artto: has joined #RubyOnRails
[12:34:35] xhoy: different directory
[12:35:04] matthewd: You.. you don't version your environment config as part of the app?
[12:35:43] arup_r: ACTION installing Atom to learn Ember .. :)
[12:36:07] xhoy: yes i do
[12:36:16] xhoy: matthewd: moment
[12:38:09] allcentury: has joined #RubyOnRails
[12:39:06] xhoy: i have 1 app calld "finance" its deployed from master to "production" and develop to "staging", both with Capistrano. Now the "production" instance is ~/production/current and has as url /finance and /finance/assets (this works like charm!) and staging is in /staging/ and staging/assets = not workign
[12:39:16] Cervajz_: has joined #RubyOnRails
[12:39:21] xhoy: comparing configs no good, compairing deployments no good
[12:39:40] chouhoulis: has joined #RubyOnRails
[12:39:41] xhoy: so somehow there is a difference that my staging doesn't like to bedeployed to /staging
[12:40:02] xhoy: this happent to me before! since rails does do some magic when you call 'production' instead of 'development' or something else
[12:40:38] xhoy: so what i do my "staging" is dressed up like "production" only the directory is different ALL other stuff should be just like production
[12:40:54] sevenseacat: so where exactly does /staging-assets come into things?
[12:40:57] xhoy: (in my env/production.rb i dont even have a staging thing to be sure)
[12:41:12] xhoy: sevenseacat: for ease i called it staging-assets but it is staging/assets :>
[12:41:26] xhoy: sevenseacat: the weird thing is my staging app calls /assets
[12:41:33] xhoy: sevenseacat: just in the chat :>
[12:41:51] sevenseacat: how can we help you fix things when you deliberately tell us the wrong thing?
[12:41:52] laith: has joined #RubyOnRails
[12:42:14] xhoy: sevenseacat: to make it less compilcated, but that is way i tell you the hole thing right now
[12:42:32] chipotle: has joined #RubyOnRails
[12:43:09] artto: has joined #RubyOnRails
[12:44:23] Tempesta: has joined #RubyOnRails
[12:44:59] pawnbox_: has joined #RubyOnRails
[12:46:11] xhoy: i found one different now but better looking, in my production i didn't set my assets.prefix config ....
[12:48:13] Scripore: has joined #RubyOnRails
[12:49:23] nachoman: has joined #RubyOnRails
[12:50:11] blackmesa: has joined #RubyOnRails
[12:53:05] chipotle: has joined #RubyOnRails
[12:54:11] adre_: has joined #RubyOnRails
[12:56:33] FooMunki: has joined #RubyOnRails
[12:59:06] s1|verfox: has joined #RubyOnRails
[12:59:07] Detch: has joined #RubyOnRails
[12:59:29] sled: has joined #RubyOnRails
[13:00:29] emachnic: has joined #RubyOnRails
[13:01:18] safetypin: has joined #RubyOnRails
[13:02:03] adre_: has joined #RubyOnRails
[13:02:16] konsolebox: has joined #RubyOnRails
[13:03:33] BlazeBoy: has left #RubyOnRails: ()
[13:04:00] chridal: This might be a really stupid idea, but I'll give it a shot.
[13:04:19] chipotle: has joined #RubyOnRails
[13:04:48] chridal: So we wrote a social network in Rails and launched it. We have a live chat, and since Ruby is not awesome with asyncronous TCP sockets etc. we spun off a worker that uses Amazon SNS which then uses push notifications to send messages to the users which are then displayed in the chat.
[13:04:55] chridal: The problem is that... it's slow.
[13:05:12] chridal: So we've decided to use something like Pusher (a SaaS that maintains a websocket to our iOS clients).
[13:06:17] chridal: The issue is however that we need an intermediate server in between all of this that handles persistence etc. So when a client posts a new message this will hit our server which then hits Pusher. Since we need to hit Pushers REST API here this means maybe 200 ms which means spinning it off into a worker. I really don't want the speed of this to be dependent on the speed of the worker queue though since
[13:06:19] chridal: there will be a lot going on, and even more as time goes by.
[13:06:46] xhoy: but why not just ruby? only for the async tcp?
[13:06:59] chridal: So I decided to write this all in Node.js. The problem with this however is that it's a foreign country and all of my tools are missing.. Currently writing an Express app. So that's the context, here's the question:
[13:07:00] xhoy: so if rails did async tcp you wouldn't do all this?
[13:07:19] FooMunki: has joined #RubyOnRails
[13:07:20] xhoy: ow oke :P i just tought it would still be slow :)
[13:07:41] chridal: What if I have one docker instance on the chat server running the Rails API for interfacing with the database, and then communicate with that instance via a UNIX Socket from the chat server. Then the chat server handles everything with pusher, and then uses Rails for persistence etc.
[13:07:44] chridal: How insane is this?
[13:08:31] pawnbox: has joined #RubyOnRails
[13:08:53] ppinkerton: has joined #RubyOnRails
[13:08:53] chridal: I mean like; I have looked into things like EventMachine, Faye and all that, but I am just not feeling it.
[13:09:10] matthewd: chridal: Would running a second worker queue be a simpler solution to the "speed of the worker queue" problem?
[13:10:05] chridal: matthewd: I just don't think handling this with a worker queue is the right way to go.
[13:10:21] chridal: Smells like technical debt building all of this into the Rails API.
[13:10:58] matthewd: I mean, I'm not sure about the whole "not awesome with asyncronous TCP sockets" premise, but hey, if you're bigger than Basecamp, maybe there's a point where problems do arise?
[13:11:00] xhoy: chridal: why not just build a seperate rails chat thing?
[13:11:05] chridal: Now about running HTTP over the UNIX Socket solution; what would be capping our speed with that?
[13:11:27] emachnic: has joined #RubyOnRails
[13:11:39] xhoy: chridal: do some lowlevel capture of the request to limit the rails time
[13:12:00] chridal: matthewd: I'm not sure what Basecamp is doing with ActionCable but what we need is a live chat with enterprise millisecond responses
[13:12:31] chridal: xhoy: But you basically mean having the Node server interact with Rails then to do persistence over the UNIX socket?
[13:12:33] IFrank00: has joined #RubyOnRails
[13:12:36] xhoy: chridal: write some middleware http://railscasts.com/episodes/399-autocomplete-search-terms
[13:12:49] xhoy: (like ryan did with the auto complete)
[13:13:22] chridal: xhoy: Not sure if I follow. What would I need the middleware for?
[13:13:28] xhoy: for the speed
[13:13:51] xhoy: your chat app could be just some rails app but with some improvements over "default" rails
[13:14:02] chridal: xhoy: But in which architecture scenario; using Node+Rails? or are you just thinking about a pure rails app?
[13:14:05] xhoy: but then you needed to rewrite the hole thing
[13:14:16] srinidhi: has joined #RubyOnRails
[13:14:25] xhoy: chridal: you could do both depending on requirements
[13:14:36] Guest11: has joined #RubyOnRails
[13:14:39] chridal: Our issue here is that we'll be hitting the Pusher API for every single request. Which means that we'll have to spin it off into a worker which I am not comfortable with
[13:14:43] xhoy: chridal: you need something super speedy
[13:14:48] chridal: or else I'd just build it in Rails
[13:14:59] chridal: xhoy: Yes. We want instantly propagating messages
[13:15:05] chridal: think WeeChat, Snapchat, Messenger etc.
[13:15:16] xhoy: chridal: with some middle ware you can tap right into the request
[13:15:16] chridal: The instance you start typing we need an event propagated to the other client.
[13:15:19] xhoy: that makes it super fast
[13:15:34] chipotle: has joined #RubyOnRails
[13:15:39] chridal: xhoy: It still doesn't solve the issue that Ruby is single threaded and thus a 200 ms response from Pusher would slow down every other request
[13:15:40] diegoviola: has joined #RubyOnRails
[13:15:43] chridal: which -> worker queue.
[13:15:44] pawnbox: has joined #RubyOnRails
[13:15:48] matthewd: That's exactly what Basecamp are doing with ACa, incidentally
[13:15:48] xhoy: you are creating an app with lots and lots of requests
[13:16:05] matthewd: chridal: Ummm, no, that's not how ruby being ~ single threaded works
[13:16:11] chridal: matthewd: Yes, but we're not really up for maintaining the whole TCP socket infrastructure. That's really complex
[13:16:27] chridal: matthewd: Well you can only serve one request at a time?
[13:16:38] xhoy: chridal: no
[13:16:52] chridal: Please elaborate
[13:17:02] xhoy: aaah now i get it
[13:17:20] xhoy: when i have an open websocket you think that every work can only have one session?
[13:17:43] chridal: xhoy: Not thinking about Websockets here now. We won't be maintaining the actual sockets: Pusher will do that.
[13:17:58] chridal: Our problem is that we need to make a lot of requests to Pusher via their REST API with varying response time
[13:18:13] chridal: and we can't have clients clogging a single request pipe line
[13:18:13] matthewd: One request can be actively running on a CPU, doing work
[13:18:23] matthewd: Waiting on I/O != doing work
[13:18:36] chridal: matthewd: That sounds suspiciously like an event loop
[13:18:38] xhoy: client <> pusher <> rest api <> db
[13:18:47] ppinkerton: has joined #RubyOnRails
[13:19:07] s1|verfox: Hi. I am writing RoR with Slim, and I have a form_for with a form_tag inside. The form_tag closes the form_for. Any tips on how to avoid this?
[13:19:18] xhoy: clients send message > push receivers > rest api receives > db stores message?
[13:19:18] chridal: If Rails manages waiting for IO so well, why would one even need something like Node which uses an event loop?
[13:19:37] durexlw: has joined #RubyOnRails
[13:19:49] xhoy: s1|verfox: FAIK you cannot have an from inside a form in html?
[13:20:02] chridal: xhoy: Client sends message, Send REST API call to Pusher (which propagates the messages through websockets to their server), persistence, generate notifications, send more messages to pusher for notifications
[13:20:05] xhoy: s1|verfox: http://stackoverflow.com/questions/555928/is-it-valid-to-have-a-html-form-inside-another-html-form
[13:20:06] matthewd: You'd have to ask someone who feels they need Node to solve a Ruby concurrency problem
[13:20:17] chridal: Every single call to POST /message might trigger a lot of calls to Pushers REST API
[13:20:44] xhoy: chridal: but then its more like " you got an new message from x"
[13:20:49] _Tariq: has joined #RubyOnRails
[13:20:58] chridal: matthewd: I just thought I understood it like Ruby handles one single request at a time.
[13:20:59] DmitryBochkarev: has joined #RubyOnRails
[13:21:01] xhoy: chridal: you can only do that with an worker ... since its async
[13:21:13] chridal: And I don't want to use a worker queue.
[13:21:17] chridal: Hence Node.js.
[13:21:18] matthewd: (this still feels like worker territory to me, but I can't argue against your gut)
[13:21:29] xhoy: chridal: why isn't a worker good for this?
[13:21:30] chridal: It must be solved with a worker indeed.
[13:21:43] matthewd: No, it really mustn't
[13:21:51] xhoy: chridal: sometimes a worker needs to send 10 emails (all coworkers) and 2 messages, sometimes it only needs to notify 1
[13:21:56] quazimodo: has joined #RubyOnRails
[13:22:05] worstcase: has joined #RubyOnRails
[13:22:15] pawnbox: has joined #RubyOnRails
[13:22:19] xhoy: chridal: and no this will nog give you MS stuff
[13:22:22] matthewd: > I just thought I understood it like Ruby handles one single request at a time
[13:22:24] matthewd: You were wrong.
[13:22:30] chridal: Imagine if you have 40k requests per second hitting that Rails app and each one of them have to talk to a separate API
[13:22:51] chridal: That sounds like food for Node to me.
[13:23:09] xhoy: matthewd: why would node be anybeter then a random other system?
[13:23:13] matthewd: I don't know how to prove that, short of implementing the thing, apart from saying: no, that's not a thing.
[13:23:26] durexlw: About hash and map: to give a simple exmaple: "hash = { 1 => ["value1", "value2"] }". I expected that "hash.each { |k, v| v.map { |v| "test" } }" would output: "{1=>["test", "test"]}", but in stead it outputs: "{1=>["value1", "value2"]}". Can anyone explain where I'm doing it wrong?
[13:23:27] chridal: Any thing with an event loop would be great to solve it
[13:23:33] s1|verfox: xhoy: Sweet. Thanks for the link. I get it now. I thought the initial html version had form inside form and was working. Guess I was wrong about the ordering.
[13:23:49] rvanlieshout: durexlw: you're mixing output and return value
[13:23:57] rvanlieshout: .each just iterates and calls "test".. which results in nothing
[13:24:03] chridal: matthewd: But please explain me then how it would work? I am very eager to learn that I don't have to use Node for it.
[13:24:05] rvanlieshout: then it returns itself and console prints the output of that
[13:24:27] durexlw: rvanlieshout: give me a sec to let that sink in :)
[13:24:34] chridal: Are you saying that Rails + a worker queue will scale as well for this issue as an event loop with evented IO will?
[13:24:49] xhoy: durexlw: replace the .each with a .map
[13:24:58] chridal: If so then please educate me as to how, because I don't understand the issue then
[13:25:11] xhoy: chridal: ofz it will, but your issue is the ms stuff.
[13:25:23] chridal: xhoy: That's the scaling part.
[13:25:28] chridal: It doesn't scale as well if the ms increases
[13:25:33] chridal: we need the same speed as Messenger has for instance.
[13:25:47] rvanlieshout: durexlw: a rails console will always print the returned value of a statement
[13:25:52] xhoy: 'no system' will work with 40k/s requests, and then do 20 addition tasks
[13:26:02] rvanlieshout: both look like the same deal
[13:26:27] EdwardIII: hey, i'm trying to figure out how to monkey patch I18n for a unit test: https://gist.github.com/EdwardIII/f3ae6187442bebc2b3c0#file-t-rb-L24
[13:26:28] adre_: has joined #RubyOnRails
[13:26:30] matthewd: chridal: If you're dealing with 40k rps, you probably need something better than random IRC advice
[13:26:36] durexlw: xhoy: replacing with .map returns an array
[13:26:37] EdwardIII: but not having any luck?
[13:26:49] chridal: matthewd: That's just the numbers we're using for the use case analysis
[13:26:53] rvanlieshout: durexlw: so your each is just executed.. you're not doing anything within
[13:27:00] chridal: we have a speed we want to achieve
[13:27:04] chridal: and we need to meet the requirements
[13:27:05] durexlw: rvanlieshout: I see
[13:27:23] durexlw: rvanlieshout: so basically, a nested map does nothing
[13:27:26] chridal: Anyhow so much to do, so little time.
[13:27:31] rvanlieshout: durexlw: no. that's not the case
[13:27:34] rvanlieshout: what are you trying to do?
[13:27:36] chridal: Thanks for the discussion
[13:27:47] xhoy: chridal: your problem is money :)
[13:27:55] s1|verfox: thanks for sharing chridal
[13:27:57] chridal: No. We have money
[13:27:58] ddv: mo money mo problems
[13:28:04] chridal: We just don't have the people
[13:28:15] xhoy: chridal: what you want can be " easly" done with a worker, but that is to slow, so you need to build a basecam thing (lots of work)
[13:28:19] xhoy: so lost of money
[13:28:24] xhoy: basecamp
[13:28:28] chridal: or rather; lots of time. Which we don't have.
[13:28:32] chridal: Our system is super slow atm.
[13:28:46] durexlw: rvanlieshout: I'm looking for a statement to turn this kind of hash: "hash = { 1 => ["value1", "value2"] }" into "{ 1 => ["test", "test"] }"
[13:28:47] chridal: xhoy: It can't be done with a worker if it's too slow.
[13:28:52] chridal: That means it doesn't fit the use case.
[13:28:59] xhoy: yeah so go to your boss and say, hi! there is this super awsome system (basecamp) but then i need more time
[13:29:01] durexlw: it's an oversimplification of the actual problem, but the principle is the same
[13:29:05] chridal: If the requirement is 50 ms the requirement is 50 ms.
[13:29:09] matthewd: Basecamp have a total of 12 programmers
[13:29:15] pawnbox: has joined #RubyOnRails
[13:29:18] xhoy: chridal: then you need to use the basecamp method
[13:29:26] rohit: has joined #RubyOnRails
[13:29:28] matthewd: I'm not sure why worker = slow
[13:29:33] chridal: first of all the basecamp method is not available to the rest of us since rails is in beta
[13:29:35] xhoy: matthewd: slower :)
[13:29:36] chridal: AC is in beta *
[13:29:52] chridal: matthewd: it's a lot slower than evented io running on metal
[13:30:02] rvanlieshout: durexlw: you know it's going to be a dodgy solution with fake values, right?
[13:30:05] chridal: matthewd: An async worker queue can not compete with a node service doing the same thing
[13:30:18] chridal: That's obvious
[13:30:27] chridal: Hitting Redis is a lot slower than hitting cache or RAM
[13:30:35] xhoy: chridal: no it can't but your option doesn't scal aswell so in the end
[13:30:37] rvanlieshout: durexlw: Hash[hash.map{ |key, values| [key, values.map{ |value| 'test' }] }]
[13:30:38] chridal: and that's just part of the issue
[13:30:42] durexlw: rvanlieshout: I think it would help me to understand the mechanics of "map"
[13:30:50] rvanlieshout: it won't, cause map is not the problem here
[13:30:55] chridal: Well, I'll just have to write it in Node. That's basically my answer for now :P
[13:30:55] matthewd: chridal: You're conflating work distribution strategy with implementation language/platform
[13:31:16] matthewd: You just put "async worker queue" and "node service" on opposite sides of a comparison
[13:31:23] chridal: matthewd: It is tied together since this also needs to run on servers
[13:31:27] sevenseacat: 'rails is too slow? rewrite it in node!'
[13:31:34] chridal: It's not Rails that is too slow.
[13:31:35] sevenseacat: now you have 2 problems
[13:31:43] chridal: It's the fact that an async worker queue is not the right fit for the issue
[13:31:48] chridal: and Rails is not evented
[13:31:50] sevenseacat: you have a) a slow system and b) nodejs
[13:32:02] chridal: Well, I don't want NodeJS. I'd love to do evented IO in Ruby.
[13:32:26] chridal: But EventMachine doesn't seem to be used by terribly many large sized deployment
[13:32:47] sevenseacat: i'll admit i have no idea what you mean by evented IO, but 'rewrite the whole system to fix performance' is never the right answer
[13:33:22] chridal: Well, it sort of imples understanding why asynchronous is better than syncronous to properly understand if it should be rewritten
[13:33:32] chridal: We're not rewriting the API though. Just the chat message part.
[13:33:54] matthewd: > Rails is not evented
[13:34:01] matthewd: Yeah, I think you should go with node
[13:34:08] chridal: This chat server will basically just: 1) Receive new messages 2) Hit pusher 3) Process for @mentions etc. 4) Generate notify object 5) Hit pusher to notify notifyees
[13:34:15] matthewd: Run straight on the metal, and things will be much better
[13:34:40] durexlw: rvanlieshout: damned... just like that huh :) next time make it seem hard, then i feel better
[13:34:44] chridal: matthewd: So you are arguing for that a worker queue will solve this issue well then?
[13:35:25] chridal: Evented IO is a perfect fit for that problem.
[13:35:36] chridal: thanks for the discussion, though. -> work :-)
[13:36:11] sevenseacat: a solution looking for a problem, eh
[13:37:22] rvanlieshout: durexlw: i will :)
[13:37:27] chridal: To be honest I was mostly interested in discussing using HTTP over a UNIX socket to communicate between two Docker containers running on a single host (node and Rails) to solve this issue
[13:37:43] chridal: the Node part of the architecture was already settled
[13:38:09] chridal: Interested in how well the Rails API would perform being hit by that Node instance
[13:38:16] chridal: don't know if it's a stupid solution
[13:38:26] ddv: are you the next Facebook chridal?
[13:38:33] chridal: ddv: I know where this is headed.
[13:38:34] durexlw: rvanlieshout: is it possible to do it without the Hash[] ? So basically you're now making an array and then convert it back to a hash... is it possible to map a hash to a hash? something like "hash.map { |k, v| k => v }" ? (this throws an error, but I'm just wondering if there's a syntax that wouldn't give an errror)
[13:38:54] durexlw: ow, wait...
[13:39:00] rvanlieshout: durexlw: not that i'm aware of
[13:39:07] rvanlieshout: but either way you shouldn't have to do this
[13:39:12] rvanlieshout: fix it where you create the hash
[13:39:49] maxdoubt: has joined #RubyOnRails
[13:40:04] zworks: has joined #RubyOnRails
[13:40:17] zworks: I have a users table and employers table, and a third table called whitelist, the whitelist table contains, user_id and employer_id columns, i.e. a user can whitelist many employers
[13:40:18] durexlw: rvanlieshout: I don't think it's possible: I do a AR query and I need to serialize it in order to output to a graph
[13:40:25] trinaldi: has joined #RubyOnRails
[13:40:25] chouhoulis: has joined #RubyOnRails
[13:40:28] zworks: now i want to get all the employers whom a specific user has not whitelisted, how can i do that ?
[13:40:58] xhoy: user.employees.where(whitelisted: true) ?
[13:41:11] rvanlieshout: durexlw: then serialize it correctly
[13:41:37] barhum2013: has joined #RubyOnRails
[13:41:58] krz: has joined #RubyOnRails
[13:43:26] rvanlieshout: zworks: what does 'user has not whitelisted' mean from a employees perspective?
[13:43:34] drbayer: has joined #RubyOnRails
[13:43:43] openstruct: has joined #RubyOnRails
[13:43:48] SteenJobs: has joined #RubyOnRails
[13:44:55] openstru_: has joined #RubyOnRails
[13:45:02] zworks: it means, let's say there is a emp with id 7, and a user with id 2, then a row in the 'whitelist' table with these two values doesn't exists
[13:45:52] voobscout: has joined #RubyOnRails
[13:46:15] _Tariq: has joined #RubyOnRails
[13:46:36] zworks: rvanlieshout: if user (id 2) wants to whitelist employer (id 7 ), there will be a row inserted to 'whitelist' table, with 2 for the user_id column and 7 for the employer_id column
[13:46:59] zworks: rvanlieshout: got how it works?
[13:47:10] tvw: has joined #RubyOnRails
[13:47:33] SeanLazer: has joined #RubyOnRails
[13:47:42] xhoy: zworks: a many to many relation?
[13:47:47] openstruct: has joined #RubyOnRails
[13:48:00] zworks: xhoy: yep
[13:48:06] xhoy: zworks: how does your model look like (on both ends)
[13:48:42] ianfleeton: has joined #RubyOnRails
[13:49:44] rvanlieshout: zworks: and you want all employees that are not whitelisted by a given user?
[13:50:00] zworks: rvanlieshout: yep exactly
[13:50:19] emachnic: has joined #RubyOnRails
[13:50:27] rvanlieshout: Employee.includes(:whitelists).where.not(whitelists: { user_id: user.id })
[13:50:43] rvanlieshout: Employee.where.not(id: user.whitelists.select('employee_id'))
[13:50:59] jeanre: has joined #RubyOnRails
[13:50:59] jeanre: has joined #RubyOnRails
[13:51:23] bronson: has joined #RubyOnRails
[13:53:06] stannard: has joined #RubyOnRails
[13:53:20] chipotle: has joined #RubyOnRails
[13:53:24] MrNagoo_: has joined #RubyOnRails
[13:53:39] ferr: https://gist.github.com/Fercell/3c0482379ecee6e601d7 any ideas why it takes user ferr instead of postgres?
[13:54:07] rvanlieshout: ferr: the adapter documentation told you to use username and not user?
[13:54:32] tetraktys: has joined #RubyOnRails
[13:55:44] ferr: rvanlieshout: what do you mean?
[13:56:28] rvanlieshout: are you sure those keys are the expected ones?
[13:57:13] ferr: I believe so
[13:58:19] defsdoor: has joined #RubyOnRails
[13:58:21] zworks: rvanlieshout: the second one seems straightforward, thanks :)
[14:01:31] voobscout: has joined #RubyOnRails
[14:02:11] _djbkd: has joined #RubyOnRails
[14:06:54] _Tariq: has joined #RubyOnRails
[14:08:28] flashpoint9: has joined #RubyOnRails
[14:08:54] chipotle: has joined #RubyOnRails
[14:12:07] humbledaisy: has joined #RubyOnRails
[14:14:14] emachnic: has joined #RubyOnRails
[14:16:04] ramortegui: has joined #RubyOnRails
[14:16:48] daivyk: has joined #RubyOnRails
[14:17:25] sankaber: has joined #RubyOnRails
[14:17:57] bryyy: has joined #RubyOnRails
[14:18:54] tetraktys: has joined #RubyOnRails
[14:19:54] jas02: has joined #RubyOnRails
[14:19:59] solars: has joined #RubyOnRails
[14:20:17] chipotle: has joined #RubyOnRails
[14:21:44] Guest34101: has joined #RubyOnRails
[14:22:44] ppinkerton: has joined #RubyOnRails
[14:23:05] lacrymology: has joined #RubyOnRails
[14:24:37] worknick: i tried this <%= p.input :actimg, :label=>nil, as: :file, :input_html => { :value => '1.jpg' }, :required => true%> to make paperlclip upload button not have any label. but it still print the model column name.
[14:26:00] godzillaenlacasa: has joined #RubyOnRails
[14:27:04] durexlw: Anyone know a way to return only the database fields of a certain model? So if contracts table would have 'name' and 'id' as fields, I'd like a way to output from Contract.some_method the fields in that database
[14:28:28] mikecmpbll: has joined #RubyOnRails
[14:28:32] Denarii: has joined #RubyOnRails
[14:30:11] blackmesa: has joined #RubyOnRails
[14:31:04] kerunaru: has joined #RubyOnRails
[14:31:40] durexlw: ".attributes.keys" would do the trick
[14:31:45] chipotle: has joined #RubyOnRails
[14:31:46] Dustin: has joined #RubyOnRails
[14:32:27] Dustin: has left #RubyOnRails: ()
[14:32:45] reckoner: has joined #RubyOnRails
[14:33:00] artto: has joined #RubyOnRails
[14:33:30] worknick: durexlw: hi
[14:33:36] durexlw: sup reckoner
[14:33:43] durexlw: hiya worknick :)
[14:37:06] tbuehlmann: durexlw, try `Contract.column_names`
[14:37:30] PedramT: has joined #RubyOnRails
[14:37:31] durexlw: tbuehlmann: that's shorter :)
[14:37:37] fmcgeough: has joined #RubyOnRails
[14:37:46] sled: has joined #RubyOnRails
[14:37:47] durexlw: shorter makes me happy... it's like with a girl's skirt...
[14:38:01] tbuehlmann: what the actual
[14:41:00] rubyonrails860: has joined #RubyOnRails
[14:41:06] chouhoulis: has joined #RubyOnRails
[14:42:09] rubyonrails860: anyone know how I log in?
[14:42:50] aub: has joined #RubyOnRails
[14:43:08] rubyonrails860: I have no clue how to work IRC... I guess I'm in but this isn't my nickname
[14:43:29] reckoner: go read a tutorial on how irc works.
[14:44:03] ferr: has joined #RubyOnRails
[14:44:13] amiuhle: has joined #RubyOnRails
[14:44:26] chipotle: has joined #RubyOnRails
[14:44:31] voobscout: has joined #RubyOnRails
[14:44:45] rubyonrails860: I'm good now. I'm new to rails. Just logging in to watch convo's and learn
[14:45:07] rubyonrails860: I'm taking the BLOC.io rails course
[14:45:32] reckoner: irc is a lot like platform 9 3/4
[14:45:41] reckoner: there is no "door"
[14:46:06] nzst: has joined #RubyOnRails
[14:46:44] amiuhle: has left #RubyOnRails: ()
[14:46:55] nzst: How do I disable the application template for a specific route?
[14:47:04] amiuhle: has joined #RubyOnRails
[14:47:05] reckoner: layout false
[14:47:20] rubyonrails860: within the method layout false?
[14:48:18] amiuhle: Hi guys, just a quick question about naming convention: For a datetime field like an expiration date, would you use *expires_at* or *expired_at*?
[14:48:43] nzst: reckoner: rubyonrails860: that was it :) thank you, both
[14:48:45] reckoner: render layout: false
[14:49:12] aub: has joined #RubyOnRails
[14:49:20] amiuhle: Basically the same question for all timestamps that might be in the future or in the past
[14:49:36] jeanre: I know this has been asked 100 times
[14:49:49] jeanre: but whats the status of rails 5? we are in desperate need of action cable
[14:49:56] jeanre: using sync currently
[14:50:00] jeanre: and its a pain in the ass
[14:50:11] rvanlieshout: nothing to say about that
[14:50:17] rvanlieshout: except what's on their website / github page
[14:50:25] jeanre: yeah its beta 1 still IIRC
[14:51:01] amiuhle: it's beta2, and rc was originally planned last week
[14:51:02] sevenseacat: no, its beta 2
[14:51:22] ddv: jeanre: close some of the open issues and it will go faster <3
[14:51:33] BlazeBoy: has joined #RubyOnRails
[14:51:38] jeanre: ddv if I had time I would
[14:51:38] aub: has joined #RubyOnRails
[14:52:15] mices: good morning everybody, happy monday
[14:52:44] aub: has joined #RubyOnRails
[14:52:52] bronson: has joined #RubyOnRails
[14:52:56] matthewd: jeanre: Current rc1 status is "very soon" -- it got pushed by a week, and still seems to be not quite there.. still a number of blocker issues
[14:53:44] mices: what's action cable?
[14:54:02] awea: has joined #RubyOnRails
[14:55:46] nattyPablo: has joined #RubyOnRails
[14:55:55] arup_r: has joined #RubyOnRails
[14:56:08] chipotle: has joined #RubyOnRails
[14:56:11] nzst: mices: https://github.com/rails/rails/tree/master/actioncable
[14:56:37] worknick: any idea on hiding papercrlip upload button label?
[14:57:11] nzst: worknick: maybe you can find a way to target it in your css
[14:58:13] aub: has joined #RubyOnRails
[14:58:15] PedramT: has joined #RubyOnRails
[15:00:06] aaronr: has joined #RubyOnRails
[15:00:38] B1n4r10: has joined #RubyOnRails
[15:01:11] umgrosscol: has joined #RubyOnRails
[15:01:17] stannard: has joined #RubyOnRails
[15:01:29] hcnewsom: has joined #RubyOnRails
[15:02:38] snowy: has joined #RubyOnRails
[15:03:45] aaronr_: has joined #RubyOnRails
[15:03:56] stannard: has joined #RubyOnRails
[15:04:07] nzst: you're welcome
[15:05:24] PedramT: has joined #RubyOnRails
[15:06:43] worknick: arup_r: ping you there?
[15:07:56] arup_r: wait.. I am having some VPN issues.. let me fix it. Not able to work. If I connect through VPN, not able to google.. Network admin is saying it is my config issue.. all seems weird here.. :/
[15:11:16] PedramT: has joined #RubyOnRails
[15:11:47] maxdoubt: has joined #RubyOnRails
[15:13:47] akshat: has joined #RubyOnRails
[15:13:56] syf-revk: has joined #RubyOnRails
[15:14:23] jocuman: has joined #RubyOnRails
[15:15:35] akshat: has joined #RubyOnRails
[15:16:32] sankaber: has joined #RubyOnRails
[15:19:41] akshat: has joined #RubyOnRails
[15:19:43] samgranieri: has joined #RubyOnRails
[15:19:59] jeanre: has joined #RubyOnRails
[15:19:59] jeanre: has joined #RubyOnRails
[15:20:27] drbayer: has joined #RubyOnRails
[15:22:02] IrishGringo: has joined #RubyOnRails
[15:22:33] akshat: has joined #RubyOnRails
[15:26:29] nzst: Does anyone have a workflow for injecting data into an overlay?
[15:28:54] syf-revk: has joined #RubyOnRails
[15:30:05] mary5030: has joined #RubyOnRails
[15:30:34] reckoner: you mean a modal?
[15:31:05] adavia: has joined #RubyOnRails
[15:31:11] PedramT: has joined #RubyOnRails
[15:31:38] msyvich: has joined #RubyOnRails
[15:31:53] msyvich: I'm looking for documentation on using capistrano + a build artefact strategy.
[15:32:02] msyvich: I don't suppose anyone could refer me to one? :)
[15:32:12] msyvich: I'm looking in particular at GitHub releases as the artefact repository.
[15:32:45] msyvich: I assume I would just override one or two of the tasks, to push to GH Releases instead of directly to the server?
[15:33:52] umgrosscol: has left #RubyOnRails: ("Leaving")
[15:35:50] flashpoint9: has joined #RubyOnRails
[15:37:19] eladmeidar: has joined #RubyOnRails
[15:38:51] ss_much: has joined #RubyOnRails
[15:39:20] tubbo: msyvich: you'd probably want to push to github as a tag, then tell github to define a release based on that tag
[15:39:37] tubbo: msyvich: i suppose your capistrano task would just pull down the .tar.gz at that particular version and untar it in the dir you want to deploy your rails app in
[15:39:56] tubbo: i mean, just do it...like you would normally an artefact project :D
[15:40:35] msyvich: tubbo, the release would need to be built locally (later on Jenkins) then pushed to GitHub... through a GitHub releases API client
[15:40:41] msyvich: this is what I've been thinking
[15:40:53] laith: has joined #RubyOnRails
[15:41:18] msyvich: I was surprised at the dearth of examples of this pattern in Capistrano docs / discussion
[15:41:28] artto: has joined #RubyOnRails
[15:41:39] syf-revk: has joined #RubyOnRails
[15:41:46] msyvich: the build artefact repo pattern that is
[15:41:53] polishdub: has joined #RubyOnRails
[15:42:36] Maletor: has joined #RubyOnRails
[15:42:43] emachnic: has joined #RubyOnRails
[15:43:06] cpruitt: has joined #RubyOnRails
[15:44:21] futilegames: has joined #RubyOnRails
[15:44:35] msyvich: tubbo, so presumably I would override the deploy:updating task with the build script + release upload
[15:44:56] msyvich: then override the deploy:publishing task to pull this down?
[15:45:02] msyvich: tubbo, (totally new to capistrano)
[15:45:41] tubbo: msyvich: that's because it's completely pointless imho
[15:45:58] tubbo: like there's no reason to go through the extra step of tarballing and untarring the release
[15:46:03] tubbo: except for special circumstances of course
[15:46:04] msyvich: i disagree
[15:46:27] syf-revk: has joined #RubyOnRails
[15:46:33] tubbo: msyvich: what's the win here? i've done archive-ish releases of things, but only because it was my only option
[15:46:48] tubbo: like i've packaged up an entire linux distribution, rails app frontend included, for upgrading an appliance
[15:46:50] syf-revk: has left #RubyOnRails: ()
[15:46:54] dhf: has joined #RubyOnRails
[15:47:06] tubbo: but we couldn't use capistrano because the box wasn't connected to the internet
[15:47:07] msyvich: (1) i think it's helpful when the exact same artefact which goes to production is the one which was testing in pre-prod / testing / integration environments
[15:47:13] mary5030: has joined #RubyOnRails
[15:47:33] msyvich: (2) i think it makes sense to do builds on build servers and not on application servers
[15:47:54] msyvich: building operations have different dependencies & resource demands than applications
[15:48:15] tubbo: well a "build" in a rails project is just downloading dependencies and putting code on the filesystem.
[15:48:23] tubbo: (well, if you count native extensions haha)
[15:48:23] msyvich: not necessarily
[15:48:40] msyvich: front end code minification, automated test suites, etc.
[15:48:45] syf-revk: has joined #RubyOnRails
[15:48:50] rubyonrailed: has joined #RubyOnRails
[15:48:55] syf-revk: has left #RubyOnRails: ()
[15:49:07] treehug88: has joined #RubyOnRails
[15:51:14] allcentury: has joined #RubyOnRails
[15:51:24] syf-revk: has joined #RubyOnRails
[15:51:55] syf-revk: has left #RubyOnRails: ()
[15:52:16] syf-revk: has joined #RubyOnRails
[15:52:51] tubbo: eh, this whole obsession with production parity is just bikeshedding imho
[15:52:59] tubbo: i'm down with it but people really get obsessed
[15:53:13] fedexo: has joined #RubyOnRails
[15:53:29] tubbo: like one of the teams here almost mutinied their lead because he wanted to force everyone to always run the rails server essentially in production, and it was a huuuge bitch to develop on
[15:53:48] tubbo: and i've seen people here try to develop entirely within the same docker containers as their production app, in a VM, and wondering why things are slow
[15:54:10] catcherdev: has joined #RubyOnRails
[15:54:36] epochwolf: rails has a development mode for a reason.
[15:54:59] epochwolf: And you really should have a qa or staging environment that you deploy to before production.
[15:55:11] epochwolf: qa/staging should be as close to production as possible.
[15:55:18] epochwolf: Even using sanitized production data if you can.
[15:56:35] sled: has joined #RubyOnRails
[16:01:51] diegoviola: has joined #RubyOnRails
[16:01:59] diegoviola: has joined #RubyOnRails
[16:03:25] kies^: has joined #RubyOnRails
[16:03:50] _djbkd: has joined #RubyOnRails
[16:04:07] msyvich: has joined #RubyOnRails
[16:04:56] unl0ckd: has joined #RubyOnRails
[16:06:58] joshkovach: has joined #RubyOnRails
[16:10:07] godzillaenlacasa: has joined #RubyOnRails
[16:10:44] humbleda_: has joined #RubyOnRails
[16:11:25] msyvich: has joined #RubyOnRails
[16:12:08] disgrntld: has joined #RubyOnRails
[16:13:04] chouhoulis: has joined #RubyOnRails
[16:14:14] n1lo: has joined #RubyOnRails
[16:16:23] kmckelvin: has joined #RubyOnRails
[16:19:12] dionysus69: has joined #RubyOnRails
[16:20:58] syf-revk: has left #RubyOnRails: ()
[16:20:59] syf-revk: has joined #RubyOnRails
[16:21:37] syf-revk: has left #RubyOnRails: ()
[16:21:38] syf-revk: has joined #RubyOnRails
[16:21:47] syf-revk: has left #RubyOnRails: ()
[16:23:11] lambao: has joined #RubyOnRails
[16:24:13] msyvich: has joined #RubyOnRails
[16:24:29] nzst: Use form_tag can I get the submit button to fire off a javascript function?
[16:24:33] cschneid_: has joined #RubyOnRails
[16:24:49] durexlw: laterz all!
[16:25:27] humbledaisy: has joined #RubyOnRails
[16:25:48] iamvery: has joined #RubyOnRails
[16:27:02] msyvich: has joined #RubyOnRails
[16:27:04] nzst: here's some example code: on submit I want to fire a js function as well as the other
[16:27:09] nzst: http://paste.lisp.org/display/307952
[16:27:24] sled: has joined #RubyOnRails
[16:28:13] syf-revk: has joined #RubyOnRails
[16:29:59] GeorgesLeYeti: has joined #RubyOnRails
[16:30:34] Maletor: has joined #RubyOnRails
[16:31:10] PedramT_: has joined #RubyOnRails
[16:31:55] KensoDev: has joined #RubyOnRails
[16:34:18] voobscout: has joined #RubyOnRails
[16:34:53] jeanlinux: has joined #RubyOnRails
[16:35:20] PedramT: has joined #RubyOnRails
[16:36:13] nettoweb: has joined #RubyOnRails
[16:36:45] GeorgesLeYeti: I have a problem pretty hard to explain but I'll try. I have 2 documents (1 html and 1 XML). The HTML contain the layout and the XML contain some attribute. Both file contains the same text. I would like to mix both of same in 1 document.
[16:36:48] GeorgesLeYeti: https://gist.github.com/GeorgesLeYeti/62de22bc82a008c14c6b
[16:36:58] syf-revk: anyone know a good place for a newbie to find documentation on rails commands? was looking for a ruby-doc type of style.
[16:37:24] epochwolf: GeorgesLeYeti: getting a 404 on the gist?
[16:37:40] rubyonrailed: has joined #RubyOnRails
[16:37:44] phasor: has joined #RubyOnRails
[16:37:44] tubbo: syf-revk: `rails help [COMMAND]` is usually what i use.
[16:37:53] tubbo: i don't know of any web-based documentation other than what's in the guides.
[16:38:04] tubbo: (unless you're trying to figure out how rails commands work under the hood)
[16:39:14] GeorgesLeYeti: https://gist.github.com/GeorgesLeYeti/9c64344e43d35a32ce77
[16:39:22] baweaver: has joined #RubyOnRails
[16:39:37] PedramT_: has joined #RubyOnRails
[16:39:41] dopamean_: has joined #RubyOnRails
[16:41:53] tubbo: GeorgesLeYeti: 404
[16:42:36] syf-revk: cheers tubbo - was looking for specific examples but it seems i just wasn't looking hard enough, -h does the job for now
[16:43:11] smoitra: has joined #RubyOnRails
[16:43:31] phasor: has left #RubyOnRails: ()
[16:43:33] GeorgesLeYeti: tubbo, do you know another other website ?
[16:43:52] voobscout: has joined #RubyOnRails
[16:44:01] epochwolf: nzst: That kind of behavior isn't rails-specific, it's just basic javascript or jquery. Look up the submit event for form tags. :)
[16:44:17] epochwolf: GeorgesLeYeti: http://pastie.org/
[16:44:36] korzybski: has joined #RubyOnRails
[16:44:41] GeorgesLeYeti: https://gist.github.com/anonymous/4b3f2b3e1f0f8178e5bd
[16:45:01] epochwolf: That worked
[16:45:06] jeanre: has joined #RubyOnRails
[16:45:06] jeanre: has joined #RubyOnRails
[16:45:44] syf-revk: has left #RubyOnRails: ()
[16:46:30] epochwolf: GeorgesLeYeti: you'll need to write some custom code for that. I recommend looking up nokogiri and coding that yourself.
[16:48:36] beneggett: has joined #RubyOnRails
[16:49:23] GeorgesLeYeti: epochwolf, ok too bad for me :D
[16:50:07] epochwolf: GeorgesLeYeti: you are going to have a lot of custom logic on how you want the merge to work. An automated tool would probably do the wrong thing.
[16:50:59] safety_cut: has joined #RubyOnRails
[16:54:37] dn5: has joined #RubyOnRails
[16:54:38] bronson: has joined #RubyOnRails
[16:54:39] Hans267: has joined #RubyOnRails
[16:56:07] syf-revk: has joined #RubyOnRails
[16:58:00] marr: has joined #RubyOnRails
[17:01:06] NeoHamled: has joined #RubyOnRails
[17:01:39] godzillaenlacasa: So, I just made my own Class called TransferData, which I have a method, called 'transfer'. How can I go about calling the ClassMethod in another ruby script? `include TransferData` `TransferData.transfer` ?
[17:02:17] reckoner: require 'file_name'
[17:02:28] EdwardIII: guys how do you handle stubbing out the I18n class/constant?
[17:02:29] reckoner: TransferData.transfer
[17:02:43] EdwardIII: i want to change the response of I18n.available_locales in a unit test
[17:02:50] godzillaenlacasa: @reckoner I do `require_relative "../transfer`
[17:03:12] godzillaenlacasa: But, I'm getting this error: "wrong argument type Class (expected Module)"
[17:03:16] reckoner: at replies work in twitter or whatever bullcrap slack channel you use.
[17:03:42] reckoner: use whatever require_relative or require. depends on your implementation.
[17:04:06] EdwardIII: i tried using I18n.include to monkey patch it in my unit test, but it doesn't seem to have any effect
[17:04:56] tubbo: reckoner: i don't see a reason to discourage the use of @-replies
[17:05:08] tubbo: except for at-here and at-all. use those and i'll +q you immediately.
[17:05:59] reckoner: it literally doesn't do anything. i'm fine slapping down improper use.
[17:06:01] chipotle: has joined #RubyOnRails
[17:06:08] reckoner: otherwise people will paste code all over the place.
[17:10:13] EdwardIII: heh ok so when there's a conflict it looks like the order that they're defined is what defines the winner: https://gist.github.com/EdwardIII/70940cde4c1f3a06d928
[17:10:43] tubbo: reckoner: there's a difference between pasting code (which floods clients and can cause YOU to be g-lined...we do that for your own protection!) and using a different character than ':' to mention a name.
[17:11:08] tubbo: not sure if there's a way to do that with weechat, but if i would i'd just configure my client to use @-replies all the time since i need them for hipchat
[17:11:33] tubbo: i use weechat to talk over hipchat as well and have to manually @-mention people, if i use tab-completion they don't get a notification
[17:11:39] tubbo: hipchat can't figure out i'm mentioning them
[17:11:42] diegoviola: has joined #RubyOnRails
[17:12:22] PedramT: has joined #RubyOnRails
[17:14:44] gthank: has joined #RubyOnRails
[17:14:45] gthank: has joined #RubyOnRails
[17:18:41] nettoweb: has joined #RubyOnRails
[17:19:05] EdwardIII: hrm i can't find a module/class for I18n. i can find Rdoc::I18n, but not a module or class called I18n
[17:19:26] astrofog: has joined #RubyOnRails
[17:19:35] agit0: has joined #RubyOnRails
[17:20:22] EdwardIII: is this not a common question? i can't seem to find any info on how to do this
[17:21:03] worknick: anyone using http://plugins.krajee.com/star-rating
[17:21:34] matthewd: EdwardIII: It comes from the i18n gem
[17:21:40] RegulationD: has joined #RubyOnRails
[17:22:09] jeanre: has joined #RubyOnRails
[17:22:09] jeanre: has joined #RubyOnRails
[17:22:12] FooMunki: has left #RubyOnRails: ()
[17:22:20] EdwardIII: looks like i can just bang the values in as part of the setup for my test
[17:23:15] jeanlinux: has joined #RubyOnRails
[17:23:21] EdwardIII: I18n.available_locales = ['en', 'fr'] heh
[17:24:07] Dbugger: has joined #RubyOnRails
[17:24:09] Dbugger: Hello fellas
[17:24:40] Dbugger: Could someone help me debug my app in production? I am getting a "We're sorry, but something went wrong." and I have no idea where to look, to figure out why..
[17:26:31] Denommus: has joined #RubyOnRails
[17:26:52] kmckelvin: has joined #RubyOnRails
[17:26:54] Denommus: how would I write this query in ActiveRecord? SELECT MAX(c.count), c.user FROM (SELECT COUNT(*), tweets.user FROM tweets GROUP BY tweets.user) AS c GROUP BY c.user
[17:27:13] jmignault: has joined #RubyOnRails
[17:29:09] matthewd: Denommus: I doubt that's the query you actually want
[17:29:39] flashpoint9: dbugger: you need to post your code and describe more than just "thing no work"
[17:30:15] Dbugger: flashpoint9, that is the problem. I have no idea where to start. the "/log" folder is literally empty. I have looked into nginx log and access files. also empty! I have no idea where is the break point...
[17:30:54] flashpoint9: but we have no idea what your code looks like or what the specific problem is
[17:31:07] flashpoint9: there are gems that help with debugging
[17:31:31] Dbugger: I restarted my server,and now Im not even getting the message
[17:31:31] Denommus: matthewd: you're right, SELECT COUNT(*) AS count, tweets.user FROM tweets GROUP BY tweets.user ORDER BY count LIMIT 1 is better
[17:31:36] flashpoint9: but in the end youll likely have to post your code and/or describe the errors and what you were trying to accomplish in detail
[17:31:43] Dbugger: so Im suspecting that for some reason Im not reaching the server..
[17:31:57] flashpoint9: dbugger: well sometimes in rails you need to restart the local server
[17:31:59] KensoDev: has joined #RubyOnRails
[17:32:41] Dbugger: flashpoint9, I already did a "puma restart". But that is not the weird thing... how could I be getting an "We're sorry, but something went wrong." message, but the access logs from apache are empty??
[17:32:54] Dbugger: i meant from nginx, sorry
[17:33:13] browndawg: has joined #RubyOnRails
[17:33:33] browndawg: How am I supposed to handle CSRF for a site that almost exclusively responds with JSON?
[17:33:42] browndawg: I include the token in every json response?
[17:34:20] arup_r: browndawg: no, just disable it.
[17:34:53] browndawg: arup_r: How is that a solution. :-\
[17:34:56] chipotle: has joined #RubyOnRails
[17:35:47] arup_r: browndawg: http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html
[17:36:13] fernandomm: has joined #RubyOnRails
[17:37:29] arup_r: browndawg: that is an exclusive solution "It's important to remember that XML or JSON requests are also affected and if you're building an API you'll need something.." :D
[17:38:27] B1n4r10: has joined #RubyOnRails
[17:39:36] aweis: has joined #RubyOnRails
[17:39:40] defsdoor: has joined #RubyOnRails
[17:40:48] rakm: has joined #RubyOnRails
[17:41:30] aub: has joined #RubyOnRails
[17:41:38] aadam21: has joined #RubyOnRails
[17:44:09] lolcodenewbie: has joined #RubyOnRails
[17:45:50] chipotle: has joined #RubyOnRails
[17:46:10] celly: has joined #RubyOnRails
[17:46:20] baweaver: has joined #RubyOnRails
[17:46:23] Palsson: has joined #RubyOnRails
[17:47:06] Dbugger: What do you guys think is the best server for a rails app?
[17:47:09] Dbugger: puma? or something else?
[17:47:11] rakm: has joined #RubyOnRails
[17:48:18] kichawa: has joined #RubyOnRails
[17:48:41] arup_r: browndawg: was that helpful ?
[17:48:43] kichawa: my config file seems to be wrong parse
[17:50:17] kichawa: dbname is postgres, should be "fooo"
[17:51:17] sleungcy: has joined #RubyOnRails
[17:51:31] browndawg: Okay, *why* is it a good idea to turn of csrf for JSON?
[17:52:28] lemur: has joined #RubyOnRails
[17:52:29] ElFerna: has joined #RubyOnRails
[17:53:48] jeanre: has joined #RubyOnRails
[17:53:48] jeanre: has joined #RubyOnRails
[17:54:52] replay: has joined #RubyOnRails
[17:55:36] shmambo: has joined #RubyOnRails
[17:56:36] chipotle: has joined #RubyOnRails
[17:56:53] korzybski: has joined #RubyOnRails
[17:58:36] bronson: has joined #RubyOnRails
[17:58:50] bricker: has joined #RubyOnRails
[17:59:00] _djbkd: has joined #RubyOnRails
[17:59:35] nzst: epochwolf: thanks
[17:59:39] Guest34101: has joined #RubyOnRails
[18:00:01] _djbkd: has joined #RubyOnRails
[18:00:18] brendan-: has joined #RubyOnRails
[18:00:55] TinkerTyper: has joined #RubyOnRails
[18:01:36] podman: has joined #RubyOnRails
[18:02:00] B1n4r10: has joined #RubyOnRails
[18:02:46] blackmesa: has joined #RubyOnRails
[18:04:18] bmalum: has joined #RubyOnRails
[18:04:25] IrishGringo: has joined #RubyOnRails
[18:06:54] unl0ckd: has joined #RubyOnRails
[18:07:30] manfrin: has joined #RubyOnRails
[18:07:52] DmitryBochkarev: has joined #RubyOnRails
[18:08:41] DmitryBochkarev: has joined #RubyOnRails
[18:09:30] chipotle: has joined #RubyOnRails
[18:09:40] tubbo: kichawa: !code
[18:09:40] helpa: kichawa: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[18:10:14] tubbo: browndawg: do you know what the CSRF token is used for?
[18:10:46] mikecmpbll: has joined #RubyOnRails
[18:12:16] humbledaisy: has joined #RubyOnRails
[18:13:47] chouhoul_: has joined #RubyOnRails
[18:15:06] [Butch]: has joined #RubyOnRails
[18:15:53] chouhoul_: has joined #RubyOnRails
[18:16:36] chubijs: has joined #RubyOnRails
[18:17:00] nachoman: has joined #RubyOnRails
[18:17:27] jottr: has joined #RubyOnRails
[18:17:38] chubijs: How do I fix Missing `secret_token` and `secret_key_base` for 'production' environment, set these values in `config/secrets.yml`? I get this by running rails server locally in production enviroment
[18:17:48] voobscout: has joined #RubyOnRails
[18:19:17] jeanlinux: has joined #RubyOnRails
[18:19:22] tbuehlmann: chubijs, right! just add them to your config/secrets.yml file
[18:19:46] tubbo: chubijs: do what the error tells you to do.
[18:19:53] godzillaenlacasa: has joined #RubyOnRails
[18:19:55] chubijs: production:
[18:19:55] chubijs: secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
[18:20:02] chubijs: how do I define the secret token?
[18:20:11] chubijs: my secret key base is already there
[18:20:20] chubijs: Or should i generate a key in terminal?
[18:21:15] tubbo: chubijs: look up what 'ENV' does in Ruby, and what '<%=' and '%>' are meant to do. that's not defining your SECRET_KEY_BASE, it's trying to read an environment variable named $SECRET_KEY_BASE, but clearly that's not defined.
[18:22:25] intrigueD: has joined #RubyOnRails
[18:23:15] chubijs: Okay, I see
[18:23:49] chubijs: So can I just do rake secret and paste the key there?
[18:24:24] chubijs: Sorry for these questions, Im new to this.. :(
[18:24:46] jottr: has joined #RubyOnRails
[18:25:46] tubbo: chubijs: yeah, and you want to set $SECRET_KEY_BASE once, at the initial launch of your application, not every time you deploy. in case that wasn't clear..
[18:26:20] disgrntld: has joined #RubyOnRails
[18:26:21] kdough: has joined #RubyOnRails
[18:26:28] tubbo: $SECRET_KEY_BASE is used as the salt for salted hash passwords, therefore if someone can access it, they can decrypt any password.
[18:27:19] humbledaisy: has joined #RubyOnRails
[18:28:45] godzillaenlacasa: @tubbo if you end up 'hard coding' your Secret key base in a file like config/secrets just make sure you take it out of version control (if you may end up sharing the project)
[18:29:02] godzillaenlacasa: sorry.. meant @chubijs
[18:29:24] tubbo: i follow the 12-factor app guidelines for my own apps, http://12factor.net/
[18:29:39] godzillaenlacasa: @tubbo yup, that's a good one
[18:30:46] GriffinHeart: has joined #RubyOnRails
[18:31:25] Denarii: has joined #RubyOnRails
[18:31:56] srinidhi: has joined #RubyOnRails
[18:31:58] srinidhi: has joined #RubyOnRails
[18:32:26] chubijs: thank you, sure will. Right now all I want to do is be able to run my app in production locally and download the static version with wget. At least thats the way people suggested to make static, simple sites with rails
[18:33:29] renanoronfle: has joined #RubyOnRails
[18:33:38] chubijs: Or is there a better way?
[18:34:20] momomomomo: has joined #RubyOnRails
[18:34:32] kirillzh: has joined #RubyOnRails
[18:34:57] kichawa: tubbo: helpa i do RAILS_ENV="production" bundle exec rake db:create
[18:34:59] blackmesa: has joined #RubyOnRails
[18:35:04] kichawa: http://paste.ofcode.org/33bEpDaC9Y6vZCQmvtBG35X
[18:36:08] drbayer: has joined #RubyOnRails
[18:36:14] kichawa: FATAL: no pg_hba.conf entry for host "192.168.0.1", user "test_test", database "postgres", SSL on
[18:36:27] kichawa: so, the migrate command works?!
[18:36:48] kichawa: why database is "postgres", should be "test_test"
[18:37:31] Ergo: has joined #RubyOnRails
[18:37:36] diegoviola: has joined #RubyOnRails
[18:40:05] celly: has joined #RubyOnRails
[18:41:08] kichawa: * rake (10.5.0)
[18:42:21] renanoronfle: hi, i start create my first gem, the gem for add controlling methods when you including the module, i have a doubt how can i test my gem, anyone can help-me?
[18:42:24] PedramT: has joined #RubyOnRails
[18:42:30] chouhoulis: has joined #RubyOnRails
[18:43:33] voobscout: has joined #RubyOnRails
[18:45:02] tubbo: kichawa: looks like you're either using the wrong postgres version (like you have two running) or your pg_hba.conf is misconfigured. it's probably not a rails issue, though.
[18:45:15] tubbo: renanoronfle: what
[18:45:21] nettoweb: has joined #RubyOnRails
[18:45:33] ball-hayden: has joined #RubyOnRails
[18:45:56] jottr_: has joined #RubyOnRails
[18:46:01] ball-hayden: has left #RubyOnRails: ()
[18:47:24] kichawa: tubbo: migrate works, i can connect via psql
[18:47:47] baweaver: How would I run a rake task inside a migration? I've tried backticks (``) and Rake::Task['namespace:task_name'].execute, but both return "Don't know how to build task!"
[18:47:48] tubbo: kichawa: you using RAILS_ENV=production when you run rake db:migrate?
[18:47:52] kichawa: BRAILS_ENV="production" bundle exec rake db:migrate
[18:48:05] kichawa: yeah, it works
[18:48:25] tubbo: kichawa: there's something you're not considering here. your config checks out
[18:48:28] chipotle: has joined #RubyOnRails
[18:48:33] tubbo: like to me it looks good
[18:48:42] kichawa: new version of rake parse the config file in different way?!
[18:48:49] tubbo: kichawa: has nothing to do with rake
[18:49:08] cabargas: has joined #RubyOnRails
[18:49:19] tubbo: kichawa: funny how you ran bundle exec rake db:migrate _before_ running bundle exec rake db:create
[18:49:27] tubbo: kichawa: doesn't make sense
[18:50:54] maxdoubt: could anybody share an example of how to unit test an AREL method, essentially a scope… but it doesn’t return AR results unless you to_sql the method
[18:51:28] kichawa: tubbo: i can create a new datebase and check again
[18:51:52] tubbo: kichawa: well, what i'm saying is you don't need to run `rake db:create` if you can already run `rake db:migrate` without errors.
[18:52:14] alfie_max15: has joined #RubyOnRails
[18:52:19] kichawa: i know that i dont need
[18:52:23] tubbo: maxdoubt: you want to know whether the query is getting back the results you wnat?
[18:52:33] kichawa: but i'd like to know why this happened :<
[18:52:33] corioliss: has joined #RubyOnRails
[18:52:51] alfie_max15: i'm trying to build a small passwork safe keeping app, and wondering how i can store the username and password in my db securely
[18:52:56] tubbo: kichawa: see if happens when you drop the DB and recreate it from scratch
[18:53:15] kichawa: ok, i'll check this scenario
[18:53:22] alfie_max15: i would have to show the password as plain text in the front end but dont want to store it as plain text in my database
[18:53:24] IrishGringo: has joined #RubyOnRails
[18:53:31] tubbo: alfie_max15: check out ActiveModel::SecurePassword.
[18:53:43] maxdoubt: tubbo: i’m trying to imagine what a valid test would even be. that would be the intended behavior of this method
[18:53:53] baweaver: they want to make something like Lastpass
[18:53:55] alfie_max15: thanks tubbo , i'll check it out
[18:54:01] baweaver: which is a bad idea by the way
[18:54:02] tubbo: maxdoubt: you know, like expect(Model.scope(whatever)).to be_any
[18:54:09] tubbo: maxdoubt: because any? will need data, so the query will execute
[18:54:22] tubbo: maxdoubt: i guess in minitest you'd do assert Model.scope(whatever).any?
[18:54:33] ppinkert_: has joined #RubyOnRails
[18:54:35] tubbo: or maybe refute_empty if that's still a thing
[18:54:43] baweaver: maxdoubt: I tend to: expect(Model.scope.count).to eq(3)
[18:54:46] baweaver: and create that many records
[18:55:08] tubbo: yeah...like i think any? and all? actually will materialize the data, whereas .count is better because it runs a SELECT COUNT(*) query
[18:55:09] maxdoubt: cool, thanks guys!
[18:55:13] tubbo: so baweaver, as usual, is right
[18:55:23] baweaver: I wouldn't go that far.
[18:55:32] helpa: Congratulations! You have earned a delicious, fresh-made cookie. :)
[18:55:42] baweaver: ACTION grabs and runs
[18:55:51] nattyPablo: has joined #RubyOnRails
[18:55:54] benlieb: has joined #RubyOnRails
[18:56:10] baweaver: Now back to figuring out Rake shenanigans... Google seems to be failing me.
[18:56:51] kirillzh: has joined #RubyOnRails
[18:58:20] DmitryBochkarev: has joined #RubyOnRails
[18:59:05] baweaver: I'll ask again after meetings, cheers
[19:00:20] syf-revk: has left #RubyOnRails: ()
[19:01:15] alfie_max15: tubbo, i've used this once long back before i met devise, problem with this is that i want to be able to retrieve the stored passwords and display it in the front end
[19:02:22] alfie_max15: the app is used to store login credentials, so the user would be using this to store his several login username password and thats it, ans so would want to see them
[19:04:09] cabargas: has joined #RubyOnRails
[19:05:16] momomomomo: has joined #RubyOnRails
[19:06:06] Jasaka: has joined #RubyOnRails
[19:06:25] openstru_: has joined #RubyOnRails
[19:06:34] _djbkd: has joined #RubyOnRails
[19:07:10] _djbkd: has joined #RubyOnRails
[19:07:54] pawnbox: has joined #RubyOnRails
[19:08:21] _djbkd: has joined #RubyOnRails
[19:08:55] reaVer: has joined #RubyOnRails
[19:09:18] SteenJobs: has joined #RubyOnRails
[19:11:17] jobewan: has joined #RubyOnRails
[19:11:26] cnk: has joined #RubyOnRails
[19:11:35] capin: hello, I'm trying to delete a record / user from a Postgres DB, but when I try to delete / destroy all users from the DB, the console throws this error, https://gist.github.com/ipatch/8a6641b9111c0e5eb13b
[19:13:41] glasz_: has joined #RubyOnRails
[19:14:08] celly: has joined #RubyOnRails
[19:14:13] kichawa: tubbo: new database, the same error
[19:14:15] tbuehlmann: capin, can you add the user.rb to the gist?
[19:14:33] capin: tbuehlmann: yeah one sec
[19:14:38] kichawa: will I run migrate with the empty database?
[19:15:12] hahuang65: has joined #RubyOnRails
[19:16:14] celly: has joined #RubyOnRails
[19:16:25] capin: tbuehlmann: updated
[19:16:56] tbuehlmann: capin, you don't destroy/delete associated orders when destroying a user
[19:17:19] tbuehlmann: and you can't delete a user from the database with it having orders present
[19:17:28] kichawa: i print config in activerecord
[19:17:32] kichawa: {:adapter=>"postgresql", :database=>"postgres"...
[19:17:37] kichawa: why datebase is postgres?!
[19:17:57] baweaver: has joined #RubyOnRails
[19:18:20] mices: has joined #RubyOnRails
[19:18:25] kichawa: is it strange?!
[19:18:39] capin: tbuehlmann: how could i set it up to delete associated orders?
[19:19:27] monque: has joined #RubyOnRails
[19:19:46] tbuehlmann: capin, in your User model: `has_many :orders, dependent: :destroy`
[19:20:03] emachnic: has joined #RubyOnRails
[19:21:13] baweaver: ....it helps if I spell things right.
[19:21:19] baweaver: The derp is strong this monday
[19:21:36] tvw: has joined #RubyOnRails
[19:21:36] ur5us: has joined #RubyOnRails
[19:22:20] speakingcode: has joined #RubyOnRails
[19:22:26] capin: tbuehlmann: thanks ill give that a try
[19:23:42] alfie_max15: has joined #RubyOnRails
[19:24:01] capin: tbuehlmann: thanks very much, that did the trick ;)
[19:24:09] tbuehlmann: you're welcome
[19:24:12] tubbo: kichawa: yeah something else is happening here, the configuration you're looking at is maybe not the configuration rails is reading?
[19:24:36] tubbo: kichawa: what does `which bundle` say? calling the `bin/bundle` from another rails app will actually execute within THAT app's bundle
[19:28:07] kichawa: i dont think so, if i change the ip, output is with connection refused
[19:28:14] _djbkd: has joined #RubyOnRails
[19:28:34] kichawa: ~/.rvm/gems/ruby-2.3.0/bin/bundle
[19:28:46] _djbkd: has joined #RubyOnRails
[19:29:03] kichawa: activerecord (4.2.5.1)
[19:29:16] kichawa: ails (4.2.5.1)
[19:29:45] safety_cut: has joined #RubyOnRails
[19:29:46] kichawa: why ruby environment do that :<
[19:31:16] Radar: GOOD MORNING
[19:31:28] diegoviola: good morning Radar
[19:31:41] kichawa: where rails parse the config file?
[19:33:31] syf-revk: has joined #RubyOnRails
[19:33:42] tubbo: kichawa: do you have a `bin/bundle` binstub in your rails app?
[19:34:39] kichawa: yes, there is
[19:34:56] kinduff: has joined #RubyOnRails
[19:35:04] kichawa: 1 #!/usr/bin/env ruby
[19:35:05] blackmesa: has joined #RubyOnRails
[19:35:08] kichawa: 2 ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
[19:35:10] kichawa: 3 load Gem.bin_path('bundler', 'bundle')
[19:35:45] syf-revk: hey there guys, was wondering if anyone could help me understand the full functionality/limits of rails' generate model command
[19:36:00] kichawa: tubbo: where the config file is parsed? I'd like debug that code
[19:36:33] tubbo: kichawa: try `bin/bundle rake db:create db:migrate`
[19:36:49] tubbo: might not fix it but who knows
[19:36:58] kichawa: with 'production' ?
[19:37:04] tubbo: kichawa: of course.
[19:37:17] tubbo: kichawa: also, try doing it bare with no RAILS_ENV, just to see if it's env-specific
[19:37:30] kichawa: ./bin/bundle rake db:create
[19:37:30] kichawa: Could not find command "rake".
[19:38:16] tubbo: what did you change in this app that it just started behaving like this?
[19:38:22] tubbo: are you using spring?
[19:39:03] kichawa: bundle list | grep spring
[19:41:02] DoctorMonocular: has joined #RubyOnRails
[19:41:12] matthewd: syf-revk: What exactly do you want to know?
[19:41:44] tubbo: kichawa: your Gemfile would tell you
[19:41:48] hcnewsom: has joined #RubyOnRails
[19:42:10] tubbo: kichawa: either way if this was working before and now it's not, something changed. whatever that was is your root cause. your config/database.yml seems fine.
[19:42:18] tubbo: kichawa: i doubt it's a bug with rails or pg
[19:42:20] ppinkerton: has joined #RubyOnRails
[19:42:33] kichawa: there is not in gemfile
[19:43:02] kichawa: tubbo: i think so there is a bug
[19:43:08] kichawa: i'd like to debug this
[19:43:31] tubbo: kichawa: if you do find something, definitely make a pull request to rails/rails =D
[19:43:36] kichawa: and dont know where the config file is parsed
[19:43:50] syf-revk: matthewd: basically i want to know the limits of the 'generate' command - if i want a class to validate the presence of a string variable, can i do this from the command line?
[19:43:58] tubbo: kichawa: has nothing to do with the config file, but i believe config/database.yml is parsed using `Rails.config_for`
[19:44:12] syf-revk: matthewd: i also have a few other questions in the same vein
[19:44:29] matthewd: syf-revk: No; you do need to actually write code
[19:44:31] shmambo: has joined #RubyOnRails
[19:44:44] matthewd: syf-revk: I think the guide is the most comprehensive documentation for the generators
[19:45:01] janno1: has joined #RubyOnRails
[19:45:04] SteenJobs: has joined #RubyOnRails
[19:45:31] syf-revk: matthewd: "the" guide?
[19:45:33] tubbo: matthewd: eff that http://www.hobocentral.net/ ;)
[19:46:03] tubbo: i've yet to see anyone actually use Hobo for anything. assuming it's still used since the site keeps getting updated, though
[19:46:47] ziyadb: has joined #RubyOnRails
[19:47:59] cabargas: has joined #RubyOnRails
[19:49:57] matthewd: syf-revk: Hmm, I thought there was a guide that covered the generators in detail. Looks like the content I was thinking of lives in `rails g model --help`.
[19:53:19] sled: has joined #RubyOnRails
[19:53:30] syf-revk: i read through the model -h, tried something along the lines of rails g model Candy name:string variety:string shop_id:references{validates :shop_id, presence:true} but had no luck, was hoping someone might know more about a way to make it possible
[19:54:10] matthewd: Okay.. no, that's not a thing, and not going to be a thing
[19:54:12] kichawa: tubbo: i'm trying with ruby-2.1.7
[19:54:44] dopamean_: has joined #RubyOnRails
[19:54:48] maxdoubt: has joined #RubyOnRails
[19:54:48] tubbo: rails g startup --with-funding
[19:54:53] JusticeFries: has left #RubyOnRails: ()
[19:54:54] smathy: has joined #RubyOnRails
[19:55:20] syf-revk: alright, cheers. sorry bout the noob question haha - have only just started to test out rails
[19:55:25] syf-revk: lol tubbo :P
[19:55:25] rubyonrailed: has joined #RubyOnRails
[19:56:36] mdw: has joined #RubyOnRails
[19:56:52] ElFerna: has joined #RubyOnRails
[19:58:33] aarkerio: has joined #RubyOnRails
[19:59:33] yfeldblum: has joined #RubyOnRails
[19:59:52] safety_cut: has joined #RubyOnRails
[20:02:12] safety_cut: has joined #RubyOnRails
[20:02:20] chipotle: has joined #RubyOnRails
[20:03:43] jeffleeismyhero: has joined #RubyOnRails
[20:03:45] openstruct: has joined #RubyOnRails
[20:04:42] openstruct: has joined #RubyOnRails
[20:04:52] allcentury: has joined #RubyOnRails
[20:06:00] cabargas: has joined #RubyOnRails
[20:06:41] aarkerio: has joined #RubyOnRails
[20:07:45] defsdoor: has joined #RubyOnRails
[20:09:14] srinidhi: has joined #RubyOnRails
[20:17:07] Technodrome: has joined #RubyOnRails
[20:18:17] nurf: has joined #RubyOnRails
[20:18:21] voobscout: has joined #RubyOnRails
[20:18:23] godzillaenlacasa: has joined #RubyOnRails
[20:18:46] jeanlinux: has joined #RubyOnRails
[20:21:06] kallisti5: has joined #RubyOnRails
[20:21:06] droptone: has joined #RubyOnRails
[20:21:06] gavit: has joined #RubyOnRails
[20:21:07] w0bni: has joined #RubyOnRails
[20:21:07] skyjumper: has joined #RubyOnRails
[20:44:02] helpa: has joined #RubyOnRails
[20:44:12] Scripore: has joined #RubyOnRails
[20:45:47] pbogut: has left #RubyOnRails: ("WeeChat 1.4")
[20:45:55] nzst: Can I make an html a element make a js request instead of an html request? with an attribute? i've tried things like data-remote=true and remote=true
[20:46:41] arup_r: nzst: remote: true should do what you want.
[20:47:17] Radar: nzst: depends on the element you're talking about.
[20:47:42] nzst: something like this <a ctype="sort" href="/search?{$sort_by_relevance_url} remote=true">Sort by relevance</a>
[20:47:43] arup_r: Radar: he said am html *a* element
[20:47:50] nzst: an a element
[20:47:57] Radar: nzst: link_to_remote.
[20:48:08] Radar: (if you were using Rails 2 trolololol)
[20:48:17] arup_r: did not know that ^^
[20:48:22] arup_r: let go to doc
[20:48:23] Radar: link_to "text", link, data: { remote: true }
[20:48:39] arup_r: data don't need
[20:48:41] Radar: It's been a while since I've done that kidn of thing in Rails. I use cool JS frameworks now.
[20:48:45] arup_r: only remote: true is fine
[20:48:53] Radar: arup_r: cool, thanks :)
[20:48:55] arup_r: Radar: Ember ?
[20:49:00] quazimodo: has joined #RubyOnRails
[20:49:06] Radar: arup_r: Angular (which we're getting rid of) and React.
[20:49:16] arup_r: ohh.. amazing!
[20:50:18] arup_r: nzst: link_to "Sort by relevance", search_path(q: "string"), remote: true
[20:51:25] bkulbida: has joined #RubyOnRails
[20:51:50] bkulbida: who uses rails as a backend for emberjs app on the frontend?
[20:52:23] rhizome: lots of people i think, are you having trouble finding anybody who has used those two?
[20:52:31] arup_r: bkulbida: I am learning Ember. Today I wrote 10 lines of code and I liked it. I will learn it very fast I believe ..
[20:52:59] rizenine: has joined #RubyOnRails
[20:53:05] nickenchuggets: has joined #RubyOnRails
[20:53:05] Megamos: has joined #RubyOnRails
[20:53:18] FernandoBasso: has joined #RubyOnRails
[20:53:53] lemur: has joined #RubyOnRails
[20:56:08] bkulbida: arup_r: right, me too. I started learning it few weeks ago and I like the way it forces you to write your app.
[20:56:27] bkulbida: try this book https://pragprog.com/book/mwjsember/deliver-audacious-web-apps-with-ember-2
[20:56:50] bkulbida: I personally found it very helpfull to get up to speed with conventions in ember 2.x
[20:56:57] flashpoint9: has joined #RubyOnRails
[20:57:11] bkulbida: p.s. this is not a promo, juft FYI
[20:57:45] safety_cut: has joined #RubyOnRails
[20:57:50] bkulbida: it took me a while to get a good resource to start learning ember 2
[20:58:15] ianfleeton: has joined #RubyOnRails
[20:58:19] glasz_: has joined #RubyOnRails
[20:58:45] bkulbida: online resources are good but it is somewhat not sequential though
[20:59:06] jgpawletko: has joined #RubyOnRails
[20:59:08] arup_r: I don't have book.. :/ I was following the online guide they have.
[20:59:21] bkulbida: and lack high level overview with conventions used in EmberJs 2.x
[20:59:24] arBmind: has joined #RubyOnRails
[20:59:44] ElFerna: has joined #RubyOnRails
[21:00:15] bkulbida: so anyway, using Rails as a backend is totally a joy while developing ember on the frontend
[21:00:16] FooMunki: has joined #RubyOnRails
[21:01:13] cac: has joined #RubyOnRails
[21:02:38] Frem: has joined #RubyOnRails
[21:03:38] rubyonrails860: how do you change your nick?
[21:04:04] quazimodo: has joined #RubyOnRails
[21:04:39] craiglyons: has joined #RubyOnRails
[21:05:00] arup_r: rubyonrails860: /msg nickserv help
[21:05:04] rubyonrails860: anyone watching the hack.summt() today
[21:05:22] arup_r: bkulbida: did you see my pm ? :)
[21:05:25] tubbo: dunno what that is
[21:05:29] craiglyons: has left #RubyOnRails: ()
[21:05:49] mrbubbles: has joined #RubyOnRails
[21:06:03] aegis3121: has joined #RubyOnRails
[21:06:08] arup_r: tubbo: online conference talk
[21:10:55] stannard: has joined #RubyOnRails
[21:13:55] Trynemjoel: has joined #RubyOnRails
[21:14:25] drbayer: has joined #RubyOnRails
[21:15:06] tubbo: i like how i can't just say "i like C", i have to say "i like C/C++"
[21:15:12] tubbo: because, you know, they're totally the same language
[21:15:35] tubbo: yo fuck giving these people money to watch a talk haha
[21:17:41] nettoweb: has joined #RubyOnRails
[21:18:13] nzst: Is there any way to have an html request act like a javascript request and set this up in the controller?
[21:18:25] goodcodeguy: has joined #RubyOnRails
[21:18:54] enitiz: has joined #RubyOnRails
[21:18:59] tubbo: should be in the route
[21:19:01] tubbo: format: 'js'
[21:19:35] auxbuss: has joined #RubyOnRails
[21:20:42] aweis: has joined #RubyOnRails
[21:20:50] _djbkd: has joined #RubyOnRails
[21:20:55] SteenJobs: has joined #RubyOnRails
[21:22:53] bronson: has joined #RubyOnRails
[21:23:49] nzst: tubbo: im' having a hard time phrasing this question. I want an html request to be treated as a js request http://paste.lisp.org/display/307959
[21:24:17] tubbo: nzst: why?
[21:25:21] nzst: i have a vendor xslt sheet with 'a' html elements that sort some data. I am unsure if I can change this vendor xslt sheet, so I need a way to handle this a link clicks as js
[21:27:06] doublemalt__: has joined #RubyOnRails
[21:29:04] nzst: i don't have access to link_to or other rails niceties at this point
[21:29:32] tubbo: nzst: so you basically want to hit your search route but force it to use the JS Content-Type?
[21:29:42] nzst: tubbo: yes.
[21:29:43] tubbo: nzst: try /search.js
[21:31:56] Trynemjoel: has joined #RubyOnRails
[21:32:33] ElFerna: has joined #RubyOnRails
[21:32:41] SteenJobs: has joined #RubyOnRails
[21:32:56] nzst: kinda worked, got other problems now, thanks
[21:35:02] kirillzh: has joined #RubyOnRails
[21:39:56] nettoweb: has joined #RubyOnRails
[21:40:22] PJJMD: has joined #RubyOnRails
[21:42:20] korzybski: has joined #RubyOnRails
[21:43:37] goodcodeguy: has joined #RubyOnRails
[21:43:46] jeanlinux: has joined #RubyOnRails
[21:45:50] PJJMD: Hello all :)
[21:47:04] [Butch]_: has joined #RubyOnRails
[21:48:17] tvw: has joined #RubyOnRails
[21:49:19] ianfleeton: has joined #RubyOnRails
[21:49:40] PJJMD: I'm a JR. Dev who is alone on a project and way over his head. I created a new model on a staging server, and everything worked well. I copied the new migration file and database schema to the production server, but when I redeployed the production server, the model didn't appear in our postgres DB. I tried to force an update using the schema, which promptly destroyed the DB, and caused produciton to go down for a halfhour while
[21:50:00] tubbo: PJJMD: why are you developing on a staging server?
[21:51:01] PJJMD: tubbo: 4 hours of trying to get the site to build locally, still couldn't get it working. Decided to just work with the staging server, since i'm the only person working on the site.
[21:52:03] Cohedrin: has joined #RubyOnRails
[21:52:08] diegoviola: has joined #RubyOnRails
[21:52:24] chi6rag: has joined #RubyOnRails
[21:52:24] tubbo: PJJMD: fwiw we're pretty good at answering those types of questions, so in the future please come on in here or search a guide for getting ruby and rails up and running on your workstation. there are tons of them
[21:53:30] tubbo: PJJMD: the first thing you can learn from this experience is never deploy to production until you can verify deployments to staging are working. you never tested your deployment pipeline here, and it seems that is what broke.
[21:53:36] tubbo: or at least, that is what was different from server to server
[21:53:41] jeanlinux: has joined #RubyOnRails
[21:53:46] PJJMD: I've tried looking up 'update postgres db in rails', which led me to the update schema command which dumped the DB. I'm hoping to get an idea of the proper method.
[21:54:04] emachnic: has joined #RubyOnRails
[21:54:10] tubbo: PJJMD: what you really wanted to do was run migrations on production, thereby adding the new schema change and not destroying any data
[21:55:11] PJJMD: tubbo: Thanks for the advice re getting my workstation up and running. I've been able to get rails working locally, just not the particular website. It's got a huge pile of provisioning software / etc. it wants working (I inherited the codebase from a larger produciton company)
[21:55:33] matthewd: You might think you are, but you're not developing on a staging server
[21:55:37] tubbo: ahhh i see
[21:56:04] tubbo: i worked for a company who forced me to develop on bare metal development/staging servers all the time
[21:56:09] tubbo: needless to say i didn't last very long there
[21:57:01] matthewd: I wouldn't say there's anything intrinsically wrong with developing on a remote server... but if you're developing on it, it's not a staging server any more
[21:57:30] PJJMD: tubbo: I've been postponing getting the local version working, as the client had some stuff they wanted done ASAP, and I didn't feel like billing them for 10+ hours of setup. That was 2 months ago. I'm going to have to bite the bullet and do it soon.
[21:57:48] tubbo: matthewd: have you ever developed entirely on a remote server with rails?
[21:58:47] wmdrossard: has joined #RubyOnRails
[21:59:19] tubbo: it's...not fun
[21:59:36] matthewd: tubbo: No.. I agree it's probably not a good idea. Was just clarifying that my original point was "you don't have a staging environment", not "remote server bad".
[21:59:50] PJJMD: tubbo: Circling back to performing the migration... i'm able to research that a bit, but A) Is that the sort of thing that could still corrupt the database? (I'd wrather not have the site crash again) and B) Is it the sort of thing that should be happening automagically when I deploy new code to the server?
[21:59:55] tubbo: that's true. although there were other things turned on that made development a real pain in the dick, like turning on cache_classes in development
[22:00:12] tubbo: PJJMD: yes and yes.
[22:00:31] tubbo: migrations should really not require much thought once they're "checked in" to the db (e.g., you ran rake db:migrate locally and updated db/schema.rb)
[22:01:44] yfeldblum: has joined #RubyOnRails
[22:01:53] matthewd: PJJMD: Your use of the words "copied [..] to the production server" alarm me
[22:02:23] johnflux_: has joined #RubyOnRails
[22:02:23] johnflux_: has joined #RubyOnRails
[22:03:02] matthewd: PJJMD: Reassure me you were just casually approximating "committed to version control / updated on the production server"?
[22:03:41] drbayer: has joined #RubyOnRails
[22:03:59] PJJMD: matthewd: Uhm, to clarify: I ran some rails console commands to generate the migrations on the 'staging server' (or remote dev server as you may describe it), I then copied those files to my local machine, logged them to the git repo for staging, and (eventually) merged that branch into production's branch. Then I redeployed the production site, pulling the new code from the production repo
[22:04:19] drbayer: has joined #RubyOnRails
[22:04:47] PJJMD: matthewd: So... uhm, with the exception of the horrors of having a remote development server, I think it was a pretty normal thing?
[22:04:48] emachnic: has joined #RubyOnRails
[22:05:05] drbayer: has joined #RubyOnRails
[22:05:15] ElFerna: has joined #RubyOnRails
[22:05:37] diegoviola: has joined #RubyOnRails
[22:05:38] PJJMD: matthewd: I used the term repo and branch there a bit more interchangeably than I should have... but hopefully you get the picture
[22:05:56] drbayer: has joined #RubyOnRails
[22:06:15] diegoviola: has joined #RubyOnRails
[22:06:22] matthewd: Yeah, okay, that doesn't sound quite as bad as I was picturing, at least
[22:06:35] matthewd: Though if you're developing on the server, I guess I'd expect you to be committing from there too
[22:06:36] sudoubuntu: has joined #RubyOnRails
[22:06:43] hugoangelo: has joined #RubyOnRails
[22:06:45] drbayer: has joined #RubyOnRails
[22:07:02] null__: I'm trying to render a form for searching with filtering options based on a model, but I don't know what resource to pass to it. do I need to create a Model.search method?
[22:07:05] matthewd: Your original message got cut off at "for a halfhour while" btw, in case there was more beyond the obvious
[22:07:30] PJJMD: matthewd: I probably should be, just one more layer of setup I skipped, which is making development harder/slower.
[22:07:38] drbayer: has joined #RubyOnRails
[22:08:18] drbayer: has joined #RubyOnRails
[22:08:54] drbayer: has joined #RubyOnRails
[22:09:09] htmldrum: has joined #RubyOnRails
[22:09:32] jsrn_: has joined #RubyOnRails
[22:09:35] drbayer: has joined #RubyOnRails
[22:10:16] drbayer: has joined #RubyOnRails
[22:11:00] drbayer: has joined #RubyOnRails
[22:11:43] drbayer: has joined #RubyOnRails
[22:12:23] drbayer: has joined #RubyOnRails
[22:12:55] pontiki: has joined #RubyOnRails
[22:13:05] drbayer: has joined #RubyOnRails
[22:13:49] drbayer: has joined #RubyOnRails
[22:13:49] moeabdol3: has joined #RubyOnRails
[22:14:26] pontiki: i have a question: how do I pass minitest options using `rake test` ? i've tried using `rake test TEST_OPTS="--seed 12345"` and it doesn't use that
[22:14:36] syf-revk: has joined #RubyOnRails
[22:14:37] intrigueD: has joined #RubyOnRails
[22:14:42] drbayer: has joined #RubyOnRails
[22:15:10] matthewd: PJJMD: I think you'd need to elaborate on exactly what you did, for us to help you understand why it caused a problem
[22:15:12] Scripore: has joined #RubyOnRails
[22:15:27] drbayer: has joined #RubyOnRails
[22:16:16] drbayer: has joined #RubyOnRails
[22:17:06] drbayer: has joined #RubyOnRails
[22:17:12] pontiki: oh, crikey, it's TESTOPTS, no underscore
[22:17:56] drbayer: has joined #RubyOnRails
[22:18:01] PJJMD: matthewd: I had added a new type of post to ComfyMexicanSofa (a rails CMS). I had created all the necessary controllers, views, and database entries for it to work on the 'staging server', including it being searchable via elastic search.
[22:18:41] drbayer: has joined #RubyOnRails
[22:18:44] smathy: Looking forward to the Rails5 test runner improvements.
[22:19:04] SteenJobs: any bootstrap users that have switched over to materialize and can offer some feedback/insight?
[22:19:36] drbayer: has joined #RubyOnRails
[22:20:03] PJJMD: matthewd: I then merged the staging branch into the production branch, but started to run into a large number of problems. From the production rails console, I ran ActiveRecord::Base.connections.tables and confirmed my new post type wasn't showing up, but it does when I run the command on staging.
[22:20:17] drbayer: has joined #RubyOnRails
[22:21:09] drbayer: has joined #RubyOnRails
[22:21:16] PJJMD: matthewd: It might not be the only problem, but near as I can tell, it's one of the only differences between 'staging' (where everything is working) and 'production' (where I get errors if I run elastic search, or try to access any of the controllers for the new post I added)
[22:21:47] matthewd: 1. How did you get the table into staging? 2. What did you do on production, in an attempt to fix this, that broke it?
[22:21:55] drbayer: has joined #RubyOnRails
[22:22:49] drbayer: has joined #RubyOnRails
[22:23:14] baweaver: has joined #RubyOnRails
[22:23:15] PJJMD: matthewd: 1. From my memory, I ran a couple of commands on the console to generate the migration files, and edited them a bit in vim to look more like another post type I was using as my template.
[22:23:37] drbayer: has joined #RubyOnRails
[22:24:18] PJJMD: matthewd: 1. I then ran rake db:migration. I didn't immediately check to see if the table was in the DB, but I checked the site to see if stuff was working, and it was.
[22:24:22] drbayer: has joined #RubyOnRails
[22:25:06] matthewd: Okay, that all sounds fine
[22:25:13] drbayer: has joined #RubyOnRails
[22:26:37] PJJMD: matthewd: 2. After merging the staging branch into the production branch and redeploying, errors were presenting themselves whenever I tried to access the controllers. I eventually figured out the DB didn't have the correct entries, so I tried db:schema:load, which I have since learned is a bad thing. (It dropped all the tables, the site went down, and I had to roll everything back to a previous day)
[22:27:48] PJJMD: matthewd: 2. Tubbo suggests that what I likely want to be doing is a migrate, not a schema:load, but i'm worried that I might crash the server again if I just go into production and type 'rake db:migrate', since that command should be running when I redeploy the code.
[22:28:39] matthewd: Sounds like you could really do with a staging server ;)
[22:29:12] matthewd: > should be running when I redeploy the code
[22:29:21] matthewd: Clarify "should" there?
[22:29:56] matthewd: Because yes, you should run db:migrate when you deploy new code
[22:30:22] jottr_: has joined #RubyOnRails
[22:32:58] momomomomo: has joined #RubyOnRails
[22:34:12] mostlybadfly: has joined #RubyOnRails
[22:36:26] tubbo: PJJMD: rake db:schema:load will attempt to load your entire schema and fail because those tables are created. db:reset will work but blow away all of your existing data
[22:36:58] tubbo: PJJMD: figure out your local environment, stop this bullshit with the server(s). future PJJMD will thank you in a few months when you inevitably have to open up this project again.
[22:37:26] Scripore: has joined #RubyOnRails
[22:37:32] PJJMD: matthewd: 'should' as in, I presume it was doing so automagically as part of the deploy script, I guess I should check
[22:38:28] matthewd: +1 to figuring out your dev environment
[22:38:43] PJJMD: tubbo: This is a reasonable suggestion. It's a bit of a pain, but I'll bite the bullet once I get a couple of the most pressing bugs squashed.
[22:38:59] PJJMD: Thanks to the both of you for taking the time to help me out.
[22:39:00] matthewd: So far you've saved N hours of setup time, and spent half an hour of production downtime, and loss of some production data
[22:39:19] jeanlinux: has joined #RubyOnRails
[22:39:39] matthewd: IME, very little is *that* urgent
[22:39:52] jeanlinux: has joined #RubyOnRails
[22:41:46] ppinkert_: has joined #RubyOnRails
[22:43:12] PJJMD: I presume it's a bit of me not wanting to do work I suck at (deploying this on my local machine is hard), mixed with anxiety about how over my head I am on this project. It's biasing me to work on small, incremental projects that I can use to display 'wins' to my client. It keeps them happy, it keeps me happy. It's terrible for the long term health of the project.
[22:43:31] Scripore: has joined #RubyOnRails
[22:44:02] matthewd: Deploying it really should be pretty easy, unless it's got some truly crazy stuff going on
[22:44:34] matthewd: And as tubbo mentioned earlier, you can absolutely get help with that sort of thing in here
[22:44:39] allcentury: has joined #RubyOnRails
[22:44:45] tubbo: that's precisely the kind of attitude that killed the last company i was a part of haha
[22:45:04] flappynerd: has joined #RubyOnRails
[22:46:36] PJJMD: matthewd: I'm likely going to be back later tonight for help with just that then.
[22:46:54] Scripore: has joined #RubyOnRails
[22:49:31] rhizome: sounds like zeno's paradox of programming
[22:49:35] sleungcy: has joined #RubyOnRails
[22:52:07] DEA7TH: has joined #RubyOnRails
[22:52:24] flappynerd: is it better to use .references or .belongs_to in a migration?
[22:52:28] flappynerd: or does it basically not matter
[22:52:47] matthewd: Doesn't matter; it's an alias
[22:52:56] rhizome: i just make the fields
[22:53:47] stannard: has joined #RubyOnRails
[22:54:25] bmalum: has joined #RubyOnRails
[22:54:34] ElFerna: has joined #RubyOnRails
[22:54:40] lemur: has joined #RubyOnRails
[22:54:42] Scripore: has joined #RubyOnRails
[22:56:17] differentreality: has joined #RubyOnRails
[22:56:43] Scripore: has joined #RubyOnRails
[22:57:40] yfeldblum: has joined #RubyOnRails
[22:58:27] Scripore: has joined #RubyOnRails
[22:58:31] speaking1ode: has joined #RubyOnRails
[22:59:17] jottr_: has joined #RubyOnRails
[23:04:58] diegoviola: has joined #RubyOnRails
[23:05:24] kdough: has joined #RubyOnRails
[23:07:27] differentreality: has joined #RubyOnRails
[23:08:05] Scripore: has joined #RubyOnRails
[23:09:25] ytnaidu: has joined #RubyOnRails
[23:10:37] ppinkerton: has joined #RubyOnRails
[23:11:21] SeanLazer: has joined #RubyOnRails
[23:11:54] carlos2: has joined #RubyOnRails
[23:12:28] carlos2: has left #RubyOnRails: ()
[23:18:48] nachoman: has joined #RubyOnRails
[23:21:36] benlieb: has joined #RubyOnRails
[23:23:15] IFrank00: has joined #RubyOnRails
[23:31:35] enitiz: has joined #RubyOnRails
[23:32:51] baweaver: sanity check, whenever I do something like: Model.create(child_collection: Child.where(id: ids)); does that just associate those children, or recreate them?
[23:33:33] chouhoul_: has joined #RubyOnRails
[23:35:08] Radar: It will associate them.
[23:35:36] baweaver: also seemed to be doing validations on them for some reason
[23:35:50] workmad3: has joined #RubyOnRails
[23:36:21] baweaver: (this is several different relationships, or I'd give actual names, but they're all pretty much that)
[23:36:31] Technodrome: has joined #RubyOnRails
[23:36:44] IFrank00: has joined #RubyOnRails
[23:37:20] mrbubbles: has joined #RubyOnRails
[23:45:28] worstcase: has joined #RubyOnRails
[23:46:51] superlou: has joined #RubyOnRails
[23:48:10] yfeldblum: has joined #RubyOnRails
[23:48:57] CustosLimen: has left #RubyOnRails: ("Leaving")
[23:50:06] baweaver: Radar: wow, that's off. It looks like doing that causes it to retrigger validations on the models, even if they're currently created
[23:50:07] ppinkerton: has joined #RubyOnRails
[23:50:15] baweaver: so models that were valid before a new validation....
[23:50:24] baweaver: well, things go boom
[23:50:29] Radar: baweaver: no validates_associated in the parent model?
[23:50:41] alfie_max15: has left #RubyOnRails: ()
[23:50:58] baweaver: I think it's from nested hashes being possible as an argument
[23:52:31] zichul: has joined #RubyOnRails
[23:53:07] sled: has joined #RubyOnRails
[23:53:32] one_zero: has joined #RubyOnRails
[23:53:52] Ropeney: has joined #RubyOnRails
[23:55:03] diegoviola: has joined #RubyOnRails
[23:57:02] manfrin_: has joined #RubyOnRails
[23:59:38] benlieb: has joined #RubyOnRails