« Back to channel list

#RubyOnRails - 22 September 2015

« Back 1 day Forward 1 day »
[00:00:04] mices: so how could all these pages work except this one
[00:00:33] tejasmanohar_: has joined #RubyOnRails
[00:00:34] blackmesa: has joined #RubyOnRails
[00:00:42] smathy: mices, there's no way that routes.rb produced that rake routes.
[00:01:10] smathy: mices, seems very unlikely, but just ensure that spring isn't running, run: spring stop
[00:01:15] smathy: mices, then run rake routes again.
[00:01:53] mices: spring is not running
[00:02:43] momomomomo: has joined #RubyOnRails
[00:02:56] smathy: mices, restart your web app, and try to go to any of the /bios URLs.
[00:03:37] smathy: mices, rake routes doesn't lie, so whatever is responding to your /bios URLs is not the same code (in memory) as what's stored on your hard disk in whatever app you copied that rake routes from.
[00:04:27] mices: fwiw i originally pressed ctrl-c during generate scaffold
[00:04:43] mices: because i was su'd in and wanted to run it as user
[00:04:52] mices: this is where things got messed up maybe
[00:05:22] mices: i ran generate scaffold again as user
[00:05:27] smathy: This is so ridiculous.
[00:05:36] pwnd_nsfw: Scaffolds are for plebs anyways
[00:05:48] smathy: pwnd_nsfw, I'm a pleb then.
[00:05:52] nettoweb: has joined #RubyOnRails
[00:06:03] pwnd_nsfw: I've installed gentoo
[00:06:08] baweaver: I'm not typing more than I have to
[00:06:08] mices: maybe perms on the routes lockfile
[00:06:19] smathy: pwnd_nsfw, what does that have to do with anything?
[00:06:20] _3by8: has joined #RubyOnRails
[00:06:29] pwnd_nsfw: smathy, tis a meme
[00:06:29] smathy: Oh right.
[00:06:31] smathy: I have too.
[00:06:38] stardiviner: has joined #RubyOnRails
[00:06:40] smathy: (is that how it goes?)
[00:06:49] pwnd_nsfw: It does now
[00:06:52] mices: yea the other bios pages work
[00:07:25] mices: should i log in as root and run rake routes and see what happens?
[00:07:42] smathy: ...then the code running in memory hasn't been reloaded since you removed the routes from whatever app you're getting that rake routes from.
[00:08:10] smathy: mices, you don't really want to know what I think you should do.
[00:08:10] mices: if i restart the machine would it help
[00:08:36] smathy: mices, I don't think it'll help you in the long run.
[00:09:13] mices: well it's in the right directory
[00:09:30] kidoz_: has joined #RubyOnRails
[00:09:41] idd2d: has joined #RubyOnRails
[00:10:39] chandlerbing: has joined #RubyOnRails
[00:11:03] neanderslob: has joined #RubyOnRails
[00:11:20] xelkarin: has joined #RubyOnRails
[00:12:42] mices: the routes don't show in rake routes but the other pages in the bios controller work
[00:12:56] mices: what could make the working routes invisible to rake
[00:13:05] pwnd_nsfw: localhost:3000/rails/info
[00:13:15] pwnd_nsfw: Does that show something different?
[00:13:25] pwnd_nsfw: If so, restart server...
[00:13:54] smathy: mices, absolutely nothing will make working routes invisible to rake.
[00:14:17] mices: yea all my bios routes are shown in the browser now
[00:14:23] smathy: mices, the server was started at a time when the config/routes.rb file was different than it is right now, and you've not restarted it since changing that file.
[00:14:39] smathy: mices, as I said above, restart your app.
[00:14:42] mices: i restart it over and over
[00:14:51] smathy: mices, how are you restarting it?
[00:15:04] mices: appdirectory# touch tmp/restart.txt
[00:15:07] _djbkd: has joined #RubyOnRails
[00:15:17] mices: the server?
[00:15:21] xelkarin: Is there an easy way to convert Rails' cookies object into something suitable for passing as a header to Net::HTTP?
[00:15:31] mices: i press ctrl-c and then rails server
[00:15:59] smathy: mices, ok, so press Ctrl-C but before rails server - reload the page in your browser again.
[00:16:37] mices: the routes/info page?
[00:16:49] six: has joined #RubyOnRails
[00:16:55] pwnd_nsfw: mices, sure
[00:16:57] smathy: mices, right, because the app you were restarting is not the app you're visiting in your browser.
[00:17:02] smathy: mices, as I said.
[00:17:06] mices: unable to connect
[00:17:12] mices: the servers down
[00:17:13] pwnd_nsfw: yey progress
[00:17:26] smathy: mices, oh, I thought you were saying that you received the routes info page.
[00:17:38] smathy: mices, ok, so before restarting the server, in that same window, run rake routes.
[00:17:38] jgt1: has joined #RubyOnRails
[00:17:38] pwnd_nsfw: restart server, click refresh on the same page
[00:17:43] chrisarcand: has joined #RubyOnRails
[00:17:48] mices: you told me to stop the server and reload the page before starting the server again
[00:18:02] smathy: mices, yep, and you're saying you got an unable to connect error in your browser?
[00:18:15] mices: of course, the server was stopped
[00:18:21] darrencauthon: has joined #RubyOnRails
[00:18:24] smathy: mices, nothing is "of course" with you.
[00:18:52] smathy: mices, anyway, in the same console that you used to have your server running, run rake routes
[00:20:02] allcentury: has joined #RubyOnRails
[00:20:10] mices: now all my bios routes are shown
[00:20:36] smathy: mices, wow, amazing ;)
[00:21:01] hfp_work: has joined #RubyOnRails
[00:21:08] mices: restart the server? (after reading the routes?)
[00:21:09] neanderslob: hi all, I'm attempting to create an entry in a parent model using a child model's controller; the issue is that I get the routing error: "uninitialized constant CompaniesController"
[00:21:26] smathy: mices, well no, paste those routes into the gist.
[00:21:30] neanderslob: if anyone wants to take a look, here's the gist containing my code https://gist.github.com/BigMcLargeHuge/63376ec9726111be7a6f
[00:21:31] pwnd_nsfw: neanderslob, code 'n things
[00:22:02] mices: this is what i was saying before, /bios/:id is already mapped to bios#show
[00:22:13] mices: even though it's not in the routes.rb file
[00:22:40] smathy: mices, that bit where I ask you to do something, and you don't do it, that shit's gotta stop.
[00:22:41] mices: i have to use show i can't write a method that uses that route
[00:22:46] pwnd_nsfw: neanderslob, I think something else is causing that error than the code you have provided
[00:23:00] smathy: mices, I can't explain how frustrating it is trying to help someone who won't follow simple instructions.
[00:23:02] pwnd_nsfw: What's the URL you're visiting and what does your routes look like?
[00:23:22] mices: o paste the routes in gist ok wait i didn't see sorry
[00:23:45] pwnd_nsfw: "pastes link for pastebin.ca"
[00:23:59] smathy: pwnd_nsfw, no, I've got him using gist (properly) now.
[00:24:21] smathy: mices, and as soon as you've added them to your gist, run: cat config/routes.rb and add that to the gist too.
[00:24:29] pwnd_nsfw: smathy, https://gist.github.com/SirUncleCid/98bc0ca193fe07c940b9
[00:24:51] smathy: No, look: https://gist.github.com/mices/e8b2ef7d8f2dc760dbec
[00:25:00] smathy: Correct extensions for colors and everything!
[00:25:26] mices: smathy: ok i replaced the rake routes in the gist
[00:25:35] mehwork: has joined #RubyOnRails
[00:25:48] Depili: has joined #RubyOnRails
[00:25:48] insu: has joined #RubyOnRails
[00:26:19] pwnd_nsfw: I wonder if it's having issues with pluralization
[00:26:29] ericjphillips: has joined #RubyOnRails
[00:27:19] smathy: mices, ok, and you can start the server again now, and go back to /bios/1
[00:27:29] smathy: mices, and tell me what error you get.
[00:27:57] neanderslob: pwnd_nsfw: to be clear, this is in the incorporation view, even though the form is for "company"; there shouldn't be anything I need to add to the simple form to make that work?
[00:28:06] yfeldblum: has joined #RubyOnRails
[00:28:31] jso: has joined #RubyOnRails
[00:28:39] smathy: mices, seriously, that should have taken you about 12 seconds.
[00:29:03] smathy: mices, start your server, go to your /bios/whaterer_id_you've_been_using and report back.
[00:29:32] pwnd_nsfw: neanderslob, when you put a model as the argument for form_for, it's going to try and use a controller of a similar model, so you have to specify otherwise
[00:29:53] mices: NoMethodError in Bios#artist_bio
[00:30:11] mices: undefined method `artist' for nil:NilClass
[00:30:35] pwnd_nsfw: @bio = Bio.find_by(:id)
[00:30:38] pwnd_nsfw: Isn't correct
[00:30:55] pwnd_nsfw: in the artist_bio method of your bios controller
[00:31:08] pwnd_nsfw: @bio = Bio.find(params[:id])
[00:31:13] baweaver: It would also raise another error
[00:31:16] roxtrongo: has joined #RubyOnRails
[00:31:18] pwnd_nsfw: @bio = Bio.find_by(id: params[:id])
[00:31:21] neanderslob: pwnd_nsfw: ah, that's what I sort of suspected; any idea of how to do that or should I hit the google?
[00:31:26] baweaver: RuntimeError: unsupported: Symbol
[00:31:31] smathy: mices, paste the full error, from your console, into your gist please.
[00:31:36] baweaver: meaning someone's lying here mices
[00:32:19] smathy: baweaver, I actually suspect that he has editor buffers open but unsaved (or something equally daft), and has no clue what the actual code his server is running is.
[00:32:24] pwnd_nsfw: neanderslob, use route helper method. So like.. you're trying to post to IncorporationController, right?
[00:32:32] hfp_work: has joined #RubyOnRails
[00:32:39] pwnd_nsfw: incorporations_path or w/e
[00:32:44] neanderslob: pwnd_nsfw: yep
[00:33:09] pwnd_nsfw: Seems awkward what you're doing though
[00:33:19] mices: pwnd_nsfw: works, thanks
[00:33:33] pwnd_nsfw: I feel this should be happening in the companies controller
[00:33:55] doublemalt_: has joined #RubyOnRails
[00:34:15] mices: but i'm still troubled by that same url routes to bios#show and bios#artist_bio
[00:34:16] neanderslob: pwnd_nsfw: I know, basically I'm doing it this way because there are several different vectors by which users might create a company
[00:34:56] Aeyrix: mices: They should be the same
[00:34:59] Aeyrix: you shouldn't have one of those
[00:35:11] neanderslob: pwnd_nsfw: but you're quite right, it is a pain and not advisable in better circumstances :-)
[00:37:58] smathy: mices, if you changed Bio.find_by(:id) to Bio.find_by(id: params[:id]) in artist_bio and it went from "undefined method artist for nil" to working, then you have other really major problems with how your app is running.
[00:39:39] BlackCoyote: has joined #RubyOnRails
[00:39:54] tjbiddle: has joined #RubyOnRails
[00:42:26] neanderslob: pwnd_nsfw: hey, I'm having trouble figuring out how to apply a route helper to simple_form, could you give me a hint?
[00:42:46] annlewis: has joined #RubyOnRails
[00:43:25] mices: Aeyrix: <Aeyrix> you shouldn't have one of those ... one of what?
[00:43:38] smathy: mices, a computer.
[00:44:00] lasker85: has joined #RubyOnRails
[00:45:05] mices: what about the same url having 2 different routes
[00:45:14] mices: show and artist_bio
[00:45:14] pwnd_nsfw: neanderslob, http://stackoverflow.com/questions/23945600/rails-4-action-routes-with-simple-form-and-shallow-nested-resources
[00:45:38] mices: i could have used the show method i never needed to write this
[00:45:55] mices: i see, i wrote this so i could leave the show method untouched
[00:45:56] neanderslob: pwnd_nsfw: ah, thanks
[00:46:04] mices: that's why i did it
[00:46:08] mices: was i ok on that?
[00:46:27] pwnd_nsfw: mices, but why
[00:47:05] mices: cause i'm brand new i just got started and i love the way rails gives you all these methods and routes i didn't wanna mess any of them up
[00:47:38] mices: i can leave them there for future admisitrative pages
[00:48:08] michael_mbp: has joined #RubyOnRails
[00:48:49] pwnd_nsfw: mices, you should read a book or something
[00:48:51] mices: rails gives me admisitrative pages out of the box with the scaffold generator
[00:48:53] benhorowitz: has joined #RubyOnRails
[00:49:01] pwnd_nsfw: Before you continue with anymore poor practices.
[00:49:37] mices: if you just wanna create an app to organize your recipes in the kitchen let's say rails gives all to you right out of the box with one generate scaffold
[00:50:04] mices: you know what that's worth?
[00:50:10] draig: im in a simmilar boat pwnd_nsfw
[00:50:30] draig: and ive found for special needs ive had to forgo the scaffolds
[00:50:35] draig: but im learning
[00:50:44] Aeyrix: You should not be using scaffolds
[00:50:49] Aeyrix: Like, ever.
[00:50:52] draig: which brings me to a question on migrations
[00:51:17] Aeyrix: They really need to be removed to honest.
[00:51:33] Aeyrix: Why do you think?
[00:51:48] draig: i dont think they shld be removed, which is why im asking you
[00:52:18] draig: im assuming the sme reason most expereinced people hate automation, they want to do it all by hand
[00:52:25] Aeyrix: Because people don't think they should be removed. They're a shit crutch.
[00:52:39] pwnd_nsfw: I feel I end up doing more work if I use scaffolds
[00:52:47] draig: id say for the simple case, they could save time.
[00:52:52] Aeyrix: You have to undo the bullshit.
[00:53:03] pwnd_nsfw: I don't need half the shit it generates. I don't even know why it puts the crap that it does in routes file, it should just use resources...
[00:53:05] Aeyrix: For a simple case use Sinatra, not Rails.
[00:53:05] draig: but ive found its nearly as easy just to make a model a controller and routes
[00:53:16] sharkman: what is a scafold
[00:53:24] pwnd_nsfw: RUN, RUN FAR AWAY SHARKMAN
[00:53:30] Aeyrix: Trash. Don't look it up.
[00:53:33] draig: how would you integrate a db in sinatra?
[00:53:42] draig: rails g scaffold ....
[00:54:19] draig: Aeyrix you argument sounds simmilar to people who odnt use GUI designers for desktop apps
[00:54:21] pwnd_nsfw: draig, you can use ActiveRecord in sinatra too lul
[00:54:38] draig: hmm interesting
[00:55:03] mices: thanks for all your help today everybody
[00:55:22] mices: learned a lot today
[00:55:29] draig: but anyway to my question about migrations
[00:55:41] draig: change vs up and down
[00:55:56] sevenseacat: has joined #RubyOnRails
[00:56:03] nya: has joined #RubyOnRails
[00:56:13] pwnd_nsfw: draig, change is for simple migrations
[00:56:20] ellisTAA: has joined #RubyOnRails
[00:56:34] Aeyrix: draig: You mean people who appreciate doing things correctly?
[00:56:41] draig: mine atm are simple but i find i muck up the db at this stage
[00:56:42] Aeyrix: You know why people still use a text editor over Adobe Dreamweaver?
[00:56:46] _3by8: How do I access elements of an array stored in a hash?
[00:56:52] ellisTAA: i need to include a map in my site and highlight certain coordinates, can anyone recommend a free library for this?
[00:56:56] Aeyrix: Because Dreamweaver generates shite, inefficient code.
[00:57:01] draig: im not talking about web apps. im talking about say iOS apps
[00:57:08] draig: or Windows apps
[00:57:09] Aeyrix: That changes nothing and my example still stands.
[00:57:17] sharkman: if im in the rails console and i have a table named Data
[00:57:22] sharkman: how would i query to see what column names Data has
[00:57:23] Aeyrix: The fact you even tried to use that as some form of defence shows just how much you know.
[00:57:27] pwnd_nsfw: _3by8, with a numeric index?
[00:57:31] draig: what shit code does a scaffold generate?
[00:57:36] Aeyrix: All of it.
[00:57:51] sharkman: like Data.names
[00:57:56] pwnd_nsfw: sharkman, attributes I think
[00:57:59] draig: never claimed to know much, but ive been coding in a variety of langs for a couple of decades
[00:58:10] pwnd_nsfw: But you may need an actual instance of the model
[00:58:18] Aeyrix: draig: Coding or drag n drop?
[00:58:21] draig: and i know how and when to use the tools available
[00:58:23] Aeyrix: Distinct difference.
[00:58:24] draig: I can do both
[00:58:41] draig: and it depends on what im doing as to what / when i use either
[00:58:44] paradisaeidae: has joined #RubyOnRails
[00:59:23] draig: considering ive sen the horrible amount of time that can be wasted in iOS by doing every view in code vs using interface builder
[01:00:01] Aeyrix: alright m8
[01:00:04] draig: but ive also seen IB make things a pita. it depends on the complexity of the use case and such
[01:00:05] Aeyrix: clearly you are the haqueere god here
[01:00:13] Aeyrix: so i'll let you just do things your way
[01:00:20] Aeyrix: but good luck if you come in here needing help
[01:00:26] Aeyrix: and present anything you've generated like that
[01:01:04] draig: im not talking about scaffolds. I doubt you would understand any objc coded views or view controllers
[01:01:57] draig: I asked you to explain how say the models, migrations, routes or controllers a scaffold generates is bad
[01:02:08] Aeyrix: Actually I know Objective C quite well.
[01:02:16] draig: simply saying they are a shit crutch isnt useful
[01:02:25] Aeyrix: For what it's worth, I'm quite handy with Swift too.
[01:02:43] baweaver: Aeyrix: So you could say you're a a bit of a swift learner then eh?
[01:02:46] draig: then you should know the performance of a view has nothing to do with the format of the xml in a nib or storyboard
[01:02:59] Aeyrix: baweaver: kek
[01:03:06] Aeyrix: draig: oh lord
[01:03:06] mdel: has joined #RubyOnRails
[01:03:15] draig: since they contain only object state and no executable code
[01:03:20] Aeyrix: draig: I've crashed systems using nothing but XML.
[01:03:22] Aeyrix: Just FYI.
[01:03:31] Aeyrix: In fact, I've crashed systems using nothing but XML attributes.
[01:03:56] NBarnes: has joined #RubyOnRails
[01:04:05] Aeyrix: They are a markup language. They matter in terms of performance.
[01:04:17] Aeyrix: There is a demonstrable impact on presentation speed depending on how you structure it.
[01:04:25] Aeyrix: Just look at browsers rendering HTML.
[01:04:46] Aeyrix: I'm still not 100% sure why you're so bent on talking about your interface-builder generated iOS application when we're in #RubyOnRails.
[01:04:52] Aeyrix: But hey, I guess it's quiet time.
[01:04:55] draig: browsers rendering html and a nib instantiating a view are not the same execution environment
[01:04:58] mrchris: has joined #RubyOnRails
[01:05:40] draig: I'm making an analogy that IB can save time on trivial parts of a UI, like how scaffolds could do the same for a rails app
[01:05:49] Cache_Money: has joined #RubyOnRails
[01:05:54] Aeyrix: Bad analogy, incorrect, and misguided.
[01:06:32] Aeyrix: Head size doesn't increase the hitbox size though, I've tested the bounds before.
[01:06:37] Aeyrix: Er, wrong channel. Thanks IRCCloud.
[01:06:37] FailBit: no no and no
[01:07:13] FailBit: also, XML is a horrible language to parse
[01:07:15] draig: did you know that when a xib is compiled it gets turned into a binary format anyway? so the fact it is xml is irrevelent?
[01:07:25] draig: its parsed at compile time, not runtime
[01:07:28] sevenseacat: can we stop talking about iOS now
[01:07:32] Aeyrix: offtopic conversation
[01:07:34] Aeyrix: thanks sevenseacat
[01:07:59] draig: sure. i simply asked why scaffolds should be removed, s they seem to me they could save time on trivial tasks
[01:08:17] sevenseacat: because people use them to learn rails and they dont understand what they do
[01:08:28] sevenseacat: plus, most of the boilerplate ends up needing to be removed
[01:08:39] draig: i can say ive learned a bit from looking at how they do things
[01:08:58] draig: i came here asking about migrations originally
[01:09:08] pwnd_nsfw: ONE THING LEADS TO ANOTHAAA
[01:09:27] draig: ie should i create a separate migration to undo a db change, and just use the change method
[01:09:30] sevenseacat: thats great, but you're not the typical learner that we see here.
[01:09:42] draig: or should I use up and down in the same migration
[01:09:42] pwnd_nsfw: draig, if the last migration you want to change isn't the very last migration
[01:09:48] workmad3: has joined #RubyOnRails
[01:09:54] pwnd_nsfw: Or some complex migration that you didn't write a "down" for
[01:10:00] pwnd_nsfw: then yeah, otherwise db:rollback
[01:10:10] badfish129: has joined #RubyOnRails
[01:10:23] draig: could it be said its a good idea to always right a down? I think i saw that said in rails for zombies
[01:10:32] draig: lol write
[01:10:34] sevenseacat: only write one if you need it
[01:10:35] ellisTAA: i want to use a javascript library in my project, should i just put the code in vendor, assets, javascripts?
[01:10:38] pwnd_nsfw: Eh, you don't HAVE to.
[01:10:39] sevenseacat: otherwise, just use change
[01:10:43] Aeyrix: Most of the time it can be omitted if you're doing simple stuff.
[01:10:43] mrchris: has joined #RubyOnRails
[01:10:47] Aeyrix: And most of the time you really are doing simple stuff.
[01:11:12] draig: i find as im hacking my way in learning this, and trying to do something useful I name my models badly or need to remove them
[01:11:24] draig: and then destroying the model muchs up my schema
[01:11:33] pwnd_nsfw: you can rename tables
[01:11:37] sevenseacat: always rollback your db before deleting migrations.
[01:11:55] pwnd_nsfw: Furthermore, use git
[01:12:09] draig: i do, but a lot of times im bad and dont maek small commits
[01:12:33] Aeyrix: I wrote a plugin for Sublime Text 2 that made a git commit every time you saved a file.
[01:12:47] draig: mainly for now, im just wanting to add tables on up and drop them on down
[01:13:06] Aeyrix: unfortunately it ended up looking like this: https://github.com/frc-frecon/frecon/commits/master
[01:13:08] pwnd_nsfw: Aeyrix, what would your commit message be?
[01:13:12] draig: and since rails g model makes a migration with just change, i wasnt sure what the best way to do it would be
[01:13:14] sevenseacat: then just use the change method
[01:13:23] sevenseacat: rails knows that the opposite of create table is drop table
[01:13:28] Aeyrix: pwnd_nsfw: update <filename>
[01:13:31] Aeyrix: wasn't anything fancy
[01:13:33] draig: and have say an AddFoo and RemoveFoo migration?
[01:13:42] draig: anything for atom?
[01:13:53] draig: as far as naming migrations
[01:14:14] sonofdirt: has joined #RubyOnRails
[01:14:24] yaymukund: has joined #RubyOnRails
[01:14:39] draig: if i just use the change method wouldnt they need to be different migrations?
[01:14:55] pwnd_nsfw: Rails knows the up and down for a change
[01:15:00] pwnd_nsfw: Given it's simple enough
[01:15:21] draig: hmm i see that would explain why it doesnt imp up down in its generators
[01:15:22] sevenseacat: see, now you don't understand migrations and we have to explain them to you
[01:15:28] workmad3: has joined #RubyOnRails
[01:15:38] sevenseacat: instead of just you following a tutorial that explains everything as you go
[01:15:49] stannard: has joined #RubyOnRails
[01:15:50] Aeyrix: *cough* R4IA
[01:15:51] pwnd_nsfw: Rails 4 in Action bruh
[01:15:59] sevenseacat: damn straight!
[01:16:03] sevenseacat: we spent a lot of time explaining this shit
[01:16:08] draig: i think i bought that book
[01:16:10] pwnd_nsfw: Much better than Rails Tutorial I think
[01:16:24] sevenseacat: draig: its a good book. i spent nearly a year writing it.
[01:16:33] draig: it is huge
[01:16:56] pwnd_nsfw: Huge? Not quite..
[01:16:58] Aeyrix: 3mo writing
[01:17:01] Aeyrix: 9mo fighting Manning
[01:17:04] pwnd_nsfw: It's the perfect size.
[01:17:17] Aeyrix: >benhorowitz
[01:17:19] draig: seems my copy is 8 or 9 hundred pages.
[01:17:22] Aeyrix: is Marc around?
[01:17:29] draig: ah i think i got the rails 4 way
[01:17:36] draig: not rails 4 in action
[01:17:40] helpa: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[01:17:53] bkulbida: has joined #RubyOnRails
[01:17:54] blackmesa: has joined #RubyOnRails
[01:18:21] draig: ill grab that too when my next payday comes
[01:18:51] draig: at my old job out server team used rails, so it seemed like a logical fit for me to use on this project
[01:19:06] jenrzzz: has joined #RubyOnRails
[01:20:08] greengriminal: has joined #RubyOnRails
[01:20:43] _3by8: Question: I'm trying to access an array in a hash by using its key and then attempting to iterate through the array like so: hash['key'].each do |x|
[01:20:47] _3by8: But it's giving me an error.
[01:21:02] benhorowitz: has joined #RubyOnRails
[01:21:03] _3by8: Undefined method 'each'
[01:21:22] Aeyrix: There's more to that error.
[01:21:26] Aeyrix: What's the rest of it?
[01:21:28] Aeyrix: Yo Radar.
[01:21:47] sevenseacat: morning Radar
[01:21:56] _3by8: AllSets.rb:7:in `block (2 levels) in <top (required)>': undefined method `each' for nil:NilClass (NoMethodError) from AllSets.rb:6:in `each' from AllSets.rb:6:in `block in <top (required)>' from AllSets.rb:5:in `each'
[01:21:59] sevenseacat: or evening or whatever the crap it is Canada
[01:22:09] _3by8: That's still just part of it Aeyrix
[01:22:18] Radar: _3by8: gist the stacktrace, rather than posting it in here
[01:22:20] Radar: sevenseacat: Evening :)
[01:22:25] _3by8: Gist, eh?
[01:22:29] helpa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[01:22:41] Aeyrix: Radar: Cider O'Clock!
[01:22:54] sevenseacat: ah exactly 12 hours different. cool
[01:23:05] chipotle: has joined #RubyOnRails
[01:23:37] Aeyrix: Radar: How's the weather rn?
[01:23:41] Aeyrix: "Passing showers" here. :(
[01:24:23] adam12: sevenseacat: it's evening
[01:24:27] adam12: Radar: CANADA??!?!
[01:24:42] Radar: adam12: Yes Canada is a country which exists and I am currently in it.
[01:24:50] sevenseacat: adam12: it's 9.24am here and looking like a warm and sunny day :)
[01:24:50] Aeyrix: lol no it doesn't
[01:24:52] Radar: Aeyrix: a balmy 22 degrees
[01:24:54] Aeyrix: that's northern north america
[01:24:58] adam12: Where abouts? And jetlag is a bitch :)
[01:25:05] Xiti: has left #RubyOnRails: ()
[01:25:51] _3by8: Aeyrix: https://gist.github.com/threebyeight/a873a8620db440a44448
[01:27:31] benlieb: has joined #RubyOnRails
[01:27:37] Aeyrix: that nick
[01:28:00] ellisTAA: do i need to link to my third party libraries or will rails know what i mean in my javascript?
[01:29:35] _3by8: Aeyrix: what's wrong with it? Is it too long?
[01:30:17] Radar: adam12: Montreal and I got here about a week ago so jetlag has gone
[01:30:21] draig: some of my favorite youtubers are in canada
[01:30:31] draig: Radar have you had a poutine yet?
[01:30:33] _3by8: Aeyrix: I updated the gist with a sample JSON file.
[01:30:35] Radar: draig: of course
[01:30:38] Radar: first night
[01:30:50] pwnd_nsfw: ["LEA"]["cards"]
[01:31:02] pwnd_nsfw: Would give you that array of hashes
[01:31:11] Radar: _3by8: I recommend using pry and sticking a binding.pry where there is a sets.each
[01:31:12] draig: ive only had homemade approximations, but everyone loved them. (used to game with some quebecois who introduced me to them)
[01:31:16] Radar: after the sets.each*
[01:31:42] draig: sevenseacat using rake:db rollback was much easier
[01:32:10] draig: this makes me wonder some though
[01:32:24] draig: should i be using rails at all, or should i use sinatra?
[01:32:46] pwnd_nsfw: I mean... you can do the same things in either...
[01:32:57] pwnd_nsfw: Doing them would be different
[01:33:06] draig: im working on an IoT type project that collects sensor data, and will eventually have a litle web app for administration
[01:33:28] draig: I assumed i could, but im wondering why one would use one over the other?
[01:33:56] _3by8: Radar: any idea why it's erroring out though?
[01:34:01] gambl0re: has joined #RubyOnRails
[01:34:03] draig: since im going to be delpoying on an rpi2 i want it to be as lean as possible
[01:34:51] bmurt: has joined #RubyOnRails
[01:35:12] Radar: _3by8: I reckon you can figure that one out easily with binding.pry.
[01:35:21] adam12: Radar: cool. not close to me so no beer for you.
[01:35:28] pwnd_nsfw: draig, https://github.com/rkh/almost-sinatra here you go m8
[01:35:38] Radar: adam12: When you come to Melbourne you can buy me beer
[01:35:46] Radar: well, cider because I don't drink beer
[01:35:54] adam12: Radar: deal - and you can tell me how jetlag is a bitch
[01:36:29] Maletor: has joined #RubyOnRails
[01:37:04] Radar: bye bye for now
[01:37:15] bendangelo: has joined #RubyOnRails
[01:37:33] draig: lol pwnd_nsfw
[01:41:42] mrchris: has joined #RubyOnRails
[01:43:31] jgt1: has joined #RubyOnRails
[01:45:39] workmad3: has joined #RubyOnRails
[01:46:12] havenwood: has joined #RubyOnRails
[01:46:21] jonahwtf: has joined #RubyOnRails
[01:46:57] Creeves: has joined #RubyOnRails
[01:48:31] mary5030: has joined #RubyOnRails
[01:48:57] EminenceHC: has joined #RubyOnRails
[01:51:17] mary5030: has joined #RubyOnRails
[01:52:44] mary5030_: has joined #RubyOnRails
[01:53:40] mary5030: has joined #RubyOnRails
[01:54:21] greenride: has joined #RubyOnRails
[01:55:00] greenride: has left #RubyOnRails: ()
[01:55:50] mary5030_: has joined #RubyOnRails
[01:56:34] mary5030_: has joined #RubyOnRails
[01:57:12] mices: got everything working found a lot of errors in my app from yesterday had a lot of debugging to do
[01:57:20] rubyonrails199: has joined #RubyOnRails
[01:59:42] lasker85: has joined #RubyOnRails
[02:00:54] mary5030: has joined #RubyOnRails
[02:01:41] banjara: has joined #RubyOnRails
[02:03:00] quazimodo: Possible to turn off email body logging?
[02:03:08] quazimodo: it's chewing up my log and making a bit hard to read
[02:03:23] chills42: has joined #RubyOnRails
[02:07:58] mary5030: has joined #RubyOnRails
[02:09:18] havenn: has joined #RubyOnRails
[02:11:43] badfish129: has joined #RubyOnRails
[02:13:19] Wingar: has joined #RubyOnRails
[02:16:14] idd2d: has joined #RubyOnRails
[02:20:42] roxtrongo: has joined #RubyOnRails
[02:21:57] briandeweese: has joined #RubyOnRails
[02:25:48] draig: hmm now to find some way to graph data in my db
[02:27:58] idd2d: has joined #RubyOnRails
[02:29:31] vipaca: has joined #RubyOnRails
[02:30:19] bmurt: has joined #RubyOnRails
[02:31:02] capin: draig: d3.js ?
[02:31:36] draig: ill look at it
[02:32:03] draig: i decided to abstract some bahvior into a superclass for my models, but it doesnt seem to workout
[02:32:32] draig: must models be a direct subclass of ActiveRecord ?
[02:33:32] draig: since atm my two models have the same fields and validations.
[02:36:39] draig: seems my subclass doesnt know where its superclass is
[02:37:25] sevenseacat: if you want actual help, you might need to be more specific.
[02:40:57] draig: i figured id google a bit first so i dont seem like a moron
[02:41:17] draig: an SO post from 2k11 suggests using a module. ill make a gist
[02:42:39] ahmgeek: has joined #RubyOnRails
[02:42:41] givanse: has joined #RubyOnRails
[02:43:02] sevenseacat: a gist would be a great idea.
[02:44:17] martinbjeldbak: has joined #RubyOnRails
[02:44:31] FailBit: a fist would be a great idea
[02:44:41] ahmgeek: sorry fellas
[02:44:49] FailBit: delivered directly to the pants, no less!
[02:44:57] davidcelis: has joined #RubyOnRails
[02:44:57] davidcelis: has joined #RubyOnRails
[02:45:05] sptq: has joined #RubyOnRails
[02:45:06] Aeyrix: ahmgeek: ?
[02:45:07] FailBit: ACTION has no idea what's actually happening here
[02:46:56] draig: https://gist.github.com/jhoughjr/be81f2b338b834b88faf
[02:47:28] sevenseacat: remove the include SensorReading line
[02:47:51] draig: ok i got the same result with that
[02:48:24] sevenseacat: ok, so whats the full error, and what is the name and path of this SensorReading file
[02:49:06] ahmgeek: has left #RubyOnRails: ("Leaving")
[02:49:18] draig: app/models/SesnorReading.rb
[02:49:19] ahmgeek: has joined #RubyOnRails
[02:49:46] draig: i assume it would be include 'SensorReading.rb'
[02:49:52] draig: heh i cant type today
[02:50:00] quazimodo: I see a 'rescue_from Exception' in a controller
[02:50:01] sevenseacat: now rename the file to match rails naming conventions - sensor_reading.rb
[02:50:03] quazimodo: it makes me feel a bit funny
[02:50:58] draig: ah i had a feeling there was something in rails magic since i havent seen files included a l?? c languages
[02:51:21] sevenseacat: well, all of your other model filenames might have given it away :P having a single camelcase one would stand out
[02:52:18] draig: they are all one word lol
[02:52:27] draig: temperature and humidity atm
[02:52:36] sevenseacat: and lowercase, no
[02:52:42] sevenseacat: just like humidities_controller.rb
[02:52:51] draig: it looks like i have to override new and call supers imp
[02:53:00] sevenseacat: fix the filenames first.
[02:53:03] draig: since it can't find table SensorReadings
[02:53:09] draig: fot me further
[02:53:14] quazimodo: draig: so always be careful with this autoload crap
[02:53:14] sevenseacat: right, because now you're using single table inheritance
[02:53:24] quazimodo: User and MyModul::User
[02:53:30] sevenseacat: if you don't want to put them in the same table, specify the table name for each model
[02:53:47] sevenseacat: http://stackoverflow.com/questions/4613574/how-do-i-explicitly-specify-a-models-table-name-mapping-in-rails
[02:53:56] quazimodo: if you are inside some other class/module in MyModule, and you reference User, in your mind (and if you required everything at the start) you'd be referencing MyModule::User
[02:54:10] quazimodo: but rails didn't load it, and *IF* you had loaded User before, it will use ::User
[02:54:16] quazimodo: not MyModule::User
[02:54:20] sevenseacat: way to confuse the issue
[02:54:36] quazimodo: because it knows you want a User, ::User exists and was loaded before (by chance), it wont look for MyModule::User
[02:54:49] montagesoftware_: has joined #RubyOnRails
[02:54:50] sevenseacat: yes, ruby constant autoloading sucks
[02:54:54] sevenseacat: unrelated to the problem at hand
[02:54:54] quazimodo: sevenseacat: it is a major pain in the balls
[02:55:08] draig: it is different from objc
[02:55:08] quazimodo: and he seemed to be new, it's something i wish i'd been taught early on
[02:55:25] ahmgeek: a question regards rails and js, if I have a file _something.js.erb and I do render it directly from a page, this file do some appends on the html in the erb page. but it never append any thing.
[02:55:46] sevenseacat: thats not a question
[02:56:02] quazimodo: ahmgeek: gist.github.com, please show code :)
[02:56:09] draig: thanks that seems simple enough
[02:56:13] ahmgeek: I didn't even complete :( fellas :D
[02:56:46] sevenseacat: ahmgeek: let's not make people even grumpier by pegging them all as men.
[02:56:52] gambl0re: what is ruby's runtime environment?
[02:57:40] ahmgeek: sevenseacat, I noticed that you're not a man, and I say fellas instead of guys
[02:58:10] ahmgeek: I am an Egyptian guy, so I don't have so much grammar abilities to express things right.
[02:59:39] gambl0re: sevenseacat is a she..i just found out also
[02:59:59] quazimodo: ahmgeek: dont' even bother
[03:00:09] quazimodo: please post your code
[03:00:23] baweaver: has joined #RubyOnRails
[03:00:38] quazimodo: gambl0re: it' doesn't have a VM if that's what you mean
[03:00:50] gambl0re: thats not what i mean
[03:01:17] quazimodo: what did you mean?
[03:01:27] workmad3: has joined #RubyOnRails
[03:01:48] moneylotion: has left #RubyOnRails: ()
[03:03:07] ahmgeek: https://gist.github.com/ahmgeek/4dc320ff35f524d57cf3, please don't be mad because I posted html right there.
[03:04:14] draig: hmm did self.table_name = "humidities" in humidity.rb and restarted the server, still looking for table 'sensor_readings'
[03:04:54] quazimodo: ok, so what's calling that JS
[03:04:58] quazimodo: is it being called?
[03:05:03] rboyd: has joined #RubyOnRails
[03:05:57] ahmgeek: I can put all of the js code there, one second.
[03:06:12] quazimodo: i see console.log
[03:06:15] quazimodo: does it happen?
[03:06:35] maz-dev: has joined #RubyOnRails
[03:06:41] ahmgeek: that's why I asked if append needs some personal treats in rails
[03:07:51] ahmgeek: refresh the gist
[03:08:25] draig: https://gist.github.com/jhoughjr/be81f2b338b834b88faf
[03:09:18] braincrash: has joined #RubyOnRails
[03:11:57] quazimodo: ahmgeek: this for you or your company?
[03:12:21] draig: so it seems set.table_name isnt working
[03:13:16] ahmgeek: quazimodo, this if for the current app I build. social-network in a neat new way &_&
[03:14:31] aghalarp: has joined #RubyOnRails
[03:14:56] beauby: has joined #RubyOnRails
[03:15:18] draig: the SO post doesnt indicate anything else i need to do
[03:16:04] draig: is this rails that does the single table inheritence or ActiveRecord. I assume its ActiveRecord
[03:16:09] aghalarp: has joined #RubyOnRails
[03:16:15] sevenseacat: activerecord.
[03:16:29] sevenseacat: what version of rails are you using? did you stop and restart your server and/or spring?
[03:17:59] annlewis: has joined #RubyOnRails
[03:18:49] yfeldblum: has joined #RubyOnRails
[03:19:48] vipaca: has joined #RubyOnRails
[03:19:57] tjbiddle: has joined #RubyOnRails
[03:21:11] tjbiddle: Anyone know of an easy package-manager friendly way to install handlebar helpers?
[03:21:32] tjbiddle: I've been using rails-assets.org to install all my JS assets recently - but doesn't seem to work with handlebar helpers
[03:21:44] draig: i restarted the server, rails 4.2.4
[03:22:02] quazimodo: ahmgeek: hrm
[03:22:42] ahmgeek: quazimodo, what ?
[03:23:01] quazimodo: ahmgeek: well you have all this stuff going on
[03:23:05] quazimodo: and your function just isn't being called
[03:23:08] quazimodo: so do some debugging
[03:23:20] quazimodo: it's being used in several places
[03:23:27] yfeldblum: has joined #RubyOnRails
[03:23:44] djbkd: has joined #RubyOnRails
[03:23:58] polly_wog: has joined #RubyOnRails
[03:24:49] draig: looking for the spring version, its not stated in the gemfile or the apps environment page
[03:25:23] sevenseacat: `spring stop`
[03:25:31] quazimodo: I really con't read javascript for shit
[03:26:02] ahmgeek: I hate Java
[03:26:06] ahmgeek: I hate python
[03:26:13] ahmgeek: I hate dad
[03:26:17] draig: I love objc and like ruby
[03:26:30] quazimodo: python's good
[03:26:37] quazimodo: so's coffee (in my mind anyway)
[03:26:42] quazimodo: makes js readable
[03:26:49] quazimodo: ... readerable
[03:26:59] ahmgeek: all of them is good, I just hate them, except my dad, he no good. he's a bitch :D
[03:27:50] draig: only message i see when WEBrick starts and when i run strping stop refers to the version of RubyGems 2.0.14
[03:28:02] draig: guess i can do gem which spring
[03:28:30] michaeldeol: has joined #RubyOnRails
[03:29:17] draig: hmm or not
[03:29:19] quazimodo: draig: spring yucky, zeusy baby
[03:29:35] quazimodo: ahmgeek: so yeah. Your js function destroys my brain
[03:29:43] quazimodo: step through it
[03:29:49] quazimodo: figure out what's actually wrong
[03:30:10] draig: quazimodo all i need to do is add it to the Gemfile and remove spring?
[03:30:23] draig: or would i nedd to learn more, lol
[03:30:41] draig: (wishes he had money to pay someone to do this so he could get back to Cocoa)
[03:32:08] draig: i am curious why DRY is mroe complicated than it seems it should be.
[03:32:35] sevenseacat: draig: because you're not learning rails the easy way
[03:32:58] draig: lol i know
[03:33:02] ahmgeek: quazimodo, thanks dude, I hug you
[03:33:19] draig: you learn more from mistakes than successes though
[03:34:26] sevenseacat: then thats why its more complicated than it should be.
[03:36:01] draig: 1.4.0 is the version of spring
[03:36:14] Aeyrix: "Garbage" is the version of spring.
[03:36:28] draig: stopping it and restarting the server yielded the same results in the gist
[03:36:36] Aeyrix: "rails new --skip-spring" ftw
[03:36:40] dima_: has joined #RubyOnRails
[03:37:07] draig: yeah i wouldnt mind having to restart the server each time i change code
[03:37:23] aghalarp: has joined #RubyOnRails
[03:37:58] sevenseacat: aaaaand you dont know what spring is for, it seems.
[03:40:00] draig: it keeps the app running in the background accroding to the comments in the Gemfile
[03:40:37] EminenceHC: has joined #RubyOnRails
[03:40:43] jenrzzz: has joined #RubyOnRails
[03:40:53] dopie: has joined #RubyOnRails
[03:41:07] draig: im thinking i had it confused with being in the development environment in rails
[03:41:11] jgpawletko: has joined #RubyOnRails
[03:43:41] draig: i guess ill just duplicate my code. working software and all.
[03:44:34] sevenseacat: well that was exciting.
[03:44:34] jgt1: has joined #RubyOnRails
[03:44:42] sevenseacat: next time if you show some code, you may get more help.
[03:45:54] draig: i updated the gist a long time ago, i thought you had seen it
[03:46:06] draig: you asked the version of spring, i found it and gave that
[03:46:25] sevenseacat: I didn't ask what version of spring
[03:46:47] draig: https://gist.github.com/jhoughjr/be81f2b338b834b88faf
[03:47:35] draig: my bad I assumed you wanted its version as well as rails
[03:48:09] draig: the code hasnt changed since i added the self.table_name = "humidities"
[03:48:28] sevenseacat: I think you're taking a bad approach here
[03:48:44] sevenseacat: you've changed your code to use STI but then explicitly want to use separate tables
[03:48:49] sevenseacat: which is the opposite of STI
[03:49:04] draig: thats why im here asking questions, cuz i want to try and not have to redo this after i get it working
[03:49:17] tejasmanohar: has joined #RubyOnRails
[03:49:36] sevenseacat: why are you not just using a single sensor_readings table if theyre the same thing?
[03:49:40] draig: because this will get more complicated
[03:49:54] draig: in a way they are different quantities
[03:50:05] HAL2328: has joined #RubyOnRails
[03:50:10] sevenseacat: is a humidity a sensor reading?
[03:50:15] draig: and i figured i would have some polymorphic behavior
[03:50:38] sevenseacat: or have you just included this sensor_reading model to save writing two lines of validations again?
[03:50:44] draig: such as converting the temps to different scales
[03:50:47] pontiki: has joined #RubyOnRails
[03:51:01] draig: yeah it was sort of an 'on principle' thing
[03:51:29] sevenseacat: if they're separate things, don't treat them as the same thing (a sensor reading)
[03:51:42] draig: ive seen small amounts of duplication go all butterfly effect
[03:51:47] sevenseacat: if they're the same thing, store them in the same place (a sensor readings table)
[03:52:29] draig: the idea of the system we are bulding is we have a variety of sensors
[03:52:57] draig: ad i was thinking that having one giant table might not perform well on the limited hardware this will end up on (a raspberry pi 2)
[03:53:27] draig: maybe the sensorID should be a foreign key
[03:54:18] sevenseacat: you're making an awful lot of presumptions, while just learning Rails
[03:54:49] draig: well i know db normalization is a thing
[03:55:14] sevenseacat: it sure is, but what does that have to do with anything we've discussed so far?
[03:55:17] draig: and since they are different measurements, they are different data
[03:56:16] draig: im not opposed to what you are saying, i just want to undesrstand the reasoning
[03:56:40] sevenseacat: behind what? i think we're having two separate conversations
[03:57:13] sevenseacat: you're talking about normalization and I have no idea what that has to do with single table inheritance
[03:57:48] quazimodo: draig: sorry was afk
[03:57:54] draig: it seems you are saying regardless of the data a sensor collects it should all be in one table
[03:57:59] quazimodo: removing spring has a process, the githubpage has it
[03:58:10] quazimodo: then zeus you manually start a server
[03:58:14] quazimodo: it's better tho, imho
[03:58:29] sevenseacat: no, I said that if you want to use single table inheritance, the key is in the name - single table
[03:58:35] draig: im thinking apparently insanely the millions of records in one table might not run good on a device with 1 GB of ram
[03:58:38] sevenseacat: rails does not support multiple table inheritance
[03:59:01] wldcordeiro: has joined #RubyOnRails
[03:59:08] fedexo: has joined #RubyOnRails
[03:59:20] sevenseacat: yeah Rails probably won't run too good on a device with 1GB RAM
[03:59:20] draig: i admit, im thinking more on the object side than the db side
[03:59:29] sevenseacat: but I guess you'll find out
[03:59:42] draig: since on iOS I use CoreData
[04:00:08] sevenseacat: iOS is irrelevant
[04:00:17] banister_: has joined #RubyOnRails
[04:00:30] draig: in the testing ive done (limited) it runs ok. its not going to be hosting a website on the internet so it wont get a lot of traffic
[04:00:50] draig: but these are the reasons i need to talk to ppl who know
[04:01:05] deavid: has joined #RubyOnRails
[04:01:05] draig: and find out now if rails isnt going to work for my use case
[04:01:36] Wolland: has joined #RubyOnRails
[04:06:40] draig: would it make any difference to the code in the gist if i were using mongodb vs sql?
[04:08:09] pontiki: i ran rails in a 512 rPi
[04:08:33] rhizome: not sure why you need full rails at all for this
[04:08:34] pontiki: it wasn't dealing with millions of records
[04:09:48] jobewan: has joined #RubyOnRails
[04:09:52] bruno-: has joined #RubyOnRails
[04:13:56] sevenseacat: indeed, if you just want a basic backend to store data, you don't need Rails
[04:15:50] braincra-: has joined #RubyOnRails
[04:18:00] draig: basically i need to collect a lot of sensor data, have a simple interface to visualize it, and perhaps some other data to configure the systems actuators
[04:18:32] draig: im thinking maybe sinatra and mongodb
[04:18:46] _3by8: How do I override Rails default behavior of assigning each row an incremental id? How would I give it an ID like an SHA-1 hash or something?
[04:18:58] _3by8: Would I have to remove the id column in the table first?
[04:19:03] annlewis: has joined #RubyOnRails
[04:19:07] draig: some logic that might be if sensor 2's reading is over an amount send an email or make a post request
[04:19:15] rhizome: _3by8: best not to try
[04:19:24] _3by8: rhizome: why is that?
[04:19:40] rhizome: because, most dbs don't operate by SHA-1
[04:19:59] _3by8: rhizome: can't I make the primary key something else?
[04:20:13] banjara: has joined #RubyOnRails
[04:21:12] _3by8: rhizome: you're probably right, never mind.
[04:23:43] draig: it might not be a pi ultimately, but its what we have currently. it will be some small linux sbc
[04:23:52] Aeyrix: _3by8: If you want something like that create a 'guid' column or something, and index it.
[04:33:44] roxtrongo: has joined #RubyOnRails
[04:34:04] Cache_Money: has joined #RubyOnRails
[04:34:08] greengriminal: has joined #RubyOnRails
[04:36:51] _3by8: Aeyrix: maybe you can help. I'm importing a JSON set into my database and it has a column called "id" with a unique identifier as an SHA-1 hash. What purpose would something like that serve?
[04:37:14] Aeyrix: I can't. I'm currently at my actual work.
[04:37:30] _3by8: Aeyrix: okay, thanks for the input anyways.
[04:37:47] _3by8: Does anyone else have any ideas?
[04:38:14] Creeves: has joined #RubyOnRails
[04:40:48] rickmasta: has joined #RubyOnRails
[04:40:53] _3by8: Is DB normalization a thing people usually do when working with Rails?
[04:42:02] sevenseacat: its nothing specific to rails
[04:42:48] _3by8: sevenseacat: I know but in my head I'm just thinking that creating models probably isn't the best way of normalizing a DB... am I wrong in that assumption?
[04:43:10] sevenseacat: I don't understand that assumption.
[04:43:35] EminenceHC: has joined #RubyOnRails
[04:44:03] _3by8: I mean, if my goal is to have an ideal relational model, am I going to have to get my hands dirty and do lots of stuff like write raw SQL statements?
[04:44:17] _3by8: Or can I actually achieve that goal through the use of Rails models?
[04:44:38] baweaver: You're talking about meta-database, you do realize
[04:44:39] _3by8: Pardon the question, I've only just finished the book at railstutorial.org.
[04:44:51] _3by8: baweaver: sorry, speaking Greek.
[04:45:06] baweaver: Your entire assumption is off
[04:45:29] baweaver: Normalization is a set of GUIDELINES, not rules, for the meta-design of a database system
[04:45:32] _3by8: Okay so I'll be fine generating my models via Rails.
[04:45:37] sevenseacat: do you have some examples on where you would have to write a bunch of SQL statements?
[04:45:47] sevenseacat: because I don't really understand how you can draw that conclusion
[04:45:50] _3by8: sevenseacat: not exactly, no. I'm just wondering for the sake of planning.
[04:46:05] baweaver: Meta in the sense that it's a planning aspect, not an implementation one
[04:46:13] baweaver: making your question quite bizarre
[04:46:16] _3by8: sevenseacat: it's probably because my grasp of Rails ActiveRecord is shaky at best.
[04:46:37] pawnbox: has joined #RubyOnRails
[04:47:03] baweaver: Just remember normalization is not an absolute rule
[04:47:37] sevenseacat: well you've done rails tutorial - did you need towrite a bunch of sql there?
[04:47:45] _3by8: sevenseacat: no, lol
[04:47:59] baweaver: there are a variety of cases where you're going to want denormalized data, but that's irrelevant to starting rails
[04:48:07] baweaver: as is most talk of normalization
[04:48:11] sevenseacat: does that answer your question then?
[04:48:16] srinidhi: has joined #RubyOnRails
[04:48:18] _3by8: sevenseacat: yeah
[04:49:35] workmad3: has joined #RubyOnRails
[04:51:25] nyaa: has joined #RubyOnRails
[04:53:22] diego1: has joined #RubyOnRails
[04:53:33] n00bDev: has joined #RubyOnRails
[04:54:20] diego1: has joined #RubyOnRails
[04:58:30] jobewan: has joined #RubyOnRails
[04:58:41] draig: i htink tomorrow ill start over with sinatra and mongodb and see how that goes
[04:59:23] draig: (or whenever i got time, doing 3 projects at once is rough for me!)
[05:00:07] sevenseacat: lol why mongodb?
[05:03:54] wldcordeiro: has joined #RubyOnRails
[05:03:55] Ropeney: sevenseacat: Because web scale!
[05:06:08] sevenseacat: because pain scale
[05:08:08] baweaver: there's a difference?
[05:09:51] baweaver: Ask Bitcoin enthusiasts about MongoDB
[05:09:55] baweaver: they absolutely love it.
[05:10:33] baweaver: http://hackingdistributed.com/2014/04/06/another-one-bites-the-dust-flexcoin/
[05:11:11] jenrzzz: has joined #RubyOnRails
[05:12:46] wldcordeiro: has joined #RubyOnRails
[05:13:36] sanjayu: has joined #RubyOnRails
[05:16:29] rhizome: _3by8: you're essentially doing ETL, just give it a different name
[05:17:10] krz: has joined #RubyOnRails
[05:19:42] annlewis: has joined #RubyOnRails
[05:21:15] dhjondoh: has joined #RubyOnRails
[05:21:15] asi_: has joined #RubyOnRails
[05:21:40] leo9x: has joined #RubyOnRails
[05:25:44] Aeyrix: "It's not every day when one's professional interests in NoSQL databases ..."
[05:25:46] Aeyrix: >professional
[05:27:03] Ropeney: Aeyrix: that hate :P
[05:32:39] arBmind: has joined #RubyOnRails
[05:33:46] dopamean_: has joined #RubyOnRails
[05:37:20] codenapper: has joined #RubyOnRails
[05:42:10] pawnbox: has joined #RubyOnRails
[05:44:04] arup_r: has joined #RubyOnRails
[05:44:30] roxtrongo: has joined #RubyOnRails
[05:45:17] jgt1: has joined #RubyOnRails
[05:49:50] banjara: has joined #RubyOnRails
[05:56:17] EminenceHC: has joined #RubyOnRails
[06:02:17] boombadaroomba: has joined #RubyOnRails
[06:02:21] stannard: has joined #RubyOnRails
[06:04:19] _3by8: MongoDB is a document-based DB, yeah? Why do you guys dislike it?
[06:04:34] boombadaroomba: Can anyone help me sort by a nested resource by grouping them by their category?
[06:04:34] sevenseacat: because it's inferior in just about every way to postgres
[06:04:52] sevenseacat: also, we're not all guys here, just so you know.
[06:05:44] _3by8: Sorry, I use it sexlessly.
[06:05:51] _3by8: But I'll keep that in mind.
[06:06:29] leo9x: has joined #RubyOnRails
[06:10:17] culturelabs: has joined #RubyOnRails
[06:10:25] raj___: has joined #RubyOnRails
[06:12:19] yfeldblum: has joined #RubyOnRails
[06:12:38] emilkarl: has joined #RubyOnRails
[06:14:00] eGGsha: has joined #RubyOnRails
[06:14:50] raj___: I am trying to write a script that uses both Selenium and includes the Rails namespace (http://pastebin.com/TTDLUx7Z). When instantiating Selenium using Selenium::WebDriver.for :firefox, I see "selenium/webdriver/common/driver.rb:50:in `for': cannot load such file -- selenium/webdriver/firefox"
[06:15:07] yfeldblum: has joined #RubyOnRails
[06:15:45] raj___: Why could this be? It's like it cant find any of the gems i have installed once I include the rails environment
[06:17:40] pawnbox: has joined #RubyOnRails
[06:20:37] annlewis: has joined #RubyOnRails
[06:20:48] atmosx: has joined #RubyOnRails
[06:20:51] yaymukund: has joined #RubyOnRails
[06:22:35] beauby: has joined #RubyOnRails
[06:23:25] maz-dev: has joined #RubyOnRails
[06:25:33] rvanlieshout: has joined #RubyOnRails
[06:25:42] rromanchuk: has joined #RubyOnRails
[06:28:49] darutoko: has joined #RubyOnRails
[06:29:44] pawnbox: has joined #RubyOnRails
[06:30:00] zanzibizarre: has joined #RubyOnRails
[06:31:42] n00bDev: has joined #RubyOnRails
[06:32:51] iateadonut: has joined #RubyOnRails
[06:36:43] dhjondoh: has joined #RubyOnRails
[06:37:42] workmad3: has joined #RubyOnRails
[06:38:16] boombadaroomba: How do you sort a nested resource by it's title alphabetically?
[06:38:27] w09x: has joined #RubyOnRails
[06:38:30] zanzibizarre: has left #RubyOnRails: ()
[06:38:32] boombadaroomba: https://gist.github.com/JasonY1/cf0b3ef5c7b489f9a4d2
[06:38:48] rvanlieshout: category.products.order(:title)
[06:40:48] boombadaroomba: rvanlieshout, wow. Thanks so much
[06:42:52] wldcordeiro: has joined #RubyOnRails
[06:45:15] bmalum: has joined #RubyOnRails
[06:48:32] jgt1: has joined #RubyOnRails
[06:48:51] blackmesa: has joined #RubyOnRails
[06:51:46] havenwood: has joined #RubyOnRails
[06:52:23] jenrzzz: has joined #RubyOnRails
[06:55:30] Linuus: has joined #RubyOnRails
[06:57:46] Juanchito: has joined #RubyOnRails
[06:59:42] Balzrael: has joined #RubyOnRails
[07:00:33] framling: has joined #RubyOnRails
[07:01:58] VeryBewitching: has joined #RubyOnRails
[07:02:12] skullcrasher: has joined #RubyOnRails
[07:02:34] yfeldblum: has joined #RubyOnRails
[07:02:53] solars: has joined #RubyOnRails
[07:05:17] artto: has joined #RubyOnRails
[07:06:12] wldcordeiro: has joined #RubyOnRails
[07:09:20] sandstrom: has joined #RubyOnRails
[07:10:35] cfloare: has joined #RubyOnRails
[07:11:13] duncannz: has joined #RubyOnRails
[07:14:38] lxsameer: has joined #RubyOnRails
[07:15:35] cgfbee: has joined #RubyOnRails
[07:16:49] jas02: has joined #RubyOnRails
[07:17:03] comrad: has joined #RubyOnRails
[07:17:17] Palsson: has joined #RubyOnRails
[07:19:21] blackmesa: has joined #RubyOnRails
[07:21:21] annlewis: has joined #RubyOnRails
[07:28:12] wldcordeiro: has joined #RubyOnRails
[07:28:22] artto: has joined #RubyOnRails
[07:29:00] bronson: has joined #RubyOnRails
[07:29:08] pawnbox: has joined #RubyOnRails
[07:29:16] scoot: has joined #RubyOnRails
[07:29:58] cina: I want to create a general Notification model, there can be notifications for user actions, new messages, new groups, etc. Is it a good idea to add two columns to my Notification table for object_class and object_id of the thing that the notification is about?
[07:33:54] dionysus69: has joined #RubyOnRails
[07:35:22] cina: It is apparently. Diaspora is doing that too.
[07:37:04] beauby: has joined #RubyOnRails
[07:39:42] leo9x: has joined #RubyOnRails
[07:43:05] w09x: has joined #RubyOnRails
[07:43:24] feignt: has joined #RubyOnRails
[07:43:37] alxndr: has joined #RubyOnRails
[07:43:39] hellschreiber: has joined #RubyOnRails
[07:43:40] MiracleBlue: has joined #RubyOnRails
[07:43:49] Aeyrix: has joined #RubyOnRails
[07:43:52] newton: has joined #RubyOnRails
[07:43:54] Palsson: has joined #RubyOnRails
[07:44:10] shwoodard: has joined #RubyOnRails
[07:44:21] kumavis: has joined #RubyOnRails
[07:44:22] startupality: has joined #RubyOnRails
[07:44:45] zemmihates: has joined #RubyOnRails
[07:45:33] tjbiddle: has joined #RubyOnRails
[07:48:00] Juanchito: has joined #RubyOnRails
[07:49:15] bmalum: Is ther a way to enable that Rails also echo/log the requests to /public/* files?
[07:50:04] sevenseacat: requests to public files shouldn't even touch rails, so I doubt it
[07:50:50] bmalum: sevenseacat - ah okay ^^ thanks
[07:54:02] lipoqil: has joined #RubyOnRails
[08:00:54] skroon_: has joined #RubyOnRails
[08:01:19] wldcordeiro: has joined #RubyOnRails
[08:01:42] scoot: has joined #RubyOnRails
[08:02:03] bruno-: has joined #RubyOnRails
[08:02:11] dici: has joined #RubyOnRails
[08:02:33] krainboltgreene: has joined #RubyOnRails
[08:03:51] pawnbox: has joined #RubyOnRails
[08:03:52] skroon_: has left #RubyOnRails: ()
[08:03:58] skroon: has joined #RubyOnRails
[08:04:02] startupality: has joined #RubyOnRails
[08:05:52] zpe: has joined #RubyOnRails
[08:06:21] pecpec: has joined #RubyOnRails
[08:07:29] Linuus: has joined #RubyOnRails
[08:09:11] blackmesa: has joined #RubyOnRails
[08:09:54] wldcordeiro: has joined #RubyOnRails
[08:17:38] michael_mbp: has joined #RubyOnRails
[08:20:33] krisquigley: has joined #RubyOnRails
[08:21:20] arup_r: has joined #RubyOnRails
[08:22:10] annlewis: has joined #RubyOnRails
[08:22:31] jsrn_: has joined #RubyOnRails
[08:22:51] beauby: has joined #RubyOnRails
[08:23:06] kimegede: has joined #RubyOnRails
[08:25:45] workmad3: has joined #RubyOnRails
[08:26:40] merlinp: has joined #RubyOnRails
[08:27:22] adre: has joined #RubyOnRails
[08:28:38] Ergo: has joined #RubyOnRails
[08:32:17] hmnhf: has joined #RubyOnRails
[08:35:34] kimegede: has joined #RubyOnRails
[08:35:35] quazimodo: has joined #RubyOnRails
[08:36:39] hmnhf: has joined #RubyOnRails
[08:39:00] kimegede_: has joined #RubyOnRails
[08:39:24] andrew9184: has left #RubyOnRails: ()
[08:40:00] marr: has joined #RubyOnRails
[08:40:58] DoubleMalt: has joined #RubyOnRails
[08:41:04] hmnhf: has joined #RubyOnRails
[08:45:32] hmnhf: has joined #RubyOnRails
[08:46:10] beauby: has joined #RubyOnRails
[08:48:21] codenapp_: has joined #RubyOnRails
[08:49:42] doerteDev: has joined #RubyOnRails
[08:50:47] hmnhf_: has joined #RubyOnRails
[08:53:49] beauby: has joined #RubyOnRails
[08:55:20] hmnhf__: has joined #RubyOnRails
[08:55:55] jgt1: has joined #RubyOnRails
[08:55:56] maz-dev: has joined #RubyOnRails
[08:56:00] Pavster: has joined #RubyOnRails
[08:58:08] krz: has joined #RubyOnRails
[08:59:48] hmnhf: has joined #RubyOnRails
[08:59:55] codenapper: has joined #RubyOnRails
[09:01:14] djinni`: has joined #RubyOnRails
[09:02:35] dustinm`: has joined #RubyOnRails
[09:03:08] Pupeno: has joined #RubyOnRails
[09:03:13] Pupeno: has joined #RubyOnRails
[09:03:30] zpe_: has joined #RubyOnRails
[09:04:04] alex88: has joined #RubyOnRails
[09:04:51] hmnhf_: has joined #RubyOnRails
[09:05:42] exadeci: has joined #RubyOnRails
[09:05:57] beauby: has joined #RubyOnRails
[09:06:03] yardenbar: has joined #RubyOnRails
[09:09:15] hmnhf_: has joined #RubyOnRails
[09:09:16] mikecmpbll: has joined #RubyOnRails
[09:10:30] subshad: has joined #RubyOnRails
[09:14:41] hmnhf__: has joined #RubyOnRails
[09:15:39] voker57: has joined #RubyOnRails
[09:16:59] hmnhf__: has joined #RubyOnRails
[09:20:11] jgt: has joined #RubyOnRails
[09:21:23] hmnhf__: has joined #RubyOnRails
[09:22:02] ELCALOR: has joined #RubyOnRails
[09:22:49] annlewis: has joined #RubyOnRails
[09:25:36] AzaToth: has joined #RubyOnRails
[09:25:44] hmnhf__: has joined #RubyOnRails
[09:30:08] hmnhf__: has joined #RubyOnRails
[09:33:34] fgro: has joined #RubyOnRails
[09:33:42] fgro: hi folks. So: Content::Link.model_name => "content_link", but how to reverse this properly .. "content_link".try(?) => Content::Link
[09:33:47] fgro: also: UserGroup.model_name => "user_group" ... so there is no way of telling if the source class model_name was called on was a Subclass or a camelcased class name
[09:34:16] dhjondoh: has joined #RubyOnRails
[09:35:39] hmnhf: has joined #RubyOnRails
[09:36:06] DEA7TH: has joined #RubyOnRails
[09:36:53] charliesome: has joined #RubyOnRails
[09:37:31] srinidhi: has joined #RubyOnRails
[09:37:59] fgro: sorry i'm actually referring to "model_name.param_key" .. i.e. Content::Link.model_name.param_key vs. ContentLink.model_name.param_key
[09:40:13] hmnhf_: has joined #RubyOnRails
[09:41:59] suchness: has joined #RubyOnRails
[09:42:55] pontiki: has joined #RubyOnRails
[09:43:26] maz-dev_: has joined #RubyOnRails
[09:44:41] hmnhf__: has joined #RubyOnRails
[09:45:19] maz-dev: has joined #RubyOnRails
[09:45:24] stamina: has joined #RubyOnRails
[09:46:41] RubyNewbey_: has joined #RubyOnRails
[09:47:27] daxroc: has joined #RubyOnRails
[09:47:37] srinidhi: has joined #RubyOnRails
[09:48:13] neilf: has joined #RubyOnRails
[09:48:13] corioliss: has joined #RubyOnRails
[09:49:00] hmnhf__: has joined #RubyOnRails
[09:49:05] jxf: has joined #RubyOnRails
[09:49:18] mjc_: has joined #RubyOnRails
[09:49:31] jlyndon: has joined #RubyOnRails
[09:50:06] ebryn: has joined #RubyOnRails
[09:50:17] suchness: has left #RubyOnRails: ()
[09:50:21] suchness: has joined #RubyOnRails
[09:51:04] nickfausnight: has joined #RubyOnRails
[09:51:23] suchness: So autoloading in rails 4. I have class Alpha, and I have a class Beta inheriting from it. If I check for decendants of class Alpha before Beta is referenced, I get an empty array. Anyone have any suggestions to get around that?
[09:51:44] jlpeters: has joined #RubyOnRails
[09:51:58] dyleted: has joined #RubyOnRails
[09:52:00] Hosh: has joined #RubyOnRails
[09:52:17] kapowaz: has joined #RubyOnRails
[09:52:28] culturelabs: has joined #RubyOnRails
[09:52:30] amitchellbullard: has joined #RubyOnRails
[09:52:37] zrl: has joined #RubyOnRails
[09:53:19] lacrosse: has joined #RubyOnRails
[09:53:30] danlucraft: has joined #RubyOnRails
[09:53:42] pfg: has joined #RubyOnRails
[09:53:42] BBHoss: has joined #RubyOnRails
[09:54:05] ewilliam: has joined #RubyOnRails
[09:54:14] nyandoge: has joined #RubyOnRails
[09:55:07] calleerlandsson: has joined #RubyOnRails
[09:55:24] skmp: has joined #RubyOnRails
[09:55:33] dotty: has joined #RubyOnRails
[09:55:49] chancancode_: has joined #RubyOnRails
[09:56:15] fabiorl: has joined #RubyOnRails
[09:56:17] rboyd: has joined #RubyOnRails
[09:56:44] ericpet: has joined #RubyOnRails
[09:57:22] machty: has joined #RubyOnRails
[09:57:28] Hates_: has joined #RubyOnRails
[09:57:29] lxkm__: has joined #RubyOnRails
[09:57:30] scyth: has joined #RubyOnRails
[09:57:52] Hates_: has joined #RubyOnRails
[09:58:51] DukeDave: has joined #RubyOnRails
[09:58:54] spastorino: has joined #RubyOnRails
[10:00:10] tianyi: has joined #RubyOnRails
[10:00:29] beauby: has joined #RubyOnRails
[10:00:34] Iacobus: has joined #RubyOnRails
[10:00:35] heidar: has joined #RubyOnRails
[10:00:37] jgt: has joined #RubyOnRails
[10:01:50] armyriad: has joined #RubyOnRails
[10:02:34] charliesome: has joined #RubyOnRails
[10:04:58] iamdevnul: has joined #RubyOnRails
[10:05:52] Lloyd: has joined #RubyOnRails
[10:06:12] diego1: has joined #RubyOnRails
[10:06:28] diego1: has joined #RubyOnRails
[10:07:12] joaomdmoura: has joined #RubyOnRails
[10:11:56] hcnewsom: has joined #RubyOnRails
[10:12:02] blackhuey: has joined #RubyOnRails
[10:13:52] workmad3: has joined #RubyOnRails
[10:14:41] mostlybadfly: has joined #RubyOnRails
[10:18:21] jyraff: has joined #RubyOnRails
[10:19:37] jyraff: hello. Why project on my computer in development environment has many (about 10) JS files but project on server in production environment has only applcation.js and one another js file?
[10:20:21] rickmasta: has joined #RubyOnRails
[10:20:22] pawnbox: has joined #RubyOnRails
[10:21:20] w09x: has joined #RubyOnRails
[10:23:39] annlewis: has joined #RubyOnRails
[10:27:43] chills42: has joined #RubyOnRails
[10:28:27] tvw: has joined #RubyOnRails
[10:28:37] spiman: has joined #RubyOnRails
[10:28:39] Axilla: has joined #RubyOnRails
[10:28:40] sanjayu: has joined #RubyOnRails
[10:29:20] nettoweb: has joined #RubyOnRails
[10:29:34] spiman: hello, just a quick question. Anyone have a rule of thumb of when to use ActiveRecord::Enum over a simple "static" array in a model?
[10:29:36] jammanbo: has joined #RubyOnRails
[10:34:38] h7br1x: Hey guys, I'm trying to setup a new view that displays only associated records. I have a series which has episodes, I want series/:id/all to only display episodes that match the series id and I'm having trouble setting up the controller. https://gist.github.com/ktdmedia/d2f3c3bad5423d3314ca any suggestions?
[10:34:49] Hates_: jyraff: because the asset pipeline compiles them all together
[10:35:16] jammanbo: Um, deployment question. Is it unacceptable to make my nginx/unicorn socket (in shared/tmp/sockets) globally accessible?
[10:36:04] Hates_: h7br1x: you need to loop over each series, then inside that loop over every episode
[10:36:36] h7br1x: hates_: can you elaborate? I'm still kind of green to Rails.
[10:37:07] h7br1x: It should only show episodes belonging to that series.
[10:37:36] Hates_: h7br1x: something like this https://gist.github.com/Hates/98b6b365f306686b7deb
[10:38:15] Hates_: h7br1x: oh sorry I just re-read your question, let me quickly edit
[10:38:45] Hates_: h7br1x: https://gist.github.com/Hates/98b6b365f306686b7deb
[10:40:09] h7br1x: Hates_: That was exactly what I was trying to do. Thank you bud!
[10:42:08] greenarrow: has joined #RubyOnRails
[10:43:46] bePolite: has joined #RubyOnRails
[10:44:51] jyraff: has joined #RubyOnRails
[10:45:04] lulzmachine: has joined #RubyOnRails
[10:46:32] maz-dev_: has joined #RubyOnRails
[10:49:15] allcentury: has joined #RubyOnRails
[10:53:23] rodfersou: has joined #RubyOnRails
[10:54:42] jyraff: why project in production doesn't load some JS files? I checked application.js and I cannot find them
[10:56:11] stannard: has joined #RubyOnRails
[10:57:33] prestorium: has joined #RubyOnRails
[10:58:39] h7br1x: Hates_: Can I bother you again really quick? So I put a link_to all_path on both the episode and series show, when clicking it from the episode view, it's using the episode's ID and not the series ID so it's not loading properly. Any ideas?
[10:59:20] Hates_: h7br1x: you need to pass the series to it, so something like all_path(@series)
[11:00:21] lasker85: has joined #RubyOnRails
[11:00:38] Detch: has joined #RubyOnRails
[11:02:29] lasker85: has joined #RubyOnRails
[11:03:54] chills42: has joined #RubyOnRails
[11:04:09] h7br1x: Thanks buddy!
[11:04:15] h7br1x: Hates_: ^
[11:04:19] Hates_: h7br1x: np :)
[11:05:12] jsrn_: has joined #RubyOnRails
[11:07:12] liquid-silence: has joined #RubyOnRails
[11:07:34] liquid-silence: hi all, what would be the best way to take items that have been dropped with jquery ui drag and drop and send it to the controller?
[11:07:46] artto: has joined #RubyOnRails
[11:07:53] liquid-silence: I was thinking hidden field and then just iterating over it in the controller
[11:08:47] yottanami: has joined #RubyOnRails
[11:09:13] niksw: has joined #RubyOnRails
[11:09:16] tjbiddle: has joined #RubyOnRails
[11:10:26] mikecmpbll: has joined #RubyOnRails
[11:10:56] niksw: Hi everyone. How to create the following thing: Model A has many objects of Model B, but I need to have a specific, changeable order of these objects?
[11:12:12] dhjondoh: has joined #RubyOnRails
[11:13:33] tbuehlmann: niksw, are B records unique to one A or can B belong to multiple As?
[11:13:47] jenrzzz: has joined #RubyOnRails
[11:14:39] niksw: every B record linked to only one A
[11:15:14] tbuehlmann: that's not too hard then, have a look at https://www.ruby-toolbox.com/categories/Active_Record_Sortables
[11:15:38] tbuehlmann: last time I used such a feature I went with https://github.com/mixonic/ranked-model, liked working with it
[11:16:40] niksw: Ok, thank you! I will look for it
[11:17:42] basldex: has joined #RubyOnRails
[11:17:51] bonhoeffer: has joined #RubyOnRails
[11:17:54] liquid-silence: tbuehlmann any idea on my issue?
[11:18:08] basldex: hey, can I somehow disable autosave associations dynamically?
[11:18:11] basldex: http://api.rubyonrails.org/classes/ActiveRecord/AutosaveAssociation.html
[11:18:14] krz: has joined #RubyOnRails
[11:18:19] basldex: that's the stuff I'm talking about
[11:18:29] chills42: has joined #RubyOnRails
[11:18:32] basldex: without messing with the callbacks directly maybe
[11:18:43] GreatDanton: has joined #RubyOnRails
[11:18:46] GreatDanton: has joined #RubyOnRails
[11:20:33] syath: has joined #RubyOnRails
[11:24:20] annlewis: has joined #RubyOnRails
[11:24:43] ruurd: has joined #RubyOnRails
[11:25:15] iateadonut: has joined #RubyOnRails
[11:25:41] rikkipitt: has joined #RubyOnRails
[11:26:35] workmad3: has joined #RubyOnRails
[11:27:15] pwnd_nsfw: has joined #RubyOnRails
[11:29:06] niksw: has joined #RubyOnRails
[11:30:15] suchness: jyraff: Because your assets are compiled into one in production mode.
[11:30:42] suchness: jyraff: http://guides.rubyonrails.org/asset_pipeline.html
[11:30:43] arup_r: liquid-silence: after making the array.. store it to the hidden field using https://api.jquery.com/serializeArray/ ?
[11:30:44] rikkipitt: Hey guys, I've got a quick question about grouping over multiple columns and counting...
[11:30:45] rikkipitt: https://gist.github.com/rikkipitt/033de435e00623f6c89f
[11:31:23] pecopeco: has joined #RubyOnRails
[11:31:43] rikkipitt: essentially, I'm grouping a by day and summing the count over a month. But I also want to do the same thing but check for unique counts on another column
[11:32:18] jgt: has joined #RubyOnRails
[11:32:22] arup_r: Then Rails will convert it to Array of IDS while it will be inside the controller
[11:32:23] pecopeco: has joined #RubyOnRails
[11:33:07] suchness: rikkipitt: I replied on your gist.
[11:34:22] arup_r: liquid-silence: ok
[11:34:37] ldnunes: has joined #RubyOnRails
[11:35:16] stardiviner: I want to use Bootstrap on Rails, which gem should I use? https://github.com/seyhunak/twitter-bootstrap-rails or this? https://github.com/twbs/bootstrap-sass ?
[11:35:47] rikkipitt: Hi suchness, that doesn't seem to work with my other grouping method
[11:35:57] stardiviner: And is there some simple start guide for Bootstrap Rails?
[11:36:10] suchness: rikkipitt: Of course not, you will need to think a little bit.
[11:36:37] mrchris: has joined #RubyOnRails
[11:37:04] suchness: rikkipitt: You also need more information, do you want unique opens per day? Do you want unique opens over a month?
[11:37:46] rikkipitt: suchness: per day actually, I can remove the sum bit
[11:37:47] rvanlieshout: stardiviner: i prefer bootstrap-sass
[11:38:11] suchness: rikkipitt: Post some output of your current grouping method.
[11:38:39] rikkipitt: I use count.values to just output an array of numbers for Highcharts
[11:40:01] suchness: rikkipitt: Your current grouping method.
[11:40:30] rikkipitt: suchness: I'm using groupdate https://github.com/ankane/groupdate
[11:40:38] suchness: rikkipitt: Forget it.
[11:40:51] suchness: rikkipitt: Make it easy for me or find someone else.
[11:42:00] stardiviner: rvanlieshout: do you have any suggestion manual for using bootstrap?
[11:43:22] emilkarl: has joined #RubyOnRails
[11:45:21] emilkarl: I???ve googled but not found any good resource on how to make a gem that includes a rails model + migration? Could anyone point me in the right direction?
[11:46:06] startupality: has joined #RubyOnRails
[11:46:37] Radar: emilkarl: !engines
[11:46:37] helpa: emilkarl: http://guides.rubyonrails.org/engines.html - Engines Guide - Written by Ryan Bigg
[11:47:17] liquid-silence: has joined #RubyOnRails
[11:47:21] greenarrow: has joined #RubyOnRails
[11:47:24] emilkarl: is engines used to make rails specific gems?
[11:48:00] emilkarl: nevermind. Thanks radar. ??ll just read the docs
[11:48:35] emilkarl: but something like acts_as_taggable_on, is that a rails engine?
[11:49:00] wethu: has joined #RubyOnRails
[11:49:23] bruno-: has joined #RubyOnRails
[11:50:52] suchness: emilkarl: No
[11:51:05] suchness: emilkarl: It's a gem.
[11:52:11] emilkarl: yes, when do I know when to use a gem or an engine? I want to package my plugin as a gem, but I guess that is possible with engines.
[11:53:10] cornerman: has joined #RubyOnRails
[11:54:11] chouhoulis: has joined #RubyOnRails
[11:54:17] jgt: has joined #RubyOnRails
[11:54:52] qopoap: has joined #RubyOnRails
[11:55:08] redmaverick: has joined #RubyOnRails
[11:55:19] emilkarl: Radar: if I dont intend to add any routes or views to my gem, would I still go for an engine?
[11:56:54] workmad3: has joined #RubyOnRails
[11:57:02] suchness: emilkarl: Think of an engine as a mini application, like a blog or something, that lives in your main application. Acts as taggable on is not a mini application, it's functionality added by a gem.
[11:59:11] emilkarl: that is probably right for me, i will extend active record functionality and also add a model that can be associated with a AR like a tag in acts_as_taggable_on if we???re still using that example. The model will need a migration and I will also need a generator for creating a migration for the models that will use the functionality. So my gem will be dependant on RoR.
[12:00:10] lasker85: has joined #RubyOnRails
[12:00:20] krz: has joined #RubyOnRails
[12:01:59] arup_r: If I want to make column in the model where I want to store the serialize data, what should be the column data type in the migration ?
[12:04:52] rvanlieshout: arup_r: that depends on your db engine
[12:05:02] rvanlieshout: some support hash, array or json
[12:05:19] krisquigley: has joined #RubyOnRails
[12:05:57] arup_r: I found info how to serialize http://api.rubyonrails.org/classes/ActiveRecord/AttributeMethods/Serialization/ClassMethods.html .. but no model level datatype info,, which is why asked
[12:06:20] rvanlieshout: you don't need to serialize if your engine supports it
[12:06:41] rvanlieshout: so for postgres you could use the hstore extension and just assign a hash to an attribute
[12:07:57] arup_r: rvanlieshout: Yes, you are right! i used hstore .. but didn't know this one
[12:08:46] futilegames: has joined #RubyOnRails
[12:10:56] nzst: has joined #RubyOnRails
[12:13:24] emilkarl: does hstore also work for sqlite?
[12:13:33] arup_r: No emilkarl
[12:14:00] emilkarl: so it would not work to use hstore when developing with sqlite and prod using postgres?
[12:14:04] arup_r: rvanlieshout: When you have a custom class object which you want to serialize and store to DB, then what should be the column type ? I did find any such -- https://viget.com/extend/how-i-used-activerecord-serialize-with-a-custom-data-type
[12:14:18] rvanlieshout: emilkarl: you shouldn't use different engines in dev and production
[12:14:34] rvanlieshout: arup_r: if you custom serialize it would be a text?
[12:14:38] arup_r: didn't find **
[12:16:03] pecpec: has joined #RubyOnRails
[12:16:50] krisquigley: has joined #RubyOnRails
[12:16:50] pecpec_: has joined #RubyOnRails
[12:16:54] roxtrongo: has joined #RubyOnRails
[12:16:58] alex88: has joined #RubyOnRails
[12:17:57] charliesome: has joined #RubyOnRails
[12:18:26] Radar: +1 for using the same db engine in dev and prod
[12:18:36] Radar: Otherwise: "why does my code work locally, but not on production?"
[12:18:49] hcnewsom: has joined #RubyOnRails
[12:20:24] Linuus: has joined #RubyOnRails
[12:20:42] pontiki: has joined #RubyOnRails
[12:21:14] jyraff: has joined #RubyOnRails
[12:21:45] rvanlieshout: and eventually you might want to use some db engine specific foo
[12:23:20] jkamenik: has joined #RubyOnRails
[12:23:46] quazimodo: has joined #RubyOnRails
[12:24:06] cball: has joined #RubyOnRails
[12:24:41] greenarrow: has joined #RubyOnRails
[12:25:08] annlewis: has joined #RubyOnRails
[12:26:12] Jardayn: has joined #RubyOnRails
[12:26:16] mrmylanman: has joined #RubyOnRails
[12:27:14] hcnewsom: has joined #RubyOnRails
[12:28:51] centrx: has joined #RubyOnRails
[12:29:39] redmaverick: I am writing a search functionality based on conditions. I can do database operations or I can manipulate the records in memory. https://gist.github.com/anonymous/e5f8a75acfb0cce9da52 Which approach is better.
[12:30:38] shinnya: has joined #RubyOnRails
[12:31:30] gabeodess: has joined #RubyOnRails
[12:32:11] bronson: has joined #RubyOnRails
[12:32:27] djinni`: has joined #RubyOnRails
[12:32:44] arup_r: Does Ransack is a good choice to sort also , while I am not searching ?
[12:33:17] arup_r: I am thinking it.. Because it has the capability to do sort by by its association table columns ?
[12:34:30] roxtrongo: has joined #RubyOnRails
[12:36:07] liquid-silence: has joined #RubyOnRails
[12:36:10] rickmasta: has joined #RubyOnRails
[12:36:12] moeabdol1: has joined #RubyOnRails
[12:37:44] allcentury: has joined #RubyOnRails
[12:38:59] Olipro: has joined #RubyOnRails
[12:39:02] hcnewsom: has joined #RubyOnRails
[12:40:09] Macaveli: has joined #RubyOnRails
[12:40:42] ArnaudM: has joined #RubyOnRails
[12:42:48] maz-dev: has joined #RubyOnRails
[12:43:24] charliesome: has joined #RubyOnRails
[12:43:25] DylanJ: emilkarl: you should try to develop with the same db you run in production. eventually you will run into bugs you cant reproduce in dev and you will be limited to using only common features between databases.
[12:44:18] IceyEC: has joined #RubyOnRails
[12:44:23] DylanJ: also for instance a null insert in an integer column in mysql is not the same as a null insert on an integer column in sqlite.
[12:44:47] DylanJ: that was a weird one to figure out
[12:46:34] rvanlieshout: DylanJ: what's different?
[12:48:32] yottanami: has joined #RubyOnRails
[12:49:14] DylanJ: mysql should insert a 0, sqlite should insert a null.
[12:51:07] startupality: has joined #RubyOnRails
[12:51:48] jgt: has joined #RubyOnRails
[12:52:03] hcnewsom: has joined #RubyOnRails
[12:55:35] IceyEC: has joined #RubyOnRails
[12:55:47] chouhoulis: has joined #RubyOnRails
[12:56:46] jyraff: has joined #RubyOnRails
[12:57:04] chridal: I'm going to have to execute some shell scripts (expect scripts specifically) from my Rails-app. Rake-tasks or ActiveJob?
[12:58:51] DylanJ: should it block or not?
[12:59:08] bonhoeffer: has joined #RubyOnRails
[12:59:12] chridal: They're pretty fast, so it wouldn't be a big problem, hence my question
[12:59:40] chridal: But I guess it's always better to not block, so ActiveJob it is.
[13:01:44] ramortegui: has joined #RubyOnRails
[13:02:45] bleda: has joined #RubyOnRails
[13:04:52] atrius: has joined #RubyOnRails
[13:05:10] ArnaudM: has left #RubyOnRails: ()
[13:06:04] pheuko: has joined #RubyOnRails
[13:07:05] bruno-: has joined #RubyOnRails
[13:07:08] liquid-silence: has joined #RubyOnRails
[13:07:24] ArnaudM_: has joined #RubyOnRails
[13:07:34] User458764: has joined #RubyOnRails
[13:08:05] sadaf2605: has joined #RubyOnRails
[13:08:14] ArnaudM_: Hello there, what's the best way to create a custom logger ? I did create one in initializer file (in constant) then I call it from my code : APPLOGGER.info 'foo'
[13:08:19] ArnaudM_: is this a good practice ?
[13:08:59] maz-dev: has joined #RubyOnRails
[13:09:04] basldex: activeadmin is not able to properly detect enums when registering a model?
[13:09:09] Radar: !activeadmin
[13:09:09] helpa: *makes a cross with fingers and says a prayer*
[13:09:09] basldex: that's quite disappointing
[13:09:15] helpa: Please do not use active_admin, rails_admin or any other gems to build your admin interfaces. Instead, build it yourself. This will lead you to a safe path of understanding of the code, rather than to the Hell that is those gems.
[13:09:26] sevenseacat: has joined #RubyOnRails
[13:09:29] maz-dev: has joined #RubyOnRails
[13:10:23] hcnewsom: has joined #RubyOnRails
[13:11:24] ebragaparah: has joined #RubyOnRails
[13:12:10] sharkman: has joined #RubyOnRails
[13:12:24] ebragaparah: has joined #RubyOnRails
[13:12:58] DmitryBochkarev: has joined #RubyOnRails
[13:13:08] jgt: has joined #RubyOnRails
[13:14:10] JoshL: has joined #RubyOnRails
[13:14:13] bmurt: has joined #RubyOnRails
[13:15:36] workmad3: has joined #RubyOnRails
[13:16:21] cina: is there a shortcut for "if params[:x] && params[:x][:y] && params[:x][:y][:z]"?
[13:19:42] chills42: has joined #RubyOnRails
[13:21:13] nettoweb: has joined #RubyOnRails
[13:21:23] bruno-: has joined #RubyOnRails
[13:21:26] Radar: cina: params.try(:[], :x).try(:[], :y).try(:[], :)
[13:21:30] Radar: oops, missed the Z.
[13:22:19] rikkipitt: has joined #RubyOnRails
[13:23:31] tjbiddle: has joined #RubyOnRails
[13:23:38] IceyEC: has joined #RubyOnRails
[13:25:08] habitullence: has joined #RubyOnRails
[13:25:32] sandstrom: has joined #RubyOnRails
[13:25:52] annlewis: has joined #RubyOnRails
[13:26:13] habitullence: How do people do tests involving the filesystem? Do you use something like fake/memfs or is there something like database_cleaner that you would recommend?
[13:26:33] rvanlieshout: you don't run test on your production env, right?
[13:26:36] rvanlieshout: so then just touch the filesystem
[13:27:45] habitullence: rvanlieshout: so just run test and make sure you clear up after yourself each time? that makes sense, I was wondering if there was anything like db cleaner to assist with this?
[13:28:13] rvanlieshout: well.. models that use files cleanup when destroyed
[13:28:20] mary5030: has joined #RubyOnRails
[13:28:20] rvanlieshout: in those test i just destroy them aftewards
[13:28:25] rvanlieshout: no gem could know what things i've touched
[13:29:28] habitullence: rvanlieshout: good point, thanks
[13:29:34] mary5030: has joined #RubyOnRails
[13:30:48] suchness: has joined #RubyOnRails
[13:31:19] bkulbida: has joined #RubyOnRails
[13:31:32] cina: Radar: thanks!
[13:33:03] mrchris: has joined #RubyOnRails
[13:34:44] Linuus: has joined #RubyOnRails
[13:34:47] nettoweb: guys, is it possible to deploy my app (with capstrano for instance) without restart my postgres? because every time I deploy today, the first request takes so much time to load (about 1 minute).
[13:35:10] Radar: HELPA HAS SPOKEN
[13:35:14] Radar: nettoweb: ^
[13:35:23] Radar: Where are you deploying it to?
[13:35:32] bleda: has joined #RubyOnRails
[13:35:56] nettoweb: Radar digitalocean
[13:36:14] Radar: nettoweb: So why is PostgreSQL restarting? What command is doing that during your deployment?
[13:36:23] Radar: I never have to restart my DB service when I am doing a deploy.
[13:36:30] nettoweb: Radar a RoR app + Nginx + passeger + postgres
[13:36:45] emilkarl: has joined #RubyOnRails
[13:36:52] Radar: Are you certain it's Postgres that takes a minute, or is it passenger spooling up the rails apps?
[13:37:04] nzst: Is anyone unit testing their migrations?
[13:37:20] greengriminal: has joined #RubyOnRails
[13:38:23] Ropeney: has joined #RubyOnRails
[13:38:31] Radar: If anything, I test the side effects. Making sure that fields appear on the page.
[13:38:51] Radar: Or is the migration doing something more complex?
[13:39:07] nettoweb: Radar I can see other pages after the deploy (actually the whole procces of deploy takes about 4 minutes), nut after this I can access my homepage for example, but I have some admin pages that takes so long at first visits. It's at my Articles Admin page, maybe because I have about 10.000 articles in my app.
[13:39:36] victortyau: has joined #RubyOnRails
[13:39:38] nzst: Radar: it was a general question, i'm talking with a colleague and we've never seen a test for a migration. Event though it's a class and method like everywhere else
[13:40:00] Radar: nzst: Why would you need to test a migration on its own? Why not test the side-effects?
[13:40:03] nettoweb: Radar because my homepage shows articles and it loads faster than admin articles pages
[13:40:07] sevenseacat: if you're loading all 10,000 in one page you'll have issues.
[13:40:22] sevenseacat: other than that, time to look at the logs to see whats taking so long.
[13:40:28] nzst: Radar: unit testing models is important, as is testing a model's side effects in integration tests
[13:40:50] emilkarl: has joined #RubyOnRails
[13:40:56] Radar: nzst: Does your app have a test-to-code ratio of 100?
[13:41:09] Radar: nzst: good developers know what to test and what not to test ;)
[13:42:44] sevenseacat: I run migrations back and forth a few times if they're particularly complex, but that's about it.
[13:42:49] nzst: So, why would a good developer not unit test a migration?
[13:42:51] allcentury: has joined #RubyOnRails
[13:42:56] sevenseacat: whats the point?
[13:42:57] w0rd-driven: has joined #RubyOnRails
[13:43:22] pheuko: has joined #RubyOnRails
[13:43:24] sevenseacat: they're something that gets run once, not something that needs to keep running correctly forever and may regress in the future
[13:43:44] Radar: And you can test the side-effects of the migration having run anyway, in feature tests or even controller tests
[13:44:04] IceyEC: has joined #RubyOnRails
[13:44:42] IceyEC: has joined #RubyOnRails
[13:46:44] IceyEC: has joined #RubyOnRails
[13:48:06] IceyEC: has joined #RubyOnRails
[13:49:37] Radar: nettoweb: taken a look at your logs yet?
[13:49:38] beauby: has joined #RubyOnRails
[13:50:25] Pupeno: has joined #RubyOnRails
[13:50:25] Pupeno: has joined #RubyOnRails
[13:50:41] benlieb: has joined #RubyOnRails
[13:54:20] Joffily: has joined #RubyOnRails
[13:55:07] IceyEC: has joined #RubyOnRails
[13:56:30] stannard: has joined #RubyOnRails
[13:57:12] IceyEC: has joined #RubyOnRails
[13:57:15] stannard: has joined #RubyOnRails
[13:59:08] IceyEC: has joined #RubyOnRails
[14:00:28] Creeves: has joined #RubyOnRails
[14:01:55] bruno-: has joined #RubyOnRails
[14:03:44] IceyEC: has joined #RubyOnRails
[14:03:53] workmad3: has joined #RubyOnRails
[14:04:31] sunya7a: has joined #RubyOnRails
[14:07:35] Joffily: has joined #RubyOnRails
[14:07:48] Exuma: has joined #RubyOnRails
[14:08:16] IceyEC: has joined #RubyOnRails
[14:08:42] yottanami: has joined #RubyOnRails
[14:09:20] mugurel: has joined #RubyOnRails
[14:09:27] huck5: I'm trying to write a test case for a controller, to ensure correct linking between an existing model and a new model of a different type. I'm wondering what the difference is between testing Model.save, and `post :create, Model: { ... }`? Presumably the .save bypasses the controllers action, and goes straight to AR?
[14:09:33] sadaf2605: has joined #RubyOnRails
[14:09:35] paulcsmith: has joined #RubyOnRails
[14:09:40] mugurel: does anyone know how to eagerload rails paperclip thumbnails?
[14:09:52] sevenseacat: huck5: Model.save has nothing to do with a controller
[14:10:02] huck5: Yeah, that's what I thought. Thanks sevenseacat
[14:10:11] sevenseacat: its just caling save, on a model
[14:10:45] annlewis: has joined #RubyOnRails
[14:10:51] huck5: Right. So it really wouldn't be testing anything to do with the controller. Whereas the post method is actually sending a post request with the specified information.
[14:12:37] IceyEC: has joined #RubyOnRails
[14:13:18] IceyEC: has joined #RubyOnRails
[14:13:19] yottanami1: has joined #RubyOnRails
[14:13:32] idd2d: has joined #RubyOnRails
[14:13:50] kies^: has joined #RubyOnRails
[14:14:49] maz-dev: has joined #RubyOnRails
[14:15:39] jenrzzz: has joined #RubyOnRails
[14:15:41] sharky: has joined #RubyOnRails
[14:16:19] Meow-J: has joined #RubyOnRails
[14:17:35] djinni`: has joined #RubyOnRails
[14:18:06] dustinm`: has joined #RubyOnRails
[14:18:56] IceyEC: has joined #RubyOnRails
[14:19:23] qejk: has joined #RubyOnRails
[14:21:13] bmalum: Missing template layouts/welcome_email with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder]}. Searched in: * "/Volumes/Yosemite/Users/bMalum/Development/constructeev/app/views"
[14:21:14] bmalum: But there is a /channel_mailer/welcome_email.erb in my Views Directory
[14:21:48] bmalum: basldex also not working with html.erb
[14:22:18] basldex: oh, it's looking for it in layouts
[14:22:28] yottanami__: has joined #RubyOnRails
[14:22:44] basldex: but I better just stfu, I'm backend and we're working with json only
[14:22:50] sharky: i am putting play by play information into a play by play table. everytime a new game is added, i want to analyze that data and export a variable to a different Stat table
[14:22:57] sharky: do i want a model Callback?
[14:23:30] tejasmanohar: has joined #RubyOnRails
[14:24:19] chouhoulis: has joined #RubyOnRails
[14:24:28] tubbo: sharky: usually i only use model callbacks for mutating information on the model itself, like for example setting default values or generating tokens
[14:24:35] lasker85: Does anyone know how to run a rake task for a specific user?
[14:24:52] tubbo: sharky: but you can definitely use them for the purpose you're talking about
[14:24:54] n1lo: has joined #RubyOnRails
[14:24:54] lasker85: Like let's say I want to set it up so that when a user hits a button on my website, it populates a database just for that user
[14:25:06] sevenseacat: lasker85: thats got nothing to do with rake
[14:25:10] sharky: tubbo what other options do i have to handle my logic if not a callback?
[14:25:11] tubbo: lasker85: seems like a lot of extra complexity though
[14:25:22] lasker85: Oh -- what's the best way to do that?
[14:25:32] sevenseacat: lasker85: having a database for each user is also very atypical and likely to cause a shitload of headaches
[14:25:32] tubbo: sharky: well you could just define a method on your model, and then run it in the create action after you save it.
[14:26:02] havenwood: has joined #RubyOnRails
[14:26:34] lasker85: ok, i guess i just want it to update columns in the user resource then
[14:26:39] tubbo: sharky: my problem with callbacks is if i want to unit test the model, it's harder because i have to mock out that method otherwise it will start populating data all over the place :)
[14:26:41] lasker85: when the user hits a button
[14:26:50] lasker85: *user model
[14:27:04] tubbo: lasker85: curious to know why you wanted to create a whole new database for each user
[14:27:14] tubbo: are you trying to multi-tenant your rails app or something?
[14:27:31] helpa: Multitenancy With Rails - https://leanpub.com/multi-tenancy-rails - An excellent book that teaches you about building a Multitenanted Rails application. Written by Ryan Bigg.
[14:27:43] sharky: i dont know what a unit test is and ive never done it so doesnt sound like a problem for me :)
[14:27:47] sevenseacat: that should be updated to point to v2. Radar, make it so.
[14:28:02] tubbo: sharky: !testing
[14:28:02] helpa: sharky: For a list of the most common testing framework gems used with Ruby and, by extension, the Rails framework see: https://www.ruby-toolbox.com/categories/testing_frameworks
[14:28:06] tubbo: lol never mind
[14:28:23] lasker85: Basically my project works by having a model with a lot of clothing items with different sizes. Each user has a bunch of measurements. I'm building an algorithm to determine how each item in the database will fit the user (each item will have a score for every user)
[14:28:29] tubbo: sharky: http://guides.rubyonrails.org/testing.html#unit-testing-your-models test your code, it makes you a better programmer.
[14:28:42] lasker85: Not sure how to best accomplish that
[14:29:15] sharky: even if im just working on a project for my own use of medium size?
[14:29:34] sharky: another question, what does class User < ActiveRecord::Base
[14:29:34] sharky: validates :login, :email, presence: true
[14:29:35] tubbo: lasker85: you could do that with one db. user has_many measurements through user_measurements, wherein user_measurement also has a score attribute that you can set.
[14:29:36] voltalio: has joined #RubyOnRails
[14:29:43] sharky: what does the validates line do
[14:29:53] tubbo: sharky: !validations
[14:29:53] helpa: sharky: The Active Record Validations Guide - http://guides.rubyonrails.org/active_record_validations.html - Written by Jaime Iniesta
[14:29:57] lasker85: Yea I didn't mean to say multiple databases. I meant to say multiple models
[14:30:15] tubbo: sharky: they're basically a glorified set of model callbacks :P but they allow you to define errors on a model and handle them without throwing exceptions
[14:30:24] tubbo: lasker85: ahh ok
[14:30:38] banister: has joined #RubyOnRails
[14:31:03] w0rd-driven: has joined #RubyOnRails
[14:31:13] tubbo: lasker85: well yeah, you'd have a User, and a Measurement, and maybe User belongs_to Measurement, and Measurement has_many Users
[14:31:13] sharky: i didnt use validations. my code just crashed and threw errors
[14:32:00] lasker85: tubbo -- right now the way I have it set up is that the measurements are part of the user model
[14:32:02] tubbo: sharky: i'm not surprised ;-) tests will help you figure out those errors before you start the server. saves a lot of time.
[14:32:13] lasker85: like the user has email, password, chest width, height all that stuff. is that a bad way to do it?
[14:32:39] idd2d: has joined #RubyOnRails
[14:32:41] tubbo: lasker85: that all sounds OK to me. i really don't understand your problem at all, i'm just trying to help you understand it :)
[14:32:42] alexUaN: has joined #RubyOnRails
[14:33:02] tubbo: lasker85: ah i kinda see what you're getting at now...
[14:33:40] lasker85: so basically when the user updates their height, i need to calculate a new "score" for each product in the database
[14:33:52] tubbo: lasker85: why not calculate the score on-demand?
[14:34:03] lasker85: that's what i want to do
[14:34:28] tubbo: alright well, you can do that
[14:34:37] tubbo: you probably need a join model between User and Product though
[14:34:40] tubbo: that will store the score
[14:35:03] tubbo: that table will be User.count*Product.count rows because you have to have one for each product
[14:35:24] tejasmanohar_: has joined #RubyOnRails
[14:35:24] lasker85: that sounds like exactly what i need. had never heard of a join model
[14:36:06] tubbo: lasker85: lol it's not really a "thing"...it's just a good way of saying what this model does in your app
[14:36:41] dopamean_: has joined #RubyOnRails
[14:36:43] tubbo: lasker85: because the model between User and Product (Fit?) would basically say "this user has $score chance of fitting into this product" or whatever
[14:37:01] sharky: why does this work def self.table_name
[14:37:01] sharky: "espn_pbp_baseball"
[14:37:14] sharky: but this crashes, def self.table_name; "espn_pbp_baseball"; end
[14:37:25] bratsche: has joined #RubyOnRails
[14:37:45] lasker85: so basically when the user updates their measurement
[14:37:49] lasker85: it updates that user's row in the join model
[14:37:59] suchness: sharky: just do table_name = "espnwhatever"
[14:38:10] suchness: sharky: You shouldn't be writing a method for that.
[14:39:00] workmad3: has joined #RubyOnRails
[14:39:03] sharky: okay thanks. it works when i do self.table_name = 'blah'
[14:39:33] tubbo: sharky: also for future reference, try not to post multiple lines of code into the channel.
[14:39:43] tubbo: lasker85: right
[14:41:24] huck5: I'm trying to post a collection as a hash in a test case. Something like https://gist.github.com/Huck5/09fc4dbbe0ad2413e0a6#file-strains_controller_test-rb-L24 . What is the correct way to ensure this collection is passed as part of the post params?
[14:42:42] raunicolae: has joined #RubyOnRails
[14:42:55] raunicolae: has left #RubyOnRails: ()
[14:43:26] huck5: Should I just be able to go { effects: @strain.effects }, and that will pass the information I want?
[14:43:31] suchness: huck5: You're from denver aren't you?
[14:43:54] huck5: suchness, let's go with yes.
[14:44:28] huck5: suchness, but back to testing my collection..
[14:45:10] suchness: huck5: Well.
[14:45:40] suchness: huck5: I would need to see more code. I don't know why you would be sending something like comments as a collection, wouldn't those be created and added individually?
[14:45:50] krz: has joined #RubyOnRails
[14:46:13] suchness: huck5: If not, you would need to look into nested_attributes.
[14:46:27] suchness: huck5: But to be fair, I am not really understanding what you are trying to accomplish.
[14:47:24] huck5: suchness, well if the effect does not exist in the database, it should be created and linked to this new model. I'm simply trying to test if the number of Effects changes when I post a new strain with a non-existent effect.
[14:49:23] sharky: oh i see. i just made a callback. but if data is being entered into the table via an SQL statement, not using the rails model, it wont trigger the callback. right?
[14:50:20] suchness: huck5: Does it work in your development/production code? I really think you need to leverage nested_attributes. Unless you have some sort of hook where you are creating your effect after saving your strain.
[14:50:33] moeabdol: has joined #RubyOnRails
[14:51:09] huck5: suchness, OK I'll keep looking into that. But should I be able to pass the collection (from within my test) like `post: strain: { effects: @strain.effects}`?
[14:51:24] FailBit: you need another set of braces
[14:51:35] FailBit: post: {strain: {}}
[14:51:49] suchness: huck5: No, I shouldn't think so. I am no expert on tests, but I think that's that is bad practice to start, and wont work to finish.
[14:52:04] huck5: Alright, thanks both!
[14:52:43] suchness: huck5: And if you listen to FailBit, I am pretty sure as I said you would need nested_attributes, but I could be wrong.
[14:53:02] huck5: Ok, thanks again suchness.
[14:55:13] lasker85: has joined #RubyOnRails
[14:55:54] Ergo^: has joined #RubyOnRails
[14:57:12] kristofferR: has joined #RubyOnRails
[14:58:11] Rodya_: has joined #RubyOnRails
[14:58:54] hashrocket: has joined #RubyOnRails
[14:59:26] artto: has joined #RubyOnRails
[15:00:44] chills42: has joined #RubyOnRails
[15:01:34] bronson: has joined #RubyOnRails
[15:02:47] Rodya_: has joined #RubyOnRails
[15:03:34] jyraff: has joined #RubyOnRails
[15:06:30] meatherly: has joined #RubyOnRails
[15:07:03] dopie: has joined #RubyOnRails
[15:07:22] lasker85: has joined #RubyOnRails
[15:08:27] idd2d: has joined #RubyOnRails
[15:09:11] workmad3: has joined #RubyOnRails
[15:09:34] beauby: has joined #RubyOnRails
[15:09:39] rromanchuk: has joined #RubyOnRails
[15:12:29] bobbobbins: has joined #RubyOnRails
[15:13:29] suchness: So autoloading in rails 4. I have class Alpha, and I have a class Beta inheriting from it. If I check for descendants of class Alpha before Beta is referenced, I get an empty array. Anyone have any suggestions to get around that?
[15:13:52] Papierkorb: suchness: do "Rails.eager_load!" before it
[15:13:56] IceyEC: has joined #RubyOnRails
[15:14:12] Papierkorb: suchness: Oh, it was this: Rails.application.eager_load
[15:14:18] momomomomo: has joined #RubyOnRails
[15:14:29] Papierkorb: "Rails.application.eager_load!" stupid auto select copy thing
[15:14:29] suchness: Papierkorb: Is there a way to only set that on the Beta class and not every class?
[15:14:57] Papierkorb: suchness: not without constraints given by you, how else should it know where to look?
[15:15:09] Papierkorb: suchness: you can require_dependency all of them beforehand
[15:15:52] suchness: Papierkorb: Hrm, that sounds like an option. I was explicitly doing a plain require before, but it caused an error, that was last night though, I forget what the error was.
[15:15:59] Scriptonaut: has joined #RubyOnRails
[15:16:00] suchness: Papierkorb: I will look into that, thanks!
[15:16:28] Papierkorb: suchness: require_dep is what you want then, that'll keep your code reloadable in DEV env.
[15:16:45] suchness: Papierkorb: Excellent, I will give that a try, thanks again.
[15:16:54] ortsac: has joined #RubyOnRails
[15:17:00] IceyEC: has joined #RubyOnRails
[15:17:55] IceyEC: has joined #RubyOnRails
[15:18:48] Scriptonaut: Does anyone know if there's a way with the form helpers to submit a single field, and split it into two fields at some point before I create the object? In the form there is a Full Name field, however the object has first_name and last_name attributes. I could just make two inputs on the form but that would mess up the way it looks a bit.
[15:20:06] fertapric: has joined #RubyOnRails
[15:20:13] suchness: Scriptonaut: Having dealt with transitions from one setup to another, I can say that your form, in that case, should reflect the model. If you have first and last on the model, have first and last on the form. Saying that, eventually you will want to transition from fullname to first name and last name.
[15:20:16] vjdhama: has joined #RubyOnRails
[15:20:32] suchness: Scriptonaut: That said, without javascript, no.
[15:20:56] suchness: Scriptonaut: and don't even think about a before valid hook splitting full name into first and last.
[15:21:06] Papierkorb: Is it possible to have multiple independent route definitions in a custom rails engine? I have separate controllers for API and for non-API requests
[15:21:16] EminenceHC: has joined #RubyOnRails
[15:21:54] Scriptonaut: suchness: ya the problem is I have no control over the model, it's a Chargify API object
[15:22:04] maz-dev: has joined #RubyOnRails
[15:22:14] suchness: Scriptonaut: The model has separate first and last name field correct?
[15:22:21] sevenseacat: I feel obliged to link http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/
[15:22:31] Scriptonaut: so I guess I'll need first and last name fields then
[15:22:37] Scriptonaut: was hoping for some MAGIC
[15:22:46] nettoweb: has joined #RubyOnRails
[15:23:15] sevenseacat: well you can manipulate the submitted params in your controller before passing them to the API
[15:23:45] Scriptonaut: could I define a custom setter method
[15:23:49] Scriptonaut: def full_name=
[15:24:07] Scriptonaut: thanks for the help
[15:25:02] disgrntld: has joined #RubyOnRails
[15:25:16] andrew-l: has joined #RubyOnRails
[15:25:21] andrew-l: has left #RubyOnRails: ("ERC Version 5.3 (IRC client for Emacs)")
[15:25:39] krisquigley: has joined #RubyOnRails
[15:26:08] vjdhama: has joined #RubyOnRails
[15:27:40] dman777_alter: has joined #RubyOnRails
[15:27:52] pecpec: has joined #RubyOnRails
[15:28:35] User458764: has joined #RubyOnRails
[15:28:36] dman777_alter: I have device_id = device.respond_to?(:id) || device. but instead device.respond_to?(:id) returning a number, it returns true. How can I have it return a number if the value exists?
[15:29:10] suchness: dman777_alter: Might try device.try(:id)
[15:29:21] smathy: dman777_alter, respond_to? only returns whether the object responds to that method or not.
[15:29:22] Papierkorb: dman777_alter: you're posing a question, and you're wondering that it gives you true or false?
[15:29:52] lurkmaster: has joined #RubyOnRails
[15:29:52] dman777_alter: suchness: I can't, my version of rails doesn't return false but error out with that try. It's only available 4.0 and after
[15:30:26] suchness: dman777_alter: Then you need to standardize what's coming into your method to always be a device or always be an id. Or you will need to write a little bit more code.
[15:30:31] smathy: dman777_alter, that's not true.
[15:30:50] sevenseacat: try does something totally different than respond_to?
[15:31:10] smathy: Not totally different, but a superset.
[15:31:20] Papierkorb: .. it is totally different
[15:31:22] sevenseacat: no, totally different
[15:31:29] polishdub: has joined #RubyOnRails
[15:32:14] smathy: In Rails 4 it's a superset, check it again.
[15:32:48] smathy: dman777_alter, the difference in Rails3 is that try will not return nil if the method doesn't exist.
[15:32:57] smathy: (in Rails4 it does)
[15:33:22] smathy: dman777_alter, so, you probably want: device_id = device.respond_to?(:id) ? device.id : device
[15:33:41] mwlang: has joined #RubyOnRails
[15:33:47] EminenceHC: has joined #RubyOnRails
[15:33:51] sevenseacat: try is concerned with the receiver, more than the symbol being passed to it.
[15:34:13] smathy: sevenseacat, what does "more" mean? It's concerned with both.
[15:34:54] idd2d: has joined #RubyOnRails
[15:34:54] smathy: https://goo.gl/0nPIOZ
[15:35:06] safetypin: has joined #RubyOnRails
[15:36:26] smathy: cc Papierkorb ^
[15:36:29] Joffily: has joined #RubyOnRails
[15:37:14] cabotto: has joined #RubyOnRails
[15:37:29] mwlang: I am working on an email authoring tool on the backend of my app and am looking for an easy way to let my client test/preview emails after he has composed the template, styles, and content for that email. Does anyone have a suggestion for gem(s) that might ease this task? I was thinking about utilizing mailcatcher and just simply delivering real emails to the mailcatcher server, but there???s docs (that I can find) on deploying mailcat
[15:37:30] mwlang: as a long-standing server.
[15:37:38] ArnaudM_: has left #RubyOnRails: (".")
[15:38:01] sevenseacat: can't really argue with "you're wrong! here's code to prove your point!"
[15:38:20] mwlang: c/but there???s docs/but there???s *no* docs/
[15:39:43] suchness: mwlang: I once did that, I just used an iframe that pointed to a controller that rendered the email markup. Not a great solution though.
[15:39:58] suchness: mwlang: That was a long time ago, I am sure there is a good tool out there now.
[15:40:21] lurkmaster: i need some help. I'm trying to delete an entry from my db. not fully understanding the concept. I don't get how to pass the :id parameter to my controller. what am I missing here? http://pastie.org/10437837
[15:41:14] mwlang: suchness: yeah, I hear you. I???m mostly trying to see if I can avoid reinventing the wheel here as I???m betting this has cropped up many times for others.
[15:41:19] lurkmaster: im adapting this from a codeadekmy tutorial. they convenient fail to mention how to use the show,edit,update, and destroy actions, which all involve the :id parameter. not sure how to implement those features in my app
[15:41:24] suchness: lurkmaster: Instead of the routes you have, try resources :messages, then run rake routes and look at the deifference bewteen what you have now and what they create for you.
[15:41:29] mustmodify_: has joined #RubyOnRails
[15:42:01] suchness: mwlang: https://github.com/glebm/rails_email_preview ?
[15:42:43] mwlang: lurkmaster: try generating a scaffolded controller as I think the code in the scaffold will illuminate you greatly.
[15:42:43] suchness: lurkmaster: The key thing you are missing is :id, eg /messages/:id, /messages/:id/edit, etc.
[15:42:51] mustmodify: So I would have sworn you could do this: ` validates_presence_of :field1, :if => :field2 ` ... did that work in some previous version? Now you must use a proc
[15:44:22] suchness: mwlang: This looks good to: https://github.com/basecamp/mail_view
[15:44:36] briandeweese: has joined #RubyOnRails
[15:44:55] maz-dev: has joined #RubyOnRails
[15:45:33] lurkmaster: mwlang: ok, ill try using the scaffolding
[15:45:49] yfeldblum: has joined #RubyOnRails
[15:45:58] lurkmaster: so when you use the resources instead of defining the routes individually, it automatically assigns an id to each entry?
[15:46:04] briandeweese: has joined #RubyOnRails
[15:46:07] Jasaka: has joined #RubyOnRails
[15:46:19] lurkmaster: which would be at the end of the url
[15:47:20] mwlang: mustmodify: not sure if that used to work or not, but what I do is create ???def field2_present?; self.field2.present?; end??? and then that validate???s becomes: validates :field1, presence: true, if: :field2_present?
[15:48:04] vjdhama: has joined #RubyOnRails
[15:48:17] mwlang: lurkmaster: in a manner of speaking. ???rake routes??? will show you what routes are generated by the resources call.
[15:48:39] mwlang: but it???s basically shorthand for getting all the RESTful routes on a resource.
[15:49:23] Cache_Money: has joined #RubyOnRails
[15:49:25] yfeldblum: has joined #RubyOnRails
[15:50:11] CanTonic: has joined #RubyOnRails
[15:50:28] mwlang: suchness: your google-fu is on fire today. thanks for the links.
[15:50:41] suchness: mwlang: Haha, no problem.
[15:51:17] mwlang: so far, I???m liking the rails_email_preview gem.
[15:51:39] mwlang: and it???s nice to see some sort of preview facility is now baked into RoR4
[15:52:11] cabotto: has joined #RubyOnRails
[15:54:23] startupality: has joined #RubyOnRails
[15:55:47] blackmesa: has joined #RubyOnRails
[15:56:38] ebragaparah: has joined #RubyOnRails
[15:57:18] hoodow: has joined #RubyOnRails
[15:57:19] hoodow: has joined #RubyOnRails
[15:58:23] rikkipitt: has joined #RubyOnRails
[16:00:36] mustmodify: has left #RubyOnRails: ()
[16:00:37] tubbo: mustmodify: you have to use :field2_changed? or something like that
[16:00:51] smathy_: has joined #RubyOnRails
[16:01:53] towski_: has joined #RubyOnRails
[16:02:32] jyraff: has joined #RubyOnRails
[16:02:35] bricker: has joined #RubyOnRails
[16:02:45] sam_weerasinghe: has joined #RubyOnRails
[16:03:04] jobewan: has joined #RubyOnRails
[16:03:18] pwnd_nfsw: has joined #RubyOnRails
[16:03:45] maz-dev: has joined #RubyOnRails
[16:03:54] michaeldeol: has joined #RubyOnRails
[16:04:30] EminenceHC: has joined #RubyOnRails
[16:04:53] dima_: has joined #RubyOnRails
[16:05:37] IceyEC: has joined #RubyOnRails
[16:06:02] chills42: has joined #RubyOnRails
[16:07:56] Pavster: has joined #RubyOnRails
[16:08:49] idd2d: has joined #RubyOnRails
[16:12:19] VeryBewitching: has joined #RubyOnRails
[16:13:01] romdi: has joined #RubyOnRails
[16:13:52] n008f4g_: has joined #RubyOnRails
[16:14:32] User458764: has joined #RubyOnRails
[16:14:45] CanTonic: has joined #RubyOnRails
[16:15:19] User458764: has joined #RubyOnRails
[16:15:34] rikkipitt: has joined #RubyOnRails
[16:16:04] xMopxShell: has joined #RubyOnRails
[16:18:45] hawson: has joined #RubyOnRails
[16:19:30] Maletor: has joined #RubyOnRails
[16:20:00] hawson: 'afternoon all (or other appropriate time of day)
[16:20:00] blackmesa: has joined #RubyOnRails
[16:20:47] hawson: I have an odd setup, and could use some guidance.
[16:21:14] EminenceHC: has joined #RubyOnRails
[16:21:27] hawson: I have a Rails app (on Apache) that uses HTTPS. Apache bounces users to KRB5 for authentication. This works fine.
[16:22:08] hawson: I have a CLI program that makes calls to the Rails app, but I need to use existing Kerberos tickets (e.g. from 'kinit') to authenticate.
[16:22:45] hawson: I do *not* want to re-implement authentication in the CLI program--just use an existing ticket if it exists. Exiting with an error is perfectly fine if the ticket is bad/missing.
[16:24:33] bronson: has joined #RubyOnRails
[16:25:47] habitullence: has joined #RubyOnRails
[16:25:49] nya: has joined #RubyOnRails
[16:28:27] ngscheurich: has joined #RubyOnRails
[16:30:03] workmad3: has joined #RubyOnRails
[16:30:18] bePolite: has joined #RubyOnRails
[16:30:18] bePolite: has joined #RubyOnRails
[16:30:34] tubbo: now that is interesting
[16:31:00] tubbo: does the CLI program live on the same box as the rails app?
[16:31:30] Scriptonaut: hey guys, I upgraded my app from 3.2 to 4.2 (something around there). I nkow when you create a rails 4 project, it makes a concerns directory for you in the models directory, however since this isn't a new app it didn't. I made one, and put a concern in there, however it's not getting run, how do I make rails require the files in the concerns directory?
[16:32:27] tubbo: Scriptonaut: rails requires everything in app/**/* so if your concerns dir is in there, it should be getting picked up.
[16:32:34] tubbo: s/requires/autoloads
[16:32:51] simkessy: Does anyone know the answer to this http://stackoverflow.com/questions/32710705/simple-form-and-bootstrap-erors
[16:33:17] mehwork: is rvm still a good way to install multiple ruby/rails versions on macs or is there something better now?
[16:33:43] maz-dev: has joined #RubyOnRails
[16:33:54] Scriptonaut: hrm, so why the heck isn't my module loading. Under the module I did a bunch of puts to see if I could see the output and it never shows up
[16:34:22] s2013: has joined #RubyOnRails
[16:35:01] VeryBewitching: hawson: Are you trying to find a way to reuse the ticket issued to Apache?
[16:36:02] krisquigley: has joined #RubyOnRails
[16:36:29] podman: has joined #RubyOnRails
[16:37:17] lasker85: has joined #RubyOnRails
[16:39:47] zpe: has joined #RubyOnRails
[16:40:20] nzst: has joined #RubyOnRails
[16:41:33] Scriptonaut: this is the file I want to execute, but it's not happening, it's now in the models directory, other modules in this folder are being executed: https://gist.github.com/robins35/382ab71667878ff05513
[16:41:44] Scriptonaut: does anyone see anything inherently wrong with that code?
[16:42:36] smathy_: Scriptonaut, naming has to match directory structure.
[16:42:52] Scriptonaut: ah, so what should the name of this file be then?
[16:43:08] dima_: has joined #RubyOnRails
[16:43:32] smathy_: Scriptonaut, sorry, I just read your gist and it looks fine (that file is in app/models/concerns ?)
[16:43:37] smathy_: Scriptonaut, not a subdirectory thereof?
[16:43:46] Scriptonaut: no, it's now just in models
[16:43:57] Scriptonaut: I was thinking maybe the concerns directory was messing it up
[16:44:13] dima_: has joined #RubyOnRails
[16:44:15] smathy: Scriptonaut, ok, either should work.
[16:44:24] smathy: Scriptonaut, what error are you seeing?
[16:44:35] Scriptonaut: no error, it just doesn't load that file
[16:44:36] smathy: Scriptonaut, like you go to rails console and ChargifyPaymentProfileExtension is undefined?
[16:44:37] dima_: has joined #RubyOnRails
[16:44:50] Scriptonaut: let me try that
[16:45:17] Scriptonaut: when I type that, it *then* gets stuck in my binding pry
[16:45:24] Scriptonaut: but it's not doing it automatically
[16:45:45] smathy: Scriptonaut, well, it'll only load once you use it. Everything in app is autoloaded.
[16:46:17] smathy: Scriptonaut, if you're not actually using it anywhere, then you should put that last line in a config/initializers/file.rb
[16:46:39] Papierkorb: I have a controller called FileUpload::FilesController. Now, I want to point /files to it. Is this correct? scope module: 'file_upload' do resources :files end
[16:47:27] cschneid_: has joined #RubyOnRails
[16:48:29] smathy: Scriptonaut, you're welcome.
[16:48:35] dideler: has joined #RubyOnRails
[16:48:58] smathy: Papierkorb, you tell us, does it produce the right route?
[16:49:15] Papierkorb: But the docs say that this should be correct.
[16:49:49] paulcsmith: has joined #RubyOnRails
[16:51:46] sharky: enumerize :blah, in { ddd }, scope: true
[16:51:49] sharky: what does scope mean here?
[16:51:49] workmad3: has joined #RubyOnRails
[16:52:18] smathy: Papierkorb, what are you getting instead, just show me the index route as an example.
[16:52:39] ruurd: has joined #RubyOnRails
[16:53:00] Papierkorb: smathy: I found it. The route was inside a rails engine, and the auto-module magic of the isolation confused me
[16:53:23] smathy: sharky, it tells enumerize to add scopes to the model.
[16:53:30] smathy: Papierkorb, cool.
[16:54:32] sharky: what are scopes
[16:54:41] habitullence: has joined #RubyOnRails
[16:55:04] djbkd: has joined #RubyOnRails
[16:55:42] voltalio: has joined #RubyOnRails
[16:56:30] Pavster: has joined #RubyOnRails
[16:56:34] smathy: sharky, http://guides.rubyonrails.org/active_record_querying.html#scopes
[16:56:50] CanTonic: has joined #RubyOnRails
[16:56:56] banjara: has joined #RubyOnRails
[16:58:29] sadaf2605: has joined #RubyOnRails
[16:59:50] rakm: has joined #RubyOnRails
[17:03:43] fedexo: has joined #RubyOnRails
[17:05:12] sharky: do you guys use enumeration
[17:05:12] qejk: has joined #RubyOnRails
[17:05:55] smathy: sharky, !used
[17:05:55] helpa: sharky: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[17:06:38] rickmasta: has joined #RubyOnRails
[17:06:47] sharky: k i was just trying to use enumerations to categorize different types of sport statistics but its tricky
[17:07:00] dionysus69: has joined #RubyOnRails
[17:08:14] roxtrongo: has joined #RubyOnRails
[17:08:29] jyraff: has joined #RubyOnRails
[17:08:41] habitullence: has joined #RubyOnRails
[17:11:25] tubbo: i don't even know what enumeration is
[17:11:29] tubbo: or enumerize
[17:11:36] idd2d: has joined #RubyOnRails
[17:12:04] smathy: tubbo, enumerize is just an enum gem.
[17:12:05] beauby: Let's say I'm inside a class method `self.m(x)` of a class `A`: what's a sound way to bind a new class named `"Class#{x}"`, namespaced inside `A`? I've been toying with stuff like `c = Class.new() do ... end; const_set("Class#{x}", c)` Is there an other way?
[17:12:17] beauby: Oops sorry, that was meant for #ruby
[17:12:21] smathy: sharky, you still didn't actually explain your problem.
[17:12:31] smathy: beauby, thank God, I was scared.
[17:12:49] platzhirsch: has joined #RubyOnRails
[17:12:58] platzhirsch: Is there something like a success_if_statement_is_reached_here equivalent? (cross-posted that one in #rspec)
[17:14:14] hawson: VeryBewitching: not quite. I want to take a ticket granted by kinit on the CLI, pass it to a Ruby CLI app, which passes the ticket to Apache.
[17:14:33] smathy: platzhirsch, I'm not really clear on what you're asking, but is "create a mocked method, and have an expectation that that method was called" the answer?
[17:15:07] bricker: platzhirsch: "return true"
[17:15:20] platzhirsch: bricker: ah yeah
[17:16:07] platzhirsch: well RSpec doesn't like return
[17:16:29] elaptics: platzhirsch: do you have some code you can show us?
[17:16:38] platzhirsch: smathy: not quite, I am looking for something that makes sure that the test succeeds if the statement is reached
[17:16:56] elaptics: that seems an odd test
[17:17:10] elaptics: what are you actually trying to do?
[17:17:14] platzhirsch: something along the lines of this here: http://pastebin.com/A0616znj
[17:17:39] jenrzzz: has joined #RubyOnRails
[17:18:02] platzhirsch: well I think it's fine as it is, before I had a begin rescue block and I thought it would be nice to have a success statement in the resuce block rather than just a comment # success
[17:18:54] elaptics: against my better judgement I looked at the pastebin - what is that supposed to be testing?
[17:19:01] wildlander: has joined #RubyOnRails
[17:19:09] elaptics: can you gist the actual code and specs
[17:19:21] platzhirsch: that sleep gets invoked
[17:19:24] petricore: has joined #RubyOnRails
[17:19:37] platzhirsch: sleep inside a forever loop
[17:19:41] badfish129: has joined #RubyOnRails
[17:20:11] yfeldblum: has joined #RubyOnRails
[17:20:26] elaptics: so your code actually needs to sleep and you want to test that it's called but not actually call it as it'll sleep the code?
[17:21:41] elaptics: if so then you will probably want to pass it in as a dependency so you can swap out the implementation in the test for something more benign
[17:22:00] bruno-: has joined #RubyOnRails
[17:22:20] elaptics: need to see actual code to advise further
[17:23:04] platzhirsch: I think that's fine, gives me into the right direction :)
[17:23:29] blackmesa: has joined #RubyOnRails
[17:23:40] sharky: okay so if i have a module StatEnumeration, and i want it to enumerize a column in a Stat table called "type"how would i do that
[17:24:43] sharky: how do i map onto the type column
[17:25:29] yfeldblum: has joined #RubyOnRails
[17:26:29] maz-dev: has joined #RubyOnRails
[17:27:03] CanTonic: has joined #RubyOnRails
[17:27:04] habitullence: has joined #RubyOnRails
[17:28:25] bronson: has joined #RubyOnRails
[17:28:41] nickjj: has joined #RubyOnRails
[17:29:22] EminenceHC: has joined #RubyOnRails
[17:29:50] smathy: sharky, !code might be easier here, show us what you're trying to do
[17:29:50] helpa: sharky: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[17:31:09] badfish129: has joined #RubyOnRails
[17:32:37] startupality: has joined #RubyOnRails
[17:33:54] cantonic_: has joined #RubyOnRails
[17:33:56] armyriad: has joined #RubyOnRails
[17:35:33] annlewis: has joined #RubyOnRails
[17:35:45] armyriad: has joined #RubyOnRails
[17:35:54] badfish129: has joined #RubyOnRails
[17:37:21] wldcordeiro: has joined #RubyOnRails
[17:38:28] pwnd_nfsw: RubyMine seems like a bit much
[17:38:32] bruno-: has joined #RubyOnRails
[17:38:40] DEA7TH: has joined #RubyOnRails
[17:38:54] Lightsword: has joined #RubyOnRails
[17:39:50] jgt: has joined #RubyOnRails
[17:40:16] workmad3: has joined #RubyOnRails
[17:40:23] futilegames: has joined #RubyOnRails
[17:40:37] bricker: It's good if you're learning or especially you're already familiar with JetBrains tools
[17:41:24] Papierkorb: Can I get a list of loaded/available rails engines?
[17:41:37] SteenJobs: has joined #RubyOnRails
[17:41:42] tubbo: Papierkorb: Gemfile.lock | grep "-rails" ;)
[17:41:55] Papierkorb: at run-time without `` hacks.
[17:42:08] tubbo: Papierkorb: i think you can find ancestors of Rails::Engine
[17:43:25] tubbo: Papierkorb: check the source, http://api.rubyonrails.org/classes/Rails/Engine.html#method-c-find
[17:43:32] tubbo: it shows you the subclasses method of Rails::Engine
[17:44:20] Papierkorb: tubbo: Ah, that looks good, thanks
[17:47:48] willywos: has joined #RubyOnRails
[17:48:11] badfish129: has joined #RubyOnRails
[17:49:49] ciwolsey: has joined #RubyOnRails
[17:50:00] lampe2: has joined #RubyOnRails
[17:50:20] kimegede: has joined #RubyOnRails
[17:50:41] Joffily: has joined #RubyOnRails
[17:51:32] havenwood: has joined #RubyOnRails
[17:51:37] yaymukund: has joined #RubyOnRails
[17:51:50] dyleted: has joined #RubyOnRails
[17:52:16] michaeldeol: has joined #RubyOnRails
[17:53:43] ejnahc: has joined #RubyOnRails
[17:58:05] DEA7TH_: has joined #RubyOnRails
[18:01:36] jsrn_: has joined #RubyOnRails
[18:03:26] User458764: has joined #RubyOnRails
[18:04:37] romdi`: has joined #RubyOnRails
[18:07:56] hahuang65: has joined #RubyOnRails
[18:09:27] srinidhi: has joined #RubyOnRails
[18:09:43] lasker85: has joined #RubyOnRails
[18:12:55] [Butch]: has joined #RubyOnRails
[18:13:38] Maletor: is this philosophy a contradiction to the implementation? https://github.com/octokit/octokit.rb#philosophy it sort of looks to me like knowledge of REST is needed if you look at https://github.com/octokit/octokit.rb#the-full-hypermedia-experience
[18:14:14] User458764: has joined #RubyOnRails
[18:14:56] baweaver: has joined #RubyOnRails
[18:15:09] cnk: has joined #RubyOnRails
[18:16:05] maz-dev: has joined #RubyOnRails
[18:16:19] mrchris: hey guys I'm stuck on a bug atm
[18:16:53] centrx: Fascinating
[18:17:05] ruurd: has joined #RubyOnRails
[18:17:16] myotkyaw: has joined #RubyOnRails
[18:17:35] krisquigley: has joined #RubyOnRails
[18:18:02] myotkyaw: has joined #RubyOnRails
[18:18:12] romdi``: has joined #RubyOnRails
[18:18:12] smathy: maletor, what knowledge of REST is required for that method?
[18:18:15] habitullence: has joined #RubyOnRails
[18:18:34] tubbo: __chris: cool story bro
[18:18:43] mrchris: tubbo, thanks.
[18:18:44] jenrzzz: has joined #RubyOnRails
[18:18:45] mrchris: listing now
[18:18:55] Maletor: smathy: user.rels[:gists].href # => "https://api.github.com/users/jbarnette/gists"
[18:19:14] Maletor: ...:uri => {:owner => "octokit", :repo => "octokit.rb" }
[18:20:01] romdi: has joined #RubyOnRails
[18:20:27] idd2d: has joined #RubyOnRails
[18:21:57] smathy: maletor, so there's a hash interface to relations from user, and properties on the values of those. Not sure where you're seeing REST knowledge required?
[18:23:15] Maletor: well, let's say HTTP
[18:23:26] Maletor: .post is there
[18:23:32] myotkyaw: hello everyone
[18:23:37] romdi`: has joined #RubyOnRails
[18:23:50] Maletor: smathy: see the contradiction now?
[18:24:06] KorriX: has joined #RubyOnRails
[18:24:13] sharky: is anyone else coding
[18:24:14] Maletor: don't get me wrong hypermedia is excellent and so is domain abstraction. but does it make sense to mix them together in the same place?
[18:24:15] yfeldblum: has joined #RubyOnRails
[18:24:32] myotkyaw: has left #RubyOnRails: ()
[18:24:33] RegulationD: has joined #RubyOnRails
[18:25:07] KorriX: Hello! I have a quick question: How to replace sprockets directives require_self, require_tree in my application.sass with @import?
[18:25:13] blackmesa: has joined #RubyOnRails
[18:25:34] davidheward: has joined #RubyOnRails
[18:25:49] rezzack: has joined #RubyOnRails
[18:26:06] Wolland: has joined #RubyOnRails
[18:26:23] habitullence: has joined #RubyOnRails
[18:26:41] polly_wog: has joined #RubyOnRails
[18:26:47] smathy: maletor, just because that corresponds to an HTTP convention doesn't really mean that you're having to know REST, I suppose it could have been get and set - but "post" is still fairly generic.
[18:27:00] tubbo: KorriX: sass @import doesn't support that, afaik. you must explicitly @import each file.
[18:27:11] smathy: maletor, also, the philosophy didn't said: "requires little knowledge of REST"
[18:27:15] smathy: ...not none at all.
[18:27:16] KorriX: tubbo: Thx
[18:27:29] bricker: tubbo: KorriX: sass supports globbing for imports
[18:27:39] kadoppe: has joined #RubyOnRails
[18:27:44] bricker: https://github.com/chriseppstein/sass-globbing
[18:27:52] bricker: I think it might be built-into sass now
[18:27:58] smathy: maletor, I'm sure you can see the vivid contrast between that and the underlying GH API.
[18:27:58] tubbo: well spank my ass and call me charlie
[18:28:04] bricker: Oh: "Ruby on Rails has this capability out of the box starting in Rails 3.1. Do not install this plugin if you use Rails 3.1 or greater."
[18:28:06] tubbo: bricker: https://github.com/rails/sass-rails is actually where @import globs exist
[18:28:18] tubbo: there's no docs for globs on sass-lang
[18:29:08] bricker: there's no docs for your mom either but that never stopped me before
[18:29:11] smathy: sharky, nope, no one, we're all just waiting for you to gist your problem.
[18:30:38] dman777_alter: is there a way to get the query string will all the parameters without specifying each param's key?
[18:31:20] stannard: has joined #RubyOnRails
[18:31:40] adam12: dman777_alter: what's your use case?
[18:32:12] sharky: i am coding
[18:32:34] djbkd: has joined #RubyOnRails
[18:32:38] EminenceHC: has joined #RubyOnRails
[18:33:45] dman777_alter: adam12: I need to get config_type and template in the query string. it would be easier if I could get everything after the '?' since those query params could be ether or both
[18:34:37] adam12: You can get a string representation, likely from request.query_parameters
[18:34:55] djbkd: has joined #RubyOnRails
[18:34:56] adam12: dman777_alter: But it would be better to just use params. what about params[:config_type] || params[:template]
[18:35:19] adam12: or params.slice(:config_type, :template). I'm not sure what your code looks like. Gist some and we can look at it.
[18:36:12] annlewis: has joined #RubyOnRails
[18:36:13] bobbobbins: has joined #RubyOnRails
[18:37:23] mrchris: tubbo, http://pastie.org/10438158 - When a GameSubmission is saved 2 GameSubmissionCode records are being allocated. Do you see any issues with my associations?
[18:38:45] ericjphillips: has joined #RubyOnRails
[18:39:07] mrchris: One thing to note is game_submission_codes is repopulated
[18:40:58] tubbo: __chris: 'game_submission_code =' isn't gonna do anything, you need 'self.game_submission_code =' to actually set the method
[18:41:19] tubbo: __chris: that code you're showing me is just populating a local var
[18:41:29] roxtrongo: has joined #RubyOnRails
[18:41:41] mrchris: ok ill try that. I;ve updated the gist to better reflect the before/after in the db http://pastie.org/private/7eu6i2tkbf0t7dfyezysw
[18:41:59] tubbo: __chris: GameSubmissionCode.where(game_id: game.id).where(game_submission_id: nil) is also not guaranteed to give you back *one* record, it will give you back N records.
[18:42:19] mrchris: * sorry, yes, I do have `.first` on that as well
[18:42:41] tubbo: __chris: please post your ACTUAL code not a shitty version of it, and i will help you further. but i can't work with pseudocode, it's too indirect.
[18:43:06] mrchris: i understand. wish I could
[18:43:40] smathy: __chris, !rule3
[18:43:40] helpa: __chris: Clearly explain what is happening and create a Gist (http://gist.github.com), (formatted neatly please: http://bit.ly/1q75oia) of the code that is causing the problem you are encountering, as well as any useful output like stacktraces.
[18:44:06] baweaver: has joined #RubyOnRails
[18:44:55] atmosx_laptop: has joined #RubyOnRails
[18:45:39] michael_mbp: has joined #RubyOnRails
[18:46:30] n00bDev: has joined #RubyOnRails
[18:46:44] lasker85: has joined #RubyOnRails
[18:47:38] sanjayu: has joined #RubyOnRails
[18:48:39] EminenceHC: has joined #RubyOnRails
[18:48:58] n00bDev: If I using STI within a table, how do i show only the parent type? calling .all on the parent is including the subclass also
[18:50:57] FailBit: then do a filter on _type
[18:52:29] Palsson: has joined #RubyOnRails
[18:52:33] jenrzzz: has joined #RubyOnRails
[18:52:45] greengriminal: has joined #RubyOnRails
[18:57:03] habitullence: has joined #RubyOnRails
[18:57:20] smathy: n00bdev, I find that if I want to use the parent type/class, then it's better to make it a subclass of the actual STI base class too.
[18:58:01] Lincee: has joined #RubyOnRails
[18:58:08] dstarh: has joined #RubyOnRails
[18:59:48] blackmesa: has joined #RubyOnRails
[18:59:53] voltalio: has joined #RubyOnRails
[19:00:15] dstarh: Our api currently allows http and https connections but before we make the switch to allowing only https, we need to report on which clients are making http calls. We only want to report once per endpoint and ip-address combination. Ideally i need an applicaiton scope variable that will survive requests and act as cache/memo to ensure we don't continually alet
[19:00:30] dstarh: where is the appropriate place to define the variable
[19:00:40] dstarh: an initializer?
[19:01:35] Coldblackice: has joined #RubyOnRails
[19:01:56] lxsameer: has joined #RubyOnRails
[19:01:56] lxsameer: has joined #RubyOnRails
[19:03:05] User458764: has joined #RubyOnRails
[19:03:06] raunicolae: has joined #RubyOnRails
[19:03:09] smathy: dstarh, how many distinct clients do you have?
[19:03:25] iamse7en: has joined #RubyOnRails
[19:03:42] jgt: has joined #RubyOnRails
[19:03:49] User458764: has joined #RubyOnRails
[19:03:53] frmendes: has joined #RubyOnRails
[19:04:01] dstarh: only 4 or 5 but they're client's we're not in control of so we're just wanting to do some reporting now
[19:04:38] raunicolae: has left #RubyOnRails: ()
[19:07:37] Macaveli: has joined #RubyOnRails
[19:07:41] romdi``: has joined #RubyOnRails
[19:07:59] sandstrom: has joined #RubyOnRails
[19:09:01] EminenceHC: has joined #RubyOnRails
[19:09:53] djbkd: has joined #RubyOnRails
[19:10:08] HAL2328: has joined #RubyOnRails
[19:10:25] djbkd: has joined #RubyOnRails
[19:11:01] habitullence: has joined #RubyOnRails
[19:11:09] VeryBewitching: Using Kaminari in a Rails 4 engine; the translations for the paginator are defined by Kaminari will only use the translation provided by the gem. Anyone know how to fix this? https://gist.github.com/bewitchingme/c4f80dccbc626866ea02 This is from the project: https://github.com/bewitchingme/diabetic_toolbox
[19:13:21] cmisenas: has joined #RubyOnRails
[19:13:30] dstarh: smathy forgot to mention you in my reply
[19:14:14] GragHarker: has joined #RubyOnRails
[19:15:02] cnk: has joined #RubyOnRails
[19:15:03] tubbo: VeryBewitching: is that an engine or an app?
[19:15:07] smathy: dstarh, I'd just put it in the DB then.
[19:15:43] dstarh: smathy thought about that bit we'll be ditching the code after a few days so didn't want to go though that much trouble
[19:15:50] tubbo: hmm, very odd
[19:16:12] VeryBewitching: Yup, been driving me nuts for about an hour.
[19:16:32] jenrzzz: has joined #RubyOnRails
[19:16:34] rhizome: VeryBewitching: kaminari docs seem to indicate you can override simply
[19:16:56] craysiii: has joined #RubyOnRails
[19:17:29] smathy: dstarh, just make a new table/model to stash this data and just do something like: ClientReport.find_or_create_by(client_id: the_client.id) unless request.ssl? or whatever you're using.
[19:17:35] smathy: dstarh, it's probably the least trouble.
[19:18:07] dstarh: smathy thanks that might work
[19:18:31] VeryBewitching: rhizome: Well I've overridden the keys that they specify, and I've done this in an app the same way, with this it simply does nothing.
[19:19:03] VeryBewitching: rhizome: Well, not nothing, it uses the values from the kaminari gem, not mine.
[19:19:25] pwnd_nsfw: has joined #RubyOnRails
[19:19:30] tubbo: VeryBewitching: no i mean, it's odd that you created an engine for this when it is very clearly an application meant to be installed.
[19:20:56] Pupeno: has joined #RubyOnRails
[19:20:56] Pupeno: has joined #RubyOnRails
[19:20:59] VeryBewitching: tubbo: Ya, there's a reason why it's an engine, but that reason isn't very interesting.
[19:21:03] Ergo: has joined #RubyOnRails
[19:21:09] tubbo: hehe word
[19:21:18] tubbo: have made engines for personal use as well
[19:22:15] yaymukund: has joined #RubyOnRails
[19:22:30] VeryBewitching: Right now it's a standalone application, but the intention eventually is to cover other areas of out-patient healthcare.
[19:23:49] t_mmyv: has joined #RubyOnRails
[19:25:07] pwnd_nsfw: sublimelinter is terrible for ruby lol
[19:25:09] bruno-: has joined #RubyOnRails
[19:25:25] IceyEC: has joined #RubyOnRails
[19:26:16] someish: has joined #RubyOnRails
[19:26:58] Macaveli: has joined #RubyOnRails
[19:27:45] banjara: has joined #RubyOnRails
[19:28:22] workmad3: has joined #RubyOnRails
[19:29:41] djbkd: has joined #RubyOnRails
[19:30:15] djbkd: has joined #RubyOnRails
[19:31:00] rhizome: lint and dynamic languages are generally incompatible
[19:31:33] rromanchuk: has joined #RubyOnRails
[19:31:35] arup_r: has joined #RubyOnRails
[19:32:21] HAL2328: has joined #RubyOnRails
[19:32:33] sam_weerasinghe: has joined #RubyOnRails
[19:32:42] arup_r: Why my presence validation didn;t work
[19:32:54] arup_r: https://gist.github.com/aruprakshit/26a9a3d7cf10dd76adff
[19:33:24] mwlang: how do I drop the ??????silent??? flag on whenever???s rake job?
[19:33:52] mwlang: I have a rake task I want it???s output emailed everytime it runs and ???silent prevents this.
[19:34:13] pwnd_nsfw: arup_r, are you sure it inserted anything?
[19:34:30] arup_r: it shouldn't show rollback ?
[19:34:32] smathy: arup_r, what makes you think it didn't work?
[19:34:56] jyraff: has joined #RubyOnRails
[19:35:07] pwnd_nsfw: It won't rollback if nothing was put into the database
[19:35:09] arup_r: smathy: It say commit and then not JS alert I got also
[19:35:27] arup_r: ok.. then why the JS alert didn't come ?
[19:37:07] annlewis: has joined #RubyOnRails
[19:37:14] BlackCoyote: has joined #RubyOnRails
[19:37:17] smathy: pwnd_nsfw, a ROLLBACK will still be issued.
[19:37:27] yaymukund: has joined #RubyOnRails
[19:38:35] pwnd_nsfw: arup_r, on the application itself, does anything at all happen?
[19:39:10] workmad3: has joined #RubyOnRails
[19:40:01] arup_r: I put a logger.info 1 in the else.. and saw the 1 as in the log https://gist.github.com/aruprakshit/26a9a3d7cf10dd76adff/edit
[19:40:06] `based_pdev`: has joined #RubyOnRails
[19:40:10] arup_r: no idea why the alert is not coming..
[19:40:19] arup_r: pwnd_nsfw: didn't get you
[19:40:42] tubbo: i've never seen that arup_r, usually people just render a js template
[19:40:45] bronson: has joined #RubyOnRails
[19:40:56] tubbo: arup_r: but i'd highly recommend keeping your JS in assets, and leaving rails to do what it does best
[19:41:11] arup_r: tubbo: 2.2.11 Rendering Vanilla JavaScript http://guides.rubyonrails.org/layouts_and_rendering.html#using-render
[19:41:55] smathy: arup_r, you're right, if @tenant.persisted? was false then you should see your alert.
[19:42:04] smathy: arup_r, what's the sync_new method?
[19:42:12] arup_r: tubbo: I see in browser console response tab it is showing alert('Name can't be blank');
[19:42:21] arup_r: but not seeing in the page
[19:42:30] rhizome: you should put it in the page then
[19:42:33] arup_r: smathy: It is a Gem
[19:42:52] arup_r: I don't know about it.. My other project friend added it
[19:43:28] tubbo: pwnd_nsfw: rubocop isn't so bad
[19:43:30] Pupeno: has joined #RubyOnRails
[19:43:35] tubbo: pwnd_nsfw: i use it with syntastic to get inline style checks
[19:45:58] finnnnnnnnnnn: has joined #RubyOnRails
[19:46:32] maz-dev: has joined #RubyOnRails
[19:46:47] finnnnnnnnnnn: in rails is the type ???bool??? or ???boolean???
[19:46:48] smathy: arup_r, it shouldn't have affected the validation.
[19:47:16] arup_r: finnnnnnnnnnn: later one
[19:47:22] tubbo: finnnnnnnnnnn: !migrations
[19:47:22] helpa: finnnnnnnnnnn: http://guides.rubyonrails.org/migrations.html - Migrations Guide by Frederick Cheung
[19:47:26] baweaver: has joined #RubyOnRails
[19:47:36] tubbo: pretty sure there
[19:47:38] smathy: arup_r, add that `tenants` association/whatever from your User model.
[19:47:42] tubbo: is an example on t.boolean there
[19:48:26] habitullence: has joined #RubyOnRails
[19:48:29] finnnnnnnnnnn: tubbo: I was reading that as I asked, it???s not mentioned!
[19:48:36] tubbo: ahhh shit
[19:48:38] smathy: arup_r, sorry, I just noticed that you said that the else was hit - from your logger.
[19:48:55] arup_r: smathy: I am seeing in browser dev tool response tab it is rendenring the js, only it is not visible to the page
[19:49:28] tubbo: arup_r: is it coming over with the proper Content-Type?
[19:49:41] arup_r: let me check
[19:50:02] manfrin: has joined #RubyOnRails
[19:50:09] michael_mbp: has joined #RubyOnRails
[19:50:26] havenn: has joined #RubyOnRails
[19:50:49] smathy: arup_r, ok, so it's just not being run. Maybe the content type isn't being set properly.
[19:51:50] arup_r: https://gist.github.com/aruprakshit/26a9a3d7cf10dd76adff#file-devtool-txt
[19:52:07] smathy: arup_r, I still suspect that sync gem, it's some sort of real time update of things on the client from the server, sounds like it hooks into JS - might be overriding something.
[19:52:28] ramortegui: has joined #RubyOnRails
[19:52:39] michael_mbp: has joined #RubyOnRails
[19:53:06] prestorium: has joined #RubyOnRails
[19:54:58] bronson: has joined #RubyOnRails
[19:55:25] arup_r: It is working if I write `render js: "alert(12);"
[19:55:34] arup_r: It means my syntax is wrong
[19:56:08] arup_r: those " and ' messed up
[19:56:18] arup_r: How to write ` "alert('#{@tenant.errors.full_messages.join("\n")}');"`
[19:56:35] smathy: That sync gem is pretty neat.
[19:56:36] meoblast001: has joined #RubyOnRails
[19:56:57] smathy: arup_r, ah, of course, you forgot to escape it.
[19:57:05] drptbl_: has joined #RubyOnRails
[19:57:07] smathy: #{ j @tenan....
[19:58:37] arup_r: smathy: I got error with the `j`
[19:58:37] arup_r: JSON::GeneratorError (only generation of JSON objects or arrays allowed):
[19:58:37] arup_r: app/controllers/tenants_controller.rb:25:in `create'
[19:59:03] arup_r: I used render js: "alert('#{ j @tenant.errors.full_messages.join("\n") }');"
[19:59:27] lagweezle: Where would I go to read up on good approaches to showing the user information for error cases and how to structure the views for this?
[20:00:13] benlieb: has joined #RubyOnRails
[20:00:19] rhizome: lagweezle: google "rails validation errors" and use that as a launching point. also: sites you already visit
[20:00:53] lagweezle: rhizome: Thank you!
[20:01:07] lagweezle: Largely I'm after the implementation side, rather than how to make pretty and readable.
[20:01:33] smathy: Oh, it's a view helper, means something else in a controller.
[20:01:36] smathy: arup_r, ^
[20:02:05] smathy: arup_r, means we're back to tubbo's recommendation - use a JS template :)
[20:02:08] RandyT: has joined #RubyOnRails
[20:03:29] smathy: arup_r, you could also `include ActionView::Helpers::JavaScriptHelper` in your controller if you wanted to get really hacky :)
[20:03:48] zendrix: has joined #RubyOnRails
[20:03:59] arup_r: How he did it http://stackoverflow.com/questions/7055975/rendering-inline-in-rails ?
[20:05:54] mices: how do i make a site that looks like grubhub i've seen some similarly styled sites it's like a trend
[20:06:20] smathy: arup_r, oh yeah, that'll pass the string on to the view processor to be parsed as ERB.
[20:06:33] smathy: arup_r, you can do that instead of the #{}
[20:06:37] mices: i mean those kind of submit buttons and stuff
[20:06:53] arup_r: I tried <%= %> also
[20:06:55] smathy: mices, button/graphic design nothing to with Rails.
[20:06:56] sharkman: has joined #RubyOnRails
[20:06:59] drptbl: has joined #RubyOnRails
[20:07:07] arup_r: some weird thing happened
[20:07:52] baweaver: has joined #RubyOnRails
[20:08:00] smathy: arup_r, seriously, just make a quick template.
[20:08:24] arup_r: yes wasting time it seems.. Rails hard game sometimes to crack
[20:08:25] sandstrom: has joined #RubyOnRails
[20:09:19] bmurt: has joined #RubyOnRails
[20:10:07] jkamenik: has joined #RubyOnRails
[20:10:37] Pupeno: has joined #RubyOnRails
[20:10:41] maxx: has joined #RubyOnRails
[20:10:53] _3by8: has joined #RubyOnRails
[20:11:08] targaf: has joined #RubyOnRails
[20:12:48] _3by8: Would I be following convention if I had an index page that was attached to a controller I've called "static pages controller" but also displayed some dynamic data?
[20:13:16] Nuck: has joined #RubyOnRails
[20:13:44] baweaver: then that's kinda not a static page
[20:13:52] baweaver: you're probably looking for templates
[20:13:56] centrx: If your convention is "name things the opposite of what they do", then yes
[20:14:04] _3by8: centrx: lol
[20:14:08] _3by8: baweaver: lol, yeah
[20:14:13] _3by8: everyone: lol
[20:15:15] _3by8: baweaver, centrx I've been following along with the conventions set forth in the tutorial at railstutorial.org
[20:15:53] _3by8: He has a static pages controller which contains the index page but has also got a link for logging in and a header partial that displays information pertaining to the user such as their status.
[20:16:04] baweaver: keep following it then, it'll get to non-statics
[20:16:26] _3by8: I'm basically finished with it.
[20:16:46] arup_r: I created a error.js.erb file.. How to give the name from create action like render js: "error" didn't work
[20:16:55] momomomomo: has joined #RubyOnRails
[20:17:44] baweaver: arup_r: what have you tried
[20:18:26] arup_r: baweaver: I said already
[20:18:38] krisquigley: has joined #RubyOnRails
[20:18:40] baweaver: http://guides.rubyonrails.org/layouts_and_rendering.html
[20:19:02] Guest29845: has joined #RubyOnRails
[20:19:52] arup_r: baweaver: reading from first to last character.. thanks
[20:22:08] _3by8: centrx: do you have any suggestions for me? I'm going to be displaying a list containing rows of recent information from the database. Would I just want to create an index controller for something like that?
[20:23:37] centrx: _3by8, Sure
[20:23:48] bendangelo: has joined #RubyOnRails
[20:24:19] centrx: _3by8, but if you have a controller for "admin pages" or "status pages" or whatever this collection may be, could be called something other than index, to fit others in the same controller
[20:25:04] rboyd: has joined #RubyOnRails
[20:25:36] DLSteve: has joined #RubyOnRails
[20:25:40] smathy: ACTION almost always has PagesController to do stuff like thta
[20:25:51] _3by8: smathy: lol
[20:26:04] _3by8: smathy: can't argue with the name
[20:26:09] smathy: See, by not calling it StaticPagesController I'm free to do whatever I want in there ;)
[20:26:14] _3by8: haha true
[20:26:17] bruno-: has joined #RubyOnRails
[20:26:50] lasker85: has joined #RubyOnRails
[20:27:22] arup_r: Now alert is coming.. I have `alert("<%= @tenant.errors.full_messages.join('\n') %>");` but text is "Name can&#39;t be blank"
[20:27:32] arup_r: what to escape here ?
[20:27:46] arup_r: I moved it to template btw
[20:28:02] arup_r: the code is in error.js.erb
[20:28:23] morenoh149: has joined #RubyOnRails
[20:28:39] moshef: has joined #RubyOnRails
[20:28:41] smathy: _3by8, the name isn't that important really, and it's also reasonably easy to change later. If the information you want to display is reasonably generic then you could put it in the PagesController or maybe it's user specific and you have UsersController#dashboard or something?
[20:28:41] morenoh149: can anyone explain http caching in rails/rack?
[20:28:45] sloggerkhan: If I want to make a url like (/archive)/activities is there a way to get /archive/activities out of the hypothetical activities_path or activities_url helper rather than /activities? Or am I stuck duplicating all my urls for the archive pages?
[20:28:53] momomomomo_: has joined #RubyOnRails
[20:29:07] morenoh149: I'm building a SPA that consumes json from RoR and I'm wondering if I should use redis as a cache or HTTP caching.
[20:29:11] pulgolino: has joined #RubyOnRails
[20:29:21] smathy: arup_r, html_safe
[20:29:28] havenwood: has joined #RubyOnRails
[20:29:49] tubbo: morenoh149: you should use both,
[20:30:03] smathy: morenoh149, http://guides.rubyonrails.org/caching_with_rails.html
[20:30:10] amortimer: has joined #RubyOnRails
[20:30:30] chouhoulis: has joined #RubyOnRails
[20:30:43] drptbl: has joined #RubyOnRails
[20:34:46] lasker85: Hey I'm looking at this: http://stackoverflow.com/questions/5113248/devise-update-user-without-password
[20:34:58] lasker85: Specifically there is a guy named Duncan Robertson who provides an ansewr
[20:35:32] lasker85: where it says def update_resource(resource,params) and resource.update_without_password -- am I replacing "resource" with the attribute I'm changing?
[20:37:18] michael_mbp: has joined #RubyOnRails
[20:38:17] annlewis: has joined #RubyOnRails
[20:38:39] michael_mbp: has joined #RubyOnRails
[20:38:54] whatisgoingon: has joined #RubyOnRails
[20:39:52] kinduff: has joined #RubyOnRails
[20:40:38] fgielow: has joined #RubyOnRails
[20:40:43] otacon-: has joined #RubyOnRails
[20:41:19] lurkmaster: has joined #RubyOnRails
[20:42:01] whatisgoingon: I have an issue where I have rails running in a VM, when I set time in the controller on an object and save it in the DB it is correct, however when I save time within the model it is off. Any idea why this would be. I use unicorns if that makes a difference
[20:42:42] lapide_viridi: has joined #RubyOnRails
[20:44:48] corioliss: has joined #RubyOnRails
[20:45:37] lurkmaster: does anyone know how to add the ability to delete a message in this app --> http://pastie.org/10438351
[20:46:15] lurkmaster: i asked this question earlier, but I'm still kind of confused. if someone could edit my pastie with a basic working example i would appreciate it so much
[20:46:28] Spami: has joined #RubyOnRails
[20:46:38] lurkmaster: i just need to see a working example so i can understand how it works. I've never used the :id parameter before
[20:47:21] lurkmaster: ACTION is trying to learn how to use the destroy action
[20:47:41] whatisgoingon: :id paramter comes from the route
[20:47:54] whatisgoingon: You use the Id to look up the object and destroy it
[20:48:28] Exuma: has joined #RubyOnRails
[20:49:29] shinnya: has joined #RubyOnRails
[20:51:39] lurkmaster: i tried editing the index view like this --> http://pastie.org/10438360
[20:52:49] whatisgoingon: message_path(@message) is wrong
[20:52:55] whatisgoingon: you dont have @message in the index
[20:52:58] whatisgoingon: you have @messages
[20:53:03] Spami: I'm trying to get capybara to wait for page load before performing any more action but I can't get it to work
[20:53:06] badfish129: has joined #RubyOnRails
[20:53:06] Spami: Any idea how to do it?
[20:53:07] whatisgoingon: and you are doing an each loop through @messages and assigning each one to message
[20:53:13] whatisgoingon: so it needs to be message_path(message)
[20:53:40] n00bDev: has joined #RubyOnRails
[20:55:36] baweaver: has joined #RubyOnRails
[20:55:41] lurkmaster: in the loop the local variable message gets assigned to each instance of @message
[20:55:48] lurkmaster: i deleted the @ symbol and it worked
[20:55:50] lipoqil: has joined #RubyOnRails
[20:55:59] whatisgoingon: Anyone with experience running Rails in VMs ever have an issue with time being off? I have a cron that fixes the time but for some reason when I set the time in my Model it drifts, but when I set the time in the controller it uses the corrected time? Any idea why this would occur
[20:56:01] lurkmaster: the problem i copied that code from a tutorial and edited it slightly, forgot to edit that part
[20:56:05] Polysics: has joined #RubyOnRails
[20:56:14] Guest29845: has left #RubyOnRails: ()
[20:56:22] lasker85: I will pay someone familiar with devise to help me fix my problem. I'm trying to build a "user profile" section where the user can update attributes without requiring a password.
[20:56:29] whatisgoingon: In the loop each object in the array @messages gets assigned to message
[20:56:39] whatisgoingon: But yeah it seems like you get it
[20:56:44] Polysics: anyone has ever encountered guard not autoloading things properly?
[20:56:58] Polysics: I have this app/inputs folder where I keep custom SimpleForm inputs
[20:57:00] smathy: Spami, capybara automatically waits for elements to appear before interacting with them.
[20:57:04] djbkd: has joined #RubyOnRails
[20:57:05] crunk_bear: has joined #RubyOnRails
[20:57:14] lurkmaster: yea, my terminology is off, but i see what was wrong. thanks!
[20:57:18] Polysics: rspec tests run fine, when running through guard it thinks the class is not loeaded
[20:57:29] lipoqil: lasker85: You need to authenticate the user somehow. What is the whole flow?
[20:57:33] Polysics: lasker85: you don't need to pay anyone. What are you having issues with?
[20:57:44] elaptics: Spami: what driver are you using?
[20:58:04] Spami: elaptics, selenium_chrome
[20:58:19] benlieb: has joined #RubyOnRails
[20:58:27] whatisgoingon: lurkmaster: np, it can be confusing when you first dive in. good luck
[20:58:27] Spami: smathy, I'm actually calling the method visit after clicking on a login button
[20:58:37] Polysics: if the user is already authenticated, all you need to do is update the attributes and save the object?
[20:58:54] lasker85: It's complicated. A lot of people have problems.
[20:58:59] lasker85: http://stackoverflow.com/questions/5113248/devise-update-user-without-password
[20:59:02] elaptics: Spami: not familiar with that one but I'd expect it to work like smathy says
[20:59:24] lipoqil: polysics: But what he has meaningless amount of money he needs to help with :O
[20:59:28] smathy: Spami, you generally only use visit to begin a scenario - after that you use the clicking etc. to navigate.
[20:59:40] finnnnnnnnnnn: has joined #RubyOnRails
[20:59:45] Spami: Not in my scenario though
[20:59:47] smathy: Spami, although, that should only create a redundant request, not cause something not to load.
[20:59:51] Polysics: lipoqil: then we should totally help him offload all that cash
[20:59:53] smathy: Spami, !code
[20:59:53] helpa: Spami: 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.
[21:00:00] djbkd: has joined #RubyOnRails
[21:00:05] lipoqil: polysics: :)
[21:00:20] someish: has joined #RubyOnRails
[21:00:21] Polysics: lasker85: !code works for you, too :)
[21:00:32] elaptics: lasker85: !code :)
[21:00:32] helpa: lasker85: 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.
[21:00:33] bricker: smathy: I'm going to disagree with you on that one. Sometimes an action changes the state of another page, so the assertion is that the other page has changed and you have to visit to make the assertion
[21:00:34] jher: has joined #RubyOnRails
[21:00:38] yfeldblum: has joined #RubyOnRails
[21:00:42] elaptics: lasker85: also how tied to devise are you?
[21:01:02] smathy: bricker, you saw my "generally" qualification?
[21:01:04] whatisgoingon: Devise is fairly easy to override
[21:01:07] lasker85: Rather than build my own auth? I'm only 2 weeks into rails so I'd rather not do something from scratch.
[21:01:08] bricker: smathy: yes :)
[21:01:15] smathy: bricker, I stand by that comment.
[21:01:21] Polysics: I take the above back: the whole autoloading that guard does seems to be borked
[21:01:33] Polysics: it is not seeing gems. What the.
[21:01:43] bricker: smathy: just clarifying for Spami that using "visit" multiple times in a test isn't wrong
[21:01:43] elaptics: lasker85: I've been using clearance lately
[21:01:52] whatisgoingon: did you use bundle exec polysics?
[21:01:57] smathy: bricker, generally it's unnecessary.
[21:02:04] bricker: smathy: okay
[21:02:08] Polysics: whatisgoingon: yes, of course, both with rspec and guard
[21:02:16] Polysics: I am thinking I maybe have the wrong options?
[21:02:24] yfeldblum: has joined #RubyOnRails
[21:02:38] whatisgoingon: No idea but forgetting to bundle exec is a common explanation to the not having the right gems being used
[21:03:11] Polysics: whatisgoingon: the interesting thing is that is seems to affect both some gems and some files that should be autoloaded
[21:03:30] Polysics: does guard use spring? maybe I have a runaway spring process?
[21:03:48] whatisgoingon: Could be a possible answer, spring drives me crazy sometimes
[21:03:53] SteenJobs: has joined #RubyOnRails
[21:04:00] Polysics: I'll killall spring
[21:04:01] sam_weerasinghe: has joined #RubyOnRails
[21:04:04] tubbo: polysics: are *you* using spring? type bin/spring stop
[21:04:10] tubbo: killall spring won't do it
[21:04:43] Polysics: I stopped it but there's multiples, one of which is 125 hours old
[21:04:43] yfeldblum: has joined #RubyOnRails
[21:04:52] lasker85: https://gist.github.com/anonymous/514a6fa379e1abe9b962
[21:05:03] Polysics: pkill to the rescue. DIEDIEDIE.
[21:05:13] smathy: polysics, hopefully the others are from a different app/directory.
[21:05:27] Polysics: all of them from my current work dir
[21:05:41] smathy: pkill -9 -f spring is always in my command history :)
[21:05:42] rromanchuk: has joined #RubyOnRails
[21:05:46] Polysics: aand it works :)
[21:06:00] Polysics: it does get out of sync some time, who knows
[21:06:07] Polysics: thanks for making me think of the solution :P
[21:06:36] tubbo: generator_spec users, have you ever recieved the error "TypeError: can't convert Tempfile into StringIO
[21:06:42] tubbo: in your generator tests
[21:06:56] smathy: Generator tests? Now you're just showing off tubbo
[21:07:02] lipoqil: lasker85: I guess you are missing just submit button and you are done, isn't it?
[21:07:05] tubbo: smathy: hell yeah buddy
[21:07:16] smathy: 110% coverage.
[21:07:34] lasker85: When I go to /measurements.html I get this undefined local variable or method `resource' for #<#<Class:0x007fdee2499aa8>:0x007fdee2498fe0>
[21:07:48] jher: 4am coding session, but at least I have 110% coding coverage!
[21:07:53] krisquigley: has joined #RubyOnRails
[21:08:04] tubbo: far from that, but maybe this will help a little bit. it's for a decorator generator, wherein we generate a decorator object for an already defined class and place it in app/decorators, but i also copy the unit test out of our platform and put it in the host app, so you can verify unit tests and create additional ones, or alter the existing examples.
[21:08:13] smathy: lasker85, !code
[21:08:13] helpa: lasker85: 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.
[21:08:21] lasker85: https://gist.github.com/anonymous/514a6fa379e1abe9b962
[21:08:39] smathy: lasker85, !gist-usage for next time
[21:08:39] helpa: lasker85: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[21:08:58] RegulationD: has joined #RubyOnRails
[21:09:20] whatisgoingon: Anyone with experience running Rails in VMs ever have an issue with time being off? I have a cron that fixes the time but for some reason when I set the time in my Model it drifts, but when I set the time in the controller it uses the corrected time? Any idea why this would occur. Restarting unicorns resets the time drift, and it just drifts away from the current time as long as rails runs.
[21:10:04] bruno-: has joined #RubyOnRails
[21:10:16] yaymukund: has joined #RubyOnRails
[21:10:44] whatisgoingon: My understanding was that Time.now with no parameters will use system time
[21:11:03] whatisgoingon: From what I can read from the rails codebase that appears to be true
[21:11:47] voltalio: has joined #RubyOnRails
[21:11:49] rhizome: a vm? don't fix the time with cron, run xntpd
[21:12:04] rhizome: or an ntpd in general
[21:12:27] whatisgoingon: But even if I used ntpd would that really solve this problem with rails having drifting time only in the models?
[21:12:44] lasker85: I'm happy to pay someone $100 to fix this for me. It's worth it to me to just move on and not spend more time on it.
[21:12:52] whatisgoingon: Gonna try to turn off eager loading and see if this is related
[21:12:55] rhizome: whatisgoingon: no idea what could be going on there, but first things first
[21:13:12] lasker85: These people seem to like Duncan Robertson's solution: http://stackoverflow.com/questions/5113248/devise-update-user-without-password
[21:14:15] lasker85: I can give someone control of my computer with teamviewer. PM me if you want to make $100.
[21:14:36] whatisgoingon: It should be noted you are taking away quite a bit of security by removing the password requirement when saving your settings, obviously it is dependent on the application if it matters.
[21:15:08] lasker85: You talking to me?
[21:15:10] whatisgoingon: I would just override the controller or model
[21:15:19] whatisgoingon: you could do it by overriding either
[21:15:42] whatisgoingon: Just go to the devise github and look at the registrations controller
[21:15:47] elaptics: whatisgoingon: why not take height, etc off your user model?
[21:15:54] lasker85: I've been trying man. I'll pay you $100 if you can do it for me. I'm super new to rails so all this stuff is hard for me.
[21:16:09] elaptics: lasker85: ^ that was for you :)
[21:16:28] lasker85: I'm not sure what you mean by that
[21:16:36] lasker85: Oh you mean make it a separate model?
[21:16:53] elaptics: lasker85: create a separate model to store it on, e.g. a UserProfile
[21:17:02] elaptics: User has_one :user_profile
[21:17:23] whatisgoingon: lasker85: Its really not that difficult, look here: https://github.com/plataformatec/devise/blob/master/app/controllers/devise/registrations_controller.rb
[21:17:25] lasker85: hmm I could do that
[21:17:45] whatisgoingon: All you need to do is override the update_resource function
[21:17:51] whatisgoingon: replace updates with password
[21:17:56] whatisgoingon: to just updates_attributes
[21:18:12] whatisgoingon: and it will work without a password
[21:18:37] lasker85: I think I should create a separate model
[21:18:39] lasker85: that makes sense
[21:18:44] lasker85: instead of screwing with devise
[21:19:28] whatisgoingon: Its trivial to override a single function: http://stackoverflow.com/questions/20783633/override-devise-registrations-controller-create-action
[21:19:41] michael_mbp: has joined #RubyOnRails
[21:19:44] lasker85: ...and yet I could not do it
[21:20:10] whatisgoingon: Whats the prefered paste?
[21:20:13] whatisgoingon: Ill paste the code
[21:20:21] idd2d: has joined #RubyOnRails
[21:20:35] lasker85: I'm going to create a separate model. I have to run to the gym now
[21:20:35] HAL2328: for sqlite3 db, is libsqlite3-dev all i need? i can't perform rake db:migrate
[21:21:02] lipoqil: lasker85: I like the idea with different model
[21:21:30] whatisgoingon: Seems like overkill if you are using devise.
[21:22:18] tomeara: has joined #RubyOnRails
[21:22:23] lipoqil: lasker85: https://github.com/plataformatec/devise/wiki/How-To%3a-Allow-users-to-edit-their-account-without-providing-a-password
[21:22:43] whatisgoingon: Thats exactly what I was suggesting
[21:22:50] lasker85: Yes I've read all of that
[21:22:55] whatisgoingon: except apparently they use updates_without_password instead of just updates_attributes
[21:22:57] lasker85: I read everything I can find on the web before i ask IRC
[21:23:29] whatisgoingon: Pretty sure updates_without_password is just a function that says updates_attributes though
[21:23:47] lipoqil: lasker85: And how this guide didn't work?
[21:23:59] lipoqil: Some error message or nil fields?
[21:24:11] User458764: has joined #RubyOnRails
[21:24:20] lasker85: https://gist.github.com/anonymous/514a6fa379e1abe9b962
[21:24:21] smathy: HAL2328, what errors are you getting?
[21:24:24] lasker85: This is what I tried to do
[21:24:27] whatisgoingon: Oh it also removes passwords
[21:24:58] tubbo: haha that's funny
[21:25:00] mrmylanman: has joined #RubyOnRails
[21:25:22] RockLee: has joined #RubyOnRails
[21:25:44] smathy: HAL2328, I'm not sure if libsqlite3-dev is all you need because I always install sqlite3 too.
[21:26:45] whatisgoingon: that controller is going to need to be in the correct folder structure
[21:26:48] HAL2328: smathy, thanks let me try that
[21:27:16] workmad3: has joined #RubyOnRails
[21:27:37] whatisgoingon: Also the name is wrong
[21:27:40] whatisgoingon: it has to be update_resource
[21:28:07] startupality: has joined #RubyOnRails
[21:28:24] HAL2328: smathy, worked! thanks very much
[21:28:45] smathy: HAL2328, you're welcome.
[21:29:50] badfish129: has joined #RubyOnRails
[21:29:51] morenoh149: has joined #RubyOnRails
[21:30:02] whatisgoingon: lasker: like this https://gist.github.com/anonymous/40107aa5914ade448630
[21:30:12] whatisgoingon: but that controller will need to be in the right structure
[21:30:14] bricker: whyyyy is apidock always at the top of search results instead of the official documentation
[21:30:17] bricker: infuriating
[21:30:49] rhizome: LINK JOOSE
[21:31:04] Cache_Money: has joined #RubyOnRails
[21:31:38] erich: has joined #RubyOnRails
[21:31:51] pheuko: has joined #RubyOnRails
[21:32:24] __apr__: I'm reviewing someone elses code and there is something I don't understand.
[21:32:24] __apr__: load_question method is not defined anywhere in the code: https://gist.github.com/andresriancho/e50df29be49d42eb0bd2
[21:32:24] __apr__: for what I can understand from the code, it does query the DB and assign que @question attribute to the controller
[21:32:24] __apr__: but I would like to know how rails resolves that, in other words, which lines of code are run to set @question?
[21:32:25] __apr__: what's the name of this "load_*" rails feature?
[21:32:31] sandstrom: has joined #RubyOnRails
[21:32:52] rezzack1: has joined #RubyOnRails
[21:33:17] bricker: __apr__: that's not Rails, looks like some gem adding functionality to rails controllers
[21:33:42] __apr__: bricker, aha, that's a nice clue
[21:33:53] __apr__: any way to find out which gem?
[21:34:15] kinduff: has joined #RubyOnRails
[21:34:23] __apr__: include LoadModel maybe?
[21:34:31] __apr__: that's in the application_controller.rb
[21:34:44] bricker: __apr__: that seems likely, in that case it would not be a gem :)
[21:35:01] bricker: __apr__: grep "load_question" or "self.load_question" should help you find the method
[21:35:34] __apr__: bricker, no, that's the case, load_question is not defined anywhere
[21:35:38] User458764: has joined #RubyOnRails
[21:35:50] __apr__: bricker, just found this code which seems to be what I wanted:
[21:35:51] __apr__: MODEL_TYPES.each do |model_type|
[21:35:52] __apr__: define_method(:"load_#{model_type}") do |*options|
[21:36:01] momomomomo: has joined #RubyOnRails
[21:36:03] bricker: __apr__: looks like it
[21:36:26] rhizome: important metaprogramming
[21:36:44] bricker: __apr__: for the future, outputting "caller" inside of a method will show you its call chain.
[21:37:22] __apr__: awesome, thanks :)
[21:37:49] mrmylanman: has joined #RubyOnRails
[21:38:58] annlewis: has joined #RubyOnRails
[21:39:01] bricker: why this person thought `load_question(parameter: ...)` is better than `load_model(:question, parameter...)` is the next mystery you need to solve :)
[21:39:30] rhizome: extra meta points
[21:39:36] bricker: rhizome: meta-cred
[21:39:43] __apr__: heh, well, that's beyond my scope. I'm doing a security focused source code review
[21:39:49] rhizome: it's metascale
[21:41:07] petricore: has joined #RubyOnRails
[21:43:06] Skelz0r: has joined #RubyOnRails
[21:43:45] SteenJobs: has joined #RubyOnRails
[21:44:47] havenwood: has joined #RubyOnRails
[21:46:32] beauby: has joined #RubyOnRails
[21:47:36] sargas: has joined #RubyOnRails
[21:47:45] rikkipitt: has joined #RubyOnRails
[21:49:29] jenrzzz: has joined #RubyOnRails
[21:57:07] mrchris: has joined #RubyOnRails
[21:58:04] finnnnnnnnnnn: has joined #RubyOnRails
[22:00:44] badfish129: has joined #RubyOnRails
[22:01:14] n00bDev: has joined #RubyOnRails
[22:01:58] lasker85: has joined #RubyOnRails
[22:04:21] wethu: has joined #RubyOnRails
[22:05:08] workmad3: has joined #RubyOnRails
[22:08:09] yfeldblum: has joined #RubyOnRails
[22:08:22] sethetter: has joined #RubyOnRails
[22:08:22] superrorc: has joined #RubyOnRails
[22:09:13] hobodave: has joined #RubyOnRails
[22:09:38] Jardayn_two: has joined #RubyOnRails
[22:09:53] maxx88: has joined #RubyOnRails
[22:10:05] levifig: has joined #RubyOnRails
[22:10:08] GarethAdams: has joined #RubyOnRails
[22:10:45] cmmagid: has joined #RubyOnRails
[22:11:14] sparr: has joined #RubyOnRails
[22:12:32] jtdowney: has joined #RubyOnRails
[22:12:33] jtdowney: has joined #RubyOnRails
[22:12:48] lasker85: has joined #RubyOnRails
[22:13:58] toydestroyer: has joined #RubyOnRails
[22:14:05] atrius: has joined #RubyOnRails
[22:14:08] yfeldblum: has joined #RubyOnRails
[22:14:32] Kilo`byte: has joined #RubyOnRails
[22:14:35] Jardayn_two: has left #RubyOnRails: ()
[22:14:50] josephkokenge: has joined #RubyOnRails
[22:14:57] josephkokenge: has left #RubyOnRails: ()
[22:15:06] Silex^^: has joined #RubyOnRails
[22:15:23] braincrash: has joined #RubyOnRails
[22:15:33] Emily: has joined #RubyOnRails
[22:15:55] GreySyntax: has joined #RubyOnRails
[22:16:04] Leef_: has joined #RubyOnRails
[22:16:41] amitchellbullard: has joined #RubyOnRails
[22:16:44] robotbrain: has joined #RubyOnRails
[22:16:46] camilasan: has joined #RubyOnRails
[22:17:00] danlucraft: has joined #RubyOnRails
[22:17:18] gz0: has joined #RubyOnRails
[22:17:50] Leef_: has joined #RubyOnRails
[22:17:54] prasselpikachu_: has joined #RubyOnRails
[22:18:09] drupald: has joined #RubyOnRails
[22:18:11] rickmasta: has joined #RubyOnRails
[22:18:18] morenoh149: has joined #RubyOnRails
[22:18:24] voltalio: has joined #RubyOnRails
[22:18:32] prasselpikachu_: has left #RubyOnRails: ()
[22:18:42] polly_wog: has joined #RubyOnRails
[22:19:08] prasselpikachu: has joined #RubyOnRails
[22:19:16] Leef90: has joined #RubyOnRails
[22:20:34] sharkman: is this a channel for ruby
[22:20:57] duaneb: has joined #RubyOnRails
[22:22:03] duaneb: hola, everyone
[22:22:13] duaneb: I have a pretty simple problem (in my mind) with the asset pipeline
[22:22:30] duaneb: I need to upload to 2 cdns, so I call assets:compile, sync, adjust the asset host, and repeat
[22:23:00] duaneb: the problem is, even if I clobber the assets, it seems to upload assets only referring to the first host. As in, they're byte-to-byte identical
[22:23:17] duaneb: is there some kind of flag I need to reset to force it to re-render the assets with the new asset host?
[22:23:22] workmad3: has joined #RubyOnRails
[22:23:24] CanTonic: has joined #RubyOnRails
[22:23:55] rhizome: i don't understand the setup
[22:24:08] Radar: sharkman: #ruby
[22:24:22] sharkman: okay cool this is #ruby?
[22:24:28] Radar: sharkman: no, this is dog
[22:24:31] Makorak: has joined #RubyOnRails
[22:24:35] Radar: also #rubyonrails
[22:24:41] michael_mbp: has joined #RubyOnRails
[22:25:04] jokke|: has joined #RubyOnRails
[22:25:35] badfish129: has joined #RubyOnRails
[22:26:10] duaneb: rhizome: what part do you not understand?
[22:26:26] GreySyntax: has joined #RubyOnRails
[22:26:38] duaneb: in sequence, I rake assets:precompile, then I sync, then I clobber, then I reset the asset host, then I re-run rake assets:precompile, and re-run the sync
[22:26:47] deavid: has joined #RubyOnRails
[22:26:54] duaneb: this is all in one task, mind you, so some state changes may be cached. Hence my presence here.
[22:27:25] hyperdrive: has joined #RubyOnRails
[22:27:52] hcnewsom: has joined #RubyOnRails
[22:28:37] baweaver: has joined #RubyOnRails
[22:28:37] mary5030: has joined #RubyOnRails
[22:29:36] many: has joined #RubyOnRails
[22:32:22] Radar: duaneb: steps to reproduce in a new app
[22:32:56] blackmesa: has joined #RubyOnRails
[22:33:13] Radar: sharkman: I thought I recognised that nick http://logs.ryanbigg.com/p/sharkman
[22:33:24] Radar: +q *!*@2601:18f:300:47d2:26fd:52ff:fe23:8d0
[22:33:54] sharkman: how do you have my chats saved online
[22:34:47] sharkman: thats cool it has me from 18 months ago
[22:34:48] workmad3: has joined #RubyOnRails
[22:35:06] craysiii: they're always watching
[22:35:17] sharkman: maybe ryabigg hacked up that page using rails
[22:35:54] rhizome: how's class
[22:36:12] NBarnes: has joined #RubyOnRails
[22:39:45] annlewis: has joined #RubyOnRails
[22:39:59] ngscheurich: has joined #RubyOnRails
[22:40:19] ChanServ: +o baweaver
[22:40:46] baweaver: +q *!*@2601:18f:300:47d2:26fd:52ff:fe23:8d04
[22:43:45] Wolland: has joined #RubyOnRails
[22:45:33] jtoy: has joined #RubyOnRails
[22:49:37] banister: has joined #RubyOnRails
[22:50:03] ericjphillips: has joined #RubyOnRails
[22:51:45] chouhoulis: has joined #RubyOnRails
[22:52:51] GreatDanton: has joined #RubyOnRails
[22:55:32] ChanServ: -o baweaver
[23:02:46] rhizome: how many github issues are due to the existence of rubocop
[23:03:22] FailBit: Radar: I recommend you ban his /64
[23:03:29] FailBit: or, quiet for that matter
[23:04:00] NBarnes: Re: Rubocop - https://twitter.com/FoxBarnes/status/640587140594700289
[23:05:03] ngscheurich: has joined #RubyOnRails
[23:05:57] Aeyrix: [17:46:19] sharkman: i think hitler invented rails
[23:06:14] tvon: has joined #RubyOnRails
[23:07:03] NBarnes: He made the rails run on thyme?
[23:07:07] FailBit: hitler also ate sugar
[23:08:24] Aeyrix: nbarnes: That was Mussolini
[23:08:41] NBarnes: HISTORY NAZI
[23:08:44] NBarnes: No, wait...
[23:08:49] Aeyrix: [ TRIGGERED ]
[23:08:54] oflannabhra: has joined #RubyOnRails
[23:09:06] beauby: has joined #RubyOnRails
[23:09:32] baweaver: #ruby-offtopic if we're going to get carried away on that.
[23:10:34] Aeyrix: I left those.
[23:13:08] maz-dev: has joined #RubyOnRails
[23:13:12] lshanx: has joined #RubyOnRails
[23:13:29] AntiSpamMeta: has joined #RubyOnRails
[23:14:44] arBmind1: has joined #RubyOnRails
[23:15:41] voltalio: has joined #RubyOnRails
[23:15:53] lshanx: has joined #RubyOnRails
[23:16:13] AntiSpamMeta: has joined #RubyOnRails
[23:16:48] charliesome: has joined #RubyOnRails
[23:16:59] rikkipitt: has joined #RubyOnRails
[23:17:43] lshanx: has joined #RubyOnRails
[23:18:03] lshanx: has joined #RubyOnRails
[23:20:23] SteenJobs: has joined #RubyOnRails
[23:21:01] Lightsword: has joined #RubyOnRails
[23:21:19] r00ster: has joined #RubyOnRails
[23:21:40] mary5030: has joined #RubyOnRails
[23:21:56] montagesoftware: has joined #RubyOnRails
[23:22:57] cnk: has joined #RubyOnRails
[23:23:17] montagesoftware: has left #RubyOnRails: ()
[23:23:34] shpoont: has joined #RubyOnRails
[23:25:00] voltalio: has joined #RubyOnRails
[23:25:56] shpoont: has joined #RubyOnRails
[23:26:36] iamse7en: has joined #RubyOnRails
[23:31:28] blackmesa: has joined #RubyOnRails
[23:33:00] Palsson: has joined #RubyOnRails
[23:33:51] maxx88: has joined #RubyOnRails
[23:34:01] pwnd_nfsw: has joined #RubyOnRails
[23:34:32] rhizome: someone explain the persistence of <br> tags in generated devise views
[23:35:10] hcnewsom: has joined #RubyOnRails
[23:35:54] rromanchuk: has joined #RubyOnRails
[23:38:23] rhizome: superfluous acronym of the day: RCAV
[23:40:37] annlewis: has joined #RubyOnRails
[23:43:48] one_zero: has joined #RubyOnRails
[23:44:18] sadaf2606: has joined #RubyOnRails
[23:48:33] yfeldblum: has joined #RubyOnRails
[23:49:13] baweaver: has joined #RubyOnRails
[23:50:11] michael_mbp: has joined #RubyOnRails
[23:50:14] quazimodo: has joined #RubyOnRails
[23:52:24] yfeldblum: has joined #RubyOnRails
[23:55:22] Maletor: has joined #RubyOnRails
[23:59:24] aghalarp: has joined #RubyOnRails
[23:59:39] duncannz: has joined #RubyOnRails