« Back to channel list

#RubyOnRails - 05 April 2016

« Back 1 day Forward 1 day »
[00:00:01] ascarter: has joined #RubyOnRails
[00:00:06] Radar: voidDotClass: If you had a model for that table, you could do School.where(id: SchoolStudent.where(student_id: student.id).pluck(:school_id))
[00:00:13] Radar: Or something like that. Maybe someone can come up with a shorter version.
[00:00:38] voidDotClass: that's pretty uglyish
[00:00:39] StevenXL: has joined #RubyOnRails
[00:00:39] StevenXL: has joined #RubyOnRails
[00:02:00] helpa: has joined #RubyOnRails
[00:02:43] baweaver: SchoolStudent.includes(:schools).where(student_id: student.id).map(&:school)
[00:03:19] baweaver: School.joins(:school_students).where(school_students: {student_id: student.id})
[00:03:50] ascarter: has joined #RubyOnRails
[00:04:36] cnk: I like that last one. Expressive
[00:05:11] rakm: has joined #RubyOnRails
[00:06:44] sudoubuntu: has joined #RubyOnRails
[00:09:47] ur5us: has joined #RubyOnRails
[00:10:25] akshat_: has joined #RubyOnRails
[00:13:19] _Tariq: has joined #RubyOnRails
[00:13:58] joshhbk: has joined #RubyOnRails
[00:16:05] _Tariq: has joined #RubyOnRails
[00:16:12] one_zero: has joined #RubyOnRails
[00:18:27] hahuang65: Can anyone show me how after_commit callbacks get called on destroy?
[00:19:05] flashpoint9: has joined #RubyOnRails
[00:22:47] georgedrummond: has joined #RubyOnRails
[00:25:19] Cohedrin: hahuang65 what do you mean
[00:25:41] Cohedrin: are you asking what in the middle ware is calling them?
[00:25:55] Cohedrin: or are you asking how its possible they get called after the object is destroyed?
[00:27:16] bga57: has joined #RubyOnRails
[00:27:33] epitron: hey baweaver!
[00:27:56] epitron: can i pick your brain about a rails issue?
[00:28:09] baweaver: shoot, but no promises I know how to solve it.
[00:28:22] hahuang65: Cohedrin: yeah what in the middleware is calling it
[00:28:43] epitron: i have a situation where i need some special database rows to be in my database at a specific point in the migration process
[00:28:49] owenjones: has joined #RubyOnRails
[00:28:53] epitron: rows that aren't yet there
[00:29:12] epitron: i've tried adding them in the past by just doing Thing.create in the migration
[00:29:21] epitron: but that sometimes blows up at a later date if the Thing model changes
[00:29:36] epitron: i guess if i created it without validations it would be stable...
[00:29:55] epitron: it's kinda like seed data, but it needs to exist while the migrations are happening
[00:30:33] baweaver: well they run in order, so how's that a problem?
[00:30:57] epitron: i think the issue i had in the past was that "Model.create!" runs validations, which could change at a later date
[00:31:10] epitron: and then when you try to do a fresh db:migrate, it dies
[00:31:21] baweaver: Then just load the schema instead
[00:31:52] epitron: yes, i guess i could treat schema.rb as a bootstrapped C compiler :)
[00:31:58] epitron: it just has to exist
[00:32:13] baweaver: save!(validate: false)
[00:32:27] epitron: i think that's the best solution
[00:32:30] baweaver: that'd be the best guess.
[00:32:39] epitron: schema.rb still won't solve the issue if i'm creating records in the migration
[00:32:40] baweaver: because that's saying you know you're breaking it
[00:32:45] baweaver: yeah, that's true
[00:32:48] epitron: i'd have to create them both in seeds and in the migration
[00:32:55] Cohedrin: hahuang65: they're called from the active record transaction
[00:33:04] Cohedrin: after its commited to the database
[00:33:15] Cohedrin: so you should look at the #commited! method
[00:33:21] baweaver: you also run the issue of deleting old model files in some cases. Those are fun too
[00:33:29] epitron: baweaver: rails should really do a git checkout of all the models at the point in time that the migration was created :)
[00:33:31] Cohedrin: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/transactions.rb#L351
[00:33:47] andatche: has joined #RubyOnRails
[00:33:55] Cohedrin: its not doced as its largely an internal method that you should have a good understanding of what you're doing before you use it
[00:33:55] epitron: or rather, at the time the migration was committed to git
[00:34:14] epitron: ok, sweet... thanks for letting me bounce ideas
[00:34:19] baweaver: Just capture all called models in a db/migrate/snapshot directory
[00:34:30] baweaver: and load them as you progress.
[00:34:35] epitron: although, now you have gem issues
[00:35:20] baweaver: Not sure if there really is a sane way to approach any of it
[00:35:34] baweaver: other than to avoid the necessity of creating things in migrations if at all possible,
[00:35:48] hahuang65: Cohedrin: what takes it to #committed from #destroy? I'm asking because I wrote my own destroy method and its NOT calling after_commit
[00:36:01] baweaver: If you can't stop a meteor from hitting, at least try and make sure to reduce the size before impact.
[00:36:08] epitron: baweaver: yeah... that's definitely a better solution
[00:36:30] Cohedrin: hahuang65, #commited is a not an activemodel method
[00:36:49] hahuang65: Cohedrin: I understand, I'm trying to figure out how it gest from #destroy to #committed.
[00:37:27] Cohedrin: its called from a transaction. So when the transaction is commited, it calls commited!, which calls the callbacks
[00:37:47] baweaver: epitron: If I notice something is going to be a pain later, I do whatever I can to minimize or kill it.
[00:37:50] flashpoint9: has joined #RubyOnRails
[00:38:04] baweaver: before I have nightmares for a month trying to pull it out after it has time to settle and fester.
[00:38:31] Darmani: Radar: Bro?
[00:38:40] Radar: Darmani: busy having internet arguments, but might be able to help
[00:38:51] Darmani: Just a quick question,
[00:38:53] Arcaire: ACTION checks all channels we're both in.
[00:39:31] Darmani: Radar: I am understanding all of the stuff I'm reading. But I don't feel like I've memorized it yet... Is that bad?
[00:39:43] baweaver: that takes time
[00:39:57] Darmani: oh hey baweaver :D
[00:39:59] baweaver: memorization is far more a case of repetition and practical use
[00:40:20] baweaver: reading once, it won't happen unless you have a photographic memory of some type
[00:40:33] hahuang65: Cohedrin: how does it get from destroy to transaction
[00:40:33] Darmani: heh. I wish.
[00:41:19] Cohedrin: hahuang65, wrap it in a transactions
[00:41:36] Radar: Darmani: No, that is normal.
[00:41:51] laputa: has joined #RubyOnRails
[00:41:56] Radar: Darmani: I am learning a song on the piano at the moment and I can tell you the notes in Bars 1-4, but ask me what the 1st note is in Bar #5 and I'll give you the blankest of stares.
[00:42:16] Radar: Darmani: You'll pick up things the more you practice them and you'll do that without even realising it.
[00:42:17] baweaver: Radar: which one?
[00:42:25] Radar: baweaver: Le Onde by Ludovico Einaudi.
[00:42:26] Arcaire: baweaver: Adele - Hello
[00:42:32] bruce___: has joined #RubyOnRails
[00:42:35] Darmani: Radar: Alright, thanks man.
[00:42:50] Radar: Darmani: A good book to read about that learning process is "The Talent Code"
[00:43:05] Radar: Darmani: The "thesis" of the book is that the more you practice something, the better you become at it.
[00:43:07] baweaver: It's a D, B on the bass
[00:43:16] Radar: baweaver: thanks ;)
[00:43:23] Radar: And while the initial bout of practicing is going to be really... sucky.
[00:43:26] baweaver: ACTION had to play it in his head
[00:43:26] Arcaire: I picked guitar back up recently. Currently (re-)learning RHCP songs.
[00:43:50] Radar: But the next time you might remember that it's "click_link" without checking in the book. And the time after that you'll remember it's @ticket and not @tickets.
[00:44:00] baweaver: after a while things become intuitive and you can guess or learn from context, but that takes a long time
[00:44:40] Darmani: Radar: I suppose getting better at something has always had the same process of practice makes perfect..
[00:44:44] Darmani: ACTION sighs
[00:44:49] georgedrummond: has joined #RubyOnRails
[00:44:51] Radar: Darmani: lots and lots of practice :)
[00:44:55] Arcaire: Darmani: Combination of practice and intelligently learning from your mistakes.
[00:45:04] Arcaire: >do something
[00:45:04] Radar: mentoring can help with that too
[00:45:09] Arcaire: >"what the fuck why doesn't that work?"
[00:45:12] Radar: Darmani: Do you know of anyone who would mentor you?
[00:45:14] Arcaire: >"oh it's @ticket not @tickets"
[00:45:18] Arcaire: >remember that bit
[00:45:57] scope: how would you write a link_to using class=pagescroll
[00:46:02] scope: <%= link_to class="page-scroll" href="#services">Services %>
[00:46:28] Arcaire: Is that going to make the page automatically slow-scroll down to your services section?
[00:46:46] scope: speed isnt importnant
[00:46:48] Arcaire: Please hand in your computer driving license.
[00:46:51] Radar: Arcaire: oi
[00:46:59] Arcaire: I hate that auto-scrolling stuff. :(
[00:47:07] Arcaire: It's so bad for the web, especially for people with disabilities.
[00:47:19] scope: its a scroll
[00:47:21] Arcaire: Try using a screen-reader.
[00:47:24] Radar: scope: <%= link_to "Services", "#services", class: "page-scroll" %>
[00:47:41] scope: ah ok so the class always at the end
[00:47:41] Radar: scope: Scroll-hijacking might effect the way that some people use your site.
[00:47:45] Radar: scope: yes.
[00:47:56] scope: how would they hijak it
[00:48:04] scope: its just the front page
[00:48:07] Arcaire: Scroll-hijacking is what the thing you're doing is called.
[00:48:17] Arcaire: Any site that modifies how I scroll down a page gets immediately closed.
[00:48:25] r0bby_: has joined #RubyOnRails
[00:48:37] scope: what would be your prefered method
[00:48:46] hahuang65: Cohedrin: thanks for the tip, but it actually didn't work out. my after_commit callback still isn't being called.
[00:48:54] Arcaire: You know when you click something on Google and it goes to that page normally?
[00:49:10] scope: but thats the problem
[00:49:17] Arcaire: What's the problem?
[00:49:20] scope: the first page has many different links and info
[00:49:34] scope: if you want the photo album
[00:49:38] Arcaire: The UX part of me says "that means you have too much content on that page"
[00:49:42] scope: where bugs are from
[00:49:51] Cohedrin: hahuang65 thats odd. When you say you "wrote your own destory method"
[00:49:58] Cohedrin: can you explain what you mean?
[00:50:02] PlasmaStar: has joined #RubyOnRails
[00:50:07] Cohedrin: did you override the destroy method?
[00:50:10] Arcaire: scope: Then don't autoscroll or w/e, just do the anchor link.
[00:50:32] timdotrb: Wtf. This is breaking my brain.. I’ve set the system time on my server to my timezone. I’ve set the rails config timezone to my timezone. I’ve set the MySQL timezone to my timezone. But when I create or update an attribute, it uses UTC
[00:51:04] timdotrb: Time.now shows the correct time, but if I do update_attribute(:created_at, Time.now) it shows UTC
[00:51:13] Arcaire: Timestamps are stored in UTC by default, and this is probably the best way to do it.
[00:51:18] scope: would i just change the class to anchor-link
[00:51:29] Arcaire: If you want it in your timezone, use: meme_object.updated_at.localtime
[00:51:43] hahuang65: Cohedrin: yeah: https://gist.github.com/hahuang65/5883b11bb5848515966200c46d2ffcdc
[00:51:56] timdotrb: Arcaire: good to know. Thanks
[00:52:42] hahuang65: Cohedrin: is it because `update_columns` stopps callbacks from happening maybe
[00:53:22] Cohedrin: hahuang65, yes, update_columns goes straight to sql
[00:53:32] hahuang65: Cohedrin: even if I wrap it in a transaction?
[00:53:43] Cohedrin: it won't even instantaite the object
[00:53:54] Cohedrin: use update if you want callbacks
[00:54:08] Cohedrin: why are you updating columns in a destroy method though?
[00:54:21] hahuang65: Cohedrin: just a copy of acts_as_paranoia.
[00:55:19] hightower2: has joined #RubyOnRails
[00:55:24] baweaver: has joined #RubyOnRails
[00:56:50] quazimodo: has joined #RubyOnRails
[00:57:05] dstarh: has joined #RubyOnRails
[00:58:59] DoctorMonocular: has joined #RubyOnRails
[01:00:13] Cohedrin: hahuang65 AFIAK acts_as_paranoia doesn
[01:00:24] Cohedrin: doesn't log updates that don't get callbacks
[01:00:28] SteenJobs: has joined #RubyOnRails
[01:00:33] Cohedrin: thought it might, I've never used it
[01:00:41] Darmani: Radar: Sorry I left for a sec
[01:00:43] Cohedrin: you'd have to look at their code to see how they do it though
[01:00:46] Radar: Darmani: is ok
[01:00:55] Darmani: No I don't know anyone. Besides the people from IRC =p
[01:01:05] sevenseacat: has joined #RubyOnRails
[01:01:48] Darmani: Radar: If there's a list of people who want to be mentored put me on it xP
[01:03:05] aloneintheworld: has joined #RubyOnRails
[01:04:22] _Sypheren: has joined #RubyOnRails
[01:04:57] PlasmaStar: has joined #RubyOnRails
[01:04:59] Arcaire: https://twitter.com/ThePracticalDev/status/715623065078644738
[01:06:30] Radar: Darmani: There isn't a list in particular.
[01:06:47] sevenseacat: can I be on it?
[01:10:20] hahuang65: Cohedrin: I ended up using `touch` :)
[01:10:24] hahuang65: Cohedrin: thanks for the help
[01:10:50] Cohedrin: hahuang65, no problem, glad you got it working
[01:11:15] hahuang65: Cohedrin: callbacks are the bane of my life. also haven't been using rails much since I started doing elixir
[01:11:33] timdotrb: has joined #RubyOnRails
[01:11:50] Arcaire: Unfortunately getting a job with Elixir is still a pipe dream in a lot of places. :<
[01:11:53] Cohedrin: hahuang65 after_commit in particular is incredibly buggy, especially if you're on one of the older versions of rails
[01:11:56] alicrow: has joined #RubyOnRails
[01:12:13] Cohedrin: it seems to be fixed then break every other release
[01:12:18] hahuang65: Arcaire: it's getting more and more common though....
[01:12:22] hahuang65: Arcaire: oh where are you
[01:12:27] hahuang65: Cohedrin: yeah
[01:12:41] Arcaire: humd1ng3r: I'm in that country where they haven't worked out what a technology is yet: Australia.
[01:12:45] alicrow: Rake seems to be ignoring "~>" in my gemfile.
[01:12:54] sevenseacat: alicrow: how so?
[01:13:56] georgedrummond: has joined #RubyOnRails
[01:14:00] alicrow: My Gemfile says `gem 'sass-rails', '~> 5.0'`, and I have 5.0.4 installed. Rake fails unless I change it to `gem 'sass-rails', '~> 5.0.4'`
[01:14:07] baweaver: In SF, if you haven't rewritten your application within 3 months you're super conservative.
[01:14:15] maxx88: Darmani: you could try codementor for a mentor, I know of one person in here that does mentoring. btw, it’s not me. still absorbing as much as I can.
[01:14:16] alicrow: Same thing is happening for coffee-rails, too.
[01:14:58] sevenseacat: alicrow: ok, seems nothing to do with rake. but what exactly 'fails'?
[01:15:01] DoctorMonocular: has joined #RubyOnRails
[01:15:05] sevenseacat: bundler is what deals with your Gemfile, not rake
[01:15:40] alicrow: Well, rake is what I try to run.
[01:15:45] alicrow: "cannot load such file -- sass"
[01:15:51] Darmani: maxx88: I have looked into that. It wasn't for me to be honest.
[01:16:36] alicrow: Although now it's complaining about coffee-script, not sass.
[01:16:55] sevenseacat: alicrow: have you run bundle install after changing your Gemfile?
[01:17:31] sevenseacat: and the bundle install succeeds?
[01:17:46] sevenseacat: can you gist the full error with the command you're running?
[01:18:18] alicrow: Also, I've been running this app successfully on two other computers. One of which I *know* has the same version of sass-rails (other isn't currently accessible to check)
[01:19:23] jenrzzz: has joined #RubyOnRails
[01:20:48] alicrow: It seems to have stopped complaining about sass after I changed it to '~> 5.0.4' and then back again. Complaining about coffee-script instead.
[01:21:13] sevenseacat: can you gist the full error with the command you're running?
[01:22:22] moeabdol1: has joined #RubyOnRails
[01:23:12] alicrow: https://gist.github.com/WriterOfAlicrow/bca95bdd5eee658d9e5d87399db2999c
[01:23:24] Radar: That is a very different error.
[01:23:56] alicrow: Different from what?
[01:24:01] Radar: [11:15:45] <alicrow> "cannot load such file -- sass"
[01:24:06] Radar: But in the gist
[01:24:06] Radar: LoadError: cannot load such file -- coffee-script
[01:24:13] Radar: Very different error message.
[01:24:22] Radar: https://rubygems.org/gems/coffee-script/versions/2.4.1 was released today and I bet is to blame.
[01:24:30] alicrow: Like I said, it's complaining about coffee-script instead of sass now.
[01:24:44] TheNet: has joined #RubyOnRails
[01:24:47] Radar: I missed that part.
[01:25:09] Radar: one moment.
[01:25:23] sevenseacat: i see system gems and user gems in that backtrace
[01:25:29] sevenseacat: and i don't see a command being run
[01:25:38] sevenseacat: two different versions of rake
[01:25:41] Radar: sevenseacat: at the top. rake --trace
[01:25:56] Radar: And yeah, seems weird to have system + user paths
[01:26:05] DragonPunch: has joined #RubyOnRails
[01:26:30] Radar: alicrow: How did you setup Ruby?
[01:26:59] B1n4r10: has joined #RubyOnRails
[01:27:30] someish: has joined #RubyOnRails
[01:28:05] alicrow: Can't remember. I set up ruby/rails for a different app originally. And I might have installed some stuff as dependencies for system stuff before that.
[01:28:53] Radar: alicrow: Ok, so I think that should be fixed ifrst.
[01:29:03] someish: Can someone explain why this seeder is failing with a password can not be blank error? When running the debugger, the password is clearly hashed. https://gist.github.com/saturday/a2eebee652d79b615924c8a0541cc019
[01:29:05] Radar: alicrow: rm -rf ~/.gem to start with.
[01:29:16] Radar: alicrow: Then find out how you installed Ruby using the system package and remove that.
[01:29:21] Radar: alicrow: Then... what OS are you on?
[01:29:46] helpa: Ubuntu, Ruby, ruby-install, chruby, Rails setup guide: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you/ - Gauranteed to work 100% of the time or your money back!
[01:29:49] Radar: Should work for you too.
[01:30:03] Radar: That's step 3. Don't forget to do the first 2 steps otherwise things will just get more... weird.
[01:31:44] rake_db_migrate: has joined #RubyOnRails
[01:32:39] alicrow: Ugh. So basically, ruby should never be installed through system packages?
[01:33:28] alicrow: Why the hell can't it just work?
[01:33:52] alicrow: I have the right versions, so why does it matter where they're installed?
[01:34:15] sevenseacat: well you have two versions of rake installed, which one should be used?
[01:34:22] Ropeney: Thats.... a huge claim to say it should never be installed by system packages...
[01:35:36] Radar: Ropeney: It sure is. It's in bigger text than the rest of the content too.
[01:36:41] owenjones: has joined #RubyOnRails
[01:36:48] Ropeney: I feel, if anything, that should only be specific when using ruby for rails
[01:37:12] Radar: Ropeney: Any Ruby install imo.
[01:38:27] alicrow: When I first tried to run the app on this machine, it told me had the wrong version of rake, said to run bundle install, so I did... so now it's looking for stuff in ~/.gem or something.
[01:42:44] alicrow: So I need to uninstall every gem?
[01:43:21] Radar: alicrow: Removing them with `rm` is an efficient way to do that.
[01:43:43] Radar: You need to destroy the two versions of Ruby that you currently have installed (which may just be one, actually) and then install a proper version of Ruby.
[01:44:19] akshat: has joined #RubyOnRails
[01:45:04] alicrow: Won't it screw with my system if I uninstall packages with rm?
[01:45:09] jenrzzz: has joined #RubyOnRails
[01:45:26] Radar: You're not installing anything that the package installed. Anything in ~/.gem is likely something you installed yourself.
[01:45:28] alicrow: And potentially crash it if one of those turns out to be necessary?
[01:45:43] Radar: Your system. We're just directing you in how to possibly fix it.
[01:45:58] alicrow: No, I was told to uninstall all the stuff installed by the system.
[01:48:44] bruce___: has joined #RubyOnRails
[01:52:35] nodejunkie: has joined #RubyOnRails
[01:52:47] alicrow: And now rake isn't in my system path anymore.
[01:54:35] smathy: alicrow, of course you can use system packages, you just have to carefully manage your path - which evidently, you did not.
[01:55:35] alicrow: So how do I get rails/rake/whatever to recognize gems in my system?
[01:56:05] sevenseacat: i know nothing about gentoo, so
[01:56:09] alicrow: bundle seems fine with it, finds the stuff in the system, but rake doesn't.
[01:56:22] smathy: alicrow, any executable that's ruby code is just using the ruby in the shebang line of the file in question.
[01:56:37] sevenseacat: try bundle exec rake, see it if fixes it
[01:58:30] someish: Can someone explain why this seeder is failing with a password can not be blank error? I’m using devise. When running the debugger, the password is clearly hashed. https://gist.github.com/saturday/a2eebee652d79b615924c8a0541cc019
[01:59:14] sevenseacat: someish: you're setting password *and* encrypted_password to the same hash?
[01:59:25] sevenseacat: i think... that indentation is whack
[01:59:44] someish: sevenseacat: hahah gist messed up the indentation.
[01:59:46] alicrow: Okay, I think the "rake" package I uninstalled is different from the rake gem. Since the pacakge is version 0.9.6-r1, and the gem is 11.1.1. Seems too great a version difference for those to actually be different versions of the same thing.
[01:59:49] sevenseacat: i dont think it did
[01:59:59] someish: sevenseacat: Want to bet?
[02:00:43] alicrow: Anyway, uninstalled some of the gems, reinstalled with bundle install, and seems to work for now.
[02:00:46] someish: sevenseacat: The password and encrypted_password keys aren’t both there at the moment. I’m only user encrypted_keys.
[02:00:59] sevenseacat: someish: then the code you shared is wrong
[02:01:02] Radar: alicrow: So you've setup ruby using chruby+ruby-install now?
[02:01:04] sevenseacat: please gist the real code
[02:01:44] alicrow: I didn't uninstall ruby. Just some of the gems it was complaining about.
[02:02:50] Radar: alicrow: ok. that is not the advice I gave, but if it works for you then
[02:02:51] helpa: ¯\_(ツ)_/¯ Sorry, Radar is not able to help you any further as they do not know.
[02:03:05] someish: sevenseacat: Here’s my most recent attempt: https://gist.github.com/saturday/4c27fe57ab240d5cc7a4e266a3d45e0e
[02:03:26] someish: again with the mangling…
[02:05:50] Cohedrin_: has joined #RubyOnRails
[02:08:00] context: wtf is that
[02:08:49] context: someish: thats hardly mangled. stop using tab characters.
[02:10:02] sp1rs: has joined #RubyOnRails
[02:10:37] cabinB: has joined #RubyOnRails
[02:11:44] someish: https://gist.github.com/saturday/d803af876a5d4e8065906d79a97c57ca
[02:12:16] someish: Fixed…can anyone point out what I’m doing wrong.
[02:13:39] jinette: hello ruby girls and boys, I have this problem: http://paste.ubuntu.com/15623258/ can you help me please?
[02:20:31] _Tariq: has joined #RubyOnRails
[02:22:02] penguinpowernz: has joined #RubyOnRails
[02:22:25] jinette: hmm, maybe because I didn't say ror girls and boys..
[02:23:34] Arcaire: More because this is for people to volunteer their time to assist, and all three of the core people online at this time are probably having lunch.
[02:23:39] Arcaire: Source: I'm currently having lunch.
[02:25:01] jinette: good appetite, Arcaire. it matters not to forget that one should eat.
[02:25:24] laputa: what are most people's timezone here? i'm having dinner.
[02:25:39] Arcaire: Right now most people who are active are in GMT +8 to GMT +10
[02:25:56] Arcaire: jinette: `which -a ruby`, please/
[02:26:30] zave: has joined #RubyOnRails
[02:26:37] jinette: Arcaire, do you mean the version?
[02:26:48] Arcaire: No I mean run that command in your terminal.
[02:30:46] jinette: Arcaire, ah, sorry, of course..it says '/usr/bin/ruby'
[02:33:00] Arcaire: jinette: How did you install ruby?
[02:33:03] Arcaire: Sorry I was finishing my subway.
[02:33:26] Arcaire: I recently learned that some people eat an entire foot long themselves, not sharing it with five people as it's intended. Can you believe that?
[02:34:30] Ropeney: Arcaire, way to remind me I'm fat :( Does that make eating 2 worse?
[02:35:15] Arcaire: At that point I feel that maybe I should point you in the direction of a veterinary clinic. You may actually have several miniaturised zoo animals inside you.
[02:35:28] Arcaire: You can eat two footlong subs?
[02:35:31] Arcaire: That's genuinely impressive.
[02:35:37] jinette: Arcaire, I guess via bundle install
[02:35:43] Arcaire: jinette: I mean Ruby itself.
[02:35:48] Arcaire: Like, did you apt-get install or something?
[02:35:52] djbkd: has joined #RubyOnRails
[02:37:59] jinette: Arcaire, yes apt-get install
[02:38:06] helpa: Ubuntu, Ruby, ruby-install, chruby, Rails setup guide: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you/ - Gauranteed to work 100% of the time or your money back!
[02:38:10] Arcaire: You're gonna need that.
[02:39:14] Ropeney: Arcaire, yes I can – Chicken pieces, spinach, tomato, avocado and mayo... so good
[02:39:31] Arcaire: I'm super mainstream with my subway.
[02:39:48] Arcaire: Toasted pizza on multigrain, mozarella cheese, all salads, honey mustard.
[02:39:58] Ropeney: oh yes... cheese
[02:40:00] sevenseacat: pizza subs are indeed the shit.
[02:40:10] Arcaire: Still only $8.95 in my area, too.
[02:40:36] Ropeney: I wish I could be satisfied with a $8.95 lunch haha
[02:41:49] PedramT: has joined #RubyOnRails
[02:42:13] eyeamaye: has joined #RubyOnRails
[02:42:54] benlieb: has joined #RubyOnRails
[02:43:16] someish: I figured out my issue if anyone cares, it’s because I’m using devise and the validatable module. The module automatically validates the password attribute, even though the db table only contains an encrypted_password field.
[02:44:03] someish: Why validate an attribute that doesn’t exist as a column on the table? I’m not sure.
[02:44:13] sevenseacat: to make sure it gets entered?
[02:44:15] crystal77: has joined #RubyOnRails
[02:44:21] jinette: Arcaire, hope you enjoyed the lunch.
[02:44:51] Arcaire: ACTION scrolls up to find someish's original issue.
[02:44:58] Arcaire: But it failed!
[02:45:32] someish: How typical is it to validate attributes that aren’t actual table columns?
[02:45:49] someish: sorry…how typical is it to have attributes that aren’t table columns.
[02:45:50] Arcaire: It's about as typical as it is to have model attributes that aren't actual table columns.
[02:45:52] Arcaire: So, very frequent.
[02:45:57] sevenseacat: pretty ty pical, if you need to do it.
[02:46:43] Arcaire: The reason it's done this way is because you're supposed to create the instance of the model using the plaintext password you were supplied. Devise handles the hashing and then stores it as encrypted_password.
[02:47:01] someish: I’m not explaining the root of my confusion well.
[02:47:15] someish: Arcaire: I get that now, but why not just name the column “password”?
[02:47:21] Arcaire: Because it's "encrypted".
[02:47:33] Arcaire: It's technically not, it's hashed and the two are different things, but whatever.
[02:48:00] someish: So does that neccessitate different table column names anytime you do some sort of transformation on the original model attribute?
[02:48:26] someish: I don’t know. It seems unnecessary.
[02:48:30] Arcaire: Not all the time, but in cases like this where the difference can be a PCI CVSS Score of 10 out of 10, it is.
[02:48:39] someish: Fair enough.
[02:48:56] someish: first_name_to_lower_string
[02:49:03] Arcaire: For instance, if I was converting a phone number to an international format I wouldn't name it regionalised_phone
[02:49:26] sevenseacat: passwords are a very common thing in webapps that are also very easy to fuck up
[02:49:31] Arcaire: but explicitly differentiating between a hashed password and a plaintext password (or, in the case of comparison for authentication - the representation of the plain-text password) is good.
[02:49:32] sevenseacat: and have a long history of being fucked up
[02:49:46] jinette: has left #RubyOnRails: ("Leaving")
[02:49:58] someish: I suppose it makes sense.
[02:50:02] Arcaire: someish: I personally prefer the gem 'Clearance' over Devise because it's a bit more transparent.
[02:50:09] sevenseacat: naming the field tells clueless users "hey you know you should probably be encrypting this"
[02:50:12] pawnbox: has joined #RubyOnRails
[02:50:21] johnflux: has joined #RubyOnRails
[02:50:33] sevenseacat: (even though its strictly not encrypting, but whatever)
[02:50:33] someish: Arcaire: That’s exactly what I was just thinking. “I need something that hides less”
[02:50:50] sevenseacat: you could try clearance or sorcery
[02:51:30] Arcaire: someish: Also, I hope you're not using tabs in your source code.
[02:51:37] Arcaire: I noticed them in the Gist.
[02:51:40] Arcaire: We all did.
[02:51:42] Arcaire: We're all judging it.
[02:51:44] someish: Yes. I’m sorry.
[02:51:47] someish: Magic tabs.
[02:51:56] someish: In rubymine. At least I thought I was.
[02:51:59] Arcaire: sed -i s'/\t/ /g' ./*/**/*.rb
[02:52:04] chagel: has joined #RubyOnRails
[02:52:09] georgedrummond: has joined #RubyOnRails
[02:52:42] Arcaire: `sed -i 's/\t/ /g' ./*/**/*.rb`, even. Misplaced the first quote.
[02:53:00] Arcaire: Also don't actually run that in your console. It replaces all tabs in all Ruby files in the current directory and subdirectories with two spaces (the Ruby standard).
[02:53:24] someish: No I know. I won’t.
[02:54:02] someish: I’ve been away from rails and ruby for about 3 years and now I feel pretty dense, but I’m getting it.
[02:54:06] Arcaire: But really, if you need help in the future you might save time if you switch to two-spaces.
[02:54:08] someish: I was never really “into it".
[02:54:27] someish: Noted. I’ll start doing that from here on.
[02:54:32] Arcaire: Because if you come in here with tabbed code, people will take half of the total 'help time' exhaling their angst about tabs.
[02:55:11] someish: Fair enough. I appreciate the help everyone. Cheers.
[02:56:43] cnk: has joined #RubyOnRails
[02:59:23] w09x: has joined #RubyOnRails
[03:00:11] Cohedrin: has joined #RubyOnRails
[03:00:56] blackmesa: has joined #RubyOnRails
[03:03:28] benlieb: has joined #RubyOnRails
[03:03:44] SeductiveError: has joined #RubyOnRails
[03:04:32] johnflux: has joined #RubyOnRails
[03:06:35] Inside: has joined #RubyOnRails
[03:09:18] w09x_: has joined #RubyOnRails
[03:09:44] mDuff: has joined #RubyOnRails
[03:13:57] braincras: has joined #RubyOnRails
[03:15:34] htmldrum: has joined #RubyOnRails
[03:16:44] sonofdirt: has joined #RubyOnRails
[03:19:37] paradisaeidae_: has joined #RubyOnRails
[03:21:24] IrishGringo: has joined #RubyOnRails
[03:21:36] DragonPunch: has joined #RubyOnRails
[03:31:35] baweaver: has joined #RubyOnRails
[03:38:54] djbkd: has joined #RubyOnRails
[03:39:37] arBmind: has joined #RubyOnRails
[03:39:59] benlieb: has joined #RubyOnRails
[03:42:20] Chagel_: has joined #RubyOnRails
[03:43:32] PedramT: has joined #RubyOnRails
[03:47:18] fedexo: has joined #RubyOnRails
[03:47:19] chagel: has joined #RubyOnRails
[03:50:21] shayan: has joined #RubyOnRails
[03:51:25] jenrzzz: has joined #RubyOnRails
[03:51:25] jenrzzz: has joined #RubyOnRails
[03:52:18] chagel: has joined #RubyOnRails
[03:53:06] duncannz: has joined #RubyOnRails
[03:53:44] sonofdirt: has joined #RubyOnRails
[03:58:13] B1n4r10: has joined #RubyOnRails
[03:59:05] sp1rs: has joined #RubyOnRails
[04:02:35] blackmesa: has joined #RubyOnRails
[04:06:18] Lumia930: has joined #RubyOnRails
[04:09:00] Radar: GOOD AFTERNOON
[04:09:23] baweaver: GOOD AFTERNOON
[04:09:50] Arcaire: GOOD AFTERNOON
[04:10:12] timdotrb: has joined #RubyOnRails
[04:10:29] sevenseacat: c-c-c-combo breaker
[04:11:14] Arcaire: disgusting
[04:11:51] Arcaire: mods mods mods
[04:12:21] baweaver: op, nerf now
[04:14:33] d0nn1e: has joined #RubyOnRails
[04:14:44] Radar: cat is op
[04:15:45] baweaver: ACTION runs away
[04:17:40] owenjones: has joined #RubyOnRails
[04:17:41] lxsameer: has joined #RubyOnRails
[04:19:36] ramfjord: has joined #RubyOnRails
[04:25:20] G: has joined #RubyOnRails
[04:27:11] DragonPunch: has joined #RubyOnRails
[04:27:14] moeabdol1: has joined #RubyOnRails
[04:29:29] draig: has joined #RubyOnRails
[04:35:07] joshkovach: has joined #RubyOnRails
[04:38:19] chagel: has joined #RubyOnRails
[04:40:26] krz: has joined #RubyOnRails
[04:41:37] Palsson: has joined #RubyOnRails
[04:43:38] chagel: has joined #RubyOnRails
[04:47:00] jenrzzz: has joined #RubyOnRails
[04:47:00] jenrzzz: has joined #RubyOnRails
[04:51:19] SeductiveError: has joined #RubyOnRails
[05:02:35] Pathfinder: has joined #RubyOnRails
[05:03:24] PedramT: has joined #RubyOnRails
[05:04:37] blackmesa: has joined #RubyOnRails
[05:06:58] krz: has joined #RubyOnRails
[05:07:14] PedramT_: has joined #RubyOnRails
[05:08:59] rake_db_migrate: has joined #RubyOnRails
[05:10:40] PedramT: has joined #RubyOnRails
[05:12:58] audy: has joined #RubyOnRails
[05:13:23] smoitra: has joined #RubyOnRails
[05:13:51] Devalo: has joined #RubyOnRails
[05:15:01] lele: has joined #RubyOnRails
[05:16:41] B1n4r10: has joined #RubyOnRails
[05:18:44] alfie_max15: has joined #RubyOnRails
[05:19:03] PedramT: has joined #RubyOnRails
[05:20:36] PedramT: has joined #RubyOnRails
[05:26:35] chagel: has joined #RubyOnRails
[05:29:12] GitGud: has joined #RubyOnRails
[05:30:51] timdotrb: has joined #RubyOnRails
[05:31:32] chagel: has joined #RubyOnRails
[05:36:32] chagel: has joined #RubyOnRails
[05:37:55] PedramT: has joined #RubyOnRails
[05:38:29] rvanlieshout: has joined #RubyOnRails
[05:40:32] rake_db__: has joined #RubyOnRails
[05:41:01] PedramT: has joined #RubyOnRails
[05:42:46] hahuang65: has joined #RubyOnRails
[05:44:51] rake_db_migrate: has joined #RubyOnRails
[05:45:23] htmldrum: has joined #RubyOnRails
[05:47:02] chagel: has joined #RubyOnRails
[05:48:47] rake_db__: has joined #RubyOnRails
[05:50:33] apotry: has joined #RubyOnRails
[05:51:12] Radar: How do you find an action + controller combo in new relic? I want to see if this action has been performing badly recently.
[05:53:11] alex88: has joined #RubyOnRails
[05:53:50] jenrzzz: has joined #RubyOnRails
[05:53:50] jenrzzz: has joined #RubyOnRails
[05:54:36] scepticulous: has joined #RubyOnRails
[05:56:23] aganov: has joined #RubyOnRails
[05:56:47] rake_db_migrate: has joined #RubyOnRails
[06:06:15] paradisaeidae_: has left #RubyOnRails: ()
[06:07:37] blackmesa: has joined #RubyOnRails
[06:08:27] gusrub: has joined #RubyOnRails
[06:13:51] crameth: has joined #RubyOnRails
[06:14:11] pydave6367: has joined #RubyOnRails
[06:17:13] joshkovach: has joined #RubyOnRails
[06:18:07] sp1rs: has joined #RubyOnRails
[06:18:17] darutoko: has joined #RubyOnRails
[06:18:17] htmldrum: has joined #RubyOnRails
[06:21:59] dikaio: has joined #RubyOnRails
[06:22:02] Pathfinder: has joined #RubyOnRails
[06:22:33] pydave6367: has joined #RubyOnRails
[06:22:48] Pathfinder: How do I send out a registration message after save during excel importation. http://pastie.org/10785859
[06:23:34] sandstrom: has joined #RubyOnRails
[06:24:31] gusrub: has joined #RubyOnRails
[06:24:34] rvanlieshout: Pathfinder: to start with, narrow down what you exactly want to do. don't include irrelevant stuff
[06:24:47] Macaveli: has joined #RubyOnRails
[06:25:02] rvanlieshout: are you able to send a registration message in a console?
[06:25:39] alfie_max15: has left #RubyOnRails: ("Ex-Chat")
[06:25:46] benlieb: has joined #RubyOnRails
[06:25:48] davee_: has joined #RubyOnRails
[06:27:22] Pathfinder_: has joined #RubyOnRails
[06:28:20] jas02: has joined #RubyOnRails
[06:30:52] Pathfinder: rvanlieshout: Radar: Thanks for the info. I have edited the paste here: http://pastie.org/10785864
[06:31:21] Radar: Pathfinder: Did you try calling the method on line 46?
[06:31:22] mDuff: has joined #RubyOnRails
[06:31:29] rvanlieshout: 08:25 < rvanlieshout> are you able to send a registration message in a console?
[06:34:01] Pathfinder: The problem I am having is knowing how to pass the member's phone_number and pin from the load_imported_members method to the save method at the top
[06:35:08] Pathfinder: rvanlieshout: The api part works independently and I have tested it on the console using my phone_number and dummy data. The issue I am having is more of a logic one on how to pass data between the methods
[06:36:14] smoitra_: has joined #RubyOnRails
[06:37:00] artto: has joined #RubyOnRails
[06:37:05] sevenseacat: ACTION tiptoes away carefully
[06:38:09] defsdoor: has joined #RubyOnRails
[06:38:11] rvanlieshout: Pathfinder: so iterate over your imported_members and trigger mail for each of them?
[06:38:50] Radar: rvanlieshout: It's not a mail.
[06:39:06] Radar: Probably just wants to call send_registration_message
[06:39:27] rvanlieshout: aah right. not really that awake yet
[06:39:56] Pathfinder: Radar: Yes that is what I would precisely want to do. I would love to call it on a one liner after save has successfully occured
[06:40:13] Radar: Pathfinder: and what have you tried doing?
[06:40:25] Radar: send_registration_message(member.phone_number, member.pin) ?
[06:41:34] Pathfinder: I am using bcrypt which uses a password digest, hence I would never be able to query for the member.password hence I have to pass the pin upwards from the load_imported_members to the save method at the top
[06:41:50] Radar: " The problem I am having is knowing how to pass the member's phone_number and pin "
[06:41:56] Radar: Where in this sentence do you use the word "password"
[06:42:17] Radar: I know I'm getting to the end of my day and so I can not read things correctly... but I think I've read it enough times now to know that you're not referring to password *ever&
[06:42:59] Radar: In that sentence, anyway.
[06:43:03] duncannz: has joined #RubyOnRails
[06:43:13] Radar: and member.password will be available just fine in that instance.
[06:43:29] Radar: It's the same instance.
[06:43:54] sevenseacat: 'method A calls method B. but i dont know how to get data from B to A!'
[06:44:19] Radar: sevenseacat: yeah it's hard hey
[06:44:33] sevenseacat: given method B already returns a list of records to A
[06:44:40] sevenseacat: i am not seeing the problem
[06:46:42] hahuang65: has joined #RubyOnRails
[06:47:17] patrick-sartent: has joined #RubyOnRails
[06:49:38] mark2: has joined #RubyOnRails
[06:49:43] Pathfinder: Okay the issue is this. I have a method B called load_imported_members and a method A called save. The problem seems to be since I am calling member.update_attributes instead of member.assign_attributes, the record gets saved in B. When I pass the now already saved member/person to A, I could not extract the password to send to the user since calling member.password cannot work now as it has now been encrypted
[06:50:05] sevenseacat: say what now?
[06:50:13] sevenseacat: did you try it?
[06:50:40] Radar: it'll still be in memory
[06:50:44] Radar: You can access member.password fine
[06:50:59] jgt1: has joined #RubyOnRails
[06:51:04] sevenseacat: update_attributes is just assign_attributes + save, anyway.
[06:52:19] Pathfinder: Okay. I was getting a block. Let me gather my thoughts and notes properly before I ask. Apologies for the time wasted.
[06:54:06] PedramT: has joined #RubyOnRails
[06:55:23] jgrevich: has joined #RubyOnRails
[06:55:40] djbkd: has joined #RubyOnRails
[06:59:12] hxegon: has joined #RubyOnRails
[06:59:53] mbreedlove: has joined #RubyOnRails
[07:00:36] Pathfinder: Blocks are an exciting feature of ruby but Godamn this things are confusing :o !
[07:00:53] mbreedlove: has joined #RubyOnRails
[07:01:41] comrad: has joined #RubyOnRails
[07:01:45] denaras: has joined #RubyOnRails
[07:02:47] ur5us: has joined #RubyOnRails
[07:03:50] artto: has joined #RubyOnRails
[07:04:11] syndikate: has joined #RubyOnRails
[07:07:41] PedramT: has joined #RubyOnRails
[07:08:13] pawnbox: has joined #RubyOnRails
[07:10:39] blackmesa: has joined #RubyOnRails
[07:13:56] mhoungbo: has joined #RubyOnRails
[07:15:23] agit0: has joined #RubyOnRails
[07:15:32] lessless: has joined #RubyOnRails
[07:15:57] lessless: Hey, folks, is there any function similar do dasherize which will replace spaces with dashes?
[07:16:02] lessless: like str.split(' ').map(&:downcase).join('-')
[07:16:12] rvanlieshout: .tr(' ', '-')
[07:16:26] sevenseacat: are you looking for parameterize ?
[07:16:39] sevenseacat: rvanlieshout also has a good idea :)
[07:16:47] ur5us: has joined #RubyOnRails
[07:16:56] Pathfinder: Noob answer here: How about a simple gsub?
[07:17:19] context: wtf does tr even stand for
[07:17:40] sevenseacat: probably translate or transform
[07:17:50] Pathfinder: string.gsub(/\s+/, '-')
[07:18:30] context: im assuming thats a perl carry over or something :-/
[07:19:46] baweaver: more like unix/bash
[07:20:03] baweaver: it's more useful than gsub in some cases
[07:20:23] context: baweaver: excellent. get to add that to me 'commands that are 3 chars or less' for my next sysadmin interview
[07:21:19] baweaver: like make a l33t substitution: string.tr('aeiostlz', '43105712')
[07:21:24] baweaver: instant mad hacker cred
[07:21:39] baweaver: anyways, it's making a mapping from set A to set B
[07:21:42] Doddlin: has joined #RubyOnRails
[07:21:57] context: gotcha. seems more useful all of a sudden ;)
[07:21:58] sandstrom: has joined #RubyOnRails
[07:22:16] baweaver: also useful for ROTn algorithms
[07:22:29] Pathfinder: Radar , sevenseacat & rvanlieshout I have been able to solve my dummy issue by iterating over each individual on save and sending the message to them
[07:22:57] sevenseacat: well, i'm glad you solved it.
[07:23:53] baweaver: 'foobarbaz'.tr('a-z', 'm-za-l')
[07:24:03] PedramT: has joined #RubyOnRails
[07:24:40] AzaToth: has joined #RubyOnRails
[07:25:34] baweaver: ps df du top tar zip tr cut awk cat vim ln ls should all be on your 3 chars or less list too
[07:25:40] baweaver: ACTION is probably forgetting several
[07:25:45] gingray: has joined #RubyOnRails
[07:26:35] sevenseacat: i can spell all of those!
[07:26:51] PedramT_: has joined #RubyOnRails
[07:27:30] artto: has joined #RubyOnRails
[07:30:08] defsdoor_: has joined #RubyOnRails
[07:30:52] moep: has joined #RubyOnRails
[07:33:14] SPYGAME: has joined #RubyOnRails
[07:34:16] Ergo: has joined #RubyOnRails
[07:35:56] Silox|: has joined #RubyOnRails
[07:38:34] antgel: has joined #RubyOnRails
[07:39:04] solars: has joined #RubyOnRails
[07:39:34] chagel: has joined #RubyOnRails
[07:40:49] dikaio: has joined #RubyOnRails
[07:41:59] Ergo: has joined #RubyOnRails
[07:42:05] merida: has joined #RubyOnRails
[07:48:29] njero: has joined #RubyOnRails
[07:48:54] hahuang65: has joined #RubyOnRails
[07:49:04] artto: has joined #RubyOnRails
[07:51:23] Palsson: has joined #RubyOnRails
[07:52:22] finnnnnnnnnnn: has joined #RubyOnRails
[07:53:17] Pathfinder: has joined #RubyOnRails
[07:53:44] vedu: Hello. I am getting 500s for `RoutingError: No route matches`. Shouldn't this be a 404 instead?
[07:56:24] sp1rs: has joined #RubyOnRails
[07:56:50] pawnbox: has joined #RubyOnRails
[07:59:07] apotry: has joined #RubyOnRails
[07:59:59] mikecmpbll: has joined #RubyOnRails
[08:01:35] stannard: has joined #RubyOnRails
[08:02:44] mdw: has joined #RubyOnRails
[08:03:22] artto: has joined #RubyOnRails
[08:03:49] neanderslob_: has joined #RubyOnRails
[08:04:33] sandstrom: has left #RubyOnRails: ("OS X IRC Client (www.textualapp.com)")
[08:05:45] jsrn_: has joined #RubyOnRails
[08:05:50] scope: has joined #RubyOnRails
[08:06:23] tildes: has joined #RubyOnRails
[08:08:20] edwinvdgraaf: has joined #RubyOnRails
[08:11:29] srinidhi: has joined #RubyOnRails
[08:12:25] blackmesa: has joined #RubyOnRails
[08:13:22] dannyguk: has joined #RubyOnRails
[08:15:37] pawnbox: has joined #RubyOnRails
[08:21:02] maxx88_: has joined #RubyOnRails
[08:21:06] marr: has joined #RubyOnRails
[08:21:53] nmyr: has joined #RubyOnRails
[08:22:07] defsdoor: has joined #RubyOnRails
[08:22:13] snowy: has joined #RubyOnRails
[08:23:19] yfeldblum: has joined #RubyOnRails
[08:26:06] existensil: has joined #RubyOnRails
[08:26:17] Ergo: has joined #RubyOnRails
[08:29:10] snowy: has joined #RubyOnRails
[08:31:34] baweaver: has joined #RubyOnRails
[08:33:32] artto: has joined #RubyOnRails
[08:35:39] dannyguk: /msg NickServ VERIFY REGISTER dannyguk mblighhmnohh
[08:36:00] antgel: has joined #RubyOnRails
[08:36:41] adaedra: that's just the verify, should be ok.
[08:37:32] dannyguk: that'll teach me for cutting and pasting
[08:37:46] mDuff: has joined #RubyOnRails
[08:38:43] weckl: has joined #RubyOnRails
[08:41:04] chagel: has joined #RubyOnRails
[08:42:14] njero: has joined #RubyOnRails
[08:42:52] weckl: has joined #RubyOnRails
[08:43:27] weckl: has joined #RubyOnRails
[08:47:15] nocontrol: has joined #RubyOnRails
[08:49:42] hahuang65: has joined #RubyOnRails
[08:50:12] nocontrol: has joined #RubyOnRails
[08:51:44] arBmind: has joined #RubyOnRails
[08:53:13] vale_tudo: has joined #RubyOnRails
[08:53:38] ferr: has joined #RubyOnRails
[08:55:46] rodfersou: has joined #RubyOnRails
[09:00:31] hahuang65: has joined #RubyOnRails
[09:00:55] Pathfinder: has joined #RubyOnRails
[09:01:33] sp1rs: has joined #RubyOnRails
[09:02:55] artto_: has joined #RubyOnRails
[09:07:11] chagel: has joined #RubyOnRails
[09:07:41] n008f4g_: has joined #RubyOnRails
[09:08:35] Tempesta: has joined #RubyOnRails
[09:10:07] skislak: has joined #RubyOnRails
[09:10:37] enkristoffer: has joined #RubyOnRails
[09:13:38] tjvc: has joined #RubyOnRails
[09:13:41] tjvc: has joined #RubyOnRails
[09:14:13] blackmesa: has joined #RubyOnRails
[09:14:41] failasLStoRM: has joined #RubyOnRails
[09:15:21] antgel: has joined #RubyOnRails
[09:18:04] chagel: has joined #RubyOnRails
[09:19:22] benlieb: has joined #RubyOnRails
[09:22:19] mbreedlove: has joined #RubyOnRails
[09:23:03] chagel: has joined #RubyOnRails
[09:25:18] nodejunkie: has joined #RubyOnRails
[09:26:55] tvw: has joined #RubyOnRails
[09:30:27] chagel: has joined #RubyOnRails
[09:30:37] srinidhi: has joined #RubyOnRails
[09:32:57] ql6wlld: has joined #RubyOnRails
[09:33:47] finnnnnnnnnnn: has joined #RubyOnRails
[09:35:35] Palsson: has joined #RubyOnRails
[09:36:12] Megamos: has joined #RubyOnRails
[09:37:08] Domon: has joined #RubyOnRails
[09:37:12] PedramT: has joined #RubyOnRails
[09:37:14] workmad3: has joined #RubyOnRails
[09:37:21] artto: has joined #RubyOnRails
[09:38:58] bauerd: Hi everyone, when I `//= require` a JavaScript file that's located inside the asset load path, all that Rails sends down is three empty lines. How would I go about debugging this? I have two manifest files and they both pull in JavaScript files from the same directory. One works, the other doesn't...
[09:39:22] PedramT_: has joined #RubyOnRails
[09:39:58] maximski: has joined #RubyOnRails
[09:40:13] rvanlieshout: bauerd: you might want to show a bit more then this
[09:40:17] maximski: how can i skip protect_from_forgery for all json requests?
[09:40:24] maximski: or rather set it to null_exception
[09:40:39] rvanlieshout: show the content content of the file and the response of a direct access
[09:41:53] PedramT__: has joined #RubyOnRails
[09:42:22] merida: has joined #RubyOnRails
[09:43:30] adaedra: bauerd: in development, assets you `= require` are loaded as separate files when using stylesheet_link_tag
[09:44:11] adaedra: er, javascript
[09:46:30] DoubleMalt: has joined #RubyOnRails
[09:47:29] ishamo: has joined #RubyOnRails
[09:49:13] blackhuey: has joined #RubyOnRails
[09:50:55] artto: has joined #RubyOnRails
[09:51:03] bauerd: Thanks, got it sorted out. The manifest file had the same name as the file I intended to get required, and being higher in the asset load path, the manifest required itself. Thanks though!
[09:51:59] antgel: has joined #RubyOnRails
[09:52:03] merida_: has joined #RubyOnRails
[09:55:36] blackmesa: has joined #RubyOnRails
[10:00:19] chagel: has joined #RubyOnRails
[10:00:48] acosonic: has joined #RubyOnRails
[10:00:58] acosonic: Hi all how do I log something?
[10:01:08] acosonic: like log(something) and it goes to logger...
[10:01:10] rvanlieshout: Rails.logger.info "Hello"
[10:01:21] rvanlieshout: or whatever other log level you want to use
[10:02:09] Jasaka: has joined #RubyOnRails
[10:03:18] hahuang65: has joined #RubyOnRails
[10:04:56] rahc: I get an error when running rake to precompile assets:
[10:04:58] rahc: http://codepad.org/JSKc0qOn
[10:05:17] Palsson: has joined #RubyOnRails
[10:05:38] srinidhi1: has joined #RubyOnRails
[10:06:13] yfeldblum: has joined #RubyOnRails
[10:06:14] rahc: # ls /var/lib/gems/2.1.0/gems/jquery-datatables-rails-1.12.2/app/assets/javascripts/dataTables/jquery.dataTables.js
[10:06:18] rahc: /var/lib/gems/2.1.0/gems/jquery-datatables-rails-1.12.2/app/assets/javascripts/dataTables/jquery.dataTables.js
[10:06:26] rahc: the file exists
[10:06:47] rahc: I'm trying to find why that directory is not included in the path that's being searched
[10:07:04] Pathfinder_: has joined #RubyOnRails
[10:07:21] workmad3: rahc: how did you add the gem to your app?
[10:08:11] antgel: has joined #RubyOnRails
[10:08:13] rahc: but it's like swimming through treacle
[10:09:57] sp1rs: has joined #RubyOnRails
[10:10:01] rahc: workmad3:
[10:10:02] rahc: # grep dataTables app/assets/javascripts/webui/application.js
[10:10:02] rahc: //= require dataTables/jquery.dataTables
[10:11:45] workmad3: rahc: no, the gem
[10:12:00] workmad3: rahc: not how you're trying to pull in assets from the gem
[10:12:15] arup_r: has joined #RubyOnRails
[10:14:06] mbreedlove: has joined #RubyOnRails
[10:14:42] rahc: workmad3: what do you mean by "add the gem" then?
[10:14:58] workmad3: rahc: did you add a line to your Gemfile?
[10:15:14] rahc: workmad3: yes of course
[10:15:34] rahc: # grep datatables Gemfile gem 'jquery-datatables-rails'
[10:16:18] Blaze_Boy: has joined #RubyOnRails
[10:17:00] rahc: # grep datatables Gemfile
[10:17:04] rahc: gem 'jquery-datatables-rails'
[10:17:51] Ergo^: has joined #RubyOnRails
[10:18:08] artto: has joined #RubyOnRails
[10:18:36] workmad3: rahc: ok, weird... that's the normal reason gems like that don't work
[10:19:45] chagel: has joined #RubyOnRails
[10:25:57] workmad3: rahc: my next suggestion would be to restart the server
[10:29:31] norc: has joined #RubyOnRails
[10:29:50] norc: Hi. Does AS have some elegant solution to quickly iterate over the past N days that I do not see?
[10:30:08] norc: ActiveSupport
[10:30:32] rvanlieshout: and you want to iterate over a date range?
[10:31:00] rvanlieshout: or fetch records within a range?
[10:32:00] norc: (7.days.ago.to_date..Date.current).each { |a| p a } feels a bit clumsy.
[10:32:46] baweaver: has joined #RubyOnRails
[10:32:50] rvanlieshout: i don't expect there to be a generic thing for that
[10:33:05] rvanlieshout: because it has quite some variables
[10:33:12] rvanlieshout: and this is the minimal way to specify them all
[10:33:23] Hates_: 7.days.ago.upto(Date.current) { |a| pa } perhaos
[10:33:41] Hates_: haven't got a rails project handy to try
[10:34:14] norc: Well you have to call #to_date first but I get the idea.
[10:34:19] norc: Its minimally better I guess.
[10:34:21] Hates_: yeah, it's not exact probably :)
[10:34:34] norc: Hates_: Yeah I guess that is what I was looking for thanks.
[10:34:38] Hates_: (7.days.ago).upto(Date.current) maybe
[10:34:43] rlf: has joined #RubyOnRails
[10:35:08] norc: as I said, you have to call #to_date first
[10:35:14] norc: since upto is defined on Date, not Time
[10:35:19] norc: But its fine
[10:35:36] norc: 7.days.ago.to_date.upto(Date.current) works for me
[10:36:08] rlf: hello, i have sqlite3 for development adapter and mysql2 for production adapter, in production when i run bundle exec rake db:seed, it says that sqlite3 adapter is specified but not installed (obviously, because i have a group :production and mysql2 there). any ideas how to fix that?
[10:36:24] Pathfinder: has joined #RubyOnRails
[10:36:29] rvanlieshout: rlf: switch to mysql2 in development
[10:36:48] rvanlieshout: just because you don't want that much differences between your environments in development & production
[10:37:08] chridal: x-posting from #ruby
[10:37:39] chridal: We want to record some statistics in our application, but doing a SQL INSERT for every single GET sounds like a bad idea, and the network overhead with Redis sounds pretty bad too.
[10:37:49] chridal: What are you guys doing to record metrics about who is viewing what etc.?
[10:38:08] AimlessRAven: has joined #RubyOnRails
[10:38:11] sevenseacat: google analytics.
[10:38:15] chridal: I thought about having something like a separate process that receives information on a pipe from the Rails application, and that this process handles the writes
[10:38:27] chridal: This is for an API btw
[10:38:36] chridal: we want to record metrics on which users are fetching what, and when
[10:38:44] chridal: clients are iOS devices
[10:38:44] AimlessRAven: hi all, i have model newsletter, i want after create to generate token use devise token friendly id
[10:38:52] rlf: rvanlieshout: great solution, no thanks
[10:38:57] rahc: workmad3: err.. wtf do you think restarting the server would do?
[10:39:07] rvanlieshout: chridal: push them to redis list and have a worker flush that every x minutes
[10:39:07] sevenseacat: rlf: he's right, you really should.
[10:39:08] k13nox: has joined #RubyOnRails
[10:39:33] sevenseacat: rahc: pick up the change in the Gemfile if you didnt restrart after adding it
[10:39:51] chridal: rvanlieshout: Then we would incur the network cost of hitting the Redis for every single GET-request
[10:39:58] chridal: It's livable though
[10:40:06] sevenseacat: you're going to have to incur some cost somewhere
[10:40:16] chridal: Not necessarily.
[10:40:23] sevenseacat: yes necessarily, you're doing extra work
[10:40:29] sevenseacat: work is not free
[10:40:29] chridal: Yes, but not network work.
[10:40:30] rahc: sevenseacat: you mean the web server daemon?
[10:40:44] sevenseacat: rahc: yes, the server.
[10:40:55] rvanlieshout: run a redis locally and use sockets
[10:41:03] chridal: It's slightly different doing a syscall and ending that syscall on the other end of the network
[10:41:09] chridal: rvanlieshout: Yes, that's an option.
[10:41:10] rahc: sevenseacat: why would the server be required for precompiling assets?
[10:41:28] chridal: rvanlieshout: What do you think about spinning off just a simple process though and talk to it via a pipe?
[10:41:37] rahc: workmad3: ^
[10:41:48] chridal: and then have that just work through a queue and hit the remote Redis/Postgres?
[10:41:57] chridal: but that would sort of be reimplementing Redis.
[10:42:04] chridal: A local Redis is probably the solution I am looking for here.
[10:42:29] AimlessRAven: how to generate token after create action using devise friendly id
[10:42:47] AimlessRAven: devise friendyl token
[10:43:22] n008f4g_: has joined #RubyOnRails
[10:43:24] sevenseacat: AimlessRaven: what have you tried?
[10:43:48] rvanlieshout: chridal: which would be somewhat like how redis functions
[10:43:52] rvanlieshout: easier to maintain
[10:43:55] AimlessRAven: sevenseacat: amm i have newsletter model, and i want after create to generate devise friendly_token
[10:44:03] rvanlieshout: don't reinvent the wheel
[10:44:05] sevenseacat: AimlessRaven: what have you tried?
[10:44:35] chridal: I think what I'll do is run that local Redis, and then have a separate service running on the servers that work through the local redis, pool them up and then write many at the same time
[10:44:48] rvanlieshout: ^ wrong window.. alias for git add --patch :)
[10:44:57] chridal: to the remote Redis
[10:44:59] sevenseacat: AimlessRaven: you have a habit of asking questions that have zero effort put into them. please stop doing that.
[10:45:19] rvanlieshout: is the connection to that remote redis really that slow?
[10:45:35] chridal: rvanlieshout: Not necessarily, but network overhead is network overhead
[10:45:47] AimlessRAven: sevenseacat: ok but my model is empty for now .. :) i just want to set after_create method to generate devise friendly_token
[10:45:52] rahc: sevenseacat: hello?
[10:45:53] chridal: And there are a lot of servers that's talking to it
[10:45:56] rvanlieshout: but maintaining additional redis instances also is a overhead
[10:46:04] sevenseacat: AimlessRaven: you have a shot at doing it, then if you have problems, come back and seek help.
[10:46:09] rvanlieshout: why not see if it's actually a problem?
[10:46:14] sevenseacat: AimlessRaven: we are not going to spoon-feed you code anymore.
[10:46:18] chridal: rvanlieshout: Yes, but the cost is RAM vs. network time
[10:46:24] sevenseacat: rahc: i didnt make the suggestion, don't look at me.
[10:46:30] rvanlieshout: + maintanance
[10:46:35] chridal: Yes, indeed.
[10:46:35] rvanlieshout: + chance of failure
[10:46:55] rvanlieshout: i would give it a spin first.. just see how it functions
[10:47:50] merida: has joined #RubyOnRails
[10:47:53] p1k: has joined #RubyOnRails
[10:48:00] p1k: has joined #RubyOnRails
[10:48:55] chridal: rvanlieshout: Give what a spin? Hitting Redis an extra time for every single GET?
[10:49:08] chridal: vs. writing to a local cache?
[10:49:33] chridal: To be honest I totally am pre-optimizing here...
[10:49:44] chridal: So probably I should just do that untill it becomes a real issue.
[10:49:46] rvanlieshout: the first one yes. just using the redis you already have
[10:49:48] p1k: hey I've recently moved my development environment to a slightly older computer while travelling, and I'm getting very slow app load times
[10:50:09] jgt1: has joined #RubyOnRails
[10:50:36] p1k: it's still a Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz, so that shouldn't be too bad, is there some benchmarking someone would recommend for seeing where the real bottleknecks are?
[10:50:58] rvanlieshout: p1k: do you suspect you have a single bottlekneck?
[10:51:18] rvanlieshout: how is your disk activity?
[10:51:50] finnnnnnnnnnn_: has joined #RubyOnRails
[10:51:56] p1k: rvanlieshout: I very much do, it's an ssd though an older one,
[10:52:16] rvanlieshout: is any request slow?
[10:52:22] PedramT: has joined #RubyOnRails
[10:52:28] rahc: I get an error when running rake to precompile assets:
[10:53:39] p1k: rvanlieshout: full page reload is very slow - so either serving or erb rendering times, of course it could be somewhere on a lower system level (scheduler/disk io) but I wouldn't be checking that first
[10:54:03] PedramT: has joined #RubyOnRails
[10:54:21] rvanlieshout: p1k: does your log also show you slow response times?
[10:54:25] rvanlieshout: log/development.log
[10:55:48] artto: has joined #RubyOnRails
[10:56:59] rahc: http://codepad.org/JSKc0qOn
[10:57:09] rahc: /var/lib/gems/2.1.0/gems/jquery-datatables-rails-1.12.2/app/assets/javascripts/dataTables/jquery.dataTables.jsthe file exists
[10:57:14] rahc: I'm trying to find why that directory is not included in the path that's being searched
[10:57:19] rahc: but it's like swimming through treacle
[10:57:43] rvanlieshout: rahc: edit /usr/lib/ruby/vendor_ruby/sprockets/context.rb:108 directly on the server and add logging for the paths
[10:57:47] rahc: any ideas why rake isn't finding that file
[10:57:52] p1k: rvanlieshout: yeah for example after checking out a different branch - Rendered application/_footer.html.erb (10398.6ms)
[10:58:02] p1k: that looks like asset pre-compile
[10:58:12] rvanlieshout: p1k: and that's fast if you empty that file?
[10:58:22] dvinciguerra_: has joined #RubyOnRails
[10:58:54] rahc: rvanlieshout: I know what the paths are
[10:59:17] rvanlieshout: rahc: oh. so you've verified that it didn't include the gem's path
[10:59:20] rahc: rvanlieshout: what I want to know is why the path containing the directory I need, isn't included
[10:59:24] p1k: still very slow Completed 200 OK in 14154ms (Views: 14021.9ms | ActiveRecord: 20.9ms)
[10:59:29] rahc: rvanlieshout: yes
[10:59:31] rvanlieshout: p1k: then it's not that file
[10:59:51] rahc: 11:57 < rahc> I'm trying to find why that directory is not included in the path that's being searched
[11:00:14] rahc: does anybody have any idea?
[11:00:32] rvanlieshout: except reading through stack and finding out where it gets its list of paths, no
[11:00:51] rahc: does anybody else have any idea?
[11:00:54] p1k: rvanlieshout: Anything I can do to generically get a bunch of timers, or do I got to go through everything in the app pipe-line and figure-out where to toggle verbose and timing ?
[11:00:57] rahc: rvanlieshout: that's what I've been doing
[11:01:03] rahc: 11:57 < rahc> but it's like swimming through treacle
[11:02:57] rvanlieshout: what's in resolve?
[11:03:20] rvanlieshout: p1k: you clould narrow it down by render text: '' at the end of the controller#action
[11:03:25] rvanlieshout: and see if it's the view or the controller
[11:04:15] rvanlieshout: rahc: what version of sprockets? cause it's not https://github.com/rails/sprockets/blob/master/lib/sprockets/context.rb#L108
[11:04:16] hahuang65: has joined #RubyOnRails
[11:05:02] rahc: rvanlieshout: 2.12.3
[11:05:37] p1k: rvanlieshout: so pretty much piece by piece? it's reloading means sass, es6, coffee well basically a bunch of pre-processing
[11:07:00] rvanlieshout: rahc: you did install gems there?
[11:07:13] workmad3: p1k: https://github.com/MiniProfiler/rack-mini-profiler could help you
[11:07:14] rvanlieshout: p1k: well yes, but start with splitting it in 2
[11:07:29] rahc: rvanlieshout: what do you mean? install gems where?
[11:07:39] rvanlieshout: on the machine where you're running this rake task
[11:07:56] acosonic: has left #RubyOnRails: ()
[11:08:10] rahc: rvanlieshout: yes
[11:08:21] rahc: 11:57 < rahc> /var/lib/gems/2.1.0/gems/jquery-datatables-rails-1.12.2/app/assets/javascripts/dataTables/jquery.dataTables.jsthe file exists
[11:08:57] rvanlieshout: using the same ruby? cause the error points to /usr/lib/ruby
[11:09:49] rahc: rvanlieshout: I would imagine so
[11:10:35] rahc: rvanlieshout: there are other paths under /var/lib/gems which are present in the paths
[11:10:36] p1k: workmad3: I've got that
[11:10:58] p1k: workmad3: almost all of the requests were very slow on first load after branch checkout
[11:10:58] rvanlieshout: rahc: and those files that can be found are not also on a different location?
[11:11:34] rahc: rvanlieshout: what do you mean "on a different location"?
[11:11:53] rvanlieshout: rahc: in /usr/lib/ruby/gems/somewhere
[11:12:12] rahc: rvanlieshout: I don't understnad what you're asking
[11:12:27] rahc: /var/lib/gems/2.1.0/gems/cocoon-1.2.6/app/assets/javascripts
[11:12:30] rahc: that's in the path
[11:12:33] FooMunki: has joined #RubyOnRails
[11:12:36] vale_tudo: has joined #RubyOnRails
[11:12:39] rahc: /var/lib/gems/2.1.0/gems/jquery-datatables-rails-1.12.2/app/assets/javascripts
[11:12:42] rahc: that's not in the path
[11:12:50] arup_r: has joined #RubyOnRails
[11:12:51] rahc: it needs to be in the path
[11:13:04] rahc: I'm trying to understand why it isn't in the path so that I can make it be in the path
[11:13:28] sandelius: has joined #RubyOnRails
[11:14:21] artto: has joined #RubyOnRails
[11:14:54] rvanlieshout: i'm out of generic ideas. i guess you'll just need to walk through the code
[11:14:56] rvanlieshout: and time for lunch
[11:17:15] voidDotClass: has joined #RubyOnRails
[11:17:40] DoubleMalt: has joined #RubyOnRails
[11:18:45] tvw: has joined #RubyOnRails
[11:19:05] tvw: has joined #RubyOnRails
[11:19:29] voidDotClass: I have a class School, with a Jbuilder for it in schools/_school.jbuilder . I have another class, Student, which belongs_to school. I'm trying to load the partial for the school in _student.jbuilder, but its not working. doing: json.school student.school, partial: 'schoolss/school', as: school . Error: ActionView::Template::Error: undefined local variable or method `school' for #<#<Class:0x007fe385c932c0>:0x007fe385c8ece8>
[11:19:41] voidDotClass: if I do "puts #{student.school}" right before that line, it works
[11:20:22] GodFather: has joined #RubyOnRails
[11:20:37] jgt1: has joined #RubyOnRails
[11:21:10] workmad3: voidDotClass: you have 'as: school' instead of 'as: :school'
[11:21:13] k13nox_: has joined #RubyOnRails
[11:22:19] trinaldi: has joined #RubyOnRails
[11:23:59] lxsameer: hey folks, does rails provide any code to test generators using minitest ?
[11:24:34] voidDotClass: thank you, workmad3
[11:24:52] FooMunki: has joined #RubyOnRails
[11:26:47] RegulationD: has joined #RubyOnRails
[11:28:07] ldnunes: has joined #RubyOnRails
[11:28:11] workmad3: voidDotClass: for future reference, if something is complaining about an 'undefined local variable' then that means 'school' is appearing on its own somewhere :)
[11:28:19] sp1rs: has joined #RubyOnRails
[11:28:34] workmad3: voidDotClass: so you just need to look for where you've made the typo
[11:31:28] dionysus69: has joined #RubyOnRails
[11:32:39] Blaze_Boy: has joined #RubyOnRails
[11:32:53] mikecmpbll: has joined #RubyOnRails
[11:33:24] zave: has joined #RubyOnRails
[11:38:38] mDuff: has joined #RubyOnRails
[11:40:53] srinidhi: has joined #RubyOnRails
[11:41:14] artto: has joined #RubyOnRails
[11:41:39] htmldrum: has joined #RubyOnRails
[11:46:43] adre: has joined #RubyOnRails
[11:47:30] sandelius: has joined #RubyOnRails
[11:48:35] stannard: has joined #RubyOnRails
[11:50:01] rodferso1: has joined #RubyOnRails
[11:53:03] Macaveli: has joined #RubyOnRails
[11:53:10] blackmesa: has joined #RubyOnRails
[11:54:02] artto: has joined #RubyOnRails
[11:54:55] Sephyros: has joined #RubyOnRails
[11:55:38] rodfersou: has joined #RubyOnRails
[11:56:06] Sephyros: What is the best way to display a pdf file in a view?
[11:56:20] sp1rs: has joined #RubyOnRails
[11:59:11] chridal: rvanlieshout: But! We have one counter that is to be incremented every time someone views an image. This means that if we do this syncronously with 5 separate servers and they all try to do an atomic write at the same time they will be stuck waiting for eachother freezing the entire main thread?
[11:59:16] chridal: of all the 5 servers
[11:59:37] rvanlieshout: chridal: freezing it for the time needed to update an in memory database
[11:59:45] rvanlieshout: which takes like 0 time
[12:00:06] rvanlieshout: or you mean a deadlock?
[12:00:25] chridal: No, I meant what you was referring to. I just wasn't being entirely practical I guess.
[12:01:45] workmad3: chridal: you could potentially have a setup where each server writes to their own key in a namespace, and then have a process that sums the values of all keys in the namespace
[12:02:23] workmad3: chridal: but the more petinant problem there would probably be error handling or slow requests, which you'll have to deal with in both cases anyway
[12:03:11] PedramT: has joined #RubyOnRails
[12:03:49] k13nox: has joined #RubyOnRails
[12:04:13] Sephyros: no, inside another tab
[12:04:28] Sephyros: open a new tab to display the pdf
[12:04:48] Sephyros: if the user dont allow display the pdf get downloaded
[12:06:35] snowy: has joined #RubyOnRails
[12:06:39] Pupeno: has joined #RubyOnRails
[12:06:39] Pupeno: has joined #RubyOnRails
[12:15:34] King_Rex: has joined #RubyOnRails
[12:15:42] _Tariq: has joined #RubyOnRails
[12:15:44] Palsson: has joined #RubyOnRails
[12:17:32] barajasfab: has joined #RubyOnRails
[12:18:52] nmyr: Hey! I've committed my first PR to rails about ~20 days ago. I didn't receive any feedback from official reviewer. If somebody had tips or any improvement/feedback for the PR, i'm happy to hear. https://github.com/rails/rails/pull/24225
[12:19:42] rickmasta: has joined #RubyOnRails
[12:21:08] artto: has joined #RubyOnRails
[12:23:07] FooMunki: has joined #RubyOnRails
[12:24:36] someish: has joined #RubyOnRails
[12:26:47] solars: has joined #RubyOnRails
[12:27:58] IrishGringo: has joined #RubyOnRails
[12:29:02] mikecmpbll: nmyr: i'm not involved with rails core or anything, but it might be nice for a similar API to collection_check_boxes http://apidock.com/rails/ActionView/Helpers/FormOptionsHelper/collection_check_boxes
[12:29:12] mikecmpbll: where it will yield a builder to a block
[12:30:06] mikecmpbll: then you can render and apply any additional options such as class, prompt, directly on the select. (i guess the builder would need to have a b.unit method or similar so you can see if it's day, month, minute, etc.
[12:31:11] Ergo^: has joined #RubyOnRails
[12:31:40] pawnbox: has joined #RubyOnRails
[12:32:52] pawnbox: has joined #RubyOnRails
[12:33:06] chagel: has joined #RubyOnRails
[12:33:10] sudoubuntu: has joined #RubyOnRails
[12:33:23] baweaver: has joined #RubyOnRails
[12:35:38] nmyr: mikecmpbll, ok interesting. but this means more to change. i've done a research about the existing `with_css_classes` attribute and provided a similar solution to the `promt` attribute.
[12:36:03] mikecmpbll: agreed. it makes a more palatable PR.
[12:36:15] norc: nmyr: Your best bet to get some feedback is to write a mail to the rubyonrails-core mailing list, or write another comment in your pullrequest.
[12:37:01] mikecmpbll: it's not likely to be reviewed any time soon, i'd say
[12:38:13] CodaBrink: has joined #RubyOnRails
[12:38:19] crystal77: has joined #RubyOnRails
[12:38:43] nmyr: norc, ok thanks - do you mind i should ping another reviewer in the PR? Mail to core mailing list is a good idea, will prepare one.
[12:38:48] dannyguk: has joined #RubyOnRails
[12:38:50] akshat: has joined #RubyOnRails
[12:39:24] Malgorath: has joined #RubyOnRails
[12:39:30] Malgorath: good (insert time of day here), hows everyone doing?
[12:39:42] mikecmpbll: good 13:39, malgorath .
[12:39:53] mikecmpbll: amidoinitrite?
[12:39:59] finnnnnnnnnnn: has joined #RubyOnRails
[12:39:59] CanTonic: has joined #RubyOnRails
[12:40:03] stevednd: has joined #RubyOnRails
[12:40:05] Malgorath: perfection mikecmpbll
[12:40:52] mikecmpbll: malgorath: !hi5
[12:40:52] helpa: malgorath: High five, mikecmpbll!
[12:41:26] Malgorath: that seemed backwards for some reason
[12:41:42] pawnbox: has joined #RubyOnRails
[12:41:46] mikecmpbll: yeah, i misinterpreted the command :'(
[12:41:58] dstarh: has joined #RubyOnRails
[12:42:01] Malgorath: mikecmpbll: you ever worked with OpenProject?
[12:42:24] rake_db_migrate: has joined #RubyOnRails
[12:42:43] Malgorath: Finding someone that has written a 'plugin' for it ain't not uneasy
[12:44:19] akipt: has joined #RubyOnRails
[12:45:12] akipt: I stucked, maybe someone can giv me an advice: i have a 'location' and an event'
[12:45:36] Malgorath: *brain starts to seize at unterminated single quote
[12:46:00] mikecmpbll: malgorath : looks like the plugins are just rails plugins
[12:46:03] mikecmpbll: is the main app an engine?
[12:46:20] akipt: location has many events
[12:46:39] mikecmpbll: just looks like it's a regular rails app.
[12:46:47] Malgorath: mikecmpbll: from best I can tell it is. I'm just not that great at making engines and gems yet, just starting to understand it
[12:46:55] theblang: has joined #RubyOnRails
[12:47:00] akipt: the locations are fine, but now i want to show an independent list with all events and my problem is, that i want to see the title of the location, not only the location_id from event
[12:47:11] Malgorath: I been asked if I could make a task list to add to 'jobs'
[12:47:19] mikecmpbll: ah okay. the best way to imagine it is that the plugin gem you're writing will be merged with the openproject repo
[12:47:46] mikecmpbll: so you'd structure it pretty similarly.
[12:48:01] rake_db_migrate: has joined #RubyOnRails
[12:48:10] akipt: in the event index view i have a problem with this line -> <%= event.location.id%>
[12:48:21] pawnbox: has joined #RubyOnRails
[12:48:27] akipt: only valid output is <%= event.location_id%>
[12:48:38] Malgorath: mikecmpbll: yeah I'm getting the concept, its just the implementing part I'm about 30% comfortable doing
[12:48:52] mikecmpbll: k, what you stuck with?
[12:48:54] Malgorath: I want to have a proof of concept by Thursday
[12:49:03] Paradox: has joined #RubyOnRails
[12:49:07] Denart_: has joined #RubyOnRails
[12:49:47] Malgorath: I can generate a blank plugin and even have it appear in main app, but I have to figure out how the models work to build the micro app to go with it and then figure out where in the templates to put in the actual lists
[12:51:08] PedramT: has joined #RubyOnRails
[12:52:02] Malgorath: I'm stuck kinda that point, I'm just back at work to look at where I left off yesterday with it. in 2 hours early as I want to get this done.
[12:52:25] mikecmpbll: quite difficult to help without a targeted question.
[12:52:45] mikecmpbll: probably look at the source for other plugins.
[12:53:14] Malgorath: Sorry, I am still getting organized for the day
[12:53:19] pawnbox: has joined #RubyOnRails
[12:54:35] BaNzounet: has joined #RubyOnRails
[13:00:34] jetpack_joe: has joined #RubyOnRails
[13:01:28] stannard: has joined #RubyOnRails
[13:01:38] sp1rs: has joined #RubyOnRails
[13:02:46] Malgorath: mostly think I just need to find the model relationships, which I can do probably on my own with some googlin' if needs be
[13:02:59] joaumg: has joined #RubyOnRails
[13:03:50] krz: has joined #RubyOnRails
[13:04:46] flashpoint9: has joined #RubyOnRails
[13:04:47] drbayer: has joined #RubyOnRails
[13:05:41] hahuang65: has joined #RubyOnRails
[13:06:32] sp1rs1: has joined #RubyOnRails
[13:08:48] mikecmpbll: look in app/models/<whatever>.rb :)
[13:09:06] Malgorath: yeah, its work_packages(table) and work_package_id for relationship
[13:09:32] diegoaguilar: has joined #RubyOnRails
[13:09:35] Malgorath: just realizing some work I tried lastnight that didn't work out was cause I was in the wrong VM :-/
[13:13:01] moeabdol2: has joined #RubyOnRails
[13:13:07] Denart__: has joined #RubyOnRails
[13:14:39] pfg__: has joined #RubyOnRails
[13:15:06] antgel: has joined #RubyOnRails
[13:15:11] jgt2: has joined #RubyOnRails
[13:15:28] jhill_: has joined #RubyOnRails
[13:15:30] SuppliedRelic_: has joined #RubyOnRails
[13:15:33] jcugno__: has joined #RubyOnRails
[13:15:48] sp1rs: has joined #RubyOnRails
[13:15:53] dstarh: has joined #RubyOnRails
[13:16:01] neanderslob__: has joined #RubyOnRails
[13:16:15] Ikzi: has joined #RubyOnRails
[13:17:03] penguinp1wernz: has joined #RubyOnRails
[13:17:08] jmignault: has joined #RubyOnRails
[13:17:11] malgorat1: has joined #RubyOnRails
[13:17:23] thorgi_: has joined #RubyOnRails
[13:18:19] Ratler_: has joined #RubyOnRails
[13:18:26] _Tariq: has joined #RubyOnRails
[13:18:52] pawnbox_: has joined #RubyOnRails
[13:19:18] cantonic_: has joined #RubyOnRails
[13:20:24] cschneid: has joined #RubyOnRails
[13:21:02] Pupeno: has joined #RubyOnRails
[13:21:24] FastJack_: has joined #RubyOnRails
[13:21:29] artto: has joined #RubyOnRails
[13:21:48] Donkoko: has joined #RubyOnRails
[13:22:25] russt: has joined #RubyOnRails
[13:22:32] gambl0re: has joined #RubyOnRails
[13:22:32] gambl0re: has joined #RubyOnRails
[13:22:34] tomaw: has joined #RubyOnRails
[13:22:50] QualityAddict: has joined #RubyOnRails
[13:24:10] IrishGringo_: has joined #RubyOnRails
[13:24:10] DanKnox_: has joined #RubyOnRails
[13:24:10] crdpink2: has joined #RubyOnRails
[13:24:10] c355E3B_: has joined #RubyOnRails
[13:24:10] arBmind1: has joined #RubyOnRails
[13:24:10] pwnd_nsfw`: has joined #RubyOnRails
[13:24:10] flashpoint9: has joined #RubyOnRails
[13:24:10] Palsson: has joined #RubyOnRails
[13:24:10] srinidhi: has joined #RubyOnRails
[13:24:10] Pathfinder: has joined #RubyOnRails
[13:24:10] blackhuey: has joined #RubyOnRails
[13:24:10] patrick-sartent: has joined #RubyOnRails
[13:24:10] andatche: has joined #RubyOnRails
[13:24:10] bga57: has joined #RubyOnRails
[13:24:10] MuffinPimp: has joined #RubyOnRails
[13:24:10] lord4163: has joined #RubyOnRails
[13:24:10] timmyBsd: has joined #RubyOnRails
[13:24:10] nyandoge: has joined #RubyOnRails
[13:24:10] JonasOSDever_: has joined #RubyOnRails
[13:24:10] Caerus: has joined #RubyOnRails
[13:24:10] Veejay: has joined #RubyOnRails
[13:24:10] markelite: has joined #RubyOnRails
[13:24:11] Cork: has joined #RubyOnRails
[13:24:11] mikeiniowa: has joined #RubyOnRails
[13:24:11] Diabolik: has joined #RubyOnRails
[13:24:11] krainboltgreene: has joined #RubyOnRails
[13:24:11] alethea: has joined #RubyOnRails
[13:24:11] DarkBushido: has joined #RubyOnRails
[13:24:11] codepete: has joined #RubyOnRails
[13:24:11] ELCALOR: has joined #RubyOnRails
[13:24:11] Olipro: has joined #RubyOnRails
[13:24:11] CustosLimen: has joined #RubyOnRails
[13:24:11] dede: has joined #RubyOnRails
[13:24:11] jcp: has joined #RubyOnRails
[13:24:11] upgrayeddd: has joined #RubyOnRails
[13:24:11] mcr-credil: has joined #RubyOnRails
[13:24:11] epochwolf: has joined #RubyOnRails
[13:24:11] mozzarella: has joined #RubyOnRails
[13:24:11] KorriX: has joined #RubyOnRails
[13:24:11] jlyndon: has joined #RubyOnRails
[13:24:11] eduardodeoh: has joined #RubyOnRails
[13:24:17] c355E3B_: has joined #RubyOnRails
[13:24:51] Olipro: has joined #RubyOnRails
[13:25:18] PlasmaStar: has joined #RubyOnRails
[13:26:07] DoubleMalt: has joined #RubyOnRails
[13:26:50] joshkovach: has joined #RubyOnRails
[13:26:52] jero_: has joined #RubyOnRails
[13:27:27] mhoungbo: has joined #RubyOnRails
[13:27:40] jwang: has joined #RubyOnRails
[13:27:42] dede: has joined #RubyOnRails
[13:28:04] Sephyros: has joined #RubyOnRails
[13:28:12] ELCALOR: has joined #RubyOnRails
[13:28:18] hightower2: has joined #RubyOnRails
[13:28:26] jsrn_: has joined #RubyOnRails
[13:28:46] jcp: has joined #RubyOnRails
[13:29:01] nyandoge: has joined #RubyOnRails
[13:29:35] drptbl: has joined #RubyOnRails
[13:29:51] DragonPunch: has joined #RubyOnRails
[13:31:09] GodFather: has joined #RubyOnRails
[13:33:21] artto_: has joined #RubyOnRails
[13:33:49] Hosh: has joined #RubyOnRails
[13:34:44] markelite: has joined #RubyOnRails
[13:35:56] cdnsteve: has joined #RubyOnRails
[13:36:12] cdnsteve: Good morning
[13:36:30] artto: has joined #RubyOnRails
[13:36:31] gr1m_: has joined #RubyOnRails
[13:36:38] cdnsteve: Getting setup in Rails. Is RSpec preferred over Minitest?
[13:36:49] sevenseacat: its your personal preference
[13:36:54] sevenseacat: i would say its slightly more common
[13:37:08] jlyndon: has joined #RubyOnRails
[13:37:46] gr1m_: hi, web application is communicating with desktop client that makes big requests 60-100KB every 30 seconds. after a while the web server stops responding. i suspect its because the requests are very long and im exchausting some kind of a limit. i am using nginx/phusion combo
[13:38:00] IrishGringo: has joined #RubyOnRails
[13:38:08] gr1m_: whats the best way to handle this so it wont slow down the server?
[13:38:21] context: find out whats slowing it down
[13:38:47] chouhoulis: has joined #RubyOnRails
[13:40:04] gr1m_: could it be just the fact that the requests are big?
[13:40:29] gr1m_: the time that takes the client to send the data?
[13:40:36] context: it could im sure. but i wouldnt think it would stop responding.
[13:40:49] context: how is memory usage, cpu usage, logs?
[13:41:09] rvanlieshout: and what should it do with such a request?
[13:41:11] rvanlieshout: does that take long?
[13:41:24] StevenXL: has joined #RubyOnRails
[13:41:53] gr1m_: the memory/cpu is low. i just realized that i was sending all the data to a kafka queue inside the request.. perhaps thats whats causing the slowdown
[13:42:06] gr1m_: i should probably do that asynchroneously
[13:43:05] Ropeney: has joined #RubyOnRails
[13:43:28] Lumia930`: has joined #RubyOnRails
[13:46:05] CanTonic: has joined #RubyOnRails
[13:48:10] leifcr: has joined #RubyOnRails
[13:48:25] Lumia930: has joined #RubyOnRails
[13:48:25] Megamos: has joined #RubyOnRails
[13:49:14] solars: has joined #RubyOnRails
[13:49:21] ddv: has joined #RubyOnRails
[13:49:39] circ-user-l638e: has joined #RubyOnRails
[13:50:02] circ-user-l638e: has left #RubyOnRails: ()
[13:51:30] ctrlrsf: has joined #RubyOnRails
[13:59:16] arup_r: has joined #RubyOnRails
[13:59:38] PedramT: has joined #RubyOnRails
[14:03:13] leifcr: has joined #RubyOnRails
[14:04:50] hightower2: has joined #RubyOnRails
[14:04:52] njero: has joined #RubyOnRails
[14:05:19] nukleuz: has joined #RubyOnRails
[14:06:33] hahuang65: has joined #RubyOnRails
[14:07:34] chagel: has joined #RubyOnRails
[14:09:52] diegoaguilar: has joined #RubyOnRails
[14:11:56] PedramT: has joined #RubyOnRails
[14:12:11] mDuff: has joined #RubyOnRails
[14:12:45] arup_r: has joined #RubyOnRails
[14:15:40] cpruitt: has joined #RubyOnRails
[14:17:39] Martyn: has joined #RubyOnRails
[14:18:02] aegis3121: has joined #RubyOnRails
[14:18:09] Ropeney_: has joined #RubyOnRails
[14:19:13] Ratler: has joined #RubyOnRails
[14:19:57] arup_r: has joined #RubyOnRails
[14:21:45] quazimodo: has joined #RubyOnRails
[14:22:25] PedramT: has joined #RubyOnRails
[14:24:05] PedramT: has joined #RubyOnRails
[14:25:44] sp1rs: has joined #RubyOnRails
[14:27:50] arup_r: has joined #RubyOnRails
[14:28:22] artto: has joined #RubyOnRails
[14:30:20] pawnbox__: has joined #RubyOnRails
[14:31:51] arup_r: has joined #RubyOnRails
[14:32:48] artto: has joined #RubyOnRails
[14:36:03] artto: has joined #RubyOnRails
[14:36:45] constantinexvi: has joined #RubyOnRails
[14:42:21] CodaBrink: has joined #RubyOnRails
[14:42:47] Blaze_Boy: has joined #RubyOnRails
[14:43:44] c355E3B: has joined #RubyOnRails
[14:44:25] blackmesa: has joined #RubyOnRails
[14:44:34] Lumia930: has joined #RubyOnRails
[14:45:11] rake_db_migrate: has joined #RubyOnRails
[14:46:17] PedramT: has joined #RubyOnRails
[14:47:15] hxegon: has joined #RubyOnRails
[14:49:32] adavia: has joined #RubyOnRails
[14:50:20] PedramT: has joined #RubyOnRails
[14:51:20] PedramT: has joined #RubyOnRails
[14:52:31] artto: has joined #RubyOnRails
[14:52:36] beauby: has joined #RubyOnRails
[14:53:15] dionysus69: has joined #RubyOnRails
[14:55:09] smathy: has joined #RubyOnRails
[14:57:35] cschneid_: has joined #RubyOnRails
[14:58:24] finnnnnnnnnnn: has joined #RubyOnRails
[14:59:25] PedramT: has joined #RubyOnRails
[14:59:37] tbuehlmann: has joined #RubyOnRails
[15:00:37] polishdub: has joined #RubyOnRails
[15:02:16] Pathfinder: has joined #RubyOnRails
[15:06:26] crystal77: has joined #RubyOnRails
[15:07:01] diegoaguilar: has joined #RubyOnRails
[15:07:08] sp1rs: has joined #RubyOnRails
[15:07:34] hahuang65: has joined #RubyOnRails
[15:10:37] rickmasta: has joined #RubyOnRails
[15:11:02] PedramT: has joined #RubyOnRails
[15:11:02] mustmodify: has joined #RubyOnRails
[15:11:41] forcer: has joined #RubyOnRails
[15:11:43] mustmodify: I'm generating static reports via cron using ActionDispatch::Integration::Session... but I need to be able to set the correct domain name. Turns out example.com is being used by someone else. Anyone know how to do that off the top of their heads?
[15:12:02] PedramT: has joined #RubyOnRails
[15:13:12] Quintin: has joined #RubyOnRails
[15:15:27] jottr: has joined #RubyOnRails
[15:16:10] hxegon: has joined #RubyOnRails
[15:16:15] Mia: has joined #RubyOnRails
[15:16:15] Mia: has joined #RubyOnRails
[15:20:07] mustmodify: Oh geez! I found a #host method and set that... how I have www.www.mydomain.com
[15:23:14] Blaze_Boy: has joined #RubyOnRails
[15:23:25] smathy: You're using the testing framework for production content?
[15:23:26] merida: has joined #RubyOnRails
[15:23:42] Moeh: has joined #RubyOnRails
[15:23:53] mustmodify: Is ActionDispatch::Integration::Session part of testing?
[15:24:02] mustmodify: If so then yes, but for good reason. :P
[15:24:03] mostlybadfly: has joined #RubyOnRails
[15:24:37] mustmodify: I mean, I'm open to other suggestions of a way to generate a page without making an http request.
[15:24:49] Moeh: Hey guys. I am using "render nothing: true, status: 204" in one of my controllers and rails actually returns 200, not 204. I am running Rails 5.0.0.beta1. Is that expected behavior? (And yes, I know I should rather use head, I was just surprised.)
[15:25:24] mustmodify: are you sure you're hitting the right action?
[15:25:27] mustmodify: and that line?
[15:25:42] moeabdol3: has joined #RubyOnRails
[15:27:12] Moeh: Yes, I experience the following behavior: "head :ok" => 200 (correct), "head :no_content" => 204 (correct), "render nothing: true, status: 204" => 200 (incorrect, at least IMO).
[15:27:15] smathy: mustmodify, well as long as your page isn't coupled to your session, it's not that hard, ERB/haml/slim/etc are all standalone gems.
[15:28:00] mustmodify: smathy: well, this was pretty easy and seems to work beautifully. But if it causes a problem I'll dig deeper.
[15:28:22] mustmodify: unless you can think of a specific reason it will cause problems?
[15:29:56] fedexo: has joined #RubyOnRails
[15:30:42] solars: has joined #RubyOnRails
[15:31:31] VeryBewitching: has joined #RubyOnRails
[15:31:49] disgrntld: has joined #RubyOnRails
[15:33:46] StevenXL: /join #thoughtbot
[15:33:48] smathy: Moeh, works fine for me in 5b1
[15:33:56] smathy: How embarrassing.
[15:34:00] dikaio: has joined #RubyOnRails
[15:34:01] StevenXL: confused as to how that didn't work
[15:35:58] gr1m-_: has joined #RubyOnRails
[15:35:58] gr1m-_: has left #RubyOnRails: ()
[15:36:25] B1n4r10: has joined #RubyOnRails
[15:37:36] smathy: Looks like you had a space before /
[15:39:28] braincrash: has joined #RubyOnRails
[15:40:18] mrchris: has joined #RubyOnRails
[15:42:01] Blaze_Boy: has joined #RubyOnRails
[15:43:00] mrchris: I'm working on my old Rails 2 app in development mode and I keep getting the error "(Association named 'company' was not found; perhaps you misspelled it?)". It works on the first request, but not on any subsequent ones. I keep restarting the dev server. Does anyone know how this could happen?
[15:43:14] mrchris: It's happened in various places in the app and there's no obvious reason
[15:43:26] mrchris: It's really slowing me down
[15:43:38] drbayer: has joined #RubyOnRails
[15:43:51] mrchris: I think it's something to do with the autoloader
[15:43:56] hxegon: has joined #RubyOnRails
[15:45:07] smathy: mrchris, which ruby version?
[15:46:23] smathy: ....and the full version of Rails?
[15:46:38] Pathfinder: has joined #RubyOnRails
[15:46:40] universa1_: has joined #RubyOnRails
[15:46:47] mrchris: smathy: 2.3.17
[15:46:51] rikkipitt: has joined #RubyOnRails
[15:47:24] Blaze_Boy: has left #RubyOnRails: ("ERC (IRC client for Emacs 24.5.1)")
[15:47:48] smathy: Ok, should work, that was my only guess.
[15:48:13] mrchris: smathy: I've stripped everything from the activerecord class that it happens on, except the one association, and it still happens
[15:48:34] mrchris: I wonder if there's a way I can change the way the autoloading is done
[15:48:52] mrchris: It's fine in production
[15:49:04] Malgorath: anyone ever tried using datatables(from datatables.net) JS with Rails? If so how was the performance?
[15:49:39] mustmodify: mrchris: is it just 'belongs_to :company' or 'has_many :companies' or whatever?
[15:49:48] smathy: mrchris, sorry, I wouldn't have any clue about that in ruby/rails that old.
[15:50:00] kies: has joined #RubyOnRails
[15:50:06] smathy: malgorath, yes, performance? As you'd expect.
[15:50:18] mrchris: mustmodify: its just belongs_to :company
[15:50:31] darkxploit: has joined #RubyOnRails
[15:51:34] mustmodify: Well that's odd...
[15:51:49] smathy: mrchris, anything unusual about your app? Like is this model namespaced within another class, or are you defining this class anywhere else, as a namespace, etc?
[15:52:02] [Butch]: has joined #RubyOnRails
[15:52:27] mrchris: smathy: Nope
[15:52:51] Malgorath: smathy: just was considering some factors in converting an old atk framework that has been heavily modified in php over to Rails but they are using datatables(not using Ajax Sync 'yet')
[15:52:56] smathy: mrchris, create a new app with same ruby and rails, just two models, see if you can reproduce.
[15:54:15] smathy: malgorath, just "how was the performance" is like holding up a coil of rope in a hardware store asking the clerk "Have you used this rope before? How was its length?"
[15:54:28] The_Phoenix: has joined #RubyOnRails
[15:54:32] mrchris: smathy: I'm fairly confident it won't happen again
[15:54:50] mrchris: smathy: I have some of my classes in app/forms
[15:54:53] smathy: mrchris, great, fairly confident, no point in trying then.
[15:55:22] mrchris: smathy: because I use that model in many other places in my app and it works fine. It's just this page
[15:55:50] rikkipitt: hey folks, does anyone know of a gem that can handle subscription plan active record quotas/limits (so we can easily manage plan based model limits e.g. can add 5 users etc)
[15:55:53] smathy: mrchris, ahhh, now we're getting more details.
[15:56:05] sp1rs: has joined #RubyOnRails
[15:56:12] smathy: mrchris, !gist the relevant pages/files
[15:56:12] helpa: mrchris: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[15:56:38] roelof: has joined #RubyOnRails
[15:56:54] smathy: rikkipitt, try https://www.ruby-toolbox.com/search?utf8=%E2%9C%93&q=subscription
[15:57:02] PaulePanter: Hi. How do I unescape *T%F6pfe*?
[15:57:08] PaulePanter: %F6 should be ö.
[15:57:26] rafaelfranca: has joined #RubyOnRails
[15:57:28] roelof: Can I make something appear on the head page and not on the detail page and using 1 template to display a article ?
[15:57:30] PaulePanter: CGI::unescape("T%F6pfe")
[15:57:42] PaulePanter: => "T\xF6pfe"
[15:57:57] CanTonic: has joined #RubyOnRails
[15:57:57] PaulePanter: … which is seems to do something different.
[15:58:42] someish: has joined #RubyOnRails
[15:58:50] elaptics: PaulePanter: what are you trying to do?
[15:59:14] elaptics: is that string user input or is stored like that in your db and you're trying to display it?
[15:59:28] mrchris: smathy: https://gist.github.com/anonymous/f59bcbfab0093df92c9a1cf9a0aad875
[15:59:38] elaptics: has it already been transformed in some way?
[16:00:38] rbraaf: has joined #RubyOnRails
[16:00:58] nfk|laptop: has joined #RubyOnRails
[16:01:17] PaulePanter: elaptics: That is part of the request URI.
[16:01:24] PaulePanter: I only see this with one bot.
[16:01:39] Moeh: smathy: I just created a new rails app and there it also works for me. So that means that something in our app breaks this behavior. Quite strange.
[16:01:50] PaulePanter: OFM search_robot .*google.* (compatible; )
[16:01:52] benlieb: has joined #RubyOnRails
[16:01:56] PaulePanter: elaptics: ↑
[16:01:58] cnk: has joined #RubyOnRails
[16:02:22] smathy: PaulePanter, it's different because F6 is extended ascii, not utf8.
[16:02:24] PlasmaStar: has joined #RubyOnRails
[16:02:24] PaulePanter: ActionController::BadRequest is the exception I get.
[16:03:46] Devalo: has joined #RubyOnRails
[16:04:35] drupald: has joined #RubyOnRails
[16:04:46] PaulePanter: smathy: Interesting.
[16:05:04] PaulePanter: smathy, elaptics: Anything I can do about that, besides only using ASCII for file names?
[16:05:49] smathy: PaulePanter, ie. this gets you the string you're expecting: URI.unescape( "T%F6pfe").force_encoding("windows-1252").encode("utf-8")
[16:06:22] smathy: PaulePanter, ...but that's only because we _know_ that F6 is a meaningful extended ascii char.
[16:06:46] PaulePanter: smathy: Indeed, that gives the correct result.
[16:06:48] smathy: PaulePanter, the incoming request _should_ have a content type with an encoding shown.
[16:07:07] PaulePanter: `T%C3%B6pfe` is used on the Website, so I guess the bot is doing something wrong.
[16:07:22] smathy: PaulePanter, right, that's the UTF-8 char for ö
[16:08:21] defsdoor: windows-1252 :o
[16:09:01] merida_: has joined #RubyOnRails
[16:09:05] acosonic_: has joined #RubyOnRails
[16:09:15] mustmodify: mrchris: figure it out?
[16:09:20] defsdoor: https://en.wikipedia.org/wiki/Windows-1252
[16:09:34] smathy: PaulePanter, well, truth is that HTTP/1.1 is set to iso-8859-1 by default, which F6 is (windows-1252 is a superset of iso-8859-1), so if there's no charset given in the request then actually the bot is doing the right thing.
[16:09:55] smathy: defsdoor, are you asking a question?
[16:10:26] mrchris: mustmodify: nope. There's nothing obvious causing it. It's some kind of reloading issue.
[16:10:39] sudoubuntu: has joined #RubyOnRails
[16:10:40] acosonic_: I’m developing in debug mode Rails and using bin/server and while modifying I need to restart server everytime or I get this https://nimbus.everhelper.me/client/notes/share/437821/8r4taxn315fhr7rqcibt
[16:11:00] acosonic_: any way I can develop without restarting server manually between requests?
[16:11:04] smathy: PaulePanter, part of the reason that Rails now adds the utf8=✓ attribute to forms is so that it can default to utf8 encoding, because the ✓ isn't valid ascii.
[16:11:40] PaulePanter: smathy: I couldn’t find any encoding configuration in the request.
[16:12:07] GitGud: has joined #RubyOnRails
[16:12:14] PaulePanter: smathy: Is that a Rack or Rails issue?
[16:12:18] smathy: PaulePanter, then yeah, the bot is actually doing the right thing. Unfortunately it seems Rails isn't, it should be defaulting to ascii too.
[16:12:30] smathy: Not sure, you're right, it could be a middleware issue.
[16:12:41] smathy: Could even be an httpd issue (although very unlikely).
[16:13:48] PaulePanter: PhusionPassenger is used.
[16:13:57] defsdoor: PaulePanter, where do you encounter that filename ?
[16:14:35] defsdoor: are you scraping a site or presenting it yourself ?
[16:15:53] CanTonic: has joined #RubyOnRails
[16:15:55] smathy: defsdoor, he has a file with UTF8 chars in its name, and this is the URL of an incoming request from a bot.
[16:16:07] Macaveli: has joined #RubyOnRails
[16:16:16] roelof: I have this line in my .html.erb file : <a class="btn btn-default read-more" <%= link_to 'Read More', article %> Can I somehow make it only visible when on the root page ?
[16:16:20] smathy: PaulePanter, honestly, I'd punt on this and just rename your file.
[16:16:25] defsdoor: well urls themselves are represented by the http headers are they
[16:16:53] smathy: defsdoor, not sure what you mean by "represented".
[16:16:53] defsdoor: you can't request a URL and in the headers say - oh - that URL is encoded in this format
[16:17:28] baweaver: has joined #RubyOnRails
[16:17:31] PaulePanter: defsdoor, smathy: http://www.historische-museen-hamburg.de/de/shmh/kuratorium.htm
[16:17:32] smathy: defsdoor, you *can*, in the content-type header, browsers don't though, so servers find other ways.
[16:17:45] defsdoor: thats the encoding of the content
[16:17:46] PaulePanter: data-popup="/uploads/historische_museen_hamburg/documents/3674/popup/5._Herr_Ansgar_Wimmer__Vorsitzender_des_Vorstands_der_Alfred_T%C3%B6pfer_Stiftung.png?1457535420"
[16:17:52] defsdoor: not the requested URI
[16:18:17] smathy: defsdoor, it's the same thing.
[16:18:44] MrPunkin: has joined #RubyOnRails
[16:18:53] defsdoor: smathy, I don't believe it is - else how would you post or get data in a difference encoding to the URI encoding
[16:18:58] quazimodo: has joined #RubyOnRails
[16:19:09] smathy: PaulePanter, are you replying to my comment about changing the name? If so I don't understand your point.
[16:19:12] PaulePanter: I menat: <img src="/uploads/historische_museen_hamburg/documents/3674/width200/5._Herr_Ansgar_Wimmer__Vorsitzender_des_Vorstands_der_Alfred_Töpfer_Stiftung.jpg"
[16:19:24] Balzrael: has joined #RubyOnRails
[16:19:28] PaulePanter: smathy: Sorry, I look some more, but in the end, that’s what I going to have to do.
[16:19:41] PaulePanter: defsdoor: Requested by the bot is http://www.historische-museen-hamburg.de/uploads/jenisch_haus/documents/2588/width1200/Jenisch_Haus_au%DFen_%C2%A9Ulrike_Pfeiffer_2011_Seite_17_Banner_1200x500.jpg
[16:19:51] defsdoor: PaulePanter, you should be rencoding that filename the first time it's encountered
[16:19:52] PaulePanter: Sorry, wrong excerpt.
[16:19:55] smathy: defsdoor, nothing to do with URI encoding.
[16:20:09] smathy: defsdoor, it's to do with what value the URI encoding gives to a character.
[16:20:39] PaulePanter: "GET /uploads/historische_museen_hamburg/documents/3674/width200/5._Herr_Ansgar_Wimmer__Vorsitzender_des_Vorstands_der_Alfred_T%F6pfer_Stiftung.jpg HTTP/1.1" 400 0 "-" "OFM search_robot .*google.* (compatible; )"
[16:20:57] PaulePanter: … from the Web server log.
[16:21:26] smathy: defsdoor, ie. %f6 is the byte 0xF6 which is the ISO-8859-1 encoding for ö. If instead you had the UTF8 encoding for ö and then URI escaped it then it'd be %c3%b6
[16:21:29] n008f4g_: has joined #RubyOnRails
[16:21:33] rafaelfranca: has joined #RubyOnRails
[16:22:11] smathy: defsdoor, no one's arguing that a URI doesn't have to be URI escaped, the issue here is what values it escapes, the *character* encoding, not URI encoding/escaping.
[16:22:23] defsdoor: yes - but the file name is in 1252 - he should store and rename in a common encoding
[16:22:32] defsdoor: the first time it's uploaded/saved etc..
[16:22:34] sandelius: has joined #RubyOnRails
[16:22:36] smathy: PaulePanter, right, as I said, I'd rename the file.
[16:22:40] Detch: has joined #RubyOnRails
[16:22:48] smathy: defsdoor, no it's not, the filename is in UTF8.
[16:23:19] rakm: has joined #RubyOnRails
[16:23:27] smathy: defsdoor, ...and F6 is precisely the same character in 1252 and iso-8859-1.
[16:24:04] smathy: I don't think you got enough context here defsdoor, you seem to have missed the crux.
[16:24:14] defsdoor: %F6 is %C3%B6 isnt it ?
[16:24:53] smathy: defsdoor, not sure what you're asking by "is" there.
[16:25:14] PaulePanter: Before renaming I’ll try https://github.com/whitequark/rack-utf8_sanitizer.
[16:25:14] defsdoor: %F6 doesnt exist in utf8
[16:25:19] smathy: defsdoor, correct.
[16:25:48] defsdoor: sorry - i misunderstood what you meant when you said "and F6 is precisely the same character in 1252 and iso-8859-1" then
[16:26:02] ramfjord: has joined #RubyOnRails
[16:26:04] defsdoor: because it isnt
[16:26:09] smathy: PaulePanter, ok, just that that does everything, whether it's already UTF8 or not.
[16:26:26] smathy: defsdoor, yes it is.
[16:26:30] tweeeaks: has joined #RubyOnRails
[16:26:31] Pathfinder_: has joined #RubyOnRails
[16:26:34] n1lo: has joined #RubyOnRails
[16:26:42] smathy: defsdoor, 1252 is a superset of iso-8859-1
[16:26:42] bphogan: has joined #RubyOnRails
[16:28:06] benlieb: is it possible to have access to the string the logger will log at runtime?
[16:30:44] arup_r: very good question! ^
[16:32:23] moeabdol4: has joined #RubyOnRails
[16:32:27] Pritchard: has joined #RubyOnRails
[16:32:50] universa1_: benlieb: sure, inherit from the default logger, call super and you got the log result
[16:33:31] Pritchard: I am a Ruby newbie but have been assigned to a new client with a Ruby backend. They have a manager who they want to edit multiple employee availability times on the same page. I know how to work the MVC pattern in Rails with a single employee's scheduled time, but not have a few with an array of different records...
[16:34:11] benlieb: universa1_: I don't follow
[16:34:16] Pritchard: I'm still figuring out exactly how I want to present this. It might be by days of the week instead (Sun - Sat) but I'm struggling to figure out how to do this the "Rails way".
[16:35:07] Pritchard: Starting with the data model, the data model is just a record of an employee's availability time block for a single day. There are multiple employees scheduled for 7 days a week, one week in advance.
[16:35:26] Pritchard: So start_time, end_time as integer date time stamps..
[16:36:39] sandelius: has joined #RubyOnRails
[16:36:53] Pritchard: An an associated employee_id. Now that I think about it, I'll probably let a manager edit one employee's availability at a time, but for all days of the week on the same page.
[16:36:58] pawnbox: has joined #RubyOnRails
[16:37:04] cnk: has joined #RubyOnRails
[16:37:21] hightower3: has joined #RubyOnRails
[16:39:02] The_Phoenix: has joined #RubyOnRails
[16:39:06] mikecmpb_: has joined #RubyOnRails
[16:41:32] hahuang65: has joined #RubyOnRails
[16:42:20] CanTonic: has joined #RubyOnRails
[16:43:15] tvw: has joined #RubyOnRails
[16:44:07] PaulePanter: smathy, defsdoor: The Gem seems to work.
[16:44:18] PaulePanter: No BadRequest errors anymore.
[16:44:25] benlieb: universa1: could you explain what you mean a bit more?
[16:44:48] smathy: PaulePanter, yep, just that it'll convert everything, including already UTF8 things. Good luck.
[16:44:50] benlieb: In my controller I want to inspect what will be logged
[16:44:59] hxegon: has joined #RubyOnRails
[16:46:34] smathy: benlieb, !xy why?
[16:46:34] helpa: benlieb: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[16:47:44] baweaver: has joined #RubyOnRails
[16:47:48] sadaf2606: has joined #RubyOnRails
[16:51:29] universa1: benlieb: tail -f log/development.log ?! ;-)
[16:55:21] CodaBrink: In strong params, is there a way to turn params = {filter: {text: ['hello'], dateRange: {gte: '...', lte: '...'}}} into filter_params[:text] so that I don't have to always call filter_params[:filter][:text]?
[16:55:46] aegis3121: has joined #RubyOnRails
[16:56:48] smathy: codabrink, yes.
[16:57:07] CodaBrink: How is it done, smathy?
[16:57:09] smathy: codabrink, if you guess, you'll probably be right.
[16:58:34] mrgreenfur: has joined #RubyOnRails
[16:58:38] flashpoint9: has joined #RubyOnRails
[16:58:58] mike_87: has joined #RubyOnRails
[16:59:12] Malgorath: Ever look at your googling and go... why can I not think of the most simple things and I find myself googling how to call the children of a has_many to display results in a view
[16:59:26] DoctorMonocular: has joined #RubyOnRails
[17:00:15] tjvc: has joined #RubyOnRails
[17:00:15] tjvc: has joined #RubyOnRails
[17:00:56] cnk: has joined #RubyOnRails
[17:01:07] Pathfinder: has joined #RubyOnRails
[17:01:18] shinnya: has joined #RubyOnRails
[17:01:44] CodaBrink: I would love to hear your guesses smathy, I am fresh out.
[17:02:27] CodaBrink: .require doesn't work, because :filter is conditionally present and I get a 400 when it's not.
[17:02:37] defsdoor: codabrink, filter_params = params[:filter]
[17:02:58] smathy: codabrink, well now you're adding things that weren't in your original problem, so :filter is only in your params sometimes?
[17:03:05] smathy: codabrink, !code
[17:03:05] helpa: codabrink: 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.
[17:03:07] smathy: :eyeroll:
[17:03:26] CodaBrink: Thanks for your help, guys
[17:04:09] cesarstafe: has joined #RubyOnRails
[17:04:23] smathy: defsdoor, that won't help him if he's going to do a mass assignment.
[17:04:24] cesarstafe: hi people, how are you doing? I have a question.. is possible to connect just for one method in a model to a different database?
[17:04:47] cesarstafe: using rails 3.2.22
[17:04:59] smathy: ACTION really should have a "is it possible" => "yes" auto comment setup
[17:05:18] smathy: cesarstafe, ruby is a turing complete language, so yes, it's possible.
[17:05:20] defsdoor: smathy, his concern seemed to be "always calling params[:filter][:text]"
[17:05:59] flashpoint9: has joined #RubyOnRails
[17:06:08] smathy: defsdoor, his original question began with "In strong params" and actually he was asking about `filter_params[:filter][:text]` not `params...`
[17:06:14] defsdoor: smathy, he can still do Filter.new( filter_params )
[17:06:15] smathy: defsdoor, context is everything.
[17:06:55] defsdoor: smathy, looks like a typo to me
[17:07:15] defsdoor: in the last occurance of filter_params[.... I think he meant params[....
[17:07:48] smathy: Ok, well seeing as we're guessing, I think he meant "How do I print 'Hello world.'" - so both our answers were WAY off.
[17:08:02] defsdoor: smathy, this isn't a competition
[17:08:08] cesarstafe: thank smathy
[17:08:57] MrPunkin: has left #RubyOnRails: ()
[17:09:14] chocoelho: has joined #RubyOnRails
[17:09:19] smathy: defsdoor, oh but it is, and you're losing.
[17:09:51] defsdoor: smathy, only according to your rules - I'm playing a different game over here
[17:10:57] mdw: has joined #RubyOnRails
[17:12:56] smathy: defsdoor, I know, the giving people shitty advice game. Stop it.
[17:13:28] mbreedlove: has joined #RubyOnRails
[17:13:31] rake_db_migrate: has joined #RubyOnRails
[17:13:51] DoctorMonocular: has joined #RubyOnRails
[17:14:16] sleungcy: has joined #RubyOnRails
[17:15:23] defsdoor: smathy, after you....
[17:15:32] Spami: has joined #RubyOnRails
[17:15:32] smathy: +b *!~andy@cpc19-sutt4-2-0-cust102.19-1.cable.virginm.net
[17:15:32] smathy: smathy kicked defsdoor: enough now.
[17:15:32] smathy: -o smathy
[17:16:57] ramfjord: has joined #RubyOnRails
[17:22:32] ivanskie_work: has joined #RubyOnRails
[17:22:39] pawnbox: has joined #RubyOnRails
[17:22:51] djbkd: has joined #RubyOnRails
[17:23:00] pawnbox: has joined #RubyOnRails
[17:24:27] DragonPunch: has joined #RubyOnRails
[17:24:58] roelof: has joined #RubyOnRails
[17:25:32] roelof: How can I change this : <%= link_to <%= @article.title %> , article %> so it makes a link to a article with as display the title of the article as link
[17:26:45] diegoaguilar: has joined #RubyOnRails
[17:27:40] arup_r: has joined #RubyOnRails
[17:27:50] Cohedrin: has joined #RubyOnRails
[17:27:51] flashpoint9: has joined #RubyOnRails
[17:28:17] sandelius: has joined #RubyOnRails
[17:28:27] yfeldblum: has joined #RubyOnRails
[17:28:40] mike_87: has joined #RubyOnRails
[17:28:52] RegulationD: has joined #RubyOnRails
[17:33:18] roelof: nobody ????
[17:35:31] rake_db_migrate: has joined #RubyOnRails
[17:36:12] eyeamaye: has joined #RubyOnRails
[17:36:14] someone1: has joined #RubyOnRails
[17:36:28] someone1: is someone mixing clojure with rails?
[17:36:45] Malgorath: roelof: Did you lookup link_to ? http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to
[17:38:42] Cohedrin: has joined #RubyOnRails
[17:39:40] roelof: malgorath: it seems that link to only works with a string and not with a variable , bummer
[17:40:11] hxegon: has joined #RubyOnRails
[17:40:32] Malgorath: roelof: you tried link_to(@article.title, article) ?
[17:40:34] Maxz_: has joined #RubyOnRails
[17:41:37] roelof: malgorath: then I see this error : home/ubuntu/workspace/blogger/blogger/app/views/articles/_article.html.erb:32: syntax error, unexpected keyword_ensure, expecting keyword_end /home/ubuntu/workspace/blogger/blogger/app/views/articles/_article.html.erb:34: syntax error, unexpected end-of-input, expecting keyword_end
[17:42:00] Malgorath: paste your code
[17:42:07] jyraff: has joined #RubyOnRails
[17:42:37] cnk: roelof: Almost certainly a problem nesting
[17:42:59] artto: has joined #RubyOnRails
[17:43:29] roelof: I have this now : <h2 class="entry-title"><%= link_to(article.title, article) %></h2>
[17:43:47] bbrowning_: has joined #RubyOnRails
[17:44:05] Malgorath: so that whole thing I said to do, you didn't copy, there is a @ in there somewhere
[17:44:30] tjohnson: has joined #RubyOnRails
[17:45:01] roelof: malgorath: same problem : see https://learning-rails-wissel-1.c9users.io/
[17:45:13] njero: has joined #RubyOnRails
[17:45:37] smathy: roelof, why are you putting ERB in your Ruby?
[17:45:54] Malgorath: roelof: there is no way we can help you if you are not willing to paste to gist.
[17:45:54] mikecmpbll: has joined #RubyOnRails
[17:45:59] smathy: Oh, you stopped that, good.
[17:46:25] Malgorath: wb mikecmpbll
[17:46:29] smathy: roelof, !code (there you go malgorath :)
[17:46:29] helpa: roelof: 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.
[17:46:40] mikecmpbll: malgorath : hai
[17:46:50] Malgorath: smathy: thanks :D bots tend to ignore me
[17:47:29] B1n4r10: has joined #RubyOnRails
[17:47:57] jottr: has joined #RubyOnRails
[17:48:33] Malgorath: maybe cause I don't talk to them
[17:49:00] smathy: Pisoglenteez, make sense please.
[17:49:14] jyraff: has joined #RubyOnRails
[17:49:58] Malgorath: maybe we only got part of the thing he was typing, like /usr/local/sbin/packing-tape sniffer
[17:50:56] arup_r: Hi.. I have _custom.scss file where I did override some bootstrap classes. Now, I would like to use this custom file in posts.scss and comments.scss, but not for all. So, it doesn't make sense to import it in application.scss. Now, if I import it in posts.scss and comments.scss, I am duplicating the css. So what is the way to handle it?
[17:51:04] Dimik: has joined #RubyOnRails
[17:51:43] baweaver: has joined #RubyOnRails
[17:52:37] arup_r: first time writing CSS in Rails, so seeking some advises.. please tell if my question is not clear as usual
[17:53:09] smathy: arup_r, maybe https://github.com/wilsonpage/sass-import-once
[17:53:13] scepticulous: has joined #RubyOnRails
[17:54:33] arup_r: seems can't be installed using gem install command.
[17:54:46] jyraff: has joined #RubyOnRails
[17:54:51] arup_r: but gem addressed the issue as i was saying here :)
[17:55:08] arup_r: ok.. read OR .. part now
[17:55:18] webdestroya: has joined #RubyOnRails
[17:55:33] arup_r: this I need to copy https://github.com/wilsonpage/sass-import-once/blob/master/_sass-import-once.scss .. thanks smathy
[17:56:52] tvon: has joined #RubyOnRails
[17:58:16] benlieb: universa,1 smathy: sorry I had to step out. When certain exceptions occur in my app I would like to save some information to the database, including the information that would go to the log file. This includes params. When I save params to the db, they are not filtered (password, credit card, etc).
[17:58:21] benlieb: universa1:
[17:58:44] hahuang65: has joined #RubyOnRails
[17:59:03] Pathfinder_: has joined #RubyOnRails
[18:00:19] universa1: benlieb: so you want to filter params?
[18:00:21] acosonic_: has joined #RubyOnRails
[18:00:48] Malgorath: bah think I'm over using rails g scaffold... :D lazy = bad
[18:00:48] smathy: benlieb, so rescue the exception instead.
[18:01:45] roelof: sorry, here the paste : https://gist.github.com/rwobben/aababae5b5d0b00aacb2b90de292faf5 , Wierd , it worked yesterday perfectly with this code
[18:03:01] smathy: roelof, you forgot the error again.
[18:03:07] benlieb: smathy: I am rescuing the exception, and I want to store a copy of everything that the logger would write
[18:03:11] KensoDev: has joined #RubyOnRails
[18:03:36] roelof: smathy: oke, I changed somerthing. I will make the paste look like this new code. Moment
[18:04:04] universa1: roelof: gist the actual!!!! code! along with the full stack trace
[18:04:09] universa1: don't make something look like.
[18:04:13] universa1: verbose copy and paste.
[18:04:38] aegis3121: has joined #RubyOnRails
[18:05:28] sandelius: has joined #RubyOnRails
[18:05:48] agit0: has joined #RubyOnRails
[18:05:57] Rubie: has joined #RubyOnRails
[18:06:15] theblang: has joined #RubyOnRails
[18:06:18] DoctorMonocular: has joined #RubyOnRails
[18:06:57] norc: has joined #RubyOnRails
[18:07:08] roelof: Thanks for all the help, Found it , I missed a <% end %> and the link must be article instead of @article
[18:07:21] roelof: sorry for the noise on the channel
[18:07:23] solars: has joined #RubyOnRails
[18:07:50] Cache_Money: has joined #RubyOnRails
[18:10:32] aegis3121: has joined #RubyOnRails
[18:11:04] alex88: has joined #RubyOnRails
[18:11:20] alex88: hi there, in rails 5 why "render json: { text: '123' }" doesn't work? has it been migrate to its own gem?
[18:11:31] acosonic_: has joined #RubyOnRails
[18:11:56] SPYGAME: has joined #RubyOnRails
[18:14:06] chouhoulis: has joined #RubyOnRails
[18:14:33] Ozubi_: has joined #RubyOnRails
[18:14:42] qejk: has joined #RubyOnRails
[18:15:15] ivanskie_work_: has joined #RubyOnRails
[18:15:15] scepticulous: has joined #RubyOnRails
[18:15:36] alex88: tried also to install rails from master, same thing
[18:16:28] baweaver: has joined #RubyOnRails
[18:17:35] tildes: has joined #RubyOnRails
[18:17:38] Moeh: What is the recommended way of dealing with User.find(params[:id]) where it might be that no user exists with this id? First do User.exists?(params[:id]) and then find it (and thereby have two calls) or wrap the User.find in a begin / rescue block?
[18:17:40] smathy: roelof, well done, always good to sort these yourself. Sometimes just making the gist leads you to the error :)
[18:18:48] Pathfinder: has joined #RubyOnRails
[18:19:13] cnk: alex88: I haven't seen render with explicit json. My guess is your syntax for that isn't quite right
[18:19:24] smathy: alex88, !dw
[18:19:24] helpa: alex88: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[18:19:49] cnk: perhaps actually make JSON expicitly - not passing a hash
[18:19:52] smathy: alex88, your syntax works perfectly here (re cnk's comment)
[18:20:22] Cohedrin: has joined #RubyOnRails
[18:20:23] smathy: Moeh, find_by id: ...
[18:20:48] smathy: Recommended By Smathy™
[18:21:03] Moeh: smathy: so I do "@user = User.find_by_id(params[:id])" and then "if @user ..."
[18:21:19] rikkipitt: has joined #RubyOnRails
[18:21:23] baweaver: User.find_by(id: id)
[18:21:40] Moeh: cool, thanks!
[18:21:47] baweaver: don't use the method missing variants, they're slower and likely to be deprecated
[18:22:03] baweaver: rephrase that, should be deprecated in any case.
[18:22:12] webdestroya: has joined #RubyOnRails
[18:22:18] alex88: smathy: http://edgeguides.rubyonrails.org/api_app.html#using-the-cache-middleware https://gist.github.com/alex88/22b24e9d4cf0784e937bdcb7a38008be yeah should be straightforward
[18:22:24] Moeh: you mean: do not use "User.find_by_id" and instead "User.find_by(id: id)"?
[18:22:36] Moeh: perfect, thanks!
[18:23:16] acosonic_: has joined #RubyOnRails
[18:24:04] alex88: well nvm, I'll use just a simple jbuilder template
[18:26:24] sp1rs: has joined #RubyOnRails
[18:27:18] patrick-sartent: has joined #RubyOnRails
[18:27:40] PaulePanter: baweaver: Could you please share a reference about the slower performance and possible deprecation?
[18:28:00] flashpoint9: has joined #RubyOnRails
[18:28:14] baweaver: Look up any benchmarks on method missing
[18:28:53] manfrin: has joined #RubyOnRails
[18:29:47] PaulePanter: smathy, baweaver, Moeh: My last experiments showed that, when dealing with ids, using User.find in a rescue block is the way to go, when the missing user is really the exception (less then five percent).
[18:30:15] baweaver: Don't use rescue for flow control
[18:30:18] baweaver: that's also slow
[18:30:38] PaulePanter: smathy, baweaver, Moeh: And somebody in here told me, that when milliseconds count, Ruby is not the right language anyway.
[18:30:59] baweaver: that's no reason to do something explicitly slow
[18:31:02] PaulePanter: baweaver: It’s only slower if there is an exception, which it should not be normally.
[18:31:15] PaulePanter: baweaver: Sorry, my benchmarks showed something else.
[18:31:43] Moeh: PaulePanter: What is the downside of using User.find_by(id: id)
[18:31:44] tildes: PaulePanter: could you perhaps share your benchmarks? would be interesting to see
[18:31:58] baweaver: Nothing at all.
[18:32:01] PaulePanter: Moeh: For starters, it’s much more to type.
[18:32:19] baweaver: 7 characters
[18:32:28] PaulePanter: User.find(id) what a beauty.
[18:32:38] flashpoint9: has joined #RubyOnRails
[18:32:40] PaulePanter: (and of course less to read).
[18:32:41] DoctorMonocular: has joined #RubyOnRails
[18:33:07] PaulePanter: baweaver: I’ll dig them up tomorrow.
[18:33:14] finnnnnnnnnnn: has joined #RubyOnRails
[18:33:33] PaulePanter: But in the non exception case it was a little faster.
[18:34:35] tbuehlmann: I prefer using .find_by and checking for nil over .find and rescuing an exception
[18:34:51] tildes: from typing perspective, you'll need to write up the rescue block
[18:34:58] acosonic_: has joined #RubyOnRails
[18:35:08] Moeh: PaulePanter: The find_by is shorter or did I make a mistake: https://gist.github.com/Maarius/8db78d023724de600eae770b38a676a3 ?
[18:36:13] baweaver: PaulePanter: what was that about milliseconds not mattering?
[18:36:44] PaulePanter: baweaver: It was the response to the claim, that it is slower and therefore shouldn’t be used.
[18:37:03] PaulePanter: In the end everybody should use, what they like best.
[18:37:24] scepticulous: has joined #RubyOnRails
[18:37:27] PaulePanter: tildes: True.
[18:37:58] StevenXL: has joined #RubyOnRails
[18:38:45] baweaver: PaulePanter: you're flipflopping reasons all over the place.
[18:38:52] davee_: has joined #RubyOnRails
[18:39:09] ivanskie_work_: has joined #RubyOnRails
[18:39:29] baweaver: find_by_id is around 10x slower than find_by(id:) and when rescued find is about twice as slow.
[18:39:42] baweaver: the problem is you also run the risk of covering other errors by rescuing
[18:39:53] baweaver: unless you lock it down to a record not found
[18:40:03] blackmesa: has joined #RubyOnRails
[18:40:15] baweaver: `rescue ActiveRecord::RecordNotFound`
[18:40:36] tbuehlmann: find_by_id defines the method after the first call and shouldn't be that slow, right? (wouldn't use it either way)
[18:40:58] baweaver: it's not exceptionally slow in one or two cases.
[18:41:21] baweaver: but I have a feeling they're moving away from it with all the hash/kwargs methods coming in
[18:41:36] baweaver: meaning it'll be a pain to rip out later, and will likely be deprecated
[18:42:13] baweaver: Anyways, the point I'm getting at is that PaulePanter switches logic from "It's faster" to "Fast doesn't matter" to "Use what you like"
[18:42:40] PaulePanter: Moeh: You should rescue on the specific exception.
[18:43:09] baweaver: ah, and "That's more typing"
[18:43:10] benlieb: has joined #RubyOnRails
[18:43:36] baweaver: (which it certainly is when you apply the specific rescue to it)
[18:44:10] syndikate: has joined #RubyOnRails
[18:45:04] PaulePanter: baweaver: Please reread, my responses and arguments and do not rewrite them in a false way.
[18:45:33] baweaver: They're radically inconsistent and make completely different points.
[18:45:54] PaulePanter: I admit that the length argument was false when considering the other text to write.
[18:46:15] acosonic_: has joined #RubyOnRails
[18:46:22] baweaver: in any case, good luck, have fun. I'm out.
[18:47:50] PaulePanter: baweaver: Have fun too.
[18:49:09] rubyonrailed: has joined #RubyOnRails
[18:49:36] DragonPunch: has joined #RubyOnRails
[18:50:15] rubyonrailed: I'm working on a rails engine and setup rspec with it. I'm confused on where to add my tests. Do they go inside of the dummy app or directly in app/spec?
[18:50:26] rubyonrailed: And could someone elaborate how the dummy app works
[18:50:57] Megamos: has joined #RubyOnRails
[18:51:09] Malgorath: rubyonrailed: from what I've read its in the engine directory
[18:51:14] ferr: has joined #RubyOnRails
[18:51:36] Malgorath: and then run the tests from bin/ inside that engine also
[18:51:39] hahuang65: has joined #RubyOnRails
[18:53:10] tercenya: has joined #RubyOnRails
[18:55:55] tildes: has joined #RubyOnRails
[18:56:42] sandelius: has joined #RubyOnRails
[18:57:13] acosonic_: has joined #RubyOnRails
[18:57:37] rikkipitt: has joined #RubyOnRails
[18:58:26] mikecmpbll: has joined #RubyOnRails
[19:00:28] smathy: PaulePanter, not sure how you did your benchmarks, but there's really no significant difference at all, with any amount of not found percentage, here's 5% but the same holds for 100% or even where only 1% of the records are found: https://gist.github.com/smathy/5f9e93d5341e97db015f5f4e337259f3 /cc tildes Moeh
[19:00:57] smathy: ...if anything, find_by is quicker.
[19:01:04] d0nn1e: has joined #RubyOnRails
[19:01:11] yfeldblum: has joined #RubyOnRails
[19:02:19] smathy: (actually the gist is for all three of those percentages)
[19:02:37] tvw: has joined #RubyOnRails
[19:02:51] manfrin_: has joined #RubyOnRails
[19:04:46] rickmasta: has joined #RubyOnRails
[19:05:07] smathy: Moeh, you should use find_by - as I said all along, but not because it's faster, and not because it's less typing, you should use it because it *is* the recommended way of including "the id might not exist" into your business rules. Ie. if the id might not exist as part of your usual app function, then you should use find_by
[19:07:08] finnnnnnnnnnn: has joined #RubyOnRails
[19:07:33] chouhoulis: has joined #RubyOnRails
[19:07:41] patrick-sartent: has joined #RubyOnRails
[19:09:05] acosonic_: has joined #RubyOnRails
[19:09:17] arBmind: has joined #RubyOnRails
[19:10:37] Moeh_: has joined #RubyOnRails
[19:10:53] Moeh_: @smathy: Thanks a lot, very helpful. Will use it.
[19:11:04] smathy: Moeh_, you're welcome.
[19:12:20] wldcordeiro: has joined #RubyOnRails
[19:13:29] tildes: find_by actually uses where and includes a rescue block. I didn't know you can omit begin from rescue block like that http://api.rubyonrails.org/classes/ActiveRecord/FinderMethods.html#method-i-find_by
[19:14:49] smathy: tildes, you can in a method.
[19:15:01] tildes: smathy: yeah, I learnt that just now :)
[19:15:03] smathy: Unfortunately not in any block :(
[19:17:28] drbayer: has joined #RubyOnRails
[19:17:58] Pathfinder: has joined #RubyOnRails
[19:19:01] tildes: I can't find the documentation for #take without parameters
[19:19:02] magikid: has joined #RubyOnRails
[19:19:15] tildes: Enumerable and Array have #take with params
[19:19:31] smathy: tildes, http://devdocs.io/rails~4.2/activerecord/findermethods#method-i-take
[19:19:42] moeabdol4: has joined #RubyOnRails
[19:20:03] acosonic_: has joined #RubyOnRails
[19:20:10] tildes: smathy: what's the difference between devdocs.io and apidock?
[19:20:22] smathy: devdocs doesn't suck
[19:20:26] tildes: I think google mostly directs me to apidock, and that's where I have been lookin
[19:20:30] tubbo: ACTION always uses the canonical api.rubyonrails.org because you just never know.
[19:20:40] tildes: (and yes, I agree, it's not super great :D )
[19:20:55] tubbo: devdocs _does_ look good
[19:21:14] smathy: tubbo, I've found devdocs very reliable, only time I go to API is if I want a link to github.
[19:21:35] smathy: ...and devdocs have just started including the library version in the URL - which is even more spectacular.
[19:21:54] tubbo: yeah makes it easy to diff between documentation
[19:22:02] tildes: smathy: thanks for the tip
[19:23:06] DukeDave: This is going to sound like crazy talk, but: Is there anyway in which a where clause on a model's scope, could change the behavior of db:schema:dump ?
[19:23:14] smathy: apidock is nice for finding deprecated methods, or just changes between versions.
[19:23:21] smathy: The version indicator/clicker is nice.
[19:23:39] ramfjord: has joined #RubyOnRails
[19:23:59] smathy: dukedave, !xy
[19:23:59] helpa: dukedave: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[19:25:06] DukeDave: smathy: well, yes, but the actual problem is so weird, I'm not sure I could summarize it here; although my colleague is working on a repro in a new Rails app ;)
[19:25:26] smathy: That'd be handy.
[19:25:34] DukeDave: I'll stick it in a gist ;)
[19:26:12] Sephyros: how i can get <a href="#somesymbol"> with "link_to"? i used link_to("mah link", "#somesymbol") but i dont like that =/
[19:27:33] Darmani: sevenseacat: You around?
[19:27:35] tubbo: Sephyros: what would you feel is a better API?
[19:27:44] tubbo: Sephyros: if you were DHH, what would this look like?
[19:27:47] PedramT: has joined #RubyOnRails
[19:28:31] smathy: dukedave, so anyway, yes is the answer. Rake tasks are just code, could be clumsily overridden by some gem or your own code.
[19:28:54] smathy: dukedave, the test is whether you can reproduce it in a vanilla app :)
[19:29:06] ramfjord: has joined #RubyOnRails
[19:29:40] sypheren: has joined #RubyOnRails
[19:30:17] jenrzzz: has joined #RubyOnRails
[19:30:17] jenrzzz: has joined #RubyOnRails
[19:31:04] mdw7: has joined #RubyOnRails
[19:31:32] srinidhi: has joined #RubyOnRails
[19:31:32] DukeDave: smathy: here's what we're seeing: https://gist.github.com/dukedave/75345d8dee87b44a6a9042ea9d91fe0c
[19:31:43] acosonic_: has joined #RubyOnRails
[19:32:34] pawnbox: has joined #RubyOnRails
[19:33:01] smathy: Sephyros, link_to "ya link", anchor: :somesymbol
[19:33:12] tubbo: oh shit, that's a better API :)
[19:33:30] smathy: So API, such better.
[19:33:51] smathy: It's a BroPI
[19:33:54] tubbo: Sephyros: what i meant was in your imagination, if you can think of a better way to write an <a> link to '#somesymbol' with the value 'mah link', then try it out and i'll tell you how hard it is to modify link_to to suit your needs.
[19:34:59] jenrzzz: has joined #RubyOnRails
[19:35:02] Sephyros: Oh, i got it, ahah ok :D
[19:35:56] smathy: dukedave, not really the idea of a gist.
[19:36:15] manfrin: has joined #RubyOnRails
[19:36:15] smathy: ...but sure, whatever that interval thing is could easily be buggy.
[19:36:22] DukeDave: smathy: ya I just wanted to write it down without spamming here
[19:36:25] rake_db_migrate: has joined #RubyOnRails
[19:36:25] Sephyros: smathy, thanks!
[19:36:35] smathy: Sephyros, you're welcome!!!!
[19:37:08] DukeDave: smathy: I think so too, but I'm just amazed that the specific argument to a where could leak over to db:schema:dump
[19:38:57] smathy: dukedave, hard to say how amazing it is without seeing how/where you added the where, and what that lib needs to do to work out the interval. It must be doing some introspection on the scope or association where you added the where, maybe that scope/association is being confused for an attribute, maybe just a bug, can't tell.
[19:39:18] diegoaguilar: has joined #RubyOnRails
[19:40:02] hxegon: has joined #RubyOnRails
[19:42:25] agit0: has joined #RubyOnRails
[19:42:50] acosonic_: has joined #RubyOnRails
[19:43:47] djbkd: has joined #RubyOnRails
[19:47:38] alaing: has joined #RubyOnRails
[19:47:56] alaing: has joined #RubyOnRails
[19:49:11] baweaver: has joined #RubyOnRails
[19:49:22] alaing: hi, i'm looking to replace cocoon gem and reducing the number of dependency for some better built in solution. any ideas how how i could achieve the same results?
[19:49:25] jottr: has joined #RubyOnRails
[19:50:12] alaing: https://github.com/nathanvda/cocoon
[19:52:50] lemur: has joined #RubyOnRails
[19:54:03] smathy: alaing, what's a "better built in solution" ?
[19:54:21] acosonic_: has joined #RubyOnRails
[19:55:07] alaing: like is there a "rails" way of doing this kind of thing but without a third party gem?
[19:56:36] baweaver: you do realize that rails is a collection of third party gems right?
[19:58:06] Pathfinder_: has joined #RubyOnRails
[19:58:51] rikkipitt: has joined #RubyOnRails
[19:59:57] baweaver: has joined #RubyOnRails
[20:01:08] rake_db_migrate: has joined #RubyOnRails
[20:03:10] fernandofat: has joined #RubyOnRails
[20:04:05] rogue_koder: has joined #RubyOnRails
[20:05:09] jottr: has joined #RubyOnRails
[20:05:41] Devalo: has joined #RubyOnRails
[20:06:16] acosonic_: has joined #RubyOnRails
[20:07:11] hightower3: has joined #RubyOnRails
[20:07:29] GodFather: has joined #RubyOnRails
[20:09:16] Megamos: has joined #RubyOnRails
[20:09:50] Aherin: has joined #RubyOnRails
[20:10:00] AntiSpamMeta: has joined #RubyOnRails
[20:11:45] hahuang65: has joined #RubyOnRails
[20:11:52] Olipro_: has joined #RubyOnRails
[20:11:53] ramfjord: has joined #RubyOnRails
[20:12:17] smathy: alaing, of course, write code.
[20:13:29] drbayer: has joined #RubyOnRails
[20:16:40] bronson: has joined #RubyOnRails
[20:17:36] bronson: has joined #RubyOnRails
[20:17:42] Pathfinder: has joined #RubyOnRails
[20:17:53] VeryBewitching: alaing: You can't automate everything friend.
[20:18:24] smathy: If you can send me your brain, I'll write a generator for your app for you.
[20:18:54] baweaver: VeryBewitching: Just you wait
[20:19:08] smathy: If you include a return pouch I'll even send your brain back when I'm finished with it.
[20:19:09] alaing: would that generator be able to print out money for me?
[20:19:20] VeryBewitching: baweaver: As much as you might try, at some point everyone will have to write code.
[20:19:23] smathy: ...you should have a friend on hand to sign for it.
[20:19:33] ekinmur: has joined #RubyOnRails
[20:19:50] smathy: alaing, zombie money, absolutely.
[20:19:51] baweaver: VeryBewitching: Heresy
[20:19:55] baweaver: Rails generates all
[20:20:45] alaing: sure i know that its just I would like to remove cocoon or find a better way without relying on cocoon
[20:22:14] smathy: alaing, cocoon exists for a reason, because Rails doesn't provide that same functionality, so to remove it you will need to implement whatever part of the cocoon functionality that you're using yourself.
[20:22:21] smathy: ACTION can't believe he actually wrote out that explanation
[20:23:31] alaing: ok, I get it I asked a stupid question which is why I'm getting stupid answers
[20:24:29] smathy: ACTION was on the verge of breaking out a car analogy
[20:25:05] alaing: do my questions really throw you over the edge :-D
[20:25:20] baweaver: well, it'd be more of driving over an edge
[20:25:29] alaing: ACTION still thinks this room rocks
[20:26:08] alaing: ^ even if people jump/driving off the edge
[20:26:30] sypheren: has joined #RubyOnRails
[20:27:00] smathy: It'd be like if you owned a car and you no longer want to be dependent on wheels, you wouldn't seriously go to your mechanic and ask whether if you removed the wheels from your car how would you achieve the same results without the wheels.
[20:27:06] smathy: Ok there, I had to do it.
[20:27:25] smathy: s/ whether//
[20:28:40] baweaver: Your drive is admirable smathy
[20:29:14] smathy: I try wheely hard.
[20:29:23] baweaver: ACTION rimshot
[20:29:42] alaing: but what if I wanted to swap the tyres for racing slicks?
[20:30:11] baweaver: you can put racing slicks on a Pinto, doesn't make it capable of racing
[20:30:56] baweaver: against something like a Ferrari
[20:31:51] smathy: alaing, then you probably should have worded your question differently ;) You never mentioned replacing cocoon with some other dependency.
[20:32:15] DoctorMonocular: has joined #RubyOnRails
[20:32:27] smathy: A Pinto with racing slicks vs a Ferrari with no wheel dependencies at all though - now THAT'S a race!
[20:32:54] alaing: lol, true I just wondered if there was a better solution either by removing the gem or swapping it out for something else
[20:33:14] alaing: PMSL smathy.....classic
[20:33:14] scepticulous: has joined #RubyOnRails
[20:33:56] alaing: pinto needs a lambo engine.....please and thank you
[20:34:33] smathy: alaing, and again, we're back to my *first* question: [13:54:03] smathy: alaing, what's a "better built in solution" ?
[20:35:08] alaing: is there a better alternative to cocoon?
[20:35:26] smathy: alaing, we have no idea what "better" means for you, it's very contextual.
[20:35:41] Trynemjoel: has joined #RubyOnRails
[20:35:55] alaing: smathy....i love you :-D
[20:36:50] smathy: :) It is literally impossible to answer. I mean, I hate all that shit, so better for me is to just write my own. Better for you might be some JS framework. Hard to imagine that we'll ever know though.
[20:36:55] djbkd: has joined #RubyOnRails
[20:42:12] dfockler: has joined #RubyOnRails
[20:42:47] Radar: GOOD MORNING
[20:44:10] jaequery: has joined #RubyOnRails
[20:44:13] Papierkorb: Radar: OOOHHHAAYYYYOOO
[20:44:23] Papierkorb: (No I'll not get tired of doing that)
[20:45:18] jaequery: has joined #RubyOnRails
[20:46:57] jaequery: has joined #RubyOnRails
[20:48:03] Darmani: Hey Radar ^^
[20:48:13] jaequery: has joined #RubyOnRails
[20:49:24] jaequery: has joined #RubyOnRails
[20:50:58] jaequery: has joined #RubyOnRails
[20:52:37] jaequery: has joined #RubyOnRails
[20:53:14] Pathfinder: has joined #RubyOnRails
[20:59:46] arup_r: has joined #RubyOnRails
[21:01:38] ur5us: has joined #RubyOnRails
[21:01:39] voidDotClass: i have an image in public/images, is there a rails method for getting just the url to that image?
[21:02:26] Rubie: has joined #RubyOnRails
[21:03:53] jenrzzz: has joined #RubyOnRails
[21:04:35] Radar: voidDotClass: image_tag("/images/path/to/image.jpg")
[21:04:46] voidDotClass: Radar, i dont need image tag though
[21:04:49] voidDotClass: i just need the url
[21:05:04] Radar: "/images/path/to/image.jpg"
[21:05:31] das3in: has joined #RubyOnRails
[21:05:48] smathy: voidDotClass, are you seriously asking how to prepend "/images/" to a string?
[21:06:59] klagid: has joined #RubyOnRails
[21:07:42] jgt3: has joined #RubyOnRails
[21:08:48] crdpink: has joined #RubyOnRails
[21:11:47] das3in: I want to build a React SPA for a new app so I know I need to use rails-api. But what I'd really like to do is use the default rails erb templates for a few pages like the landing page and the login page
[21:11:56] arup_r: has joined #RubyOnRails
[21:12:06] das3in: I'm confused about how to design an architecture to support that, specifically route wse
[21:12:43] DukeDave: How can I get activerecord (4.2.5) to activerecord ( in my Gemfile?
[21:12:59] arup_r: voidDotClass: have you seen image_path helper method?
[21:13:09] voidDotClass: arup_r, i havent, let me check
[21:13:23] arup_r: that gives you url
[21:13:25] voidDotClass: smathy, i need the full url incl the server address
[21:13:39] arup_r: use imagr_url then
[21:13:39] voidDotClass: i need the full url incl the current domain
[21:13:58] arup_r: image_url*
[21:14:29] arup_r: voidDotClass: http://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html
[21:15:11] voidDotClass: arup_r, does that also work if the image gets inlined by that pieline
[21:15:35] smathy: voidDotClass, yes, that will be confused if you have an image asset by the same name in app/assets/images /cc arup_r
[21:15:43] arup_r: read the doc I linked, it will teach you much better than me
[21:15:59] mustmodify: has left #RubyOnRails: ()
[21:16:55] arup_r: that's true.. asset names has to be unique..
[21:17:33] Pathfinder: has joined #RubyOnRails
[21:18:26] FooMunki: has joined #RubyOnRails
[21:19:02] Maxz_: has joined #RubyOnRails
[21:19:26] artto: has joined #RubyOnRails
[21:20:47] Devalo: has joined #RubyOnRails
[21:21:29] machty: has joined #RubyOnRails
[21:21:37] daxroc: has joined #RubyOnRails
[21:23:48] smathy: voidDotClass, ah ok, the full URL, so define a `root` in your routes and then: root_url + "images/blah.png"
[21:24:16] Radar: voidDotClass: !xy
[21:24:16] helpa: voidDotClass: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[21:24:31] Radar: You've changed the requirements so many times already, I doubt anyone here actually knows what you're trying to do.
[21:24:39] Radar: You want the full image url
[21:24:48] Radar: [07:15:10] <voidDotClass> arup_r, does that also work if the image gets inlined by that pieline
[21:24:50] Radar: And then ^
[21:24:57] Radar: Where previous to that did you mention the asset pipeline?
[21:25:01] tvon: has joined #RubyOnRails
[21:25:08] Radar: Please explain your questions thoroughly when asking them so that we don't give you the wrong answer.
[21:26:04] yfeldblum: has joined #RubyOnRails
[21:27:37] smathy: Actually, I have to say that I think his original message was a s/just the/the full/ away from being perfect: "i have an image in public/images, is there a rails method for getting just the url to that image?"
[21:29:07] Radar: It's frustrating to be given a question and then to give the right answer to that question, then be told that it wasn't even the right question in the first place.
[21:29:40] Jasaka: has joined #RubyOnRails
[21:29:59] PedramT: has joined #RubyOnRails
[21:30:17] jstransky: has joined #RubyOnRails
[21:31:02] smathy: I don't see any correct answer actually, image_tag wasn't it, he never asked for the tag, just the URL. And "/images..." is a URI but not a URL, so that wasn't right either :P
[21:32:04] smathy: ACTION includes himself in the plethora of wrong assumptions
[21:32:33] jstransky: I have an .erb that renders a div that may or may not contain innerHtml. In the case that it’s empty, it’s still rendering a bunch of spaces in the html.
[21:32:45] jstransky: This makes it hard to targe with :empty in css
[21:33:23] smathy: jstransky, !gist your ERB
[21:33:23] helpa: jstransky: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[21:34:07] jstransky: https://gist.github.com/joelstransky/1fe7109c01e3b036104e9815c08ef8c4
[21:34:18] jenrzzz_: has joined #RubyOnRails
[21:35:28] smathy: jstransky, and which div there do you claim may or may not have content?
[21:35:44] mostlybadfly: has joined #RubyOnRails
[21:35:48] smathy: ...or you mean the match-slot span?
[21:35:50] jstransky: <span class=“match-slot”>
[21:36:28] jstransky: in the event that its empty, css should work on .match-slot:empty
[21:37:09] smathy: jstransky, but you've put the space there.
[21:37:16] smathy: ...the newlines after <span> and before </span>
[21:38:09] jstransky: that fixed it
[21:38:22] scyth: has left #RubyOnRails: ()
[21:38:33] jstransky: :empty should be smarter than that
[21:38:39] jstransky: not sure I even want to use it now
[21:39:02] jstransky: anyone touches my code it will break
[21:39:47] chipotle: has joined #RubyOnRails
[21:40:06] smathy: jstransky, :blank is coming in CSS4.
[21:41:01] smathy: jstransky, yeah, I'd just add another class in the 'else' case, and use that.
[21:42:20] SeductiveError: has joined #RubyOnRails
[21:42:28] jstransky: If Houdini were out now I could polyfill :blank
[21:42:51] hxegon: has joined #RubyOnRails
[21:43:24] LastWhisper____: has joined #RubyOnRails
[21:47:20] VeryBewitching: It's nice that HAML would prevent that issue.
[21:47:23] forcer: has joined #RubyOnRails
[21:49:43] ramfjord: has joined #RubyOnRails
[21:50:54] baweaver: has joined #RubyOnRails
[21:50:54] Darmani: Radar: Breh?
[21:51:03] Radar: Darmani: pong
[21:52:37] Darmani: I keep getting an error when trying to use the "email" method inside my ticket view.
[21:52:48] Radar: Darmani: Is the code on github?
[21:53:03] Darmani: Radar: Yeah.
[21:53:09] QualityAddict: has joined #RubyOnRails
[21:53:11] Radar: Which branch?
[21:53:37] lemur: has joined #RubyOnRails
[21:53:43] Darmani: Radar: Authentication & Admin
[21:53:50] Radar: admin_features branch?
[21:53:57] Darmani: yeah that one lol
[21:54:13] Radar: Which test?
[21:54:21] Radar: All tests are passing for me.
[21:54:38] Darmani: Well that's the thing for some reason my RSpec tests pass but if I manually launch the server and try to write a ticket...
[21:54:41] Darmani: It gives me the error.
[21:56:21] Radar: what error?
[21:56:27] Radar: !didntwork
[21:56:27] helpa: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[21:56:43] Darmani: my computer exploded
[21:57:27] Darmani: Radar: https://gist.github.com/mfifth/52ecdc82e08c2dc86075ab1d2cc77c38
[21:57:42] Radar: Darmani: I am not seeing that error on my machine.
[21:57:47] Radar: Are you signed in as a user?
[21:58:16] Darmani: I'm not signed in at all.
[21:58:27] voidDotClass: has joined #RubyOnRails
[21:59:41] Radar: That would be why then. It's assigning the author as `nil` and then it's trying to call `.email` on that.
[21:59:48] Radar: keep progressing with that chapter. It will be fixed in time.
[22:00:22] G: has joined #RubyOnRails
[22:00:29] Darmani: But I reached the end of the chapter and it's still the same.
[22:00:37] smathy: VeryBewitching, it does?
[22:00:40] Radar: Yes, and that's OK.
[22:00:49] Radar: Darmani: It's fixed in Chapter 8: https://github.com/rubysherpas/r4ia_examples/commit/6f26c7a86801cbe9d924823a4e55bd7c9a11f9f8
[22:00:57] Radar: Darmani: If all the tests are passing, move on to the next chapter.
[22:01:11] Darmani: Radar: Whaaaaat? And that's normal?? Lol
[22:01:13] Radar: Darmani: At the end of a chapter there may be bugs in the code that aren't covered by tests.
[22:01:29] Radar: Darmani: Yes.
[22:01:58] VeryBewitching: smathy: I would imagine slim has something similar, but I've yet to use it.
[22:01:59] Darmani: Radar: Okay Radar. I trust you.
[22:02:08] Darmani: If my computer explodes though I'm holding you accountable.
[22:02:22] VeryBewitching: I'm a witnses to that
[22:02:34] VeryBewitching: err.. witness too
[22:03:40] dvinciguerra__: has joined #RubyOnRails
[22:04:22] Darmani: Radar: OHHH I get it
[22:04:26] Darmani: god I'm stupid
[22:05:10] Radar: You just came to a realisation and I don't think that is stupid.
[22:05:21] Darmani: yeah there's no one signed in to the application so when someone tries to create a ticket how is the system supposed to know who it is?
[22:05:22] Radar: It's the opposite, actually :P A stupid person would never get there.
[22:05:32] strass: has left #RubyOnRails: ("Be back later")
[22:05:43] Radar: Yes, and we haven't made it so that only signed in users can create tickets at that stage
[22:05:53] Darmani: I was struggling with that for hours. You don't understand. Lol
[22:05:54] Radar: We've been stupid ourselves in introducing a bug into our system that our tests don't catch.
[22:06:21] Radar: You could add a test now that ensures that users cannot create tickets could not be signed in. Consider it as homework.
[22:06:45] Darmani: You mean a validation?
[22:07:49] rafaelfranca: has joined #RubyOnRails
[22:08:31] Radar: It's not quite a validation.,
[22:08:55] Radar: You would make sure that users who try to access tickets#new or tickets#create cannot do that if `current_user` is nil
[22:09:48] Darmani: Radar: Hmm alright. I'll show you what I come up with.
[22:10:22] rafaelfranca: has joined #RubyOnRails
[22:12:12] alias-ls-to-rm: has joined #RubyOnRails
[22:12:22] smathy: VeryBewitching, ah, gotcha. I thought you meant it did it automatically.
[22:12:50] jero_: has joined #RubyOnRails
[22:14:13] VeryBewitching: smathy: No, but without compromising the structure at all, one character solves for x.
[22:15:26] Darmani: Radar: https://gist.github.com/mfifth/9e6014c71e0da833d484aba5210964b6
[22:15:28] Darmani: Does this work?
[22:17:19] Pathfinder: has joined #RubyOnRails
[22:18:00] baweaver: has joined #RubyOnRails
[22:20:09] smathy: VeryBewitching, yes, it's nice.
[22:23:05] jenrzzz: has joined #RubyOnRails
[22:23:05] jenrzzz: has joined #RubyOnRails
[22:24:23] flashpoint9: has joined #RubyOnRails
[22:25:02] hightower2: has joined #RubyOnRails
[22:27:29] baweaver: has joined #RubyOnRails
[22:32:21] Radar: Darmani: almost correct
[22:32:27] Radar: Darmani: https://gist.github.com/mfifth/9e6014c71e0da833d484aba5210964b6#file-gistfile1-txt-L61
[22:32:36] Radar: Darmani: This line is setting a local variable current_user to nil
[22:32:51] Radar: Darmani: You either want == nil or even better is current_user.nil? and even better than that is unless current_user
[22:34:22] manfrin: has joined #RubyOnRails
[22:34:53] workmad3: has joined #RubyOnRails
[22:36:59] wldcordeiro: has joined #RubyOnRails
[22:37:53] PedramT: has joined #RubyOnRails
[22:39:18] hnanon: has joined #RubyOnRails
[22:40:18] Ericx2x: has joined #RubyOnRails
[22:40:28] SeductiveError: has joined #RubyOnRails
[22:41:11] Maletor: has joined #RubyOnRails
[22:41:31] hnanon: nearest_cities = City.near(location, 100)
[22:41:36] hnanon: nearest_active_city = nearest_cities.where(title: !nil).first
[22:41:46] hnanon: Is that !nil valid?
[22:41:52] superlou: has joined #RubyOnRails
[22:42:29] htmldrum: has joined #RubyOnRails
[22:42:48] Rubie: has joined #RubyOnRails
[22:42:49] VeryBewitching: hnanon: If you're testing that the column is not null, sure.
[22:43:14] VeryBewitching: hnanon: At least, I would be very surprised if that were not true (goes to try)
[22:43:36] PedramT: has joined #RubyOnRails
[22:43:42] mwlang: has joined #RubyOnRails
[22:43:59] VeryBewitching: Yup, that's valid.
[22:44:17] daveomcd: using my "form.object.my_association" how can I do an order by? if I try "form.object.my_association.includes(:my_other_association).order('my_other_associations.sort asc')" it doesn't work
[22:44:31] VeryBewitching: If you have a column that could be nullable, that would test that the value is not null.
[22:45:08] srinidhi: has joined #RubyOnRails
[22:45:22] baweaver: hnanon: where.not(title: nil)
[22:45:38] baweaver: !nil is true
[22:45:38] helpa: RuntimeError: Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
[22:45:54] baweaver: ACTION snickers at helpa
[22:45:56] VeryBewitching: baweaver: Ah, thank you for that correction.
[22:46:07] baweaver: I've done it before a lot.
[22:46:34] hahuang65: has joined #RubyOnRails
[22:47:35] smathy: daveomcd, !dw
[22:47:35] helpa: daveomcd: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[22:48:46] aloneintheworld: has joined #RubyOnRails
[22:49:27] daveomcd: my bad! - sorry, it returned... #<ActiveRecord::AssociationRelation []> -- If I removed the "includes" it returns the records as expected
[22:49:51] hnanon: baweaver: Thank you.
[22:50:26] daveomcd: smathy, which would be... #<ActiveRecord::Associations::CollectionProxy
[22:50:50] smathy: daveomcd, !gist your actual models, and show the full error because I can't imagine where you're seeing those strings in the form.
[22:50:50] helpa: daveomcd: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[22:50:56] hnanon: Should I use find_by there instead?
[22:53:56] hnanon: never mind
[22:55:12] manfrin: has joined #RubyOnRails
[22:55:22] Darmani: Radar: Oh right duuhhh lol
[22:55:23] Darmani: thanks man.
[22:58:21] _3dwardsharp: has joined #RubyOnRails
[22:59:58] manfrin: has joined #RubyOnRails
[23:00:21] chipotle: has joined #RubyOnRails
[23:00:37] hahuang65: has joined #RubyOnRails
[23:00:55] rake_db_migrate: has joined #RubyOnRails
[23:01:27] cnk: has joined #RubyOnRails
[23:01:50] hnanon: Can I do Object.where(title: "some_variable_here rest of the title")?
[23:02:12] baweaver: hnanon: how much ruby do you know?
[23:02:40] hnanon: More than a little, I think.
[23:02:45] hnanon: But not much more.
[23:02:55] baweaver: you might want to read through a ruby book
[23:03:13] baweaver: string interpolation tends to be a fairly early chapter.
[23:03:32] hnanon: I thought I could use string interpolation...just wanted to make sure.
[23:03:39] hnanon: I guess I should have tried first.
[23:03:49] baweaver: always a good practice
[23:04:08] Radar: unless the variable is from params
[23:04:10] Radar: then it's bad
[23:04:23] flashpoint9: has joined #RubyOnRails
[23:04:42] owenjones: has joined #RubyOnRails
[23:04:50] hnanon: Actually, it's not a variable. It's a wildcard.
[23:05:09] baweaver: what exactly are you trying to do?
[23:05:11] dfockler: has joined #RubyOnRails
[23:05:45] cnk: 'cause if you want to do a SQL 'like' query you may need different syntax
[23:05:53] cnk: http://guides.rubyonrails.org/active_record_querying.html#pure-string-conditions
[23:06:11] cnk: tells you why string interpolation can be dangerous
[23:06:53] hnanon: I want to get a collection of posts from city ids, where the post title contains the words "Guide."
[23:07:05] hnanon: I have an array of city ids.
[23:07:07] Devalo: has joined #RubyOnRails
[23:07:57] baweaver: yep, like query
[23:08:05] ramfjord: has joined #RubyOnRails
[23:08:34] chouhoulis: has joined #RubyOnRails
[23:11:22] Radar: like totally omg
[23:13:08] rake_db_migrate: has joined #RubyOnRails
[23:15:18] hnanon: Ok, I have this so far: Post.where(city_id: nearest_cities).where("title like ?", "%Guide%").first
[23:15:42] hnanon: The first condition is obviously not correct, though...
[23:16:05] hnanon: nearest_cities is an array of cities
[23:16:28] VeryBewitching: cities or city IDs?
[23:16:32] Ropeney: has joined #RubyOnRails
[23:17:07] VeryBewitching: Post.where(city: nearest_cities) <-- I don't know if that works, try that though.
[23:17:51] VeryBewitching: Otherwise, make an array of the ids and Post.where(city_id: [1, 2, 3])
[23:18:32] hnanon: And it'll loop through each id and check the second condition?
[23:19:33] Inside: has joined #RubyOnRails
[23:19:33] Inside: has joined #RubyOnRails
[23:19:50] VeryBewitching: where city_id in (1, 2, 3)
[23:19:54] sudoubuntu: has joined #RubyOnRails
[23:20:39] baweaver: has joined #RubyOnRails
[23:21:34] pwnd_nsfw`: If it looped through each, that'd be brutal
[23:21:38] pwnd_nsfw`: and I'd be working on a PR right away
[23:22:07] VeryBewitching: Tremendously brutal, depending on the size of the collection and the indexing situation
[23:23:39] zave: has joined #RubyOnRails
[23:24:16] cnk: hnanon: do you have control over the data model? I would try to add an optional city field to Post
[23:25:09] hnanon: Post belongs_to City
[23:25:41] cnk: so why are you fishing around in title?
[23:26:06] hnanon: I need posts that have a specific title format.
[23:27:14] cnk: So that query looks OK - as long as nearest_cities is an array of city ids
[23:27:18] hnanon: nearest_cities is a collection of cities. Can't I use nearest_cities.pluck(:id) to get an array of their ids?
[23:27:49] one_zero: has joined #RubyOnRails
[23:28:38] Inside_: has joined #RubyOnRails
[23:28:41] cnk: but first, try where(cities: [array of cities]
[23:28:56] cnk: hnanon: ^
[23:29:13] Spami_: has joined #RubyOnRails
[23:29:23] hnanon: Ah, with "cities". Ok...
[23:30:16] hnanon: That didn't work.
[23:30:50] Ericx2x: has joined #RubyOnRails
[23:30:58] JesseH: has joined #RubyOnRails
[23:31:13] hnanon: I'm getting a weird error: SELECT "cities"."id" FROM "cities" WHERE (cities.latitude BETWEEN 39.29523316889152 AND 42.18986883110848 AND cities.longitude BETWEEN -86.01549832622074 AND -82.19495287377926) ORDER BY distance ASC ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: distance: SELECT "cities"."id" FROM "cities"
[23:31:26] hnanon: I'm using the geocoder gem.
[23:31:57] hnanon: So, nearest_cities = City.near("some location", 1000)
[23:32:16] hnanon: I get a similar error when doing nearest_cities.pluck(:id)
[23:33:50] Inside: has joined #RubyOnRails
[23:34:06] hnanon: Wait...I forgot the array brackets.
[23:35:26] flashpoint9: has joined #RubyOnRails
[23:36:55] Spami: has joined #RubyOnRails
[23:40:02] Socialdawg: ACTION /shower
[23:40:04] eyeamaye: has joined #RubyOnRails
[23:40:52] s2013: has joined #RubyOnRails
[23:41:46] baweaver: has joined #RubyOnRails
[23:41:48] s2013: whats up yall.. got a quick question.. pretty straightforward but im returning a json of events.. events.as_json but i want to merge certain relations for each events.. so if it was a single event i can just do event.as_json.merge(event.members) but how can i do it for a collection
[23:42:27] fryguy: s2013: you might want to consider using active_model_serializers
[23:42:37] hnanon: cnk: https://gist.github.com/anonymous/b138eb70071b1c42efeedaed0bd74954
[23:42:38] s2013: how would that help in this case?
[23:42:53] hnanon: The log is showing data like that.
[23:43:05] hnanon: For each city in nearest_cities.
[23:43:40] fryguy: s2013: you can define the relationships you want to include in the serializer
[23:44:00] s2013: we are using jbuilder
[23:44:02] s2013: woudl that help
[23:44:53] s2013: actually might just do that..
[23:44:54] Radar: s2013: Show us your template?
[23:44:55] s2013: use that*
[23:44:56] fryguy: yah, you can add the structure you want to the jbuilder template too
[23:45:21] s2013: i dont have a template for this yet. for this specific query i was jsut returning @events.as_json but we need to return some association now so im going to create the template
[23:45:33] cnk: hnanon: I suspect that City is not a pure ActiveRecord object so you can't just use the where(cities: array)
[23:45:46] Radar: s2013: If you don't have a template, then how is it using jbuilder? It isn't. It's going to render the straight JSON.
[23:45:50] cnk: However, you said your pluck was also having trouble?
[23:46:16] hnanon: I used this to get the ids:
[23:46:19] hnanon: nearest_cities.collect { |obj| obj.id }
[23:46:23] s2013: Radar maybe im misunderstanding.. we have templates for other actions (by template you mean the .jbuilder file right?)
[23:46:30] Radar: s2013: correc.t
[23:46:30] fryguy: s2013: you might want to profile the performance of jbuilder before you go too all-in with it. In my experience it is unusably slow
[23:46:36] s2013: but for this specific one we were just returning the straight json
[23:46:39] Radar: fryguy: Not true.
[23:46:44] s2013: fryguy kinda deep in it by now
[23:46:47] Radar: fryguy: With AMS you can't even cache the responses
[23:46:57] Radar: fryguy: So when I return 600 option values nested inside an option type, I can't cache all that.
[23:47:00] fryguy: Radar: my experience hasn't been true?
[23:47:05] Radar: hello 2sec response times
[23:47:13] s2013: Radar are you back to the rails world ?
[23:47:17] Radar: fryguy: I'm giving a contradicting anecdote.
[23:47:18] s2013: i remember you were working with Go
[23:47:19] cnk: hnanon: OK so that gives you your array which you can use with city_id
[23:47:26] Radar: s2013: That was a long time aGO now.
[23:47:31] s2013: Hahahahaha haa..ha
[23:47:36] quazimodo: has joined #RubyOnRails
[23:47:37] quazimod1: has joined #RubyOnRails
[23:47:39] Radar: s2013: 100% in Rails now with some dabblings in Elixir.
[23:47:46] s2013: how do you like elixir?
[23:47:51] hnanon: cnk: Yes, it's working now with Post.where(city_id: [ids]).where("title like ?", "%Guide%").first
[23:48:00] s2013: phoenix is the framework for elixir right?
[23:48:01] Radar: s2013: It's so much more understandable than Go ever was.
[23:48:03] cnk: excellent. contrats
[23:48:07] Radar: s2013: yes. Everyone should be learning it.
[23:48:08] s2013: havent used it yet but a lot of people are saying good things about it
[23:48:14] hnanon: cnk: Thank you for your help.
[23:48:19] s2013: plan on writing an elixir book?
[23:48:22] cnk: There was a good interview on phoenix on Ruby Rogues
[23:48:23] hnanon: I really appreciate it.
[23:48:24] DLSteve: has joined #RubyOnRails
[23:48:31] stannard: has joined #RubyOnRails
[23:48:49] s2013: ive been moving away from web applications and focusing a lot more on machine learning and nlp lately
[23:48:56] s2013: did web apps for 10 years.. enough time for me
[23:48:57] existensil: has joined #RubyOnRails
[23:49:15] Radar: s2013: NLP would be very fun
[23:49:40] s2013: i dont know if you remember but few years ago i won rails rumble.. i used nlp then
[23:49:48] s2013: itwas fun to do some basic nlp with ruby
[23:50:03] Radar: What are you using for NLP now?
[23:50:16] RegulationD: has joined #RubyOnRails
[23:50:41] s2013: i do a lot more machine learning than NLP but they sort of go hand in hand. ive been doing it from an academic point of view so learning a lot more about the theories and all that stuff
[23:50:42] Radar: I'd like Siri to know that when I say "turn on bedroom light" it actually does turn the light on. Currently it does nothing.
[23:51:00] s2013: Radar wanna see something i was building?
[23:51:05] Radar: s2013: sure
[23:51:16] s2013: https://vimeo.com/158019834 concept for a desktop app i was building
[23:52:16] s2013: but i figured id go back to my roots (i originally studied CS cause i wanted to get into AI) but got lost in the whole working to make money portion of life :\
[23:52:44] _Tariq: has joined #RubyOnRails
[23:53:28] Radar: I really like the idea of parsing text commands into actions.
[23:53:40] s2013: yep, the idea is that its an assitant for your professional life
[23:53:48] s2013: rather than siri/cortana which is more personal / general
[23:54:22] lemur: has joined #RubyOnRails
[23:55:35] dalbusch1t: has joined #RubyOnRails
[23:56:12] Ericx2x: has joined #RubyOnRails