« Back to channel list

#RubyOnRails - 18 February 2016

« Back 1 day Forward 1 day »
[00:02:02] DanKnox_: has joined #RubyOnRails
[00:02:02] DanKnox: has joined #RubyOnRails
[00:03:00] speaking1ode: has joined #RubyOnRails
[00:04:09] ruurd: has joined #RubyOnRails
[00:04:39] mices: is it ok to sudo to install rails `gem install rails` returns permissions error
[00:05:25] rhizome: use a ruby management util
[00:05:29] flappynerd: mices, if you're using RVM you don't need sudo
[00:05:37] Pazician: has joined #RubyOnRails
[00:05:46] mices: i'm trying to use rvm
[00:05:48] flappynerd: mices, what does `rvm list` say
[00:05:52] intrigueD: has joined #RubyOnRails
[00:06:01] flappynerd: I'm going to guess you might have installed ruby from apt-get or similar
[00:06:08] flappynerd: and rvm may be using your system ruby by default
[00:06:17] flappynerd: mices, make sure that `which ruby` reports something in ~/.rvm
[00:06:30] flappynerd: mices, and or alternatively rvm use --default ruby-2.2.1
[00:06:57] _Tariq: has joined #RubyOnRails
[00:08:12] mices: flappynerd: https://gist.github.com/mices/aae3d437b6cd6eb1e077
[00:08:19] Technodrome: has joined #RubyOnRails
[00:09:11] pwnd_nsfw: rvm -v gives you what/
[00:09:23] mices: which ruby: /usr/local/rvm/rubies/ruby-2.2.1/bin/ruby
[00:09:34] flappynerd: you installed root rvm
[00:09:35] flappynerd: don't do that
[00:09:40] flappynerd: mices, uninstall rvm now
[00:09:50] flappynerd: mices, and reinstall the sane way
[00:09:54] pwnd_nsfw: mices, ubuntu?
[00:10:17] flappynerd: mices, http://rvm.io/ has the only install instructions you need
[00:10:26] flappynerd: mices, never install programming languages from your OS
[00:10:34] flappynerd: mices, meaning never install anything like ruby or whatever using apt-get
[00:10:59] flappynerd: well, whatever, I dunno, I mean just, it's almost never a good idea, at the very least it's almost never a good idea to use the base packages in the distro
[00:11:25] flappynerd: if you need newer versions on a server you should be building your own .deb packages for the version(s) you need
[00:11:29] Radar: oh flappynerd is talking with mices
[00:11:44] mices: i was following this page and all the prompts were bangs so i guessed i should be doing it as root http://tecadmin.net/install-ruby-on-rails-on-ubuntu/
[00:11:57] flappynerd: but I'm doubting you're at the level where you're gonna be doing serious sysadmin yet
[00:11:57] Radar: ACTION mutters something about nuking RVM and installing chruby+ruby-install instead
[00:12:02] Radar: flappynerd: strong confirm
[00:12:11] flappynerd: yes there are other options to rvm
[00:12:19] Ropeney: rbenv to rule them all
[00:12:20] flappynerd: rvm works well for me so far, at least locally
[00:12:26] 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!
[00:12:30] flappynerd: yeah I have yet to try rbenv
[00:12:46] flappynerd: I have some co-workers who prefer rbenv
[00:12:51] Radar: flappynerd: Look: some people feel that boils on their faces are great to have too... but not everyone likes them.
[00:13:02] pwnd_nsfw: I've had no issues with rvm
[00:13:04] rickmasta: has joined #RubyOnRails
[00:13:12] pwnd_nsfw: or the boils on my face
[00:13:18] Radar: And some of them like cystic acne (don't google that), but it doesn't mean that it's for everyone either.
[00:13:32] Ropeney: escalated quickly
[00:13:44] flappynerd: Radar, did you have some facts and or data points about rvm that you wanted to share?
[00:13:57] Devalo: has joined #RubyOnRails
[00:14:09] Radar: flappynerd: RVM has fucked me,my friends and complete strangers over so many damn times that I am _strongly_ advocating for its disuse whereever and whenever I can.
[00:14:37] tfitts: Radar: do you only like chruby or you like rbenv too? I use rbenv without problems, but I don't really switch between versions of ruby.
[00:14:41] Radar: I regret once championing it.
[00:14:49] Radar: tfitts: give me chruby+ruby-install or give me death.
[00:14:55] flappynerd: Radar, mind giving some examples of some of the problems you had with RVM?
[00:15:05] flappynerd: I'm just saying I've not yet had problems with rvm
[00:15:06] Radar: flappynerd: It would decide what Ruby version it would use whenever it felt like it.
[00:15:25] Radar: flappynerd: It would fail to install gems because it didn't compile Ruby in the correct way.
[00:15:27] flappynerd: yes that seems non-optimal
[00:15:36] flappynerd: hmm, I always use --disable-binary
[00:15:37] mrbubbles: has joined #RubyOnRails
[00:15:46] flappynerd: which seems to have solved any gem compile problems I used to face on occasion
[00:15:59] Radar: flappynerd: And so many other issues. I just don't see people having any issues with chruby+ruby-install.
[00:16:13] flappynerd: k, well good to know I'll look in to chruby soon
[00:16:23] Radar: flappynerd: Whenever someone comes into here or #ruby with a Ruby installation issue on a non-Windows machine (Windows is a whole other story), the answer typically is "RVM is being stupid. Destroy it with fire."
[00:17:08] Radar: And then it ends up being "Ok, I destroyed RVM (with fire) and then used chruby (or rbenv) and now my life is all sunshine and rainbows and lollipops and puppies"
[00:17:34] Radar: I'm honestly surprised that RVM hasn't yet implemented code for reading emails. It is that bloated.
[00:17:38] flappynerd: I like puppies :)
[00:19:10] pwnd_nsfw: I like turtles
[00:19:26] tfitts: anyone ever done anything with IPP (internet printing protocol) and ruby? I found a gem that supports IPP but it say libcups isn't installed when I try to run it and I've tried installing anything related to libcups and I get nothing.
[00:20:09] tfitts: I just need something that can send a (very complicated) HTTP Post to the IPP address. My skills at reading and interpreting the RFC are failing me :(
[00:21:28] tfitts: I found a PHP implementation that works, but the freaking request is so complicated I'm having trouble just converting it from PHP to Ruby.
[00:21:54] weaksauce: has joined #RubyOnRails
[00:22:07] Radar: negatory cap
[00:23:41] flappynerd: Radar, thoughts on paper_trail vs audited?
[00:23:44] moeabdol1: has joined #RubyOnRails
[00:23:49] flappynerd: or option 3: ?
[00:23:59] flappynerd: something else? none of the above?
[00:24:05] one_zero: has joined #RubyOnRails
[00:24:49] tfitts: flappynerd: I'm not sure what your requirements are but paper_trail has worked great for my versioning needs
[00:25:29] shanemcd: has joined #RubyOnRails
[00:27:55] moeabdol2: has joined #RubyOnRails
[00:28:20] alevy: has joined #RubyOnRails
[00:28:36] baweaver: has joined #RubyOnRails
[00:28:53] _Tariq: has joined #RubyOnRails
[00:32:17] rhizome: tfitts: maybe reinstall the gem after cups/-dev installed?
[00:32:47] rhizome: i have actually wondered if IPP is a real thing
[00:33:07] triptec: has joined #RubyOnRails
[00:33:39] bronson: oo, nice. acts_as_audited is looking alive again.
[00:34:21] bronson: I tried using paper_trail a few months ago and ran into this: https://github.com/airblade/paper_trail/pull/689#issuecomment-171230401
[00:35:46] flappynerd: bronson, which appears to have since been fixed and merged btw
[00:36:05] rubyonrailed: has joined #RubyOnRails
[00:36:05] flappynerd: also appears to be an issue with unescaped data coming from e.g. factorygirl or something?
[00:36:13] bronson: flappynerd: it was, but there are some other wonky bits that gave me pause.
[00:36:15] flappynerd: i.e. nothing that you should be seeing in a regular prod app
[00:36:21] flappynerd: bronson, ok, such as?
[00:36:50] bronson: flappynerd: it was a problem unescaped data full stop. a full SQL injection opportunity.
[00:36:59] bronson: *with* unescaped ata
[00:37:02] bronson: data. arg.
[00:37:23] flappynerd: hmm, that doesn't seem like it should be considered the fault of paper_trail?
[00:37:28] Radar: flappynerd: I've not used any of those
[00:37:31] flappynerd: how would such data end up getting to postgres in the first place?
[00:37:43] flappynerd: I thought AR should take care of that kind of thing
[00:38:15] bronson: if you had a field containing a quote that went into papertrail (on postgres, and one or two other conditions)
[00:38:47] bronson: AR would if they used it properly...
[00:38:50] flappynerd: hmm, still, was that the fault of paper_trail? or AR?
[00:39:01] bronson: paper_trail, absolutely
[00:39:13] flappynerd: bronson, so have you used audited?
[00:39:23] bronson: not yet but I'm liking the look of the code better
[00:39:49] bronson: and I like that their test suite isn't an unholy mix of rspec and minitest :)
[00:39:59] rodfersou: has joined #RubyOnRails
[00:40:53] bronson: I haven't shipped that part of my app yet, I'm defintely going to try audited and see how it goes.
[00:42:00] DLSteve: has joined #RubyOnRails
[00:43:31] _Tariq: has joined #RubyOnRails
[00:43:55] djellemah: has joined #RubyOnRails
[00:44:27] bronson: flappynerd: you see https://github.com/chaps-io/public_activity ?
[00:45:52] godzillaenlacasa: has joined #RubyOnRails
[00:48:32] roshanavand: has joined #RubyOnRails
[00:48:51] flappynerd: bronson, hmm, no not yet
[00:49:01] flappynerd: what's different about it vs paper_trail or audited?
[00:49:13] flappynerd: it looks less mature than either of the former
[00:49:38] bronson: true, but in paper_trail's case, the maturity is causing it some problems.
[00:49:47] flappynerd: https://chaps.io/ homepage has a hipster as their main bg
[00:49:49] flappynerd: so, strike 1
[00:50:52] bronson: I tend to dislike like gems that try to work with AR and Mongo and other databases...
[00:50:57] bronson: The code usually suffers.
[00:51:28] bronson: I'll try audited next, that's looking most promising to me.
[00:51:48] jottr: has joined #RubyOnRails
[00:53:59] flappynerd: yeah I was going to say the main feature seems to be it works with mongo
[00:54:06] flappynerd: and I'm not all about dat mongo
[00:56:55] eddie2pc: has joined #RubyOnRails
[00:57:15] croberts: has joined #RubyOnRails
[01:01:05] sevenseacat: has joined #RubyOnRails
[01:03:46] DanKnox: has joined #RubyOnRails
[01:03:47] DanKnox_: has joined #RubyOnRails
[01:04:44] GriffinHeart: has joined #RubyOnRails
[01:04:46] meinside: has joined #RubyOnRails
[01:09:47] kies^: has joined #RubyOnRails
[01:10:58] kirillzh: has joined #RubyOnRails
[01:11:04] Maletor: has joined #RubyOnRails
[01:12:43] dopamean1: has joined #RubyOnRails
[01:14:41] moeabdol2: has joined #RubyOnRails
[01:15:29] kirillzh: has joined #RubyOnRails
[01:15:39] GriffinHeart: has joined #RubyOnRails
[01:15:59] Haydos: has joined #RubyOnRails
[01:16:36] sami: has joined #RubyOnRails
[01:21:41] mices: i untarred my apps before running rails new, now the directories already exist, can i still run rails new?
[01:22:51] jbermudes: So I'm trying to run migrations on a db and it seemed to be doing just fine until it printed "Killed" and then went back to my shell prompt. Is that a db connection timeout or does Rails give up if migrations don't finish under a certain amount of time?
[01:23:19] mices: to correct my env i ran rvm group add rvm "$USER"; \curl -sSL https://get.rvm.io | bash; rvm fix-permissions; rvm reload and finally gem install rails
[01:23:25] mices: everything looks good
[01:23:55] smathy: jbermudes, sounds like maybe your machine ran out of memory (and doesn't have any/enough virtual memory).
[01:24:18] jbermudes: smathy: oh, good point. I'll look into that, thanks
[01:24:28] smathy: jbermudes, you're welcome.
[01:24:32] mices: pwnd_nsfw, flappynerd: ty
[01:25:55] Fridtjof: has joined #RubyOnRails
[01:33:04] mices: how long does it take docs for the rails gem to install
[01:33:20] patrick99e99: has joined #RubyOnRails
[01:35:20] decaff: has joined #RubyOnRails
[01:35:30] mices: awesome, bundle install running like butter now
[01:39:26] decaff: hey is there a way to generate migrations automatically by changing the schema the way that there is in Django. Like a rake task or something. I don't mind writing the migrations but that always was a nice feature of Django
[01:40:33] SeanLazer: has joined #RubyOnRails
[01:40:41] decaff: sevenseacat I've been considering porting it to ruby but I wanted to ask before I go do a bunch of work
[01:40:58] sevenseacat: I don't think it's a great idea tbh
[01:41:05] decaff: It might not really fit in with the Rails mentality but I might do it anyway
[01:41:10] decaff: what are your reasons for disliking it
[01:41:25] sevenseacat: I don't see the purpose of it
[01:41:42] sevenseacat: I'd rather have control over how my database gets changed
[01:41:55] decaff: sevenseacat I like being able to declare how the schema should look and then have the changes generated for me
[01:42:24] sevenseacat: that doesnt make much sense to me
[01:42:38] Devalo: has joined #RubyOnRails
[01:42:59] decaff: I agree that it's nice to have control over how it is changed but at the same time it just is sometimes confusing to have to think about if the changes I am about to make are going to cause any problems
[01:43:30] _Tariq: has joined #RubyOnRails
[01:43:41] sevenseacat: rather that ignoring the fact it might cause problems? >_>
[01:44:42] Megamos: has joined #RubyOnRails
[01:44:47] decaff: yes but you can always roll back and since it's a dev environment I can basically operate with impunity
[01:45:29] sevenseacat: except all possible problems are not immediately evident
[01:45:42] sevenseacat: so just ignoring them until they crop up doesn't seem like a great idea
[01:45:50] pwnd_nsfw: I honestly don't like the idea of that functionality being available back and forth
[01:46:21] decaff: If you write the tests and don't screw them up it should be fine.
[01:46:26] prgmmr: has joined #RubyOnRails
[01:46:38] decaff: its also not impossible to read the migrations that it writes
[01:46:57] decaff: to me its just the difference between an imperative and declarative approach
[01:46:58] pwnd_nsfw: I don't understand why
[01:47:23] decaff: pwnd_nsfw what do you mean back and forth
[01:47:36] _Tariq: has joined #RubyOnRails
[01:47:37] pwnd_nsfw: writing migrations, or having it write migrations for you
[01:47:38] sevenseacat: well the way rails does it is a functional approach - specifying and applying a series of transformations to a schema
[01:47:53] sevenseacat: so the final schema can always be recalculated
[01:48:12] decaff: yes I suppose
[01:48:14] Megamos: Anyone used Stripe? I got it all set up and working. But it only works one time. The second time $('#event_stripe_token').val(response.id) never happens and the token never gets set in form before submitting. If I change the name of the form input, it works one time again.
[01:48:31] flappynerd: mices, echo "gem: --no-rdoc --no-ri" > ~/.gemrc
[01:48:33] bronson: has joined #RubyOnRails
[01:48:39] prgmmr: I'm doing a Post method to my server which then does a request to Stripe Payments, how can I get the response back to my ios app that stripe sends to my server.
[01:48:40] urbanmonk: has joined #RubyOnRails
[01:49:10] mices: flappynerd: ty
[01:49:15] _Tariq_: has joined #RubyOnRails
[01:49:48] flappynerd: mices, I dislike installing docs with every gem, I have no real need, if I don't have internet access I basically can't do my job anyway
[01:49:56] flappynerd: and they take a loooooong time to install
[01:50:04] flappynerd: so, just disable them by adding that to your ~/.gemrc file
[01:50:14] mices: yea thanks
[01:50:30] decaff: prgmr you could make the request, then take the response and whatever data you need and respond to the request. I'm assuming that might make the thread block for a while but if you're using unicorn or some such library I would expect you would be fine. Someone more knowledgeable migth be able to explain more
[01:50:30] shanemcd: has joined #RubyOnRails
[01:50:30] viiralvx: has joined #RubyOnRails
[01:52:00] sleungcy: has joined #RubyOnRails
[01:53:52] goodcodeguy: has joined #RubyOnRails
[01:55:01] _Tariq: has joined #RubyOnRails
[01:56:53] cnk: decaff: And I have been wishing for the opposite. Django get out of the damn way and let me just make the migrations I want to make. I spend WAY more time fighting with Django's automation migration machinery than I spend writing migrations in Rails
[01:58:48] sung: has joined #RubyOnRails
[01:59:05] decaff: cnk see I feel that way with Rails a lot in terms of project structure. Just let me put things where I want and name them what I want. It's a tradeoff I guess. Rails is very fast for getting things done though
[01:59:17] decaff: also, you can hand write migrations in django you just don't have to
[01:59:17] goodcodeguy: has joined #RubyOnRails
[02:00:18] sevenseacat: so we've worked out that Rails != Django. awesome :)
[02:00:40] cnk: I have written some but end up with a lot of fuss. For example, I made a class based on a database view. Wrote a migration for the SQL for the view. But I STILL had to allow Django to make a migration that it would never run (managed = False) to keep the migration magic happy
[02:03:51] Megamos: Problem Solved: I had to set a FU**ING timeout between, $('#event_stripe_token').val(response.id) and $('new_event').submit(). My god I hate javascript. Always ruins my day.
[02:05:28] Rodya_: has joined #RubyOnRails
[02:05:44] Arcaire: Am I in #django and irccloud glitched
[02:05:52] Arcaire: has left #RubyOnRails: ("Cycling")
[02:05:52] Arcaire: has joined #RubyOnRails
[02:06:00] flappynerd: django eh? bummer
[02:06:11] adamscott: has joined #RubyOnRails
[02:06:34] flappynerd: cnk, that's mostly cuz django basically sucks
[02:06:34] drbayer: has joined #RubyOnRails
[02:06:58] sevenseacat: Arcaire: just another case of 'why doesnt rails work exactly like this other thing I'm already used to'
[02:07:26] cnk: I don't know. There are things to like about Django. I like their app structure. Engines as a first class concept is ++
[02:08:12] Arcaire: Have you considered using Django?
[02:08:21] Arcaire: It sounds quite similar to Django which you keep talking about in #rubyonrails.
[02:08:21] sillypog: has joined #RubyOnRails
[02:08:24] SteenJobs: has joined #RubyOnRails
[02:08:26] cnk: And their admin is nice. I need to write a couple of things in their ORM and ActiveRecord. It seems to me that AR is a heck of a lot nicer but perhaps the tricky things I am currently struggling with would be tricky in AR too
[02:08:40] flappynerd: actually no, their admin is horrible
[02:08:48] flappynerd: and the "structure" is non existent
[02:09:04] sevenseacat: dont get me started with the admin stuff
[02:09:08] flappynerd: it follows that whole python "ooh wouldn't it be great if we take a single file and add ALL THE THINGS!"
[02:09:23] cnk: LOL well ya
[02:09:35] flappynerd: python is reasonably good in various capacities
[02:09:39] flappynerd: but django is not one of them
[02:09:45] Arcaire: #pythononrails
[02:10:17] cnk: I way prefer Ruby to Python
[02:10:18] flappynerd: besides, if you want something like the admin, you can just drop in rails_admin
[02:10:22] flappynerd: or is it active_admin
[02:10:33] flappynerd: I think one of them killed and or ate the other
[02:10:37] GriffinHeart: has joined #RubyOnRails
[02:10:40] cnk: One of these days I am going to try them
[02:10:43] flappynerd: don't remember which is which, mostly because the idea is basically shit
[02:10:44] norc-2: has joined #RubyOnRails
[02:10:53] cnk: for now, my admin is usually 'rails g scaffold'
[02:11:11] decaff: sevenseacat it isnt "why doesn't rails work exactly liek the thing I'm already used to" there are similarities and it's worth comparing them. I like using both
[02:11:22] superlou: has joined #RubyOnRails
[02:12:23] Arcaire: They've been compared since Rails 1.0 in 2005.
[02:12:41] Arcaire: There's nothing you can say that isn't already in at least sixteen Medium blog posts and over one hundred self-righteous HN comments.
[02:12:50] sevenseacat: and thats fine, but I don't know what you hope to achieve with endless comparisons
[02:12:57] cnk: What happened to Pyramid / Pylons / the rails in python thingy?
[02:13:05] sevenseacat: Arcaire: pretty much
[02:13:08] Arcaire: It's called Pyramid now and it still exists.
[02:13:11] decaff: I hope to achieve a better understanding of both frameworks and the best workflow for each
[02:13:15] sevenseacat: also, wtf is with Medium
[02:13:17] Arcaire: decaff: Try reading.
[02:13:29] Arcaire: Not sure, I don't use Medium. It's garbage.
[02:13:30] decaff: Arcaire I do. I also chat on irc
[02:13:37] sevenseacat: why did it become a replacement for people posting stuff on their own blogs
[02:13:57] Arcaire: Probably because posting on Medium makes some people mistake your content as importnat.
[02:13:59] Arcaire: s/nat/ant/
[02:14:03] cnk: sevenseacat: I am kind of interested in that question myself.
[02:14:07] Arcaire: "Oh Richard Branson posts on Medium as well, so"
[02:14:13] cnk: They do a good job of cross promoting content
[02:14:23] Arcaire: It's designed to look like invited guest posts instead of a blog without subdomains.
[02:14:24] cnk: better than blogspot
[02:14:36] decaff: They should rename it "Twitter longform"
[02:14:40] triptec: has joined #RubyOnRails
[02:14:41] arBmind: has joined #RubyOnRails
[02:14:51] sevenseacat: thats pretty much what it is
[02:14:54] cnk: I like that Medium is pretty
[02:15:00] decaff: spill out your thoughts and beg for attention
[02:15:21] decaff: say things you can't back up and pretend they are facts
[02:15:33] cnk: And their highlighting / comment feature is attractive - though it doesn't promote dialog in the way old fashioned comments at the bottom do
[02:16:01] cnk: decaff: that is most of the internet - platform independent
[02:16:32] sevenseacat: I don't like the way they do comments
[02:16:36] decaff: cnk yes I guess that's true.
[02:16:57] Arcaire: I didn't even know they had comments. I stop reading at the bottom of the main article and then close the page.
[02:17:27] cnk: Arcaire: the comments pop up next to the section you highlight
[02:17:46] cnk: We are actually aping the UI for that for a private notes feature on something we are building
[02:17:51] Arcaire: I don't highlight things.
[02:17:55] cnk: good for that - less good for public discussion
[02:20:03] sankaber: has joined #RubyOnRails
[02:20:18] DLSteve: has joined #RubyOnRails
[02:23:41] chouhoulis: has joined #RubyOnRails
[02:24:48] GriffinHeart: has joined #RubyOnRails
[02:26:03] ss_much: has joined #RubyOnRails
[02:27:55] godzillaenlacasa: if i have no value for device.last_checkin (because the device hasn't checked in yet), what's a good way to evaluate if last_checkin has a value and is less than 30 minutes? I tried ` <% if device.last_checkin.nil? && device.last_checkin < 30.minutes.ago %>` but that's throwing an error since last_checkin doesn't exist yet for some.
[02:28:31] DanKnox_: has joined #RubyOnRails
[02:28:31] DanKnox: has joined #RubyOnRails
[02:28:45] godzillaenlacasa: sorry, there's a ! in front of: !device.last_checkin.nil?
[02:30:01] LudicrousMango: has joined #RubyOnRails
[02:31:13] pwnd_nsfw: godzillaenlacasa, you can nest ifs
[02:31:14] kdough: has joined #RubyOnRails
[02:31:25] pwnd_nsfw: I would put it in a helper method
[02:31:27] blackmesa: has joined #RubyOnRails
[02:31:38] pwnd_nsfw: and probably return if devise...nil? right away
[02:31:45] pwnd_nsfw: or return whatever value you need
[02:31:58] Radar: if device.last_checkin && device.last_checkin < 30.minutes.ago
[02:32:32] kdough: has joined #RubyOnRails
[02:32:36] pwnd_nsfw: Or listen to Radar because I know pebbles next to him
[02:32:45] pwnd_nsfw: Sand, in fact
[02:32:47] pwnd_nsfw: pieces of sand
[02:32:52] godzillaenlacasa: pwnd_nsfw lol.. thanks for both
[02:32:54] Radar: It's a venn diagram bro
[02:33:03] pwnd_nsfw: Analogies and things
[02:33:18] godzillaenlacasa: Radar it's odd... it's like the 2nd part isn't getting evaluated though when I try that.
[02:33:27] Radar: godzillaenlacasa: that's the whole point
[02:33:45] Radar: godzillaenlacasa: What do you want to do if device.last_checkin is nil?
[02:33:55] pwnd_nsfw: it doesn't need to if the first bit is false to begin with
[02:34:02] godzillaenlacasa: Right, but if last_checkin does exist, then it should move on to < 30.minutes.ago, right?
[02:34:08] Radar: godzillaenlacasa: yes indeed
[02:34:17] Radar: godzillaenlacasa: So if it's not doing that, perhaps check if last_checkin is really set?
[02:35:07] godzillaenlacasa: Radar the one that it does show for had a last_checkin timestamp of yesterday (well beyond 30.minutes.ago)
[02:38:45] celly: has joined #RubyOnRails
[02:42:43] Radar: godzillaenlacasa: I don't understand
[02:42:46] alex88: has joined #RubyOnRails
[02:42:51] godzillaenlacasa: Radar haha, me either
[02:43:41] triptec: has joined #RubyOnRails
[02:43:50] Omen: has joined #RubyOnRails
[02:49:49] upsell5: has joined #RubyOnRails
[02:49:53] Jasaka|NA: has joined #RubyOnRails
[02:50:05] godzillaenlacasa: @Radar omg... I'm dumb. I needed to be checking if the time was greater than 30.minutes.ago. durrrr
[02:50:14] Radar: godzillaenlacasa: that'll do it.
[02:50:19] godzillaenlacasa: On that sad note, I'm going to bed. lol
[02:50:26] Radar: See you tomorrow?
[02:50:39] waka: has joined #RubyOnRails
[02:52:43] dima_: has joined #RubyOnRails
[02:55:21] Maletor: has joined #RubyOnRails
[03:02:57] Rodya_: has joined #RubyOnRails
[03:03:51] baash05: has joined #RubyOnRails
[03:04:11] baash05: Hey all.. Anyone ever try to use the scopes of a joined table?
[03:05:15] sevenseacat: you may need to elaborate on that... apparently you have and it hasn't worked
[03:06:48] baash05: I wanted to have say task.joins(users).user_are_active
[03:06:58] baash05: something like that.
[03:07:21] DanKnox: has joined #RubyOnRails
[03:07:23] DanKnox_: has joined #RubyOnRails
[03:07:27] baash05: where the code in users_are_active is unknown and changing
[03:07:45] jtong: has joined #RubyOnRails
[03:07:48] dopie: https://gist.github.com/8c15cea723a462395f5f is there a better way to write this test?
[03:08:19] kdough: has joined #RubyOnRails
[03:09:52] pwnd_nsfw: dopie, well, first you should be sending DELETE to destroy
[03:10:08] sevenseacat: I was just typing that
[03:10:17] sevenseacat: destructive actions behind GET links are bad
[03:10:43] pwnd_nsfw: And you probably don't have to check if the user is logged in
[03:11:00] pwnd_nsfw: since, well, same results will probably come out of the user being logged in then logged out, or just starting as logged out
[03:12:02] dopie: on line 11.. can i use a is_expected there?
[03:13:06] Devalo: has joined #RubyOnRails
[03:13:45] pwnd_nsfw: I'd probably do something like... before each, create user, log in user, log out user, then check seperately that it removes the user_id from session, and that it redirects
[03:14:04] pwnd_nsfw: I've never used is_expected
[03:17:11] _Tariq: has joined #RubyOnRails
[03:20:45] dexter_: has joined #RubyOnRails
[03:21:20] shanemcd: has joined #RubyOnRails
[03:22:16] bronson: has joined #RubyOnRails
[03:22:41] triptec: has joined #RubyOnRails
[03:24:28] Rodya_: has joined #RubyOnRails
[03:24:48] krz: has joined #RubyOnRails
[03:27:05] shtirlic: has joined #RubyOnRails
[03:27:29] Radar: is_expected is unexpected.
[03:28:46] jbrinkmusic: has joined #RubyOnRails
[03:29:04] robbyoconnor: has joined #RubyOnRails
[03:29:10] Brando753: has joined #RubyOnRails
[03:32:06] p1k: has joined #RubyOnRails
[03:32:52] blackmesa: has joined #RubyOnRails
[03:33:00] DLSteve: has joined #RubyOnRails
[03:33:37] SteenJobs: has joined #RubyOnRails
[03:36:05] smathy: has joined #RubyOnRails
[03:38:31] enitiz: has joined #RubyOnRails
[03:43:57] schuc: has joined #RubyOnRails
[03:47:55] rew: has joined #RubyOnRails
[03:48:28] GriffinHeart: has joined #RubyOnRails
[03:52:32] fedexo: has joined #RubyOnRails
[03:55:23] dima_: has joined #RubyOnRails
[03:55:51] sleungcy: has joined #RubyOnRails
[03:56:47] mary5030: has joined #RubyOnRails
[04:04:46] jfelchner: has joined #RubyOnRails
[04:04:50] baweaver: has joined #RubyOnRails
[04:06:26] stardiviner: has joined #RubyOnRails
[04:07:12] Pazician: has joined #RubyOnRails
[04:07:41] _Tariq: has joined #RubyOnRails
[04:09:11] duncannz: has joined #RubyOnRails
[04:13:21] braincrash: has joined #RubyOnRails
[04:20:41] jfelchner: has joined #RubyOnRails
[04:21:35] smathy: has joined #RubyOnRails
[04:22:59] jfelchner: has joined #RubyOnRails
[04:26:56] sillypog: has joined #RubyOnRails
[04:27:50] Scriptonaut: has left #RubyOnRails: ()
[04:28:23] jfelchner: has joined #RubyOnRails
[04:30:09] kirillzh: Is there a way to change TOKEN_KEY in HttpAuthentication?
[04:33:10] xardion: has joined #RubyOnRails
[04:34:16] blackmesa: has joined #RubyOnRails
[04:35:49] tildes: has joined #RubyOnRails
[04:40:50] jfelchner: has joined #RubyOnRails
[04:41:53] braincra-: has joined #RubyOnRails
[04:42:45] Devalo: has joined #RubyOnRails
[04:46:09] GriffinHeart: has joined #RubyOnRails
[04:47:36] pawnbox: has joined #RubyOnRails
[04:50:11] Jasaka: has joined #RubyOnRails
[04:51:28] ur5us: has joined #RubyOnRails
[04:53:45] celly: has joined #RubyOnRails
[04:58:56] treaki_: has joined #RubyOnRails
[04:59:09] barhum2013: has joined #RubyOnRails
[05:04:34] apotry: has joined #RubyOnRails
[05:08:01] sleungcy: has joined #RubyOnRails
[05:12:23] rafaelfranca: has joined #RubyOnRails
[05:15:17] rafaelfranca: has joined #RubyOnRails
[05:16:47] AntiSpamMeta: has joined #RubyOnRails
[05:17:09] ayonkhan: has joined #RubyOnRails
[05:19:24] rubyonrailed: has joined #RubyOnRails
[05:20:55] Eswar: has joined #RubyOnRails
[05:21:14] yfeldblum: has joined #RubyOnRails
[05:23:19] qejk: has joined #RubyOnRails
[05:24:32] triptec: has joined #RubyOnRails
[05:24:59] ur5us: has joined #RubyOnRails
[05:29:19] Maletor: has joined #RubyOnRails
[05:30:06] mooka: has joined #RubyOnRails
[05:33:09] barhum2013: has joined #RubyOnRails
[05:33:24] mooka: has left #RubyOnRails: ()
[05:34:18] krz: has joined #RubyOnRails
[05:35:38] blackmesa: has joined #RubyOnRails
[05:35:53] rhizome: kirillzh: what are you talking about
[05:36:25] kirillzh: rhizome never mind, I figured that out. "token=" is optional.
[05:36:37] kirillzh: https://github.com/tgxworld/rails/commit/3cc25864e34fb5b22b1ecacaaf91825841a5eebd
[05:39:58] Tempesta_: has joined #RubyOnRails
[05:40:11] _djbkd: has joined #RubyOnRails
[05:44:02] Technodrome: has joined #RubyOnRails
[05:47:33] mattp__: has joined #RubyOnRails
[05:48:38] GriffinHeart: has joined #RubyOnRails
[05:49:49] shanemcd: has joined #RubyOnRails
[05:50:43] Eswar: has joined #RubyOnRails
[05:55:14] sleungcy: has joined #RubyOnRails
[05:55:54] pawnbox_: has joined #RubyOnRails
[06:02:42] Y_Ichiro_: has joined #RubyOnRails
[06:03:59] epochwolf: has joined #RubyOnRails
[06:04:48] cschneid: has joined #RubyOnRails
[06:07:24] sarink: has joined #RubyOnRails
[06:08:39] drbayer: has joined #RubyOnRails
[06:10:32] lxsameer: has joined #RubyOnRails
[06:12:10] mwlang: has joined #RubyOnRails
[06:12:29] mwlang: @Radar so what PR is killing you with all the comments?
[06:13:12] triptec: has joined #RubyOnRails
[06:13:21] Devalo: has joined #RubyOnRails
[06:15:09] sevenseacat: I just saw that tweet
[06:20:07] Radar: mwlang: internal work PR
[06:20:15] TDJACR: has joined #RubyOnRails
[06:20:15] TDJACR: has joined #RubyOnRails
[06:20:28] Radar: 25 comments in as many minutes
[06:20:58] LudicrousMango: has joined #RubyOnRails
[06:21:43] alphaatom: has joined #RubyOnRails
[06:21:47] rhizome: now you know where everyone stands :)
[06:22:09] sevenseacat: ACTION has to fight to get people to look at PRs
[06:22:47] GriffinHeart: has joined #RubyOnRails
[06:23:16] bronson: has joined #RubyOnRails
[06:24:20] rvanlieshout: has joined #RubyOnRails
[06:24:54] baweaver: we have a policy of immediate reviews
[06:25:10] baweaver: it's unusual for a PR to last over an hour
[06:25:12] rhizome: good for flow!
[06:25:50] sevenseacat: ACTION usually gives up after a couple of days of poking people
[06:26:09] kknight: has joined #RubyOnRails
[06:26:33] sevenseacat: sorry, in a bit of an emo mood today
[06:26:50] kirillzh: has joined #RubyOnRails
[06:27:15] Macaveli: has joined #RubyOnRails
[06:27:15] mwlang: ah. I don’t miss those internal infernally long exchanges.
[06:28:00] Devalo: has joined #RubyOnRails
[06:28:47] Technodrome: has joined #RubyOnRails
[06:29:01] mwlang: Anybody have an example of omni-auth signin/signup form implementation that made you go, “now, *this* is the way to do it right”
[06:31:20] Radar: https://www.bikeexchange.com.au/ click "Sign in" at top left
[06:31:35] RTG`: has joined #RubyOnRails
[06:31:50] Cohedrin: is it possible to keep a lock across transactions?
[06:31:55] Cohedrin: guessing no right?
[06:32:42] kknight: error m getting while bunlde install gem install wkhtmltopdf-binary -v '0.9.9.3'
[06:33:07] kknight: but when i typed gem install wkhtmltopdf-binary -v '0.9.9.3' got new error that it is corrupt!!
[06:33:35] mwlang: Radar: thanks. clean and simple. Just like I was hoping for.
[06:35:06] Coldblackice: has joined #RubyOnRails
[06:35:42] rhizome: Cohedrin: like a table lock?
[06:37:02] blackmesa: has joined #RubyOnRails
[06:37:15] rhizome: kknight: worked for me, deb 8.3
[06:37:46] rhizome: oh, don't do "bundle install gem install..."
[06:38:02] Cohedrin: rhizome, yeah a row lock
[06:38:16] kknight: rhizome: then what
[06:38:18] rhizome: two transactions in a row on the same row?
[06:38:28] rhizome: kknight: then what what
[06:38:29] kknight: i have done one by obe
[06:38:57] kknight: first i have cloned it from repo
[06:39:04] kknight: then bundle install
[06:39:12] dionysus69: has joined #RubyOnRails
[06:39:19] Cohedrin: so the situation I have is I need to lock an object that I have while a save for another object completes. However, if the save for the second object completes, I need it not to rollback, ever
[06:39:24] kknight: then when it shows error then i give gem istall ...
[06:39:32] DEA7TH: has joined #RubyOnRails
[06:39:47] rhizome: so only rollback if they both fail?
[06:40:06] Cohedrin: because of the way rails transactions work, any calls in after_update that rails an exception will cause everything within the with_lock do block to rollback
[06:40:15] Cohedrin: Ideally, I would like to never rollback
[06:40:25] Cohedrin: after the first object save is completed
[06:40:29] Cohedrin: if possible
[06:40:40] kknight: i have installed rails two day back and it is updated version
[06:40:43] Cohedrin: I'm trying to avoid just catching all exceptions though
[06:40:48] rhizome: kknight: i don't know
[06:40:57] Cohedrin: because thats easy to forget to do, then cause a huge issue
[06:42:52] mices: server doesn't start https://gist.github.com/mices/4955c8f5d42240a82176
[06:42:54] Cohedrin: to simplfy:
[06:44:04] Cohedrin: 1. Item is locked 2. inner Object is created. 3. Method is run if inner object is create successfully. 4. Transaction completes and lock is released
[06:44:06] mwlang: Cohedrin: you can start a transaction at the outer level, then start another transaction inside that and also catch and handle exceptions within the inner transaction so it doesn’t bubble up to outer transaction and cause a rollback at that level.
[06:44:17] Cohedrin: Ideally, after step two, nothing would rollback
[06:44:35] Cohedrin: mwlang as I mentioned, I'm trying to avoid doing that, as that's easy to overlook and cause a bug
[06:44:40] Cohedrin: if that makes sense
[06:44:51] rhizome: mices: what do you see in there?
[06:45:48] mwlang: Cohedrin: In a case like that, I will only catch and handle very specific exceptions…the rest bubble up…but of course, that would rollback the outer transaction in your case.
[06:46:23] mices: rhizome: from /home/fugee/data/websites/fugee/config/application.rb:7:in `<top (required)>'
[06:46:30] rhizome: what else?
[06:46:44] SkepBrain: has joined #RubyOnRails
[06:46:44] rhizome: well, first off, what does that line tell you?
[06:46:47] mwlang: but really, if I wanted to do what you describe, I’d very narrowly handle errors in inner transaction, preferring to fail fast in unconsidered conditions. When new scenarios are encounter, iteratively improve the code.
[06:47:13] rhizome: i wonder why the outer is a transaction
[06:48:27] yardenbar: has joined #RubyOnRails
[06:48:43] intrigueD: has joined #RubyOnRails
[06:49:01] SeanLazer: has joined #RubyOnRails
[06:50:23] Maletor: has joined #RubyOnRails
[06:53:51] tildes: has joined #RubyOnRails
[06:54:02] fedexo: has joined #RubyOnRails
[06:54:29] razzmc9: has joined #RubyOnRails
[06:54:58] razzmc9: Hey guys, I asked this in php but thought I'd ask here too. So for this site https://www.protectedtext.com/ -- they release all their source code and everything but not the server code. I know nothing about ruby on rails, but how long do you think it would take for someone to build a backend to a site like that so you can host your notes yourself?
[06:55:22] mices: Rhizome: line 7 in application.rb is "Bundler.require(*Rails.groups)
[06:56:30] rhizome: has joined #RubyOnRails
[06:56:37] rhizome: sorry, accidental ^w
[06:57:17] razzmc9: it's razz-y
[06:57:23] mices: Rhizome: sorry, there was an error trying to load the gem Uglifier
[06:57:29] razzmc9: i was wondering if after all these years you'd like to meet
[06:57:44] rhizome: good. where is 'uglifier' specified?
[06:57:54] razzmc9: answer my question love
[06:58:09] rhizome: my hand is not for strangers
[06:58:35] rhizome: broke his brane
[06:59:18] shibly: has joined #RubyOnRails
[07:00:01] shibly: Does David heinmer heinson join here sometimes?
[07:00:14] rhizome: not anymore. are you buds with razzmc9
[07:01:04] shibly: Why not? It would have been nice if he joins here and helps others.
[07:01:19] razzmc9: i'd like to speak to your manager
[07:01:34] arup_r: has joined #RubyOnRails
[07:01:44] arup_r: any idea why the JS var, not working inside haml https://gist.github.com/aruprakshit/c9484baaa2aa3d22fe41 .. console.log prints when I give it the direct Jquery. But when I assign the value inside the var and try to print, nothing prints and no error too..
[07:02:16] arup_r: I don't see anything wrong in the code.
[07:02:25] solars: has joined #RubyOnRails
[07:02:27] sevenseacat: shibly: you'd have to ask him
[07:02:38] rhizome: razzmc9: here's his business card. call or email anytime http://i.imgur.com/OwQpCIl.jpg
[07:03:33] kies^: has joined #RubyOnRails
[07:04:05] kknight: sevenseacat: please sove my error
[07:06:14] baash05: has left #RubyOnRails: ()
[07:06:52] mices: rhizome: in the gemfile
[07:07:35] roshanavand: has joined #RubyOnRails
[07:07:49] baweaver: I'm in a lot of places arup_r :P
[07:08:01] arup_r: yeah.. I got you
[07:08:50] baweaver: I would avoid using script tags, especially in HAML
[07:08:55] baweaver: they might compile very oddly
[07:09:01] baweaver: check the generated file
[07:09:15] jtong: has joined #RubyOnRails
[07:09:52] arup_r: baweaver: I saw that in the response window of the chrome dev tool
[07:09:52] mices: rhizome: i think i need to install nodejs installing now
[07:10:14] arup_r: looks like fine.. but ofcourse it is not working.. all issues are with the `var` declaration
[07:10:45] arup_r: it just don't do as I am expecting.
[07:11:15] arup_r: baweaver: I thought, I will give http://stackoverflow.com/a/3848879/2767755 a try
[07:11:27] mices: rhizome: yea
[07:15:34] bruce_lee: has joined #RubyOnRails
[07:15:39] rhizome: looking good?
[07:16:06] kknight: sevenseacat: please solve my error
[07:17:04] rhizome: please be nice
[07:18:48] msyvich: has joined #RubyOnRails
[07:21:27] DanKnox_: has joined #RubyOnRails
[07:21:27] DanKnox: has joined #RubyOnRails
[07:21:50] kmckelvi1: has joined #RubyOnRails
[07:23:26] gingray: has joined #RubyOnRails
[07:24:52] istrasci: has joined #RubyOnRails
[07:26:54] istrasci: I have a question about best practices? If my model has a has_many association, and I want a method that performs something on the entire collection (e.g., min, max, avg, etc.), is it better to make an instance method on the model, or a class method on the association model that accepts a collection, and call it with model.the_has_manys?
[07:27:01] sandstrom: has joined #RubyOnRails
[07:27:54] comrad: has joined #RubyOnRails
[07:29:25] baweaver: So you want to perform an aggregate function on the has_many collection of that model?
[07:29:30] TheMoonMaster: has joined #RubyOnRails
[07:29:43] istrasci: Where is the best-practices location for that method?
[07:30:01] baweaver: http://baweaver.com/blog/2015/09/28/association-aggregates-explained/ - My opinion on it at least.
[07:31:00] baweaver: If you substitute count with one of the other aggregate functions that should cover the bases.
[07:31:49] istrasci: Assume the 'aggregate function' is not simply a generic mathematical one; some kind of customized logic.
[07:32:09] baweaver: min max avg sum and etc are SQL level
[07:32:24] Pazician: has joined #RubyOnRails
[07:32:28] baweaver: so using those terms leads me to suggest such things
[07:33:22] istrasci: Well, that's fine for those types. But I'm saying if the function isn't one of those.
[07:33:29] baweaver: really depends what you mean by it
[07:33:36] jiangle: has joined #RubyOnRails
[07:33:50] baweaver: I can't predict what you mean by a function
[07:34:21] baweaver: though really it's more of an XY problem
[07:34:25] helpa: 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
[07:35:01] ur5us: has joined #RubyOnRails
[07:35:02] istrasci: What is "max" is not a numerical max, but a semantic one? For example, "president" > "governor" > "mayor". I need to make a custom operator for this; I'm not gonna use the database.
[07:35:57] rvanlieshout: function's dont exist in ruby
[07:35:59] rvanlieshout: they are all methods
[07:36:47] istrasci: "aggregate function". Your words.
[07:36:56] istrasci: OK, let me start over.
[07:36:56] baweaver: quibbling about semantics seems rather pointless
[07:37:14] rvanlieshout: there is a huge differene between a function and a method
[07:37:21] baweaver: rvanlieshout: drop it
[07:37:32] rvanlieshout: and it's not pointless
[07:37:37] darutoko: has joined #RubyOnRails
[07:37:37] rvanlieshout: the point is that you have context
[07:37:43] rvanlieshout: not my problem. suit yourself
[07:37:54] istrasci: rvanlieshout: In this case it's pointless because I know what you mean.
[07:38:20] baweaver: the issue is that it started as looking like SQL aggregate functions
[07:38:21] shanemcd: has joined #RubyOnRails
[07:38:25] baweaver: hence the pointless
[07:38:30] rvanlieshout: then you might want to read about it somebday
[07:38:32] Bloodberet: has joined #RubyOnRails
[07:38:49] istrasci: OK, I have a Student model, has_many TestScores. Assume for whatever reasons that I don't want to use built-in database aggregrates.
[07:38:50] rvanlieshout: and ok. in sql it's a function
[07:39:23] rvanlieshout: away for 4 to 5 hours
[07:39:24] baweaver: in the above case, something more along the lines of an enumeration
[07:39:45] RTG`: has joined #RubyOnRails
[07:39:57] baweaver: that way you can assign priority to them as well by the order in which they're defined
[07:40:07] istrasci: I could create a best_score method in Student that iterates directly over student.test_scores. Or I could create a class method max_score in TestScore, and call TestScore::max_score(student.test_scores).
[07:40:08] blackmesa: has joined #RubyOnRails
[07:40:22] istrasci: Which is the better practice?
[07:40:46] baweaver: Student.max(:test_score)
[07:40:50] baweaver: though you can merge scopes
[07:41:14] baweaver: http://apidock.com/rails/ActiveRecord/SpawnMethods/merge
[07:41:41] mhoungbo: has joined #RubyOnRails
[07:42:25] aganov: has joined #RubyOnRails
[07:42:48] baweaver: or in that case something more like: Student.joins(:test_scores).group('student.id').max('test_scores.value')
[07:43:39] Bloodberet_: has joined #RubyOnRails
[07:43:48] baweaver: well, 'students.id'
[07:43:54] baweaver: I always mix those up.
[07:44:14] sinkensabe: has joined #RubyOnRails
[07:44:53] mdw: has joined #RubyOnRails
[07:45:06] istrasci: 1) You ignored my assumption. 2) This won't work if there is no aggregate DB function for the calculation.
[07:45:35] helpa: 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.
[07:45:36] emchamp: has joined #RubyOnRails
[07:46:00] mdw7: has joined #RubyOnRails
[07:47:11] bruce_lee: has joined #RubyOnRails
[07:48:16] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[07:50:18] istrasci: OK, give me a minute.
[07:50:49] bronson: has joined #RubyOnRails
[07:51:47] rhizome: AR has .maximum
[07:52:14] KnownSyntax: has joined #RubyOnRails
[07:52:41] celly: has joined #RubyOnRails
[07:53:56] rhizome: oh there's a whole story up there isn't there
[07:56:01] rhizome: for association collection stuff like that use an instance method on...student, i guess
[07:56:38] rhizome: that's the owner of the collection anyway, makes sense unless you want to make all of this to be more complicated.
[07:58:29] RTG`: has joined #RubyOnRails
[07:59:07] sandstrom: has joined #RubyOnRails
[08:00:12] istrasci: https://gist.github.com/anonymous/2bb73e12ebfec09da3a6
[08:00:42] rhizome: you're alphabetizing?
[08:01:20] baweaver: http://edgeapi.rubyonrails.org/classes/ActiveRecord/Enum.html
[08:01:21] rhizome: ew what's that second thing
[08:02:11] rhizome: take that thing out of student_government_position
[08:02:32] istrasci: Can you edit a public gist?
[08:02:42] rhizome: i think in @student.highest_position you are looking for .sort.first
[08:02:50] rhizome: .sort(:title).first
[08:03:17] istrasci: I don't want a string sort, I want a semantic sort.
[08:03:32] rhizome: is this homework?
[08:03:58] JohnBat26: has joined #RubyOnRails
[08:05:01] istrasci: I feel like you don't understand what a semantic sort is.
[08:05:35] rhizome: that's fine, but still, hang a .first off the end
[08:06:15] sevenseacat: we can only provide solutions for problems you clearly articulate
[08:06:26] rhizome: there's a fine gist
[08:06:32] istrasci: What's not clear about it?
[08:06:58] mrfoto: has joined #RubyOnRails
[08:07:38] rhizome: so, that should work. just clean out studentgovernmentpos..
[08:08:35] istrasci: I know that should work. I'm asking which is the better practice. The Student#highest_position or StudentGovernmentPosition.highest_position.
[08:09:40] IFrank00: has joined #RubyOnRails
[08:10:33] arup_r: has joined #RubyOnRails
[08:11:12] baweaver: never do anything to an entire collection set outside of SQL unless you absolutely have to
[08:11:30] baweaver: Enum maps an integer to a string effectively giving you that sort
[08:13:41] istrasci: What's the reasoning for that? Aren't extra DB calls more expensive than just calculating at that point?
[08:13:41] istrasci: student = Student.first
[08:13:41] istrasci: # I've already got the collection. Why go back to the DB?
[08:13:50] IFrank00: If Im doing a Task.map{ |t| t.group.name} and one of the task dont have a group because is optional. When I run the code I get a NilClass for name. so one of the task dont have a group_id. How can I do a condition on the map so if group_id is empty dont look for the name of the group.
[08:13:52] istrasci: (I'm honestly asking)
[08:14:06] Oog: has joined #RubyOnRails
[08:14:22] rhizome: istrasci: the first one
[08:14:24] Oog: with activejob higher priority is more important right...?
[08:14:49] rhizome: @student.highest
[08:15:13] rhizome: and AR only queries at the last minute
[08:15:35] Oog: can i do negative priority? im creating jobs and i want them to be lower priority than default
[08:15:50] istrasci: rhizome: Yes, so if "highest" is an instance method, isn't it faster than if it were a scope that does another DB call?
[08:16:04] istrasci: (unless you're eager loading)
[08:17:00] Oog: .set(:priority => ) is being ignored
[08:17:57] Oog: does rails 4.2.5 do priorities? i cant tell
[08:19:31] rhizome: i don't know why you wouldn't .includes
[08:20:01] IFrank00: This what im trying to do https://gist.github.com/Frank004/27008c9342abb937bca4
[08:21:57] rhizome: change your nils to "" and add a default
[08:22:13] rhizome: avoid the heartbreak of db nils
[08:23:01] Devalo: has joined #RubyOnRails
[08:23:16] rhizome: no association
[08:23:24] IFrank00: rhizome, yep
[08:23:41] Oog: https://github.com/rails/rails/pull/19384 but priorities dont seem to work in rails 4.2
[08:26:02] rhizome: IFrank00: are you sure that's the problem? it might be the group that's breaking
[08:26:15] IFrank00: rhizome, its a new one for me im like how can I tell it when no association is present and still keep my one line query
[08:26:39] defsdoor: has joined #RubyOnRails
[08:26:46] rhizome: i don't understand what the map is doing
[08:28:14] msyvich: has joined #RubyOnRails
[08:28:22] ruurd: has joined #RubyOnRails
[08:29:53] kmckelvi1: has joined #RubyOnRails
[08:30:45] Technodrome: has joined #RubyOnRails
[08:32:25] artto: has joined #RubyOnRails
[08:32:54] IFrank00: rhizome, I'm practicing and I found that problem
[08:33:22] tetraktys: has joined #RubyOnRails
[08:33:34] sandstrom: has joined #RubyOnRails
[08:33:51] IFrank00: rhizome, I look online for solution but got none results. :/
[08:35:57] alphaatom: has joined #RubyOnRails
[08:37:45] Megamos: has joined #RubyOnRails
[08:38:08] MaDErroR123: has joined #RubyOnRails
[08:40:06] triptec_: has joined #RubyOnRails
[08:40:33] Ergo: has joined #RubyOnRails
[08:41:35] blackmesa: has joined #RubyOnRails
[08:42:09] pyemkey: has joined #RubyOnRails
[08:42:49] PedramT: has joined #RubyOnRails
[08:49:06] DanKnox: has joined #RubyOnRails
[08:50:39] snowy: has joined #RubyOnRails
[08:52:36] DanKnox_: has joined #RubyOnRails
[08:52:59] srinidhi: has joined #RubyOnRails
[08:53:15] razzmc9: has left #RubyOnRails: ()
[08:54:30] sandstrom: has joined #RubyOnRails
[08:54:54] PedramT: has joined #RubyOnRails
[08:54:55] AimlessRAven: has joined #RubyOnRails
[08:55:31] AimlessRAven: how can i write spec for methods.. for example i have method def fullname [first_name, last_name].join ' ' end how my describe would be looks like ?
[08:55:40] durexlw: has joined #RubyOnRails
[08:55:46] durexlw: morning all
[08:56:02] durexlw: ...depending on the country you'e in I guess :)
[08:57:49] AzaToth: has joined #RubyOnRails
[09:04:02] mark4: has joined #RubyOnRails
[09:04:28] PedramT: has joined #RubyOnRails
[09:04:35] mrbubbles: has joined #RubyOnRails
[09:07:13] woo: has joined #RubyOnRails
[09:07:35] jds: has joined #RubyOnRails
[09:08:01] adaedra: ugt, durexlw.
[09:09:08] GriffinHeart: has joined #RubyOnRails
[09:11:22] msyvich: has joined #RubyOnRails
[09:13:23] bronson: has joined #RubyOnRails
[09:13:41] nej: has joined #RubyOnRails
[09:14:07] arup_r: I am namespacing my admin routes like https://gist.github.com/aruprakshit/d5f3ac01ee341eb9372f .. just want to know, what is the best way to set a default view for like http://localhost:300/admin to Admin::Tournaments#index always?
[09:14:47] arup_r: get "/admin", to: "Admin::Tournaments#index" I can do .. but any more nice trick ?
[09:15:33] mrbubbles: has joined #RubyOnRails
[09:15:35] tbuehlmann: AimlessRaven, as a start, something like this? https://gist.github.com/tbuehlmann/d1ccb7d614945152df68
[09:16:06] AimlessRAven: tbuehlmann: yea something like this tnx
[09:18:27] jottr: has joined #RubyOnRails
[09:18:50] baweaver: has joined #RubyOnRails
[09:19:06] durexlw: mm... in Rails if you have the byebug gem, it doesn't seem to be accessible in the tasks. Anyone know why?
[09:19:20] durexlw: mm... in Rails if you have the byebug gem, it doesn't seem to be accessible in the *tests*. Anyone know why?
[09:19:35] sevenseacat: if you load it in the test env :)
[09:22:35] durexlw: sevenseacat: it is indeed... I just didn't notice my error came before my breakpoint, that's why I didn't get it
[09:23:13] FooMunki: has joined #RubyOnRails
[09:23:42] woo: Hi, I ran into an issue when migrating from 4.1.14.1 to 4.2.5. When updating any instance of my models, the updated_at field will not be changed in the database unless the update occurs more than a sec after the previous one. For instance if I do the following `5.times{|i| post = Post.first; post.update!(content: i.to_s)}` the updated_at field will be inserted in the db only the first time.
[09:24:19] tetraktys: has joined #RubyOnRails
[09:24:32] woo: I think this might come from a gem because when testing if on a brand new 4.2.5 project I have the problem
[09:24:45] woo: has anyone already ran into something similar ?
[09:25:10] woo: *I don't have the problem
[09:25:14] woo: sorry for the typo
[09:26:36] sevenseacat: coincidentally, someone reported the exact same issue yesterday
[09:26:37] blackmesa: has joined #RubyOnRails
[09:26:58] marr: has joined #RubyOnRails
[09:27:20] adaedra: yeah, that's me, that's the same bug
[09:27:37] woo: yes, it's my coworker, but we haven't solved it yet
[09:27:45] sevenseacat: was just trying to find a github issue if one was created for it
[09:27:53] sevenseacat: but seems not
[09:28:39] adaedra: We tried narrowing down the bug, bug it does not show with the minimal code matthewd gave us yesterday, so it seems it's something more complicated, but we're having a hard time tracking it down
[09:30:11] adaedra: So we're basically looking for ideas of how to track it down now, as we couldn't find the exact change that triggered it
[09:31:23] n1lo: has joined #RubyOnRails
[09:31:56] msyvich: has joined #RubyOnRails
[09:32:09] PedramT: has joined #RubyOnRails
[09:32:16] kmckelvi1: has joined #RubyOnRails
[09:35:20] triptec: has joined #RubyOnRails
[09:35:36] srinidhi1: has joined #RubyOnRails
[09:36:13] davout: has joined #RubyOnRails
[09:42:13] Spami: has joined #RubyOnRails
[09:42:17] durexlw: Does anyone understand this error? https://gist.github.com/durexlw/fa2d67f609af19b2f544
[09:42:32] shanemcd: has joined #RubyOnRails
[09:43:13] durexlw: in a test it tells me that a contgructor needs an argument, but it absolutely doesn't need one... the rest of my code runs perfectly where the line in my test fails: "@wqm = Wqm.new"
[09:43:22] durexlw: *constructor
[09:45:37] msyvich: has joined #RubyOnRails
[09:46:20] tbuehlmann: durexlw, not too good with TestCase, but should you really name the class the same as the class you're testing?
[09:46:58] durexlw: tbuehlmann: might be a good point... I'm still struggeling to get my head around testing myself
[09:47:07] durexlw: thanks for the pointer man, i'll check it out
[09:47:50] steharro: has joined #RubyOnRails
[09:48:08] durexlw: tbuehlmann: spot on
[09:48:29] durexlw: Big thanks :) probably would have wasted hours on that one :)
[09:50:10] kitsuneyo: has joined #RubyOnRails
[09:50:10] arup_r: has joined #RubyOnRails
[09:50:18] roshanavand: has joined #RubyOnRails
[09:50:32] riotjones: has joined #RubyOnRails
[09:51:00] kitsuneyo: i want to use a condition, if self.slug.include?(basic), but in most cases self.slug is nil. how do i work with that
[09:51:08] bahar: has joined #RubyOnRails
[09:52:02] arup_r: self.slug.try :include?, basic
[09:52:40] kitsuneyo: thanks arup_r
[09:52:45] matthewd: adaedra: woo: have you tried having the minimal script load everything you have in your Gemfile?
[09:52:49] kitsuneyo: you can use try like that anywhere?
[09:53:11] arup_r: kitsuneyo: yes, mostly.
[09:53:18] msyvich: has joined #RubyOnRails
[09:53:24] arup_r: kitsuneyo: try is defined on Object i think
[09:53:30] arup_r: so you can use it..
[09:53:33] celly: has joined #RubyOnRails
[09:53:36] n1lo: has joined #RubyOnRails
[09:53:41] bruce__lee: has joined #RubyOnRails
[09:54:19] arup_r: I got what I was looking for http://everydayrails.com/2012/07/31/rails-admin-panel-from-scratch.html .. :)
[09:54:41] Prira: has joined #RubyOnRails
[09:57:10] G: has joined #RubyOnRails
[09:57:27] PedramT: has joined #RubyOnRails
[09:58:27] adaedra: matthewd: I don't know for woo (I went on another issue), but couldn't reproduce it in a blank rails 4.2.5 app, so I'm guessing this is not just it. I come back to you once this is tried in the minimal stub.
[09:59:02] matthewd: adaedra: You mean a blank app with your real app's Gemfile?
[09:59:13] adaedra: Gemfile and Gemfile.lock
[09:59:30] adaedra: I must admit we're running out of ideas on this one
[09:59:38] dtordable: has joined #RubyOnRails
[10:00:09] matthewd: Does [enough of] your app work simultaneously in 4.1 and 4.2 that you could bisect on the real thing? :/
[10:00:48] rodfersou: has joined #RubyOnRails
[10:00:59] artto: has joined #RubyOnRails
[10:01:50] adaedra: We bisected it and it told us the culprit was the update on Gemfile and Gemfile.lock
[10:02:00] arBmind: has joined #RubyOnRails
[10:02:17] woo: has joined #RubyOnRails
[10:02:54] matthewd: If your in-app test case can work with both 4.1 and 4.2, then you can bisect on *rails* to find when it changed
[10:03:25] hamed_r: has joined #RubyOnRails
[10:03:32] matthewd: Even if we then decide it's not Rails's fault (because it's not happening on a clean app), seeing the Rails commit might give a useful clue
[10:04:01] nettoweb: has joined #RubyOnRails
[10:04:15] adaedra: We just try successive rails versions from the Gemfile and stop when it stops working or there's a better way of doing it?
[10:04:36] matthewd: Change the Gemfile to point to (a local clone of) rails via a path:
[10:05:05] trinaldi: has joined #RubyOnRails
[10:05:09] matthewd: Then you do a bisect in the rails clone, where the command to run at each step is 'cd ../the-app; <try the thing>'
[10:05:37] n1lo: has joined #RubyOnRails
[10:06:33] Technodrome: has joined #RubyOnRails
[10:13:18] arBmind1: has joined #RubyOnRails
[10:13:45] matthias_: has joined #RubyOnRails
[10:14:26] alphaatom: has joined #RubyOnRails
[10:16:19] DanKnox_: has joined #RubyOnRails
[10:16:19] DanKnox: has joined #RubyOnRails
[10:16:22] pyemkey: has joined #RubyOnRails
[10:18:44] msyvich: has joined #RubyOnRails
[10:19:36] kknight: has joined #RubyOnRails
[10:20:26] jottr: has joined #RubyOnRails
[10:20:45] woo: has joined #RubyOnRails
[10:22:00] Terens: i am developing an app as a beginner
[10:22:13] Terens: I have currently 2 controllers that need authorization
[10:22:19] davout: has left #RubyOnRails: ("kthxbye")
[10:22:32] Terens: I use before_action.. where can I put the method for reusability ?
[10:23:35] pipework: Terens: module
[10:24:35] Devalo: has joined #RubyOnRails
[10:24:41] Terens: and I should include it at each controlla?
[10:25:02] pipework: somewhere in the inheritance chain, I'd htink
[10:25:52] srinidhi: has joined #RubyOnRails
[10:28:31] PedramT: has joined #RubyOnRails
[10:33:24] kmckelvi1: has joined #RubyOnRails
[10:35:51] ldnunes: has joined #RubyOnRails
[10:36:11] mikecmpbll: has joined #RubyOnRails
[10:36:24] quazimodo: has joined #RubyOnRails
[10:38:06] msyvich: has joined #RubyOnRails
[10:38:28] blackmesa: has joined #RubyOnRails
[10:40:35] msyvich: has joined #RubyOnRails
[10:41:09] stannard: has joined #RubyOnRails
[10:45:33] DoubleMalt: has joined #RubyOnRails
[10:45:33] baweaver: has joined #RubyOnRails
[10:50:23] jottr: has joined #RubyOnRails
[10:52:36] Terens: undefined method `type' for :string:Symbol
[10:52:42] Terens: request = Request.find(params['id'])
[10:54:39] rikkipitt: has joined #RubyOnRails
[10:55:24] Eswar: has joined #RubyOnRails
[10:55:54] msyvich: has joined #RubyOnRails
[10:56:46] dtordable: has joined #RubyOnRails
[10:58:35] htmldrum: has joined #RubyOnRails
[10:58:35] mices: (params[:id])
[10:59:04] srinidhi: has joined #RubyOnRails
[10:59:31] matthewd: Terens: gist the whole error please; the backtrace isn't just decoration
[10:59:58] matthewd: Terens: Request seems a brave choice of model name, incidentally.. though it *might* be okay?
[11:01:14] Terens: It is a model for users to make requests for something
[11:01:59] Tempesta: has joined #RubyOnRails
[11:02:07] Terens: you need application trace?
[11:02:32] lubekpl: has joined #RubyOnRails
[11:02:47] Terens: I call a method in before_action and there I get this error
[11:05:34] myntcake: has joined #RubyOnRails
[11:07:07] woo: has joined #RubyOnRails
[11:07:23] msyvich: has joined #RubyOnRails
[11:08:29] Terens: problem was in model
[11:13:13] artto: has joined #RubyOnRails
[11:13:24] msyvich: has joined #RubyOnRails
[11:13:37] alphaatom: has joined #RubyOnRails
[11:14:45] Xat`: has left #RubyOnRails: ()
[11:15:16] shanemcd: has joined #RubyOnRails
[11:20:39] artto: has joined #RubyOnRails
[11:20:53] kitsuneyo: has joined #RubyOnRails
[11:21:27] isieo: has joined #RubyOnRails
[11:22:58] djellemah_: has joined #RubyOnRails
[11:25:51] askhat: has joined #RubyOnRails
[11:29:09] bambanx: has joined #RubyOnRails
[11:29:13] bambanx: goo morning
[11:30:52] fernandomm: has joined #RubyOnRails
[11:33:19] msosa: has joined #RubyOnRails
[11:33:34] czerasz: has joined #RubyOnRails
[11:34:33] czerasz: how to test controller's after_filter with rspec when the controller has no action?
[11:36:35] czerasz: the after_filter is in the protected section
[11:41:17] Tempesta: has joined #RubyOnRails
[11:42:39] jottr: has joined #RubyOnRails
[11:44:48] djellemah_: has joined #RubyOnRails
[11:45:44] moeabdol2: has joined #RubyOnRails
[11:47:15] catphish: has joined #RubyOnRails
[11:47:26] renanoronfle: has joined #RubyOnRails
[11:48:04] catphish: i'm running into a bug where timestamps in mysql queries seem to be malformed, can anyone easily point me to the code in activerecord where timestamps are generated for mysql queries?
[11:48:10] renanoronfle: has joined #RubyOnRails
[11:48:19] rikkipitt: has joined #RubyOnRails
[11:48:21] PedramT: has joined #RubyOnRails
[11:49:27] renanoronfle: hi all, how can i transform a string admin/wallet_events to Admin::WalletEvents ???
[11:49:46] djellemah_: has joined #RubyOnRails
[11:50:05] barhum2013: has joined #RubyOnRails
[11:50:39] catphish: 2.3.0 :004 > "admin/wallet_events".classify
[11:50:39] catphish: => "Admin::WalletEvent"
[11:50:47] catphish: the latter probably shouldn't be pluralized
[11:51:32] renanoronfle: catphish, nice, thanks
[11:51:49] DanKnox: has joined #RubyOnRails
[11:51:59] DEA7TH: has joined #RubyOnRails
[11:54:03] blackmesa: has joined #RubyOnRails
[11:54:15] kmckelvi1: has joined #RubyOnRails
[11:54:23] celly: has joined #RubyOnRails
[11:55:18] DanKnox_: has joined #RubyOnRails
[11:57:33] bambanx: guys i am about to start using a web framework, can u help me with a few questions? i am into rails and django but stil not sure what pick
[11:59:08] tbuehlmann: hard to not cheer for rails in a rails channel, I think
[11:59:27] tbuehlmann: are you familiar with ruby? are you familiar with python?
[12:00:46] hcnewsom: has joined #RubyOnRails
[12:01:45] jottr: has joined #RubyOnRails
[12:02:55] speaking1ode: has joined #RubyOnRails
[12:03:19] bambanx: a little of both and liked both
[12:07:02] jsrn_: has joined #RubyOnRails
[12:10:35] JoshyJosh: has joined #RubyOnRails
[12:12:13] srinidhi: has joined #RubyOnRails
[12:12:53] Timberwo|f: has joined #RubyOnRails
[12:14:45] bronson: has joined #RubyOnRails
[12:15:46] JoshyJosh: Is anybody around?
[12:16:02] shanemcd: has joined #RubyOnRails
[12:16:29] matthewd: JoshyJosh: Yes
[12:16:32] Timberwo|f: has joined #RubyOnRails
[12:17:09] xrlabs: has joined #RubyOnRails
[12:17:18] JoshyJosh: Nice, registry succeded :]
[12:17:36] woo: has joined #RubyOnRails
[12:18:46] PedramT: has joined #RubyOnRails
[12:23:51] msyvich: has joined #RubyOnRails
[12:23:56] PedramT: has joined #RubyOnRails
[12:24:36] hamed_r: has joined #RubyOnRails
[12:25:00] hnanon: has joined #RubyOnRails
[12:25:23] hnanon: I have: <%= link_to "#{@job.company.jobs.size - 1} other active jobs from #{@job.company.name}", company_path(@job), class: "underline" %>
[12:25:41] hnanon: How can I pluralize "job?"
[12:26:31] hnanon: I know it's pluralize(@job.company.jobs.size, "job") but I'm not sure how to integrate that within the link_to anchor text.
[12:27:13] jottr: has joined #RubyOnRails
[12:27:35] artto: has joined #RubyOnRails
[12:27:45] kmckelvi1: has joined #RubyOnRails
[12:28:21] msyvich: has joined #RubyOnRails
[12:29:07] hcnewsom: has joined #RubyOnRails
[12:30:28] msyvich: has joined #RubyOnRails
[12:31:42] c0defeed: I am having trouble creating new records using a form and nested attributes. I have an Entity model that has_one Equipment model, and that Equipment has_many Rentals, but in the `new` action of the Entity controller (which is the controller generating the view) when I do @entity.equipment.rental = Rental.new I get a NoMethod error. What am I doing wrong?
[12:34:58] deur-: hnanon: in your case, just create another variable within that string, replacing "jobs" with your pluralize method of choice
[12:35:22] deur-: unless i misunderstood the question
[12:35:43] _sky: has joined #RubyOnRails
[12:36:12] deur-: it would probably be easier using the rails I18n api
[12:36:30] artto: has joined #RubyOnRails
[12:37:18] suchness: has joined #RubyOnRails
[12:38:12] _sky: Good day everyone!
[12:38:40] _sky: I have very strange problem, auditd is unable to capture files created by Carrierwave.
[12:39:01] _sky: Maybe someone is willing to help? I would appreciate it alot
[12:40:34] blackmesa: has joined #RubyOnRails
[12:41:52] adre: has joined #RubyOnRails
[12:42:18] sevenseacat: has joined #RubyOnRails
[12:49:16] matthias_: has joined #RubyOnRails
[12:49:54] adre: has joined #RubyOnRails
[12:52:25] jottr_: has joined #RubyOnRails
[12:53:53] Ropeney: has joined #RubyOnRails
[12:55:05] Devalo: has joined #RubyOnRails
[12:55:39] shanemcd: has joined #RubyOnRails
[12:56:04] PedramT_: has joined #RubyOnRails
[12:57:28] IFrank00: has joined #RubyOnRails
[12:58:39] godzillaenlacasa: has joined #RubyOnRails
[12:58:39] berserk_ren: has joined #RubyOnRails
[12:58:55] htmldrum: has joined #RubyOnRails
[12:59:05] rubyonrailed: has joined #RubyOnRails
[12:59:49] chipotle: has joined #RubyOnRails
[13:00:34] _sky: #Carrierwave
[13:02:01] rickmasta: has joined #RubyOnRails
[13:02:08] n1lo: has joined #RubyOnRails
[13:02:35] bahar: has joined #RubyOnRails
[13:06:33] _3by8: has joined #RubyOnRails
[13:09:52] sandstrom: has joined #RubyOnRails
[13:09:55] gingray: has joined #RubyOnRails
[13:11:38] Macaveli: has joined #RubyOnRails
[13:11:56] sandstrom: has joined #RubyOnRails
[13:12:19] jtong: has joined #RubyOnRails
[13:12:24] JakFrist: has joined #RubyOnRails
[13:12:29] DanKnox: has joined #RubyOnRails
[13:14:31] DanKnox_: has joined #RubyOnRails
[13:17:37] msyvich: has joined #RubyOnRails
[13:19:37] johnflux: has joined #RubyOnRails
[13:19:37] johnflux: has joined #RubyOnRails
[13:24:24] krz: has joined #RubyOnRails
[13:25:08] kitsuneyo: has joined #RubyOnRails
[13:26:37] xrlabs: has joined #RubyOnRails
[13:28:10] _3by8: Could an SMTP server be causing my app to error out? Like let's say the server tells the app it's sending mails too quickly and disallows mails to be sent temporarily, would that cause an error on the Rails side of things?
[13:29:25] pwnd_nsfw: You say cuasing your app to error out, does it output any errors for you to suggest this?
[13:30:08] arup_r: has joined #RubyOnRails
[13:30:34] arup_r: pwnd_nsfw: doing good, what about you
[13:30:42] pwnd_nsfw: Also doing well
[13:30:51] arup_r: nice nice..
[13:31:23] _3by8: pwnd_nsfw: yeah it displays a generic error page that my provider set up.
[13:31:31] _3by8: pwnd_nsfw: but nothing too revealing in the logs.
[13:31:34] pwnd_nsfw: Anyting in console?
[13:31:53] pwnd_nsfw: I mean, it's possible, but we don't have a lot to go on here
[13:32:04] fmcgeough: has joined #RubyOnRails
[13:33:16] _3by8: pwnd_nsfw: true, I'm going to check the logs agian.
[13:34:45] goodcodeguy: has joined #RubyOnRails
[13:35:18] _3by8: pwnd_nsfw: I wasn't looking very closely... check it out: Net::SMTPServerBusy (421 #HOSTNAME cmsmtp ESMTP server error (try again later)
[13:36:47] c0defeed: How can I set the html options for a select dropdown?
[13:37:22] c0defeed: Nevermind, figured it out
[13:37:37] c0defeed: Always the last thing you try ;p
[13:38:04] pwnd_nsfw: I mean, you could keep trying new things after you've figured it out
[13:39:01] c0defeed: I guess that's true
[13:39:41] c0defeed: It was just weird. Most of the Formbuilder stuff you can do 'class: "whatever"' as one of the parameters
[13:39:53] c0defeed: But for this one it had to be in a hash, and it had to be in a particular order
[13:40:09] pwnd_nsfw: The select tag is mad weird, yeah
[13:40:22] pwnd_nsfw: But it's also quite different in HTML as it is
[13:41:26] Jasaka: has joined #RubyOnRails
[13:42:20] durexlw: c0defeed: lol @ the 'Always the last thing you try ;p" :)
[13:43:32] xrlabs: has joined #RubyOnRails
[13:44:41] _3by8: Does anyone know if I can schedule emails to be sent out at an interval rather than all at once?
[13:46:02] pyemkey: has joined #RubyOnRails
[13:46:47] swhitt: has joined #RubyOnRails
[13:49:12] livcd: has joined #RubyOnRails
[13:49:32] catphish: has left #RubyOnRails: ("Leaving")
[13:51:24] _Tariq: has joined #RubyOnRails
[13:51:25] jottr: has joined #RubyOnRails
[13:52:00] Ropeney: has joined #RubyOnRails
[13:52:05] msyvich: has joined #RubyOnRails
[13:54:09] PedramT: has joined #RubyOnRails
[13:54:12] mrgreenfur: has joined #RubyOnRails
[13:57:31] ewnd9: has joined #RubyOnRails
[13:58:48] ziyadb: has joined #RubyOnRails
[13:59:11] sankaber: has joined #RubyOnRails
[13:59:52] ramortegui: has joined #RubyOnRails
[14:01:06] IFrank00: Hello good day
[14:05:18] sankaber: has joined #RubyOnRails
[14:05:33] roshanavand: has joined #RubyOnRails
[14:08:11] artto: has joined #RubyOnRails
[14:09:11] LudicrousMango: has joined #RubyOnRails
[14:11:39] Ergo^: has joined #RubyOnRails
[14:12:42] DanKnox: has joined #RubyOnRails
[14:12:44] DanKnox_: has joined #RubyOnRails
[14:13:19] Technodrome: has joined #RubyOnRails
[14:14:01] joeytwiddle: has joined #RubyOnRails
[14:14:55] IFrank00: rhizome, the solution was super easy I use group: t.group.try(:name) and it runs great
[14:16:07] Scient: .try() is usually a code smell
[14:17:05] bronson: has joined #RubyOnRails
[14:17:34] xrlabs: has joined #RubyOnRails
[14:17:52] viiralvx: has joined #RubyOnRails
[14:19:11] IFrank00: Scient, got a better way pls
[14:20:34] Devalo: has joined #RubyOnRails
[14:20:35] Scient: yes, refactor your code in a way that would not require .try()
[14:20:40] blackmesa: has joined #RubyOnRails
[14:20:47] IFrank00: Scient, my problem is I have a Task.map{ |t| t.group.name} but some task my not have a group.
[14:21:40] IFrank00: Scient, if a group_id in the task is nil I get a 'name' NilClass
[14:21:55] roshanavand: has joined #RubyOnRails
[14:22:12] sergey_makagon: has joined #RubyOnRails
[14:22:23] roshanavand: has joined #RubyOnRails
[14:22:33] Dbugger: has joined #RubyOnRails
[14:22:36] Dbugger: Hello everyone
[14:23:50] alphaatom: has joined #RubyOnRails
[14:24:02] arup_r: has joined #RubyOnRails
[14:24:09] IFrank00: Scient, https://gist.github.com/Frank004/27008c9342abb937bca4
[14:24:41] Dbugger: Can someone maybe tell me how I can do, so that when a rails route is called, I fire up a script?
[14:24:52] Scient: why would you even use .select {} there
[14:24:56] Dbugger: i meant a "non-rails-related script"
[14:24:57] Scient: write queries for filtering
[14:25:00] Scient: dont do it in ruby
[14:25:28] Scient: and why use map{} like that to collect only some attributes.... why not return actual records and use those
[14:28:28] acovrig: has joined #RubyOnRails
[14:28:33] lipoqil: has joined #RubyOnRails
[14:29:48] acovrig: Can (if so, how) I change the root, my assets are linking to /assets/*; can I set the app root to be /asdf/* (because of a proxy) so assets would link at /asdf/assets/* and a route ‘/abc’ would be ‘/asdf/abc’?
[14:32:06] Rodya_: has joined #RubyOnRails
[14:32:27] pwnd_nsfw: acovrig, config.assets.prefix = "/dev-assets"
[14:32:41] pwnd_nsfw: acovrig, config.assets.prefix = "/asdf"
[14:32:48] drbayer: has joined #RubyOnRails
[14:32:55] pwnd_nsfw: acovrig, http://guides.rubyonrails.org/asset_pipeline.html look at 4.2
[14:32:57] acovrig: then route ‘/asdf/abc’, to: ‘abc#index’?
[14:33:11] pwnd_nsfw: that's separate
[14:33:36] acovrig: right, I need both?
[14:33:46] akshat: has joined #RubyOnRails
[14:33:54] pwnd_nsfw: idk what this abc asdf nonsense really means though
[14:33:55] acovrig: wouldn’t the config.assets just do the asset pipeline?
[14:34:01] acovrig: placeholders
[14:35:01] nettoweb: has joined #RubyOnRails
[14:35:03] IFrank00: Scient, can you comment your approach to this as im learn by practice and exploring. Will love to see what you are pointing wrong with the right way so im not in the same place as I started if you can. thank you
[14:36:05] Ropeney: has joined #RubyOnRails
[14:37:13] MaDErroR123: has joined #RubyOnRails
[14:40:41] pyemkey: has joined #RubyOnRails
[14:40:46] Dbugger: Does anyone here has experience with Crono?
[14:40:50] xrlabs: has joined #RubyOnRails
[14:42:45] Ergo^: has joined #RubyOnRails
[14:43:25] Mia: has joined #RubyOnRails
[14:43:25] Mia: has joined #RubyOnRails
[14:44:45] PedramT: has joined #RubyOnRails
[14:44:55] Axy: has joined #RubyOnRails
[14:44:55] Axy: has joined #RubyOnRails
[14:45:33] lacrymology: has joined #RubyOnRails
[14:46:00] DanKnox_: has joined #RubyOnRails
[14:46:01] DanKnox: has joined #RubyOnRails
[14:47:34] matthias_: has joined #RubyOnRails
[14:48:01] AlexJakeGreen: has joined #RubyOnRails
[14:48:38] myntcake: has joined #RubyOnRails
[14:49:13] arup_r: has joined #RubyOnRails
[14:49:22] Scient: IFrank00: everything you are doing in your select block can and should be done with actual query conditions
[14:49:31] Scient: im assuming you know how to do those? .where() etc
[14:49:47] IFrank00: Scient, yes :)
[14:51:17] jtong: has joined #RubyOnRails
[14:52:37] acovrig: has joined #RubyOnRails
[14:52:54] IFrank00: Scient, I like to know a solution when im doing some type of {} from records and a record association is nil. as the other part I was only exploring around and not a pattern that I use. for the select part i have scopes on my model
[14:53:54] shanemcd: has joined #RubyOnRails
[14:54:12] artto: has joined #RubyOnRails
[14:54:46] herminiotorres: has joined #RubyOnRails
[14:58:32] msyvich: has joined #RubyOnRails
[15:02:39] diego2: has joined #RubyOnRails
[15:04:53] FCser: has joined #RubyOnRails
[15:08:11] DanKnox_: has joined #RubyOnRails
[15:08:11] DanKnox: has joined #RubyOnRails
[15:11:14] chouhoulis: has joined #RubyOnRails
[15:11:34] emachnic: has joined #RubyOnRails
[15:12:50] celly: has joined #RubyOnRails
[15:13:14] stannard: has joined #RubyOnRails
[15:14:04] DmitryBochkarev: has joined #RubyOnRails
[15:14:35] polishdub: has joined #RubyOnRails
[15:15:15] hcnewsom: has joined #RubyOnRails
[15:16:07] acovrig: sorry for the delay, I went AFK; I guess a better way of asking my question: I am proxying my app via nginx mapping /asdf to rail’s /; the assets are pointing to /assets instead of /asdf/assets and links in a scaffold is linking to /controller instead of /asdf/controller; would sssets.prefix do both or are they different issues?
[15:17:09] fryguy: acovrig: http://stackoverflow.com/questions/4707896/prefix-urls-in-rails-application
[15:17:37] schuc: has joined #RubyOnRails
[15:18:39] rafaelfr_: has joined #RubyOnRails
[15:21:07] hamed_r: has joined #RubyOnRails
[15:22:04] Devalo: has joined #RubyOnRails
[15:22:46] w0rd-driven: has joined #RubyOnRails
[15:25:25] herminiotorres: has joined #RubyOnRails
[15:25:50] xploshioon: has joined #RubyOnRails
[15:27:14] yatish27: has joined #RubyOnRails
[15:27:36] arup_r: ok, no worries.. I am here now. :)
[15:28:09] mary5030: has joined #RubyOnRails
[15:29:25] godzillaenlacasa: has joined #RubyOnRails
[15:30:08] allcentury: has joined #RubyOnRails
[15:30:09] xploshioon: hi guys, i have a nested form,and the problem is that when i load the edit, the fields of the other model isn't loaded
[15:30:25] bruce__lee: has joined #RubyOnRails
[15:30:33] xploshioon: anyone have an example of create and update with a nested form?
[15:30:39] Macaveli: has joined #RubyOnRails
[15:30:52] xploshioon: reusing the form from a partial
[15:31:16] adavia: has joined #RubyOnRails
[15:32:57] renanoronfle: hi, i need to create a gem and in this gem i need create new controller callback to run before actions will determinate, how can i make this, or i should use before_action?
[15:33:07] zackzorman: has joined #RubyOnRails
[15:35:13] arup_r: xploshioon: I can help you, if you share the code as a gist
[15:35:34] arup_r: add the form, controller actions from where you are rendering the form..
[15:38:03] mdw: has joined #RubyOnRails
[15:38:21] xploshioon: @arup_r https://gist.github.com/xploshioOn/1591bb19c9242a3f8bb3
[15:38:25] dopamean1: has joined #RubyOnRails
[15:38:44] xploshioon: the thing is that i want to reuse the same form in create and update
[15:38:50] xploshioon: the create works nice
[15:39:10] xploshioon: but when i go to edit, the fields of user aren't loaded in the form
[15:39:49] arup_r: xploshioon: can you show the user form also please ?
[15:40:10] xploshioon: the last file
[15:42:02] arup_r: xploshioon: <%= f.semantic_fields_for :user do |user| %> <~ write like
[15:42:30] arup_r: xploshioon: you also must need to have accept_nested_attributes_for in the model
[15:42:47] arup_r: in the parent model**
[15:43:28] platzhirsch: has joined #RubyOnRails
[15:43:59] platzhirsch: Is there a more idiomatic or expressive way of writing if current_time.to_i % time_span == 0 ...
[15:45:12] dopamean1: has joined #RubyOnRails
[15:45:20] arup_r: (current_time.to_i % time_span).zero?
[15:45:21] FooMunki: has joined #RubyOnRails
[15:45:29] platzhirsch: yeah, thought of that, too
[15:45:31] platzhirsch: still looks shit
[15:45:58] platzhirsch: ah I know. Trick #326: Create your own method
[15:46:11] arup_r: what is #326 ?
[15:46:19] NeoHamled: has joined #RubyOnRails
[15:46:22] platzhirsch: The number of the trick
[15:46:29] defsdoor: unless current_time.to_i % time_splan .....
[15:46:38] platzhirsch: what does it do anyway
[15:46:48] platzhirsch: defsdoor: that's shorter but more confsuing
[15:47:07] arup_r: platzhirsch: #326 will be awesome..
[15:47:08] platzhirsch: It checks whether the time is ... what's the verb, on full clock with whatever time_span is
[15:47:18] platzhirsch: 10.minutes, 1.hour, etc.
[15:47:22] defsdoor: a multiple of
[15:47:46] corioliss: has joined #RubyOnRails
[15:47:56] msyvich: has joined #RubyOnRails
[15:48:20] platzhirsch: if is_multiple_of(current_time, time_span)
[15:48:31] platzhirsch: yeah I guess that's pretty spot on, still technical
[15:48:52] xploshioon: arup_r the seems to work in the update but now in the new the form isn't rendered
[15:48:52] platzhirsch: rather multiple_of?
[15:48:52] defsdoor: extend time class to include multiple_of? method
[15:49:09] platzhirsch: I thought monkey patching is for witches
[15:49:12] arup_r: xploshioon: ok there is a trick
[15:49:16] platzhirsch: And witches get burned
[15:49:39] arup_r: can you add the code you have in the new action? I will then amend my idea there
[15:49:40] defsdoor: you're using rails
[15:49:55] defsdoor: it's already monkey patched the heck out of ruby
[15:50:28] guilundgren: has joined #RubyOnRails
[15:50:31] yardenbar: has joined #RubyOnRails
[15:50:45] guilundgren: hey! good morning everyone
[15:51:03] guilundgren: one simple question, im trying to submit a remote form via jquery
[15:51:20] guilundgren: but the response format returning is html, not js
[15:51:36] guilundgren: someone knows why can i be doing wrogn?
[15:51:42] Devalo: has joined #RubyOnRails
[15:51:47] defsdoor: you need a header
[15:51:50] defsdoor: or request .js
[15:52:15] guilundgren: im justing $('form').submit()
[15:52:23] guilundgren: just* doing this:
[15:52:36] guilundgren: i thought it should work
[15:53:06] deur-: you submit the form to a location that returns HTML
[15:53:22] guilundgren: the form is remote: true
[15:53:28] defsdoor: add remote: true to the form
[15:53:33] guilundgren: i did it already
[15:53:38] defsdoor: and trigger('submit.rails')
[15:53:46] guilundgren: let me try it
[15:54:00] defsdoor: $('form.myform').trigger('submit.rails');
[15:54:04] xploshioon: @arup_r I make the build in the new, that was the trick
[15:54:08] xploshioon: @arup_r thanks
[15:54:18] arup_r: xploshioon: yes that is the trick.
[15:54:39] deur-: guilundgren: http://edgeguides.rubyonrails.org/working_with_javascript_in_rails.html#server-side-concerns
[15:55:28] guilundgren: deur- thanks, in general i know how to do it, i mean... action.js.erb, etc
[15:55:45] guilundgren: but this thing specifically doesnt seems to owrk
[15:55:51] guilundgren: submit a remote form
[15:56:04] guilundgren: programatically
[15:56:13] deur-: i'm guessing your action does not respond to the JS format
[15:56:19] guilundgren: by the way defsdoor, did not work
[15:56:20] arup_r: guilundgren: show the code Jquery and the form
[15:56:25] deur-: hence returning html regardless of your remote: true
[15:56:41] guilundgren: deur- let me add the respond_to block
[15:58:06] defsdoor: didnt submit or didnt render js reponse ?
[16:00:30] guilundgren: the error is missing template
[16:00:48] guilundgren: but the form is remote: true
[16:00:54] defsdoor: does the logs show the request asking for JS or HTML ?
[16:01:16] DanKnox_: has joined #RubyOnRails
[16:01:16] DanKnox: has joined #RubyOnRails
[16:01:19] guilundgren: Started POST "/salva_metas" for 127.0.0.1 at 2016-02-18 14:00:06 -0200
[16:01:19] guilundgren: Processing by CourseController#salva_metas as HTML
[16:01:36] defsdoor: its not a ajax request then
[16:01:38] guilundgren: html, right? i believe its not
[16:01:42] defsdoor: gist your code
[16:01:56] guilundgren: thats the thing, why cant i submit the form
[16:03:41] defsdoor: $('#myform').trigger('submit.rails'); works for me - I've just verified it in console
[16:04:00] guilundgren: here: https://gist.github.com/glundgren/aa848c13e3a35312f40a
[16:04:16] msyvich: has joined #RubyOnRails
[16:04:19] guilundgren: its MESSY because im woring on it
[16:04:37] smathy: has joined #RubyOnRails
[16:04:38] defsdoor: show rendered html of the form tag
[16:05:15] defsdoor: should have data-remote="true" on it
[16:05:21] guilundgren: updated the gist
[16:05:38] guilundgren: data-remote="true" method="post"
[16:05:45] defsdoor: that looks fine
[16:05:53] guilundgren: it works fine if i add the submit button
[16:05:56] defsdoor: it's identical to mine
[16:06:08] guilundgren: but theres one thing
[16:06:13] guilundgren: im trying to submit a bunch of forms
[16:06:28] guilundgren: so it might be this
[16:06:29] nogic: has joined #RubyOnRails
[16:06:32] defsdoor: you can only submit one form
[16:06:37] Flipez: has left #RubyOnRails: ("Leaving")
[16:07:54] PlasmaStar: has joined #RubyOnRails
[16:08:42] MaDErroR123: has joined #RubyOnRails
[16:08:54] Rodya_: has joined #RubyOnRails
[16:09:12] guilundgren: defsdorr, thank you very much for the valuable insights
[16:09:21] dretnx: has joined #RubyOnRails
[16:09:21] flashpoint9: has joined #RubyOnRails
[16:11:22] defsdoor: has joined #RubyOnRails
[16:11:48] defsdoor: http://stackoverflow.com/questions/8563299/submit-multiple-forms-with-one-submit-button
[16:12:22] defsdoor: i doubt you want to do that
[16:14:27] ruurd: has joined #RubyOnRails
[16:15:27] ss_much: has joined #RubyOnRails
[16:16:07] msyvich: has joined #RubyOnRails
[16:19:09] kmckelvin: has joined #RubyOnRails
[16:19:58] xrlabs: has joined #RubyOnRails
[16:22:33] techsethi: has joined #RubyOnRails
[16:22:36] disgrntld: has joined #RubyOnRails
[16:22:43] acovrig: has joined #RubyOnRails
[16:23:57] reckoner: has joined #RubyOnRails
[16:25:25] reckoner: what's up guys.
[16:26:08] acovrig: I'm still having issues with routes, pages load fine (including assets), but links on a scaffolded page doesn't account for the proxy
[16:28:22] triptec: has joined #RubyOnRails
[16:28:31] rickmasta: has joined #RubyOnRails
[16:29:00] mustmodify: has joined #RubyOnRails
[16:29:34] rickmasta: has joined #RubyOnRails
[16:29:46] thebastl: has joined #RubyOnRails
[16:30:05] kitsuneyo: has joined #RubyOnRails
[16:32:17] aegis3121: has joined #RubyOnRails
[16:33:30] viiralvx: has joined #RubyOnRails
[16:34:24] mustmodify: ok Rails geeks and geekets, I have an important REST question. I have an appointment confirmations controller/resource. It is used by employees and customers to ... obviously ... confirm appointments ( and "unconfirm" or delete appointment confirmations ). I am setting up an automated phone calls to do some confirmations.
[16:34:25] mustmodify: The parameters that come in will be dictated by the VOIP provider not by me. and of course the workflow is slightly different... users who POST to /appointments/21/confirmation ARE confirming, whereas this API will send in a 1 for 'yes I confirm' vs a 2 for "no that won't work for me". Nothing we can't handle in a controller, but slightly off. So the question is this: Should I put this in the same controller, with a method that does some magic with
[16:35:18] mustmodify: I dislike the idea of having two resources / controllers for the "same thing." But at this point the question becomes "at what point are they not the same thing."
[16:35:58] korzybski: has joined #RubyOnRails
[16:37:18] mustmodify: both would create confirmations. the workflow isn't so different that it's clearly not the same resource. It's the extra logic for "does this or does it not create a new resource" that would complicate an already non-trivial controller (because of multiple authentication methods for users vs non-users) that sort of has me unsure.
[16:37:39] sbarg: has joined #RubyOnRails
[16:37:47] mustmodify: Radar: You seem intelligent; I would appreciate your input.
[16:38:30] acovrig: has joined #RubyOnRails
[16:39:03] sbarg: has left #RubyOnRails: ()
[16:39:10] godzillaenlacasa: I'm trying to post data to my server using HTTPMultiParty, but getting this error: the scheme http does not accept registry part: :80 (or bad hostname?)
[16:39:15] kdough: has joined #RubyOnRails
[16:39:32] godzillaenlacasa: my base_uri = "localhost:3000" so why is it complaining about port 80?
[16:39:44] mustmodify: godzillaenlacasa: code please
[16:41:11] acovrig: OK, now that I’m back *sigh* My proxy is routing /asdf to / in RAILS; I have config.action_controller.relative_url_root = ‘/asdf’ in config/application.rb so assets work, but links in scaffolds link to domain.com/controller instead of domain.com/asdf/controller
[16:41:29] acovrig: I tried scope ‘/asdf’ { resources :controller } but that gives me 404s
[16:43:04] tildes: has joined #RubyOnRails
[16:43:47] NeoHamled: has joined #RubyOnRails
[16:44:16] godzillaenlacasa: @mustmodify https://gist.github.com/godzilla74/5052a1a25036ec343a03
[16:45:46] chouhoulis: has joined #RubyOnRails
[16:46:19] rakm: has joined #RubyOnRails
[16:47:22] sandstrom: has joined #RubyOnRails
[16:49:22] Rodya_: has joined #RubyOnRails
[16:49:28] godzillaenlacasa: @mustmodify ah, got it... the = was causing the issue
[16:49:59] mustmodify: ok I was just trying to reproduce. Good spot.
[16:51:52] sandstrom: has joined #RubyOnRails
[16:52:08] efy: has joined #RubyOnRails
[16:52:59] Maletor: has joined #RubyOnRails
[16:55:26] arup_r: has joined #RubyOnRails
[16:55:45] blackmesa: has joined #RubyOnRails
[16:57:51] sleungcy: has joined #RubyOnRails
[17:01:23] lacrymology: has joined #RubyOnRails
[17:02:25] c0defeed: If I switch my controller to use strong parameters can I get rid of all of these "attr accessible" statements in my model?
[17:02:34] arthropododo: has joined #RubyOnRails
[17:02:35] triptec: has joined #RubyOnRails
[17:04:27] fedexo: has joined #RubyOnRails
[17:04:28] tbuehlmann: c0defeed, that's what you're after, yes
[17:04:40] c0defeed: tbuehlmann, great, thank you
[17:04:44] seaworthy: has left #RubyOnRails: ()
[17:04:45] Rodya_: has joined #RubyOnRails
[17:04:51] msosa: has joined #RubyOnRails
[17:06:36] Macaveli: has joined #RubyOnRails
[17:07:00] xrlabs: has joined #RubyOnRails
[17:07:28] c0defeed: What is the difference between doing <%= form_for @entity ... %> and <%= form_for :entity ... %> ?
[17:08:32] pyemkey: has joined #RubyOnRails
[17:10:30] tbuehlmann: have a look at this: http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-form_for
[17:10:33] rakm: has joined #RubyOnRails
[17:11:59] woo: has joined #RubyOnRails
[17:12:27] c0defeed: thanks again
[17:13:00] dionysus69: has joined #RubyOnRails
[17:13:32] B1n4r10: has joined #RubyOnRails
[17:13:41] drbayer: has joined #RubyOnRails
[17:14:47] rogue_koder: has joined #RubyOnRails
[17:16:37] Pazician: has joined #RubyOnRails
[17:18:34] stannard_: has joined #RubyOnRails
[17:23:18] arup_r1: has joined #RubyOnRails
[17:24:01] jottr: has joined #RubyOnRails
[17:25:02] rakm: has joined #RubyOnRails
[17:27:19] xrlabs: has joined #RubyOnRails
[17:27:23] tweeeaks: has joined #RubyOnRails
[17:27:55] kirillzh: has joined #RubyOnRails
[17:29:14] Maletor: has joined #RubyOnRails
[17:30:49] RegulationD: has joined #RubyOnRails
[17:31:23] Maletor: has joined #RubyOnRails
[17:32:52] slash_nick: mustmodify: radar is intelligent... but he also lives where the sun is not currently shining and is likely sleeping. maybe he'll reply after a while :)
[17:33:03] DanKnox: has joined #RubyOnRails
[17:33:04] DanKnox_: has joined #RubyOnRails
[17:33:29] sillypog: has joined #RubyOnRails
[17:34:03] tubbo: i'm 99% sure radar is not intelligent.
[17:34:12] tubbo: if he was, he'd be awake right now
[17:34:16] tubbo: because successful people wake up early
[17:34:22] tubbo: </internet-tough-guy>
[17:34:39] slash_nick: tubbo: but the clock is circular... at some point early becomes late becomes early
[17:34:40] IFrank00: has joined #RubyOnRails
[17:34:58] tubbo: slash_nick: it's not my fault he doesn't live in God's country
[17:35:21] lubekpl: has joined #RubyOnRails
[17:35:35] slash_nick: tubbo: can you see him? http://himawari8.nict.go.jp/
[17:35:39] Hans267: has joined #RubyOnRails
[17:36:09] mustmodify: Well anyone who wants to weigh in on my one-vs-two resources issue is welcome.
[17:36:53] baweaver: has joined #RubyOnRails
[17:37:36] dsimon: mustmodify, i mean, there are two ways to approach it that make sense to me
[17:38:35] dsimon: 1. the fact that the controller is non-trivial is a smell; factor all the complicated stuff out of the controller into concerns or stuff in lib/, then have just one controller that's still pretty easy to read and topic specific
[17:39:40] stannard: has joined #RubyOnRails
[17:40:23] dsimon: 2. don't worry too much about single-noun-focus on your controllers; controllers are about resources, but REST resources are almost but not quite an OO thing, and if you must choose it's better if they create a sensible external API than that they sensibly represent your internal models
[17:40:41] mustmodify: dsimon: Well, my non-trivial may not be your non-trivial. I just have more than one authentication strategy.
[17:40:42] Rodya_: has joined #RubyOnRails
[17:41:10] dsimon: as in, more than one way to say "the acting user is X"?
[17:41:16] dsimon: er, s/say/determine/
[17:41:21] RegulationD: has joined #RubyOnRails
[17:41:42] flashpoint9: has joined #RubyOnRails
[17:41:53] VeryBewitching: has joined #RubyOnRails
[17:41:54] mustmodify: as in, "if this is a normal user, and they have permission, go ahead. If not, if they have passed in a token specific to this appointment, then go ahead."
[17:42:06] mustmodify: I guess that's authorization and authentication.
[17:42:29] dsimon: i run into that situation all the time too, esp. with things like email links with single-use codes
[17:42:39] mustmodify: dshoreman: So it's not "fat" per se, just ... non-trivial. non-generic-what-you-would-do-for-the-easiest-instance.
[17:42:40] dsimon: seems like there ought to be a good name for it
[17:42:53] korzybski: has joined #RubyOnRails
[17:43:06] mustmodify: well, single-use-token auth is pretty good. :)
[17:43:09] GeorgesLeYeti: has joined #RubyOnRails
[17:43:20] dsimon: mustmodify, yah, but is that -entication or -orization? :-)
[17:43:25] dsimon: cause it's kind of both
[17:43:38] mustmodify: yes, it's both.
[17:43:55] mustmodify: right, auth is a shortcut for "both". :)
[17:44:11] mustmodify: well actually
[17:44:20] dsimon: authentorization, authentorication
[17:44:22] mustmodify: single-use-token doesn't identify a user.
[17:44:28] GeorgesLeYeti: Do you know any good website where i can learn how to well structurt my database
[17:44:32] mustmodify: it's just about authorization
[17:45:04] dsimon: well, if it's something like a post-registration token it does identify a user
[17:45:13] dsimon: but yeah, there are many cases where it's not
[17:45:14] mustmodify: This request is authorized to do whatever; They may not be a user. May be a user who would otherwise not be allowed." etc.
[17:45:18] Jasaka: has joined #RubyOnRails
[17:45:22] mustmodify: sure, that's true.
[17:45:31] mustmodify: Either way, both are controller concerns.
[17:45:36] Guest33237: has left #RubyOnRails: ()
[17:45:47] mustmodify: I guess that word is reserved.
[17:46:01] mustmodify: both belong in the controller.
[17:46:01] dsimon: but i think it's appropriate in its reserved context here too :-)
[17:46:16] ruurd: has joined #RubyOnRails
[17:46:29] smathy: GeorgesLeYeti, there are decades of DB design theory out there with a plethora of different, often conflicting, ideas. You'll struggle to find any definitive winner. Best to just learn from your own mistakes.
[17:46:44] kmckelvin: has joined #RubyOnRails
[17:46:50] dsimon: GeorgesLeYeti, you're using some kind of SQL?
[17:47:14] GeorgesLeYeti: I'm using postgresql
[17:47:35] dsimon: and you want to learn how to make well-designed tables to represent your data?
[17:47:36] goodcodeguy: has joined #RubyOnRails
[17:48:06] GeorgesLeYeti: smathy, ok but even though if no one give me a bettre way to design it. I'll still make these mistake.
[17:48:58] dsimon: well, i googled around a little and this looks alright: http://en.tekstenuitleg.net/articles/software/database-design-tutorial/database-characteristics.html
[17:49:11] dsimon: it's part 3 of a multi-part thing, the first two parts seem to just be historical stuff
[17:49:22] lubekpl: has joined #RubyOnRails
[17:49:38] _djbkd: has joined #RubyOnRails
[17:49:39] dsimon: i got that link from this SO answer which has other stuff you may find relevant: http://stackoverflow.com/questions/377375/a-beginners-guide-to-sql-database-design
[17:50:05] GeorgesLeYeti: For example, I have right now I have User table and UserRule table. And I think making a User UserRule and Rule should be better.
[17:50:12] GeorgesLeYeti: dsimon, ty a lot
[17:50:32] dsimon: we can talk a little about that situation too
[17:50:50] jeffleeismyhero: has joined #RubyOnRails
[17:51:28] dsimon: should you have a separate Rule model and just have UserRule be a simple link between Users and Rules? the answer depends on if Rules need to be considered independently
[17:52:11] dsimon: if you need to be able to "create a new Rule" or "list all the known Rules" or "adjust Rule X so that it's slightly different now but still associated with all the same users", for example, then it should be its own table
[17:52:31] GeorgesLeYeti: dsimon, actualy my application kind of evoled a bit through time. So now rules need to be considered independently
[17:52:43] dsimon: yah, that happens a lot with real life databases :-)
[17:53:21] dsimon: what you're doing now then, to go from UserRule to UserRule->Rule, is called "normalizing"
[17:53:51] dsimon: you'll probably learn more about that in those links, but to summarize real briefly: you normalize to get rid of repetition
[17:54:05] dsimon: before, you probably had a bunch of UserRule rows which all had the same value for "ruletype" or some field like that
[17:54:05] goodcodeguy: has joined #RubyOnRails
[17:54:13] kitsuneyo: has joined #RubyOnRails
[17:54:28] dsimon: when you see the same value being repeated over and over, that's a sign that maybe that value should actually be its own table, and be referenced with an association
[17:54:55] Rodya_: has joined #RubyOnRails
[17:54:58] GeorgesLeYeti: dsimon, :D This is exactly what happen.
[17:55:40] dsimon: normalizing isn't always a good idea, but in many cases it makes things make more sense and can reduce the number of situations where you have to change the same value in a bunch of different places at the same time
[17:55:47] blackmesa: has joined #RubyOnRails
[17:56:11] Scriptonaut: has joined #RubyOnRails
[17:56:21] dsimon: otoh, normalizing makes things more complicated, because now you have more tables and more associations, and changes can now have more indirect effects on other parts of your app
[17:56:26] dsimon: so it's a tradeoff
[17:56:47] Oliphaunte: has joined #RubyOnRails
[17:58:08] sleungcy: has joined #RubyOnRails
[17:58:38] Scriptonaut: I'm having a very odd problem. I have a table called: "listings_people". The model is called "ListingPerson" though. I have a model Listing. When I try to do this query, it says: PG::UndefinedTable "listings_people". This is the query: Listing.includes(:listing_people).where("listings_people.external = false"). However, it works when I don't use straight sql like this: Listing.includes(:listing_pe
[17:58:44] Scriptonaut: ople).where(listings_people: { external: false })
[17:58:59] Scriptonaut: anyone have an idea why it says the table doesn't exist, when it does? I checked in psql and the table is there
[17:59:13] Scriptonaut: and why does it work when I use the activerecord syntax, but not when I pass it straight SQL
[17:59:42] kmckelvi1: has joined #RubyOnRails
[17:59:47] dsimon: Scriptonaut, is the undefined table error about "listings_people" or "listing_people"?
[17:59:53] smathy: Scriptonaut, sounds like your table isn't called listings_people
[17:59:55] Scriptonaut: listings_people
[18:00:05] Scriptonaut: I'll paste my schema
[18:00:09] dsimon: gist please
[18:00:12] dsimon: or pastebin
[18:00:46] Scriptonaut: https://gist.github.com/anonymous/79cd7c060281f7680f47
[18:01:04] benlieb: has joined #RubyOnRails
[18:01:29] Scriptonaut: here is what happens when I run the query: https://gist.github.com/anonymous/9e115138e1551de29e53
[18:01:40] dsimon: can you also show the line defining the association `listing_people` on Listing?
[18:02:11] Scriptonaut: the line is just: has_many :listing_people
[18:02:32] dsimon: hm, ok, i guess that's enough for it to find ListingPerson or it would be complaining about that
[18:02:38] dsimon: does ListingPerson.all work?
[18:03:18] dsimon: oh, wait, hm
[18:03:23] dsimon: the query it's generating has no join at all
[18:03:32] dsimon: oh, cause it's an include
[18:03:37] mhoungbo: has joined #RubyOnRails
[18:04:04] dsimon: huh, but that should work...
[18:04:15] smathy: Scriptonaut, oh right, so either change your `includes` to a `joins`, or add `references` so it does an outer join.
[18:04:53] gingray: has joined #RubyOnRails
[18:05:13] acovrig: has joined #RubyOnRails
[18:05:36] Scriptonaut: smathy: why doesn't it work as it is?
[18:05:45] dsimon: yeah, i have the same question
[18:05:53] dsimon: seems like it should work based on similar examples in the docs
[18:05:55] Scriptonaut: it works when I use the rails syntax
[18:06:12] dsimon: oh, like where(x: y)?
[18:06:16] Scriptonaut: Listing.includes(:listing_people).where(listings_people: { external: true})
[18:06:18] smathy: Scriptonaut, because the where clause is a string Rails can't work out that your query references a column in the `listings_people` table, so it does the normal `includes` which is two queries rather than an outer join.
[18:06:34] smathy: Scriptonaut, you need to tell Rails that you're referencing the column in the other table.
[18:06:48] Scriptonaut: but I do, I go: listings_people.external
[18:07:09] smathy: Scriptonaut, huh? That's in a string: "listings_people.external = false"
[18:07:26] JoshL: Does `touch: true` on associations cascade? If I have a Widget that belongs to a Factory that belongs to a Company, and the Widget and Factory both have touch, then will saving a Widget also touch Company?
[18:07:26] smathy: ...Rails doesn't parse your strings to see if they refer to tables.
[18:07:51] smathy: Scriptonaut, actually, this is a plain `=` so you could do it in non-string, like: where( listings_people: { external: false } )
[18:07:52] Scriptonaut: Ok. This doesn't make sense. I'm passing a perfectly valid snippet of SQL
[18:07:53] tubbo: JoshL: that's a good question.
[18:07:57] smathy: ...that should create an outer join.
[18:08:14] tubbo: JoshL: i don't know it, but to find out you could write a test that runs `model.touch` and then checks if updated_at was changed on the reloaded sub-relation
[18:08:16] Scriptonaut: ya smathy, I was using that to test it, I have a much more complicated query where I need to use OR clauses
[18:08:18] JoshL: tubbo: thanks, I am very proud of it
[18:08:31] Scriptonaut: if there's a way to do OR clauses in rails, I would do it that way
[18:08:43] pawnbox: has joined #RubyOnRails
[18:09:05] smathy: Scriptonaut, what doesn't make sense? An `includes` does not, by default, do a join. It does two queries.
[18:09:33] Scriptonaut: I'm confused, while using an includes, why does the rails syntax work, bu twhen I do "listings_people.external = false" not work
[18:09:35] smathy: Scriptonaut, hence the need for `references` if you're referencing another table in your string.
[18:09:44] Scriptonaut: what's a reference?
[18:09:53] Scriptonaut: isn't "listings_people" a reference?
[18:09:58] Scriptonaut: it's telling it what table I want
[18:10:08] smathy: Scriptonaut, yes, you're referencing a foreign table in your query.
[18:10:24] smathy: Scriptonaut, let's take a step back and let me explain this to you.
[18:10:34] mustmodify: has left #RubyOnRails: ()
[18:10:46] smathy: Scriptonaut, you understand that this won't work, right: Listing.all.where( "people.name = 'abc'")
[18:10:56] Scriptonaut: Yes, because all is an array
[18:11:20] GeorgesLeYeti: ty a lot dsimon
[18:11:24] smathy: Scriptonaut, heh, no it's not, and that's not why it won't work.
[18:11:43] Scriptonaut: hmm, why wouldn't it work
[18:11:44] tubbo: JoshL: https://gist.github.com/tubbo/616f99b36e9936aa49b2
[18:11:48] smathy: Scriptonaut, ok, let's drop to SQL, you understand that this won't work right? -> SELECT * FROM listings WHERE people.name = 'abc'
[18:11:51] Scriptonaut: because people isn't included in the select?
[18:11:57] smathy: Scriptonaut, right.
[18:12:05] JoshL: tubbo: thanks!
[18:12:24] smathy: Scriptonaut, the `people` table has nothing to do with the SQL, so you can't just specify it in a WHERE clause.
[18:12:24] tubbo: that's how i'd figure it out at least
[18:12:27] kmckelvi1: has joined #RubyOnRails
[18:12:27] smathy: Scriptonaut, so that's precisely what's happening with the includes.
[18:12:34] cnk: has joined #RubyOnRails
[18:12:48] tubbo: i'm pretty sure if you have `touch: true` enabled on all the associations, changing the updated_at value *will* cascade down.
[18:12:49] Scriptonaut: is it not working because when I do an includes, it's not actually doing a join, and the listings_people table doesn't share the same name as the listing_people association?
[18:13:15] smathy: Scriptonaut, Listing.includes(:listing_people) is going to do TWO queries, take a look in your console.
[18:13:24] smathy: Scriptonaut, correct.
[18:13:48] Silox|: has joined #RubyOnRails
[18:14:08] Scriptonaut: what confuses me most is why does it work fine with the rails syntax
[18:14:11] Scriptonaut: but not straight SQL
[18:14:34] aegis3121: has joined #RubyOnRails
[18:14:38] JoshL: tubbo: The answer is yes, it will cascade
[18:14:42] tubbo: JoshL: nice!
[18:14:45] tubbo: #teamwork
[18:15:06] smathy: Scriptonaut, it works because with the Rails syntax Rails can tell you're referencing the other table, so it does a join instead of the two queries.
[18:15:22] Scriptonaut: ok, I got it now, thanks smathy
[18:15:27] sarink: has joined #RubyOnRails
[18:15:28] smathy: Scriptonaut, with the string, Rails can't tell you're referencing the other table, so it just does the two... cool :)
[18:15:30] Scriptonaut: is there ever an advantage to using includes over joins?
[18:15:37] diegoviola: has joined #RubyOnRails
[18:15:51] diegoviola: has joined #RubyOnRails
[18:15:56] smathy: Scriptonaut, well joins does an inner join, so will only return results with corresponding records in the other table.
[18:16:25] smathy: Scriptonaut, for a has_many it will also return multiple duplicate records for the target table.
[18:16:53] adavia: any idea why i get undefined method `slice' in http://pastie.org/10727724#7
[18:17:04] acovrig: has joined #RubyOnRails
[18:17:40] smathy: adavia, because Range has no slice method.
[18:18:06] kies^: has joined #RubyOnRails
[18:18:37] adavia: weird.. i took the code from a tutorial
[18:18:39] bronson: has joined #RubyOnRails
[18:19:17] _djbkd: has joined #RubyOnRails
[18:19:18] Scriptonaut: did you copy it? Or just write it out from the tutorial
[18:19:59] Scriptonaut: I'm guessing it was either [start_date.beginning_of_month.beginning_of_week..start_date.end_of_month].slice
[18:20:08] Scriptonaut: or (start..end).to_a.slice
[18:20:30] smathy: ...or the tutorial was wrong.
[18:20:43] mwlang: has joined #RubyOnRails
[18:20:56] adavia: i want to show the name of the days in the week
[18:22:35] adavia: Scriptonaut: oh yes that worked but i swear this dude is doing date_range.slice(0, 7).each instead of date_range.to_a.slice(0, 7).each
[18:22:44] smathy: adavia, your range is from beginning of week to end of week, and you're then just using that to create an index for the I18n list right?
[18:23:38] manfrin: has joined #RubyOnRails
[18:23:45] smathy: adavia, ie. don't you just want: (0..6).each ... ?
[18:24:29] adavia: smathy: also works
[18:24:35] adavia: smathy: thanks
[18:24:48] smathy: adavia, you're welcome. Is the tutorial online?
[18:25:12] adavia: is from this guy of gorails.com
[18:25:34] Rodya_: has joined #RubyOnRails
[18:27:11] Technodrome: has joined #RubyOnRails
[18:28:13] dsimon: we should send this guy a strongly worded letter
[18:28:16] herpless: has joined #RubyOnRails
[18:30:05] jottr_: has joined #RubyOnRails
[18:30:10] matthias_: has joined #RubyOnRails
[18:31:06] B1n4r10: has joined #RubyOnRails
[18:31:16] Maletor: shouldn't this be marked nodoc?
[18:31:17] Maletor: https://github.com/rails/rails/blob/9b3e7b672eda5982c2a16abb7b142a0ed371d9f4/activerecord/lib/active_record/associations/collection_proxy.rb#L861
[18:32:29] Maletor: and it is... in master
[18:36:07] smathy: adavia, so report the bug/problem to them.
[18:36:31] adavia: smathy: will do
[18:36:52] stannard_: has joined #RubyOnRails
[18:37:13] safety_cut: has joined #RubyOnRails
[18:38:22] elcontrastador: has joined #RubyOnRails
[18:38:49] umdstu: has joined #RubyOnRails
[18:39:08] umdstu: is there a way to generate missing factories with factory_girl_rails for models created prior to installing the gem?
[18:39:10] bronson: has joined #RubyOnRails
[18:39:47] safety_cut: has joined #RubyOnRails
[18:40:01] netzfisch: has joined #RubyOnRails
[18:40:30] kirillzh: has joined #RubyOnRails
[18:41:48] safety_cut: has joined #RubyOnRails
[18:41:52] artto: has joined #RubyOnRails
[18:44:20] platzhirsch: has left #RubyOnRails: ()
[18:46:22] chipotle: has joined #RubyOnRails
[18:47:08] Devalo: has joined #RubyOnRails
[18:48:12] baweaver: has joined #RubyOnRails
[18:49:33] kirillzh: has joined #RubyOnRails
[18:49:57] hcnewsom: has joined #RubyOnRails
[18:52:31] Technodrome: has joined #RubyOnRails
[18:53:38] chouhoulis: has joined #RubyOnRails
[18:55:36] rhizome: umdstu: no
[18:56:00] robbyoconnor: has joined #RubyOnRails
[18:56:14] umdstu: rhizome: sorry, i solved the problem... you do `rails g factory_girl:model ModelName field:field_type` etc
[18:56:30] umdstu: so in a way, yes
[18:56:45] jottr: has joined #RubyOnRails
[18:58:11] openstruct: has joined #RubyOnRails
[18:58:11] openstruct: has joined #RubyOnRails
[18:58:20] IFrank004: has joined #RubyOnRails
[18:59:23] robbyoconnor: has joined #RubyOnRails
[19:01:04] DanKnox: has joined #RubyOnRails
[19:01:06] DanKnox_: has joined #RubyOnRails
[19:01:26] yardenbar: has joined #RubyOnRails
[19:02:04] drbayer_: has joined #RubyOnRails
[19:04:00] cnk: umdstu: Cool
[19:04:48] umdstu: cnk: totalyl
[19:05:29] roshanavand: has joined #RubyOnRails
[19:07:12] brycesenz: has joined #RubyOnRails
[19:10:09] roshanavand: has joined #RubyOnRails
[19:10:20] brycesenz: Hi all. I had a super weird issue that I'm trying to understand - for a brief period of time yesterday, our app was up and working, yet none of the data that was being submitted was actually being persisted to the database. Nothing ever crashed, and outgoing requests (Facebook, Twitter, etc.) worked as normal, but it's like the app was just working with a static cache of old data. We redeployed, and things worked
[19:10:20] brycesenz: normally again. Has anyone had a similar experience?
[19:10:51] bronson: brycesenz: what db? some sort of transaction issue?
[19:10:53] bronson: check the db logs?
[19:11:01] Marquel: has joined #RubyOnRails
[19:11:08] brycesenz: bronson - we're using Postgres
[19:11:21] bronson: that's good. anything in the logs?
[19:11:34] bronson: and you're sure you weren't writing to the dev or test db?
[19:11:44] brycesenz: bronson - the logs don't seem to show anything out of whack. And it was definitely our production db.
[19:12:23] bronson: I've never seen anything like that before. Any custom transaction handling or job pooling?
[19:12:31] Spami: So I have this line: system("nohup ruby update_databse.rb #{start_id} #{last_id} &> /var/www/logs/#{start_id}-#{last_id}.log &")
[19:12:44] Spami: for some reason nothing is logged
[19:12:59] Spami: but when I run: ruby update_databse.rb #{start_id} #{last_id}
[19:13:04] Spami: I can see the output
[19:13:11] umdstu: i can't seem to test uniqueness validation in my test case. using factory_girl, build() doesn't save to db, so it can't know about one another, and create() fails before the assert because of the model validation
[19:13:17] Spami: does anyone see what I'm doing wrong? It's driving me crazy
[19:13:49] brycesenz: bronson - nope. And, this is even weirder, but when I'd SSH into the console, I could manually change DB records and they'd persist. But whatever connection the actual app had to the DB wouldn't persist a thing.
[19:14:28] triptec: has joined #RubyOnRails
[19:14:50] bronson: Spami: nohup is a cranky command. try without it and see what happens.
[19:14:58] Spami: bronson, I tried
[19:15:03] Spami: nothing in the logs
[19:15:11] zackzorman: has joined #RubyOnRails
[19:15:40] tubbo: i thought you had to do 2&>1 or something
[19:15:45] tubbo: to redirect both stdout and stderr
[19:15:58] bronson: tubbo: yep, in bash.
[19:16:01] tubbo: that '&' on the end might be doing it too
[19:16:21] Maletor: I'm trying to figure out if there is an error in the guides. It says by default caching is only enabled for production. I have found this to be *false* in testing environment. From the Rails configuration guide it says cache_store is set to file_store if tmp/cache is available or memory_store if not.
[19:16:29] bronson: I think &> is csh? (memories of th 90s...)
[19:16:46] baweaver: has joined #RubyOnRails
[19:17:19] Spami: I also tried to replace &> by just >
[19:17:24] Spami: nothing in the logs as well
[19:17:33] Spami: It's a great mystery
[19:18:37] bronson: Spami: try an explicit subshell? system("sh -c 'command ... > /log 2>&1'")
[19:19:10] bronson: system("/bin/bash -c ...") <-- be even more explicit!
[19:19:26] rakm_: has joined #RubyOnRails
[19:19:35] tubbo: here's a question
[19:19:45] tubbo: why are you, in a ruby program, calling ANOTHER ruby program by shelling out to it?
[19:19:50] tubbo: that makes no sense to me
[19:19:56] pcpanic: has joined #RubyOnRails
[19:20:31] bronson: I assume it's an el-cheapo background job
[19:21:03] bronson: background processing with threads is even more perilous.
[19:21:07] tubbo: el-cheapo?
[19:21:12] tubbo: seems more expensive to me right now
[19:21:24] Terens: Is ruby DateTime different than rails DateTime ?
[19:21:32] VeryBewitching: tubbo: ls would be an el-cheapo call, as opposed to processing 100,000 rows of data or something
[19:21:48] tubbo: VeryBewitching: i don't understand
[19:22:00] VeryBewitching: tubbo: If you're running a script that runs /bin/ls...
[19:22:00] tubbo: Terens: yes.
[19:22:05] bronson: It's like Harbor Freight... Seems cheap before you buy it, turns out it's very expensive after you buy it.
[19:22:12] VeryBewitching: That's a cheap call as it would return quickly.
[19:22:22] matthewd: Spami: Where are you redirecting stdout to your logs?
[19:22:43] tubbo: VeryBewitching: that may or may not be true, depending on your particular stack.
[19:23:06] Terens: how would I know which to use
[19:23:22] tubbo: Terens: well if you're using rails you _are_ using ActiveSupport's DateTime extensions :)
[19:23:26] tubbo: otherwise you're not
[19:23:26] havenwood: Terens: Whether you're using Rails usually determines that.
[19:23:26] fox_mulder_cp: has joined #RubyOnRails
[19:24:05] yardenbar: has joined #RubyOnRails
[19:24:18] askhat: has joined #RubyOnRails
[19:24:24] VeryBewitching: Terens: DateTime is modified by Rails, not replaced afaik
[19:24:55] Maletor: well i think it's a 'bug' https://github.com/rails/rails/issues/23763
[19:26:21] tubbo: maletor: by default, caching isn't enabled at all AFAIK
[19:26:39] tubbo: as soon as you configure a cache store, however, it does start working a bit.
[19:27:15] tubbo: maletor: you know you can change the documentation yourself right?
[19:27:30] Maletor: tubbo: course, but i want to be correct before i change it
[19:27:38] FooMunki: has joined #RubyOnRails
[19:27:54] rakm: has joined #RubyOnRails
[19:28:00] ur5us: has joined #RubyOnRails
[19:28:14] tildes: has joined #RubyOnRails
[19:28:48] Spami: tubbo, it makes sense so me :)
[19:28:58] uberjar: has joined #RubyOnRails
[19:29:11] tubbo: maletor: if you're not correct, your PR will be declined and you can re-open it with corrections.
[19:29:20] FCser: has joined #RubyOnRails
[19:29:28] Maletor: tubbo: do you agree that null_store should be in test.rb or not?
[19:29:33] tubbo: maletor: i do not.
[19:29:40] Spami: matthewd, isn't this supposed to redirect stdout &> ?
[19:29:40] Maletor: rationale?
[19:29:55] matthewd: maletor: I think it should explicitly use memory store
[19:30:03] tubbo: maletor: bikeshedding. also i don't have caching turned on in development or test environments.
[19:30:10] tubbo: so it doesn't affect me at all
[19:30:24] Dbugger: has joined #RubyOnRails
[19:30:28] Dbugger: Greetings everyone
[19:30:36] tubbo: but if you want to turn it on, go ahead. i don't see why the gennie needs to be modified, but i do think the guides could offer better clarification if it is indeed saying that "caching is enabled by default in production", because AFAIK that is false.
[19:30:37] Maletor: check it out. rails new testproject. > rails c test > Rails.configuration.cache_store > :file_store
[19:30:51] Maletor: it is definitely enabled in test by default
[19:31:09] tubbo: well the cache_store is set, but is it actually caching?
[19:31:15] tubbo: i've just never seen that behavior.
[19:31:24] IFrank004: has joined #RubyOnRails
[19:31:26] tubbo: (nor have i really been paying attention to it)
[19:31:43] Maletor: yes, it reads and writes perfectly fine
[19:32:03] tubbo: maletor: you just got the clarification you needed :)
[19:32:16] tubbo: (fwiw, rails devs don't like when you just open an issue for a fix that is clearly in your ability to contribute)
[19:32:19] tubbo: https://github.com/rails/rails/issues/23763
[19:32:24] matthewd: maletor: As RF just pointed out, the guide is talking about AP/AC caching -- it might need clarification, but it's not wrong
[19:33:07] Maletor: ok i will clarify for AC caching
[19:33:09] Cervajz: has joined #RubyOnRails
[19:33:27] Maletor: matthewd: why do you prefer memory_store over null_store in test.rb
[19:33:29] matthewd: tubbo: +1 +1 +1... I've seen a spate of "I opened this issue for permission to open a PR" things lately.. really don't understand the logic :/
[19:33:58] uberjar: API design question: suppose you're preparing to use an API that promises to place a file in an S3 bucket that you control..
[19:34:01] uberjar: would you rather the API ask you for an access_key,secret_key, and bucket.. or would you rather it tell you to edit your bucket policy and paste in a specific config ?
[19:34:13] tubbo: it's all good, there are a lot of new github users these days who are getting started with OSS contributions. rails is a "famous" project and i think a lot of people feel like they can actually contribute to it. that's a good thing
[19:34:18] tubbo: contrasted with, e.g., the linux kernel.
[19:34:38] tubbo: uberjar: isn't the API gonna need my keys and bucket anyway?
[19:34:43] JohnBat26: has joined #RubyOnRails
[19:34:48] tubbo: not sure i understand the question
[19:34:57] Cervajz_: has joined #RubyOnRails
[19:35:02] matthewd: maletor: My theory is that enabling caching might allow your tests to catch some cache invalidation issues
[19:35:11] uberjar: tubbo: no. it could ask you for the bucket name only, but tell you to add a rule to the bucket to grant permissions to the API's own IAM role
[19:35:34] Spami: damn this is weird
[19:35:41] Spami: only on log file is being written in
[19:35:49] uberjar: tubbo: or it could ask you for keys + bucket and let you figure out how to set up permissions
[19:36:17] tubbo: uberjar: i think asking for keys/bucket is more straightforward and offers more control for the user.
[19:36:33] tubbo: i've also never seen an AWS library that asked me for an "IAM role" and just figured its own way out
[19:36:34] treehug88: has joined #RubyOnRails
[19:37:14] uberjar: tubbo: if you take for example segment.com they don't ask for keys instead they ask you to add their IAM role to your bucket's policy https://segment.com/docs/integrations/amazon-s3/
[19:37:39] uberjar: I am considering taking the approach you recommend (asking for keys) because it's more flexible, but it also causes you need need to understand IAM roles
[19:38:36] netzfisch: has joined #RubyOnRails
[19:38:56] mdw: has joined #RubyOnRails
[19:39:09] Radar: GOOD MORNING
[19:40:53] flashpoint9: has joined #RubyOnRails
[19:41:07] tubbo: uberjar: i'm not a big of how segment does literally anything.
[19:41:08] Maletor: Radar: HELLO
[19:41:36] Spami: oh, for some weird reason the log is being populated only when the script is done
[19:41:53] tubbo: uberjar: after learning about google tag manager i see no reason to pay for segment *shrug*
[19:42:00] Maletor: Radar: you must be in Hawaii or something. not a lot of places it's morning right now
[19:42:11] Radar: maletor: everyone forgets about Australia
[19:42:34] Maletor: why would you be awake at 6:40AM?
[19:42:37] bronson: still morning on US pacific cost for 20 minutes!
[19:42:39] tubbo: where the dummies live
[19:43:30] bronson: Between you guys and sevenseascat, I suspect there's some great Australia Rails conspiracy I haven't figured out yet.
[19:43:32] Radar: maletor: because I leave for work at 7:15am.
[19:43:51] Radar: bronson: no comment
[19:44:11] maxx88: glad to be part of the “dummies” group here in pacific coast
[19:45:24] tubbo: i was talking about australia actually
[19:45:40] Maletor: pretty sure that's an OSHA violation radar
[19:45:47] chipotle: has joined #RubyOnRails
[19:45:52] yardenbar: has joined #RubyOnRails
[19:46:04] Radar: maletor: to travel about an hour to work? people do worse commutes by car.
[19:46:18] maxx88: bummer, wanted in on the dummy group
[19:46:21] codepete: has joined #RubyOnRails
[19:47:38] bronson: ACTION misses commuting by train... great place to do crapwork so you're ready for action when you arrive at work.
[19:48:46] sandstrom: has joined #RubyOnRails
[19:49:33] matthewd: > not a lot of places it's morning right now
[19:49:40] matthewd: .. literally half the world.
[19:50:21] bronson: seems like it would be 1/4 morning, 1/4 afternoon, and 1/2 night
[19:51:10] FernandoBasso: has joined #RubyOnRails
[19:51:48] Cohedrin: has joined #RubyOnRails
[19:52:40] defsdoor: has joined #RubyOnRails
[19:53:16] manfrin: has joined #RubyOnRails
[19:53:50] tubbo: matthewd: nowhere that matters though
[19:53:56] baweaver: http://www.total-knowledge.com/~ilya/mips/ugt.html
[19:54:06] baweaver: when arriving, it's always morning
[19:54:13] baweaver: when leaving, it's always night
[19:54:36] matthewd: tubbo: It's a fair cop
[19:54:42] rakm_: has joined #RubyOnRails
[19:55:24] dsimon: so in IRCese, "good morning" means "hi" and "good night" means "bye"? works for me
[19:56:09] bronson: UGT is good. I suppose afternoon when I'm getting fuzzy and nothing is making sense anymore.
[19:56:57] roshanavand: has joined #RubyOnRails
[20:02:57] jfelchner: has joined #RubyOnRails
[20:03:33] rakm: has joined #RubyOnRails
[20:04:48] theblang: has joined #RubyOnRails
[20:05:25] theblang: has joined #RubyOnRails
[20:05:43] rakm: has joined #RubyOnRails
[20:10:53] helpa-bot: has joined #RubyOnRails
[20:10:55] jfelchner_: has joined #RubyOnRails
[20:10:58] xrlabs: has joined #RubyOnRails
[20:11:13] janno_: has joined #RubyOnRails
[20:11:58] ereslibre_laptop: has joined #RubyOnRails
[20:11:59] ereslibre_laptop: has joined #RubyOnRails
[20:12:07] Marquel: has joined #RubyOnRails
[20:12:25] zmd: has joined #RubyOnRails
[20:12:28] Dfoolz: has joined #RubyOnRails
[20:12:37] jcm: has joined #RubyOnRails
[20:12:42] atrius: has joined #RubyOnRails
[20:12:48] EdwardIII: has joined #RubyOnRails
[20:12:52] itkin: has joined #RubyOnRails
[20:12:57] adam_: has joined #RubyOnRails
[20:13:06] Depili: has joined #RubyOnRails
[20:13:07] teaearlgraycold: has joined #RubyOnRails
[20:13:45] dmcc: has joined #RubyOnRails
[20:14:01] nogic: has joined #RubyOnRails
[20:14:29] korzybski: has joined #RubyOnRails
[20:15:39] yfeldblum: has joined #RubyOnRails
[20:16:06] AntiSpamMeta: has joined #RubyOnRails
[20:16:24] safety_cut: has joined #RubyOnRails
[20:16:28] jlyndon: has joined #RubyOnRails
[20:17:17] ewilliam: has joined #RubyOnRails
[20:18:26] RubyNewbey_____: has joined #RubyOnRails
[20:18:53] tejasmanohar: has joined #RubyOnRails
[20:22:39] yardenbar: has joined #RubyOnRails
[20:22:40] Deck`: has joined #RubyOnRails
[20:23:03] Devalo: has joined #RubyOnRails
[20:23:33] DanKnox: has joined #RubyOnRails
[20:23:34] DanKnox_: has joined #RubyOnRails
[20:26:13] mhoungbo: has joined #RubyOnRails
[20:29:52] xrlabs: has joined #RubyOnRails
[20:29:58] pydave6377: has left #RubyOnRails: ()
[20:31:26] Technodrome: has joined #RubyOnRails
[20:31:28] aegis3121: has joined #RubyOnRails
[20:32:07] goodcodeguy: has joined #RubyOnRails
[20:33:06] voobscout: has joined #RubyOnRails
[20:37:14] voobscout: has left #RubyOnRails: ()
[20:37:34] stannard: has joined #RubyOnRails
[20:37:36] baweaver: has joined #RubyOnRails
[20:38:42] chouhoul_: has joined #RubyOnRails
[20:41:09] chouhoul_: has joined #RubyOnRails
[20:46:17] yardenbar: has joined #RubyOnRails
[20:47:09] kdough: has joined #RubyOnRails
[20:47:59] slash_nick: Having a rough time with rails 5.0.0.beta2 today... I can't recreate it with a test case (the thing passes even though application/vnd.api+json isn't a registered mime type) https://gist.github.com/rthbound/09463c89a243d00a5ab8 ... but generating fresh rails apps using edge does reveal the problem: https://github.com/rthbound/ams-json-api-broken-23712
[20:52:00] mhoungbo: has joined #RubyOnRails
[20:53:25] pawnbox: has joined #RubyOnRails
[20:53:36] slash_nick: here's another, with a few less commits... https://github.com/rthbound/una-otra
[20:53:56] sandstrom: has joined #RubyOnRails
[20:54:36] flappynerd: has joined #RubyOnRails
[20:54:48] slash_nick: on tha last (una-otra)... `curl -XPOST -H 'Content-Type: application/vnd.api+json' http://localhost:3000/bugs -d '{"maybe_a_bug": true}'` is how i'm sending my payload
[20:57:16] andchar: has joined #RubyOnRails
[20:58:26] baweaver: has joined #RubyOnRails
[20:58:37] clamstar: has joined #RubyOnRails
[21:03:00] FooMunki: has joined #RubyOnRails
[21:03:52] tubbo: slash_nick: what if you tried to actually register the mime type?
[21:05:07] tubbo: slash_nick: also THAT is how you make a damn testapp!
[21:05:11] tubbo: (the gist)
[21:08:21] slash_nick: tubbo: if i register the mime type in that gist, it just continues working...
[21:08:46] slash_nick: the test case in the gist SHOULD be failing, as we removed application/vnd.api+json as a default mime type just the other day
[21:08:58] doctorly: has joined #RubyOnRails
[21:09:55] Oliphaunte: has joined #RubyOnRails
[21:14:54] Pazician: has joined #RubyOnRails
[21:16:24] doctorly: hello, I am trying to run rake db:reset
[21:16:32] doctorly: and I am getting this error: https://gist.github.com/brendenyule/d79ec2575f6ab52ec512
[21:17:16] doctorly: My migrations look to be in the correct order, and this is a recent issue. I haven't changed any migration files in my repo for a while now either.
[21:17:27] enkristoffer: has joined #RubyOnRails
[21:17:49] tubbo: slash_nick: wondering if AMS adds that inherently
[21:17:50] theery: has joined #RubyOnRails
[21:18:32] Geffy: has joined #RubyOnRails
[21:18:36] tubbo: doctorly: !gist app/models/user.rb, think the problem is on ln 25 there.
[21:18:36] helpa: doctorly: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[21:18:39] slash_nick: tubbo: you can lookup_by_extension("json") and find none
[21:18:42] Ergo: has joined #RubyOnRails
[21:18:55] slash_nick: rather, find that vnd.api+json is not there
[21:19:13] matthias_: has joined #RubyOnRails
[21:19:57] _djbkd: has joined #RubyOnRails
[21:20:17] slash_nick: tubbo: basically, this commit (hilighted by bisect and confirmed by reverting and retesting) removes the mime type... https://github.com/rails/rails/commit/c4d90b70f4f27a527e9c2cd3af6cebf560b8df98 ... we should be able to re-register the mime type and it be like that commit never happened, but we cant
[21:20:32] slash_nick: rather, we can get the mime type registered... it just doesn't make a difference
[21:20:52] hoodow: has joined #RubyOnRails
[21:20:52] hoodow: has joined #RubyOnRails
[21:21:45] doctorly: tubbo: I uploaded it to gist, should I have done something different?
[21:21:53] doctorly: tubbo: Looking at that file now
[21:22:05] slash_nick: i'm working on something folks might consider a reproduction script lol... i really wish that gist did the trick
[21:23:21] pawnbox: has joined #RubyOnRails
[21:23:37] chouhoul_: has joined #RubyOnRails
[21:24:00] doctorly: tubbo: I also found the issue, thanks
[21:26:40] PedramT: has joined #RubyOnRails
[21:26:46] doublemalt_: has joined #RubyOnRails
[21:27:32] drbayer: has joined #RubyOnRails
[21:28:14] enkristoffer: has joined #RubyOnRails
[21:28:36] Rodya_: has joined #RubyOnRails
[21:29:41] drbayer: has joined #RubyOnRails
[21:30:55] mhoungbo: has joined #RubyOnRails
[21:31:42] helpa: has joined #RubyOnRails
[21:31:43] IFrank00: has joined #RubyOnRails
[21:35:32] Technodrome: has joined #RubyOnRails
[21:36:10] tvw: has joined #RubyOnRails
[21:36:30] korzybski: has joined #RubyOnRails
[21:38:11] enkristoffer: has joined #RubyOnRails
[21:38:32] Rodya_: has joined #RubyOnRails
[21:39:00] n00bDev: has joined #RubyOnRails
[21:40:48] slash_nick: tubbo: filed a bug... hopefully i can get some feedback ;) https://github.com/rails/rails/issues/23766
[21:41:11] theery_: has joined #RubyOnRails
[21:45:05] Pumukel: has joined #RubyOnRails
[21:46:36] bronson: has joined #RubyOnRails
[21:47:04] Rodya_: has joined #RubyOnRails
[21:47:22] rickmasta: has joined #RubyOnRails
[21:49:42] zackzorman: has joined #RubyOnRails
[21:52:07] tetraktys: has joined #RubyOnRails
[21:52:37] tetraktys: Hey guys, i'm trying to authenticate users with devise through a json request with a body as this: https://gist.github.com/joostvanrijn/4322a218e379c604e78e
[21:53:03] tetraktys: I can't for the life of me figure out how to manipulate the params so devise gets it
[21:53:36] tetraktys: with registration using a custom parameter sanitizer works perfectly fine, but no such luck with signing in
[21:53:38] trinaldi: has joined #RubyOnRails
[21:53:46] pawnbox: has joined #RubyOnRails
[21:54:08] nfk: has joined #RubyOnRails
[21:57:37] htmldrum: has joined #RubyOnRails
[21:58:00] hcnewsom: has joined #RubyOnRails
[21:58:26] ebertx: has joined #RubyOnRails
[22:02:22] korzybski: has joined #RubyOnRails
[22:02:49] mdel: has joined #RubyOnRails
[22:05:31] arBmind: has joined #RubyOnRails
[22:06:55] yardenbar: has joined #RubyOnRails
[22:07:08] Terens: https://gist.github.com/parhs/39d8e01a93e314f2fbfe
[22:07:27] Terens: hello why does request.starting is different format there?
[22:07:37] mary5030: has joined #RubyOnRails
[22:08:43] wwwbukolaycom: has joined #RubyOnRails
[22:09:39] rhizome: tetraktys: no token or anything, just a straight post?
[22:10:03] tetraktys: rhizome, i was thinking i'd need to authenticate first before issuing a token
[22:10:13] tetraktys: but i might be completely wrong about that
[22:10:58] rhizome: hard to give advice then
[22:10:59] tetraktys: i'm coding a hobby project where i use rails 5 as API only, with a react frontend
[22:11:23] tetraktys: so the token would replace the session eventually
[22:11:35] rhizome: so just a straight post of those params
[22:11:50] rhizome: and when you read the log?
[22:12:25] tetraktys: i've pry'ed deep in the warden gem. somewhere it's looking for params[:user]
[22:12:30] tetraktys: but it's not there
[22:12:40] Cohedrin: has joined #RubyOnRails
[22:12:56] roshanavand: has joined #RubyOnRails
[22:13:02] smathy: Terens, which version of Rails, and what's the underlying data type of the DB field?
[22:14:46] tetraktys: i've updated the gist https://gist.github.com/joostvanrijn/4322a218e379c604e78e with the complete params
[22:15:15] rhizome: read your logs
[22:17:25] opiates: has joined #RubyOnRails
[22:17:54] Terens: I am trying to do something but failing
[22:17:55] myntcake: has joined #RubyOnRails
[22:18:05] hoodow: has joined #RubyOnRails
[22:18:09] rhizome: like many here
[22:18:10] Terens: I have hard time with virtual attributes
[22:20:03] smathy: Terens, I see, so that `starting` attribute you're talking about isn't a DB field? Maybe explain what you're actually trying to do.
[22:20:16] tetraktys: rhizome, i've added the log, but there's nothing suspicious there. the user gets created (as a factory) but then: nothing
[22:20:49] podman: has joined #RubyOnRails
[22:20:55] rhizome: not nothing: "ROLLBACK"
[22:21:04] Terens: Here is what I am trying to do:
[22:21:06] hoodow: has joined #RubyOnRails
[22:21:06] hoodow: has joined #RubyOnRails
[22:21:24] tetraktys: it's in the test environment, everything gets rolled back right?
[22:21:36] Terens: I have a starting and ending attributes that are stored in database.
[22:21:58] rhizome: tetraktys: hard to say that that's what's happening here (plus there are two rollbacks)
[22:22:04] Terens: THey are datetime.. So far in this case its all fine
[22:22:19] Terens: THen there is another case where user instead of starting and ending date
[22:22:36] Terens: fills starting date and starting time and ending time
[22:22:40] strongcode: has joined #RubyOnRails
[22:22:45] Terens: and there problems start
[22:22:59] rhizome: tetraktys: try logging errors within that action
[22:23:02] PedramT: has joined #RubyOnRails
[22:23:26] sbarg: has joined #RubyOnRails
[22:23:40] franzip: has joined #RubyOnRails
[22:23:46] Terens: I tried creating virtual attributes to convert them to DateTime everything fine , but on error form fields get filled with DateTime format unlike the others
[22:23:55] pawnbox: has joined #RubyOnRails
[22:24:16] tetraktys: This is where it goes wrong: https://github.com/plataformatec/devise/blob/master/lib/devise/strategies/authenticatable.rb#L91
[22:24:23] tetraktys: scope is :user
[22:24:46] tetraktys: but as you can see there is no :user in params
[22:26:15] Radar: tetraktys: Create a new strategy
[22:26:26] Radar: tetraktys: it should inherit from this strategy
[22:26:37] Radar: tetraktys: override the method that pulls the params out
[22:27:00] tetraktys: that sounds sensible Radar :)
[22:27:05] smathy: Terens, people generally use a datepicker of some sort.
[22:27:11] Oliphaunte: has joined #RubyOnRails
[22:27:37] Terens: this isnt my problem
[22:27:47] msyvich: has joined #RubyOnRails
[22:28:38] Radar: ACTION waits for problem
[22:31:23] smathy: Terens, excellent, glad to hear it.
[22:32:49] Terens: i have a date picker
[22:32:57] Terens: but this isnt the problem
[22:33:09] yfeldblum: has joined #RubyOnRails
[22:33:13] Terens: its the cryptic conversion happening
[22:35:35] ferr: has joined #RubyOnRails
[22:35:36] kitsuneyo: has joined #RubyOnRails
[22:35:59] chipotle: has joined #RubyOnRails
[22:36:17] mwcmitchell: has joined #RubyOnRails
[22:36:18] ferr: I am using a gem to accept payments, however, I cannot load the gem: uninitialized constant OrdersController::Paysera. Shall I somehow specifically load this gem?
[22:36:51] Kulo: has joined #RubyOnRails
[22:39:01] kdough: Hey guys - Curious if this might be an issue with AR under Rails 5.0.0.beta2+: MyThing.all.in_groups_of(3) throws NoMethodError saying that in_groups_of is not defined. However, MyThing.all.to_a.in_groups_of(3) does not thow an error (note the #to_a). Both work fine under 4.2.5.
[22:39:37] helpa: We're not all guys here - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[22:40:35] flappynerd: guys is gender neutral by now in much of the USA
[22:41:54] lacrymology: has joined #RubyOnRails
[22:42:10] baweaver: enough of that
[22:42:23] baweaver: if you want to debate it, #ruby-offtopic
[22:42:31] kdough: I certainly intended that to be gender neutral. I apologize if I offended anyone. :) gist to recreate is here: https://gist.github.com/kdough/37ae37e80d29989a192c
[22:42:57] smathy: Terens, I'm a bit lost as to the conversion you're talking about. Your picker should provide the 1i, 2i, 3i, 4i, 5i values and Rails will "just work" for the setter for a datetime attribute.
[22:43:26] smathy: ferr, after adding and installing the gem have you restarted your rails app?
[22:44:56] ferr: thanks smathy
[22:45:12] smathy: ferr, you're welcome.
[22:45:35] ferr: I just want you to know that your help is really appreciated
[22:47:55] matthewd: kdough: Sounds like a bug
[22:48:00] Radar: hug it out you two
[22:48:13] matthewd: kdough: https://github.com/rails/rails/commit/9d79334a1dee67e31222c790e231772deafcaeb8
[22:48:36] Radar: looks like an intentional decision
[22:48:41] norc_: has joined #RubyOnRails
[22:48:48] Radar: imo I would rather people call .to_a explicitly rather than it "magically" working
[22:48:51] kdough: matthewd: ah, ha! great find. thanks!
[22:49:19] matthewd: Radar: per the commit message, sgrif intended to manually whitelist all the array methods
[22:49:19] kdough: radar: fair enough - I can see the value in calling it out explicitly
[22:49:20] Radar: But if you want that magical behaviour, then you could add in_groups_of to that list.
[22:49:32] Radar: worth a PR I reckon
[22:49:42] matthewd: ... but he seems to have done it for stdlib array, but missed AS's own core_ext array stuffs
[22:49:56] Radar: matthewd: It's not like Rails core devs use Rails
[22:50:04] matthewd: as for *why* in_groups_of is in Array and not Enumerable in the first place.. :/
[22:50:19] Radar: matthewd: because in_groups_of on a hash wouldn't make sense?
[22:50:40] Radar: (but it would on a Set)
[22:50:50] matthewd: Radar: Tell that to each_slice :P
[22:51:06] Coldblackice: has joined #RubyOnRails
[22:51:56] Radar: matthewd: touché.
[22:52:15] Rodya_: has joined #RubyOnRails
[22:52:19] kdough: matthewd, radar: thanks for the help!
[22:52:47] teaearlgraycold: How do you create a directory in a generator?
[22:53:01] goodcodeguy: has joined #RubyOnRails
[22:53:04] Radar: teaearlgraycold: mkdir -p dir/name/goes/here
[22:53:13] Radar: teaearlgraycold: The generators built into the OS are my fav
[22:53:17] teaearlgraycold: I've tried just doing: directory 'path/to/new/folder' but it tells me it couldn't find the directory
[22:53:36] teaearlgraycold: Radar: yeah but I'm using ruby not bash
[22:53:39] Radar: Oh you mean your own generator.
[22:54:15] pawnbox: has joined #RubyOnRails
[22:54:27] drbayer: has joined #RubyOnRails
[22:54:33] Radar: teaearlgraycold: that command copies a source directory into a destination, doesn't create a new one
[22:54:56] matthewd: kdough: No worries! Bonus points for a PR that checks the rest of core_ext/array for other missed methods ;)
[22:55:21] Radar: teaearlgraycold: how about empty_directory?
[22:55:39] Devalo: has joined #RubyOnRails
[22:56:44] kdough: matthewd: sounds good! will put together a PR
[22:58:57] Ducky-: has joined #RubyOnRails
[22:59:19] rakm: has joined #RubyOnRails
[22:59:40] teaearlgraycold: Seems like erb's not happy with my template. I'm trying to do erb over a HAML file so that might be an issue...
[22:59:42] teaearlgraycold: http://pastie.org/private/jnt7lote5uf7uwdxk90fmq
[23:00:26] teaearlgraycold: The resulting error: http://pastie.org/private/wt64cbqeszppm1fb3pkw
[23:06:14] Oliphaunte: has joined #RubyOnRails
[23:09:30] PedramT_: has joined #RubyOnRails
[23:09:53] kirillzh: has joined #RubyOnRails
[23:11:17] rhizome: haml, erb, choose one.
[23:11:54] PedramT: has joined #RubyOnRails
[23:13:03] loc22: has joined #RubyOnRails
[23:14:42] loc22: Hi guys. Question: I need to build an API, so Im thinking on using Rails 5 with the new API-only feautre. But then I need a small dashbord for configuration. Should I create a full project instead?
[23:16:04] Pazician: has joined #RubyOnRails
[23:16:38] baweaver: has joined #RubyOnRails
[23:17:04] Rodya_: has joined #RubyOnRails
[23:17:58] DanKnox_: has joined #RubyOnRails
[23:17:59] DanKnox: has joined #RubyOnRails
[23:19:25] smathy: rhizome, a generator for multiple templating gems, depending on what's loaded, that's not a bad thing for a gem to do.
[23:19:32] tetraktys: has joined #RubyOnRails
[23:22:46] loc22: Hi guys. Question: I need to build an API, so Im thinking on using Rails 5 with the new API-only feautre. But then I need a small dashbord for configuration. Should I create a full project instead?
[23:23:16] flappynerd: what is the "api only" feature
[23:23:21] flappynerd: you can write an "api only" quite easily in rails 4
[23:23:55] robbyoconnor: has joined #RubyOnRails
[23:24:05] pawnbox: has joined #RubyOnRails
[23:24:06] Terens: Could you explain me how to make virtual parameters return user supplied value on view ?
[23:24:19] Radar: Terens: !explain
[23:24:20] helpa: Terens: Please explain your problem better as we are having trouble understanding what you mean. A Gist (http://gist.github.com) is always helpful!
[23:24:27] quazimodo: has joined #RubyOnRails
[23:24:53] prgmmr: has joined #RubyOnRails
[23:25:55] sevenseacat: has joined #RubyOnRails
[23:26:57] Ropeney: has joined #RubyOnRails
[23:28:17] PedramT_: has joined #RubyOnRails
[23:29:11] allcentury: has joined #RubyOnRails
[23:31:11] drbayer: has joined #RubyOnRails
[23:33:14] _Tariq: has joined #RubyOnRails
[23:33:21] loc22: flappynerd: http://edgeguides.rubyonrails.org/api_app.html?utm_source=rubyweekly&utm_medium=email
[23:34:35] Radar: loc22: You could always have two apps connecting to the same DB.
[23:34:43] intrigueD: has joined #RubyOnRails
[23:34:54] Radar: It's not like Rails enforces only one app allowed per server
[23:35:34] loc22: Radar: Can I use two app connecting to the same DB in Heroku?
[23:35:49] Radar: loc22: Yes. You will need to change the DATABASE_URL on one of them to the other's.
[23:36:06] rhizome: smathy: similar to tests, i like it
[23:36:44] loc22: Radar: And when adding a new migration, I should add it to both projects?
[23:36:53] bronson: there's basically no downside to writing your api in a full rails app... loc22, is there a good reason to keep them m separate?
[23:36:56] fmcgeough: has joined #RubyOnRails
[23:37:16] Radar: loc22: uh, no. Why would you do that?
[23:37:26] Radar: loc22: the database only needs to be migrated once
[23:37:29] bronson: to keep them in sync of course. ;)
[23:38:11] loc22: bronson: I read that Rails API feature is faster than creating a full app. But then I need a dashboard. So looks like that I have to create a full app anyways
[23:38:26] bronson: loc22: faster...? like more reqs/sec?
[23:38:47] loc22: bronson: Yep. Is not like that?
[23:38:54] mices: can i discuss broad aspects of social networking site i'm developing
[23:38:57] bronson: not in a real app, no. not in my experience.
[23:39:07] Radar: 21ms / req instead of 22ms
[23:39:13] bronson: sure, a microbenchmark doing nothing might show rails app moving 40% faster.
[23:39:14] Radar: API vs full app
[23:39:26] Radar: loc22: If you really care about speed in an API why even consider Rails at all? Rails is slow. Phoenix is fast.
[23:39:28] bronson: but in a real app hitting a real database, no way. like 1% maybe.
[23:40:04] Radar: (although more often than not people who come in here asking for "fast Rails APIs" are those who don't actually _need_ "fast Rails APIs" ... yet)
[23:40:07] goodcodeguy: has joined #RubyOnRails
[23:40:20] rhizome: what if you're going to be the next snapchat
[23:40:32] baweaver: hire lawyers
[23:40:35] baweaver: you'll need them more
[23:40:49] rhizome: bottleneck in legal
[23:40:58] Papierkorb: > going to be
[23:41:04] bronson: you can always scale lawyers horizontally
[23:41:17] Radar: bronson: Correct. The number of zeroes scales horizontally.
[23:41:36] bronson: yes it does
[23:42:36] baweaver: loc22: just make a full rails app
[23:42:42] baweaver: that responds to JSON
[23:43:14] bronson: loc22: just create the full app. when you run into speed issues, api vs. full isn't going to make any difference.
[23:43:57] Deck`: has joined #RubyOnRails
[23:44:28] loc22: Radar, baweaver, bronson: Yes, I think I will stay with a full app. I also was looking at Phoenix but surelly not for this project. Thanks you guys for your time and your willingness to help :)
[23:46:51] mices: acts_as_friendable vs 'has many friends' or is there something better than both?
[23:48:42] aegis3121: has joined #RubyOnRails
[23:49:50] maclover7: has joined #RubyOnRails
[23:49:58] aegis3121: has joined #RubyOnRails
[23:50:37] blackmesa: has joined #RubyOnRails
[23:51:27] ql6wlld: has joined #RubyOnRails
[23:53:20] adavia: any idea why im not able to access any locals from this simple calendar class http://pastie.org/10728092#1
[23:54:51] nej: has joined #RubyOnRails
[23:54:55] adavia: sorry http://pastie.org/10728098
[23:55:21] sevenseacat: adavia: knowing the error might help
[23:55:36] adavia: sevenseacat: undefined local variable or method `date_range'
[23:55:52] adavia: sevenseacat: actually cant access any local
[23:56:23] czerasz: has joined #RubyOnRails
[23:56:34] Devalo: has joined #RubyOnRails
[23:57:07] Radar: I am confused as to why that couldn't be a helper called CalendarHelper.
[23:57:17] Radar: then you'd do render_calendar(number_of_days: 3)
[23:58:10] baweaver: has joined #RubyOnRails
[23:59:21] adavia: Radar: well i was trying to build a gem at first
[23:59:42] Radar: make it into an engine. my recommendation for it being a helper still stands.