« Back to channel list

#RubyOnRails - 06 February 2015

« Back 1 day Forward 1 day »
[00:00:18] tds5016: it would also be preferable to keep using logger
[00:00:43] Doddlin: although, in my hash it only says amenities_attributes[???0???=>{???id???=>???1???}] no matter what checkbox has been checked :S
[00:02:45] Doddlin: and this is also at the top for some reason: <input checked="checked" id="space_amenities_attributes_0_id_1" name="space[amenities_attributes][0][id][]" type="checkbox" value="1" />
[00:04:47] tds5016: this is really frustrating... you think it would be stupidly simple to log to syslog by default.
[00:05:06] tds5016: or to log stash whatever the easier option is.... I just know that I need to agregate my logs.
[00:05:30] smathy: tds5016, https://github.com/papertrail/remote_syslog_logger/
[00:06:18] tds5016: smathy I'd be all about that, but it didn't appear to work. lol.
[00:10:02] tds5016: smithy this is entirely the wrong channel to ask this in... but is there an easy way to dump some output to the remote syslog?
[00:10:29] smathy: Doddlin, is there no hidden field with the same name before each checkbox?
[00:11:45] Doddlin: smathy, as a matter of fact I managed to break it now??? although I might have come up with a solution
[00:11:48] Doddlin: I???ll recert
[00:11:52] Doddlin: revert* rather
[00:14:44] Doddlin: smathy, although, if I want to use collection.check_boxes, and there are no relations at all at the moment, how can I force it to render the different checkboxes anyway?
[00:14:59] Doddlin: I mean, I can???t set relations if there are no boxes :S
[00:15:23] smathy: Doddlin, oh right, sorry, I was jumping to the wrong assumption.
[00:15:54] tds5016: config.logger = RemoteSyslogLogger.new('localhost', 5000, :program => "my program")
[00:16:03] smathy: Doddlin, so your Space habtm :amenities ?
[00:16:05] Doddlin: smathy, u probably didn???t, it showed boxes before but I had to redo it
[00:16:10] Doddlin: smathy, correct
[00:16:15] Doddlin: and vice versa
[00:16:17] tds5016: I have that in my development.rb in env... am I doing that incorrectly?
[00:18:41] smathy: Doddlin, ok, so your view should just be f.collection_check_boxes :amenity_ids, Amenity.all, :id, :name
[00:18:46] smathy: Doddlin, I added a comment to your gist.
[00:19:38] Doddlin: smathy, that did the trick on showing them! :D
[00:19:47] smathy: Doddlin, this would depend on there being `amenity_ids` and `amenity_ids=` methods in your Space model (usually those are added using the `accepts_nested_attributes_for` helper)
[00:20:14] Doddlin: so amenity_ids is what should be accepted, not :amenities?
[00:20:35] smathy: Doddlin, oh you're right, actually, those methods come with the habtm
[00:20:56] smathy: Doddlin, so yeah, you don't need the `accepts_nested_attributes_for` helper at all.
[00:21:02] Doddlin: smathy, that was the first time today, that I was right :P so thanks!
[00:21:17] smathy: Doddlin, yeah, amenity_ids, see the docs: http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-has_and_belongs_to_many
[00:21:24] Doddlin: smathy, ok, just need to permit amenity_ids in my controller then?
[00:21:56] smathy: Doddlin, see where it says: "collection_singular_ids" - that is unhelpful Rails docs code for "take the name of the collection in singular form and append "_ids" to the end"
[00:22:11] Doddlin: smathy, hahaha, perfect!
[00:22:21] smathy: Doddlin, yes, you'll need to have it in the strong params permit list.
[00:23:24] Doddlin: smathy, you just made my night. Now I can finally go to sleep! Hahahaha
[00:23:27] Doddlin: THANK YOU!
[00:23:40] smathy: Doddlin, you're very welcome :)
[00:26:46] smathy: tds5016, assuming that's where your rsyslogd is then yeah, that's what I'd expect too.
[00:32:55] smathy: tds5016, just to be sure, you're not literally using "my program" - with the space?
[00:34:46] smathy: tds5016, ok, so I just ran that up and it worked perfectly, logging to an `nc -ul 5000` daemon that I ran locally just to test with.
[00:35:05] smathy: tds5016, only difference was that I removed the space from your program string.
[00:48:49] gwho: has anyone used parallax scrolling and bootstrap affix together?
[00:49:12] bobbobbins: hey, I???m having an issue where if i do ruby -v with my user, or with root, it gives me 1.9.3, but if I do a sudo ruby -v I???m getting 1.8.7???any idea why that is happening?
[00:51:52] cnk: bobbobbins: most linux distros clear out your environment stuff if you use sudo
[00:52:22] cnk: try sudo -E
[00:52:54] cnk: that preserves your environment
[00:53:19] beauby: How would one go around preloading has_many :through associations?
[00:54:05] cnk: to what end?
[00:54:06] oak_alternate: I just set up my app using devise, when I log out and log in as a different user, why does the same data persist for both users?
[00:54:38] beauby: Or even better, if A belongs_to B and B has_many C, how would one eager load the corresponding B's and C's when fetching some A's?
[00:54:44] cnk: oak_alternate: the data isn???t scoped to a single user
[00:55:10] gwho: beauby http://blog.arkency.com/2013/12/rails4-preloading/
[00:55:31] oak_alternate: In order to scope the data to a single user, would I do that through a sessions_controller?
[00:56:20] gwho: I have a css question. I;m tryng to use parallax scrolling via CSS perspetcive and transform. But that seems to break bootstrap affix.
[00:56:21] gwho: http://stackoverflow.com/questions/28356532/bootstrap-affix-doesnt-affix-with-parallax-scrolling-css3-perspective-trans
[00:56:40] cnk: oak_alternate: usually I make the data belong to the user
[00:56:45] beauby: gwho: thanks
[00:56:59] cnk: but hard to say in the general case. this is your data model
[00:57:38] cnk: gwho: nice blog post!
[00:57:51] oak_alternate: hmmm, a lightbulb is coming on albeit faintly
[00:57:51] gwho: it's pretty awesome, cnk
[00:57:58] gwho: yw beauby
[00:58:33] mikecmpbll: yeah, that blog post is quality. should be on a helpa tip.
[00:59:19] tds5016: soo... figured it out; I was not forwarding udp, only tcp to the virtual machine.... *glares at self*
[01:01:54] beauby: gwho: actually, what I was looking for was in the docs (nested syntax for includes), but that blog post is pretty cool, so I'm glad I asked!
[01:07:07] cpg: hi, i am looking for a bit of help in associations. i have this situation
[01:07:10] cpg: http://fpaste.org/182247/42318481/
[01:07:12] oak_alternate: cnk: in multis model, I have "belongs_to :user" but still every use can see the same multi
[01:07:31] cpg: the association in line 18 is not working
[01:07:42] oak_alternate: https://github.com/skr5e/multireddit_splitter
[01:07:53] cpg: the id being used is not correct. looking for help
[01:08:23] oak_alternate: coding makes me feel so dumb sometimes
[01:08:29] cpg: i am looking for get the matches for a given league_player
[01:09:23] oak_alternate: why doesn't this association restrict multis just for that one user?
[01:14:03] duncannz: how can I pass a query string the query string my_param=foo to a render call (on a form validation error)? render :edit, my_param: "foo" does not work
[01:15:17] omosoj: trying to override default primary key in rails - is it possible w/o raw sql?
[01:16:00] ellisTAA: i just ordered hartl???s book today, what are some of the topics that cause ROR users the most problems? or what topics tend to be the most difficult for the non-expert rail users
[01:17:02] omosoj: ellisTAA, everything is difficult for me :)
[01:17:14] omosoj: do you have any experience web or software developing?
[01:17:22] ellisTAA: mmm drupal that???s about it
[01:17:31] ellisTAA: and ruby for 2 months
[01:18:48] omosoj: the hartl book didn't help me very much, and a lot of people i've talked to have had the same experience, so don't treat it like a bible
[01:19:20] omosoj: basically your goal is to design and create whatever you want, so you need all the skills to do that. different for each person
[01:19:33] oak_alternate: after setting associations in the models, do I make a migration that links them also?
[01:19:44] omosoj: there is a core set of skills like database design, and other stuff though
[01:20:49] ellisTAA: got it. can u tell me what u think some of those core set of skills are? this should help me out
[01:22:05] cnk: oak_alternate: but in your controller, you don???t tell the multi which user it belongs to https://github.com/skr5e/multireddit_splitter/blob/master/app/controllers/multis_controller.rb
[01:22:27] omosoj: there's a set of ror guides u can check out. the quality of the guides themselves isn't great, but the way they break up the topics is reasonable (imo): http://guides.rubyonrails.org
[01:23:23] cnk: you need something like multi = @current_user.build_multi
[01:24:39] cnk: oak_alternate: https://www.railstutorial.org/book/user_microposts#sec-user_micropost_associations
[01:25:05] smathy: ellisTAA, the biggest problem most Rails programmers face is that they never take the time to learn Ruby properly.
[01:27:05] ellisTAA: smathy: can you elaborate on what you mean by properly? bc they must know it to some extent in order to use it, so what distinguishes those who know it properly?
[01:27:15] ellisTAA: omoso: thanks for sharing
[01:34:04] smathy: ellisTAA, not really, you can get through most Rails tutorials knowing the barest of basic Ruby, really just the syntax for standard linguistic features like conditionals, assignment, etc.
[01:34:50] ellisTAA: smathy: so what would indicate someone knows ruby propery? i mean read a book about it but i dont think i???m good at it
[01:35:00] bricker: knowing Ruby is critical for debugging
[01:35:10] smathy: ellisTAA, I've heard lots of people who chose to use rspec because they liked the ability to nest tests, ie. they were unaware of how to do that in minitest/xunit because they don't understand Ruby.
[01:36:13] smathy: ellisTAA, I also know a lot of people who write really crappy Ruby just because they don't understand many of the language's features like procs, yield, mixins, and the plethora of iterators Ruby's stdlib has.
[01:51:31] stef1a: i just launched my app with unicorn_rails on our server and the site pages are just white; no errors. this error shows up in the logs: app error: undefined method `clean_path_info' for Rack::Utils:Module (NoMethodError) any ideas?
[01:53:28] smathy: ellisTAA, I think everyone should read and understand the Pickaxe, and have done all the Ruby Koans.
[01:53:50] ellisTAA: smathy: i???ve done rubymonk, is that like koans?
[01:55:19] smathy: ellisTAA, I don't know them, but if you've done them and by your own admission you don't think you're good at ruby, then no - they're not like the koans.
[01:55:50] smathy: ellisTAA, I don't know anyone who really did the koans (instead of just mindlessly plugging in the expected results) who doesn't know ruby really well.
[01:56:19] omosoj: is it possible that a migration be successful but still not be connected to a postgres db?
[01:56:28] smathy: ellisTAA, I'd say the same about reading the pickaxe btw, I don't know anyone who fully read and comprehended the pickaxe who doesn't know ruby really well now.
[02:01:49] cmckee: Anybody having problems with bootstrap gem latley?
[02:03:20] stef1a: in other words, i'm seeing a white screen of death on every page in my application. help?
[02:03:51] cnk: stef1a: error log?
[02:04:12] smathy: omosoj, no, if there's no connection then the migration will fail.
[02:05:22] stef1a: cnk: https://gist.github.com/smlance/5a86a1a774d4aa2de8a7
[02:06:35] stef1a: i have tried stopping the app, bundle installing, and migrating the database, but this error seems to be unrelated to any of those (unless i upgraded and a config file was overwritten or not compatible with a newer version of a gem)
[02:09:05] omosoj: smathy, but when i look in the postgres db, not even a db has been created. i'm taking a step back and doing rake db:setup and it's failing now, and i have the error that's causing it so i'm working on that now
[02:09:56] stef1a: hm. it looks like ruby 1.9.1 is being used, but my app should be using 1.9.3. i suppose this might be related to the problem?
[02:10:53] stef1a: actually, i'm unsure of that
[02:14:46] smathy: omosoj, cool, not sure why db:migrate wouldn't show an error, maybe it just fails silently if there's no DB.
[02:16:16] ptvu_: hello, I just have a stupid question on a rails app - using gem json 1.7.7
[02:17:38] ptvu_: can anyone help, please?
[02:18:01] capin: ptvu_: don't ask to ask, ...just ask
[02:18:18] capin: ptvu_: i suggest you make a gist too ;)
[02:19:21] ptvu_: capin: okie :0
[02:20:08] ptvu_: when running "bundle install" I got an error: Make sure that `gem install json -v '1.7.7'` succeeds before bundling.
[02:21:01] capin: ptvu_: did you try running "gem install json -v 1.7.7"
[02:21:12] ptvu_: version 1.7.7 doesn't work, so I tried "gem install json", and it succeeds "Successfully installed json-1.8.2"
[02:21:37] ptvu_: however when running "bundle install" again, it still requires 1.7.7
[02:21:46] capin: ptvu_: then edit the the gemfile of your app and put json-1.8.2 in there
[02:23:26] ptvu_: capin: is the syntax supposed to be: "gem 'json', '~> 1.8.2'"
[02:24:02] capin: ptvu_: yeah i think that should work
[02:24:13] capin: then run bundle install again
[02:24:28] ptvu_: capin: thanks a lot!! I'll give it a try
[02:24:42] capin: ptvu_: no problemo
[02:25:00] mroach: I've got an interesting problem. Something in my app is *sometimes* changing my logger level. It only happens on one controller so far that I can tell. it's driving me batshit insane and I can't track it down. Any way to detect when the Rails.logger.level value is changed?
[02:25:05] capin: ptvu_: remember "bundle update" is friend too ;)
[02:25:17] mroach: I'm guessing there's a gem that's nisbehaving/being an asshole
[02:25:20] mroach: *misbehaving
[02:25:34] stef1a: i'd appreciate some help with my white screen of death
[02:25:38] ptvu_: capin: yea I already ran "bundle update" earlier
[02:25:53] ptvu_: capin: but when running "bundle install" it still gives an error:
[02:26:02] ptvu_: capin: "You have requested: json = 1.8.2 The bundle currently has json locked at 1.7.7. Try running `bundle update json`"
[02:27:12] capin: ptvu_: did you try running 'bundle update json'
[02:27:35] capin: then running 'bundle install'
[02:27:52] capin: also make sure to save your gemfile after making changes ;)
[02:28:53] ptvu_: capin: gotcha :)
[02:31:34] capin: any new updates on R4IA?
[02:32:50] lathiat: capin: i downloaded it yesterday and got v18
[02:32:57] lathiat: if that helps
[02:34:07] capin: lathiat: someone said there's 15 chapters and they've reviewed 10 of them so far :l ...don't remember the person's nick though
[02:34:20] omosoj: i'm running a sinatra app - erb isn't working in the database.yml file (presumably b/c i don't have the erb gem)... is there another way to access environmental variables? (like passwords)
[02:34:59] capin: omosoj: your joking right?
[02:35:21] capin: omosoj: you do know what .yml stands for right?
[02:36:12] omosoj: no, mr passive aggressive
[02:36:51] capin: omosoj: yml = yml ain't markup language
[02:37:17] omosoj: but in rails you can write erb into it, right?
[02:37:18] capin: so i suggest you don't treat it as such
[02:38:16] johntrails: Can someone help me out with something. As of now, I have a query sent to an API which specifies the time of day. I was able to achieve this by doing massive research, but now I need to have it specify the start of the month, instead of the start of day.
[02:38:17] johntrails: http://pastie.org/9890988
[02:38:47] omosoj: capin - my objective is pretty clear here. do you have an constructive suggestions?
[02:42:02] capin: johntrails: does this help => http://apidock.com/rails/DateAndTime/Calculations/beginning_of_month
[02:42:39] x-light: capin: I'm the r4ia accused
[02:43:00] johntrails: capin, perfect. thanks
[02:43:14] capin: johntrails: no problem
[02:43:51] capin: x-light: how do i get put on the list screen r4ia?
[02:44:18] x-light: capin: you mean to review it?
[02:45:23] x-light: capin: I just asked Radar. He might not be around now tho' cause hes at rubyconf.
[02:46:28] mroach: I solved my problem. I'm using the quiet_assets gem to squelch verbose asset pipeline logging and I have a route /assets/ in my property control system. #facepalm
[02:46:38] capin: not sure Radar likes me :l
[02:46:40] mroach: I suppose assets is a semi-reserved word in Rails world.
[02:50:32] omosoj: how do i hide passwords in my database.yml file in a sinatra app if sinatra doesn't look for erb inside ymls?
[03:04:51] savish: Could some one take a look at this stack post: http://stackoverflow.com/questions/28357888/getting-401-unauthorized-when-i-believe-it-should-be-a-solid-200-rspec-3-0, I am curious if I setting the headers incorrectly when making a post, the relevant information shows up in the request.headers and the request statement its self but I keep getting 401, when I believe it should be a 200
[03:14:17] omosoj: should i be able to find corresponding tables to my migrations at the postgres prompt? all i see is schema migrations
[03:25:06] roamingdog: omosoj: yes you should
[03:25:44] capin: Savish: the only thing i can think of is your rspec test suite doesn't have the auth token and that's why your getting a 401
[03:40:48] andhof-mt: Do any of you have branding experience? I have two possible domains for my new social network I can't decide between
[03:41:10] andhof-mt: "rivals" and "rivalz" - my social network is a RoR app with "rivals" instead of "friends"
[04:13:38] omosoj: anyone have a problem with having your app be able to connect to pg and persist data, but you can't access the tables from within pg?
[04:14:36] andhof-mt: hey is radar here?
[04:14:38] andhof-mt: Got some forem questions
[04:15:54] rhizome: omosoj: are you connecting with the same user?
[04:16:58] omosoj: rhizome, no, with the superuser i think
[04:24:41] andhof-mt: so I want to collect email signups
[04:24:46] andhof-mt: any idea the best way to do that in rails?
[04:28:14] here4thegear: New to rails(ish). I have a running project on a server (that someone else started). I've pulled a complete local copy of the running project (including the MySQL database that they were using). I want to start the project without rebuilding it. I have nodejs installed and gem is there (ubuntu server).
[04:28:41] here4thegear: I assume I need to do gem install rails but what do I do to spin up the application without rebuilding everything
[04:38:17] andhof-mt: you need rails + ruby
[04:38:19] andhof-mt: than bundle install
[04:38:23] andhof-mt: than rails server ... should be good
[04:38:26] andhof-mt: rails is nicely packaged
[04:38:42] basichash: I'm getting a ActiveModel::Forbidden attributes error when trying to add a new Article to activeadmin
[04:38:56] basichash: it works when using the scaffolded views, but not AA
[04:39:06] capin: here4thegear: please don't use web brick in a production environment
[04:45:36] mib_mib: why doesn't this work
[04:45:47] mib_mib: MyModel.order("LOCATE(#{search_field}, :name)", name: params[:sSearch])
[04:46:03] mib_mib: i.e. the named parameter doesn't work
[04:50:28] mib_mib: can't we pass inputs that get sanitized properly just like where?
[04:50:29] here4thegear: capin: no clue what web brick is. I'm just trying to make a local dev environment from an existing production source so that I can work on the UI (and learn rails)
[04:54:30] capin: here4thegear: web brick is the local web server for a rails env in dev
[04:55:52] here4thegear: capin: okay. I still don't follow but, I assume I'm safe because I'm not really planning on doing anything on the production server. My changes are going to be reviewed by someone who knows better :-)
[04:56:21] Wolland: here4thegear: what OS are you on?
[04:56:54] here4thegear: my dev env is a virtualbox version of ubuntu trusty64
[04:57:04] here4thegear: server edition
[04:57:35] here4thegear: well, it's a vagrant spin up if that makes any difference.
[04:58:32] Wolland: do you have ruby on it?
[04:59:29] here4thegear: Wolland: yes ruby is installed
[04:59:43] Wolland: same version as your production env?
[04:59:50] here4thegear: I think it installed as part of nodejs (because I use this server for nodejs development)
[05:00:59] Wolland: if you are not sure
[05:01:09] here4thegear: Wolland: prod is 1.9.3p286.... dev is 1.9.3p484
[05:01:18] Wolland: that's fine
[05:01:25] Wolland: then install rubygems
[05:01:37] Wolland: https://rubygems.org/pages/download
[05:02:25] here4thegear: Wolland: `which gem` provides me a path. do I still need to install rubygems?
[05:02:55] Wolland: if version is up to date, no
[05:03:26] Wolland: then go to your rails project dir
[05:03:39] Wolland: gem install bundler
[05:03:45] Wolland: bundle install
[05:04:10] Wolland: these 2 should install gems from Gemfile file in that directory
[05:04:25] Wolland: including rails
[05:05:35] here4thegear: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
[05:06:33] here4thegear: also RedCloth intall choked so Bundler stopped... This was on bundle install... gem install bundler appears to have installed without errors
[05:07:05] Wolland: sudo apt-get install ruby-dev
[05:07:19] Wolland: then do bundle install again
[05:08:37] Wolland: if that doesn't work, try again after this:
[05:08:37] Wolland: sudo apt-get install make
[05:09:49] here4thegear: Wolland:A bunch of things were installed now it choked on the mysql2 install
[05:10:01] here4thegear: Make sure that `gem install mysql2 -v '0.3.14'` succeeds before bundling.
[05:10:18] Wolland: with just that command, solo
[05:11:10] Wolland: you might be missing a mysql dev library or some other dev lib?
[05:12:10] here4thegear: Error installing mysql2: failed to build gem native extensions.
[05:12:52] here4thegear: extconf.rb failed could not create makefile due to some reason, probably lack of necessary libraries and/or headers.
[05:13:30] here4thegear: where is mkmf.log located, it told me to check that
[05:13:44] dvdchr: I???m having a problem with delayed_job. Somehow my jobs are silently deleted from the queue without it ever proessing..
[05:13:46] Wolland: sudo apt-get install libmysqlclient libmysqlclient-dev
[05:13:59] Wolland: then try installing mysql gem again
[05:14:09] dvdchr: I???ve read the ???common problems??? section on their github.
[05:14:16] dvdchr: but it???s still getting deleted..
[05:14:58] dvdchr: I am using delayed_job_active_record and using the .delay method on one of my model???s method
[05:15:26] here4thegear: Wolland: YES! that worked.
[05:15:42] Wolland: now do, bundle install
[05:15:48] Wolland: to make sure all other gems are installed
[05:16:09] here4thegear: BTW thank you so much for walking me through this. there's so many tutes and they all have different methods of install... I had no clue which to use or where to begin.
[05:16:38] dvdchr: When I track the database, the job gets added and after a few seconds, it got removed. The interesting part is, this happens only sometimes. So, if I keep doing bin/delayed_job restart, eventually I???ll get it running randomly.
[05:17:09] dvdchr: ..and after some time, of course, it returns to silently removing jobs..
[05:17:10] Wolland: next thing would be starting mysql, making sure data is there, then adjusting database connection config and/or creating right user/password in mysql so rails can connect
[05:18:39] Wolland: config/database.yml is where you would do that
[05:20:11] here4thegear: yeah MySQL has the right db configured with a dump of prod and the same connection as i databases.yml.
[05:20:11] here4thegear: The guy who wrote this has a sqlite dev database as well but bundle install is now crapping out on building that gem
[05:20:42] here4thegear: I really don't need the sqlite so I'd probably prefer to just remove that dependancy all together.
[05:21:23] Wolland: you might still have to create user and grant access in mysql
[05:21:29] Wolland: but you can try starting rails app now
[05:21:44] Wolland: should be as easy as doing this in the rails app dir:
[05:22:29] Wolland: you should see it starting locally on port 3000 and be able to see it in your browser localhost:3000
[05:24:45] Cache_Money: Why can't I access the key of a Hash within my seeds.rb file? https://gist.github.com/anonymous/c27aa529ddfff9cb8401
[05:25:03] Cache_Money: ^^ I can manually run the same code within rails console and get the insert to work just fine
[05:25:36] here4thegear: Wolland: thanks. I think this will work out now. I just need to rip out sqlite from the source and let everything go through mysql at this point. thanks for your help!
[05:25:45] Wolland: symbol keys vs string keys Cache_Money?
[05:26:02] Cache_Money: Wolland: I'm using symbol keys
[05:26:03] s2013: sup folks
[05:26:12] s2013: anyone of you use docker for rails apps? how do you feel about it
[05:26:50] Cache_Money: Wolland: I ran the same code within the console and the insert worked. I even print to the console the value of `position[:name]` the line above where it breaks
[05:27:21] Wolland: what error are you getting?
[05:28:35] here4thegear: where would a rails developer define which environment the server is. I just want to tell this thing it's production environment.
[05:28:39] Wolland: @position vs position vs position hash
[05:29:02] Wolland: maybe you are using position where @position should be?
[05:29:29] Cache_Money: Wolland: it has to do with this line `puts "Added #{@sport.name} - #{position.name}"`
[05:29:41] Wolland: here4thegear: you should be able to pass it to rails c
[05:29:43] Cache_Money: The insert works but it fails when printing to the console
[05:29:59] Wolland: rails c RAILS_ENV=production, or just rails c production
[05:30:05] Cache_Money: Wolland: I should have used puts "Added #{@sport.name} - #{position[:name]}"
[05:30:24] Wolland: or @position.name
[05:30:33] Wolland: depends on what you are trying to print
[05:31:06] Cache_Money: Wolland: Thanks!
[05:35:27] here4thegear: ah I was missing apt-get install libsqlite3-dev
[05:36:14] here4thegear: so I can just do that then bundle install then I can rails c production and this should run correctly (crossing fingers)
[05:37:09] Wolland: rake db:create, rake db:migrate etc
[05:37:23] Wolland: unless you have a db already
[05:43:21] here4thegear: I have a db already. the config has the correct creds because I can login using them at command line but the application is giving me this error
[05:43:22] here4thegear: /var/lib/gems/1.9.1/gems/mysql2-0.3.14/lib/mysql2/client.rb:67:in `connect': Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[05:44:17] here4thegear: mysql.sock does not exist in that dir when I ll
[05:44:56] Wolland: check your db config, try removing socket line if you have it there
[05:45:26] Wolland: for whatever env you are using, p.s. using production in dev is not a good idea
[05:49:37] here4thegear: Wolland: removing socket worked I think. I have a command prompt irb (main):001:0 but navigating to ipaddress:3000 isn't "this webpage not available"... I think I can probably work through that issue tho.
[05:49:54] Wolland: oh sorry, rails s
[05:49:57] Wolland: not rails c
[05:50:03] Wolland: c = console, s = server
[05:50:18] Wolland: exit to quit console
[05:54:14] here4thegear: /var/lib/gems/1.9.1/gems/activesupport-3.2.16/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- rack/handler/production (LoadError)
[05:55:07] here4thegear: bottom of the stack mentions line 6 on script/rails which reads
[05:55:08] here4thegear: require 'rails/commands'
[05:55:19] Wolland: rails s -e production
[05:56:15] here4thegear: what is the -e flag? that seems to be boothing something up
[05:56:37] here4thegear: woohoo... it's my project!
[05:56:40] Wolland: and you really should run development not production ... -e = environment
[05:58:48] here4thegear: Wolland: yeah, my problem with running development at the moment is the way the project is set up. I need to be able to see snap shot of real life data. Maybe I should just copy the database to a development database and then change the creds in the db config file.
[06:01:54] here4thegear: yep... that worked perfect... just copied the db gave new creds and dropped new creds into the development connection spot. boom. Thanks again. perfect!
[06:07:59] s2013: is there anyway to test out all the mails that would be sent out without triggering them
[06:19:44] rhizome: what do you mean by "triggering?"
[06:36:13] savish: Because I missed capin - unless he's still on, the auth token is passed in the third param to post - its passed through the header. Its even seen in the request.headers.
[06:36:31] savish: And because I missed him, unless he's still on the sorry for the doubt post of this but ...
[06:36:36] savish: Could some one take a look at this stack post: http://stackoverflow.com/questions/28357888/getting-401-unauthorized-when-i-believe-it-should-be-a-solid-200-rspec-3-0, I am curious if I setting the headers incorrectly when making a post, the relevant information shows up in the request.headers and the request statement its self but I keep getting 401, when I believe it should be a 200
[06:44:21] basichash: anyone active?
[06:46:46] basichash: can someone help me?
[06:47:20] rvanlieshout: basichash: !ask
[06:47:20] helpa: basichash: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[06:48:34] basichash: rvanlieshout: oh ok. I'm trying to create a model called Tasks (with an creator and a assignee), how would I go about this?
[06:49:04] basichash: rvanlieshout: wondering what fields i need, and how to incorporate this into my user strucutre
[06:49:19] rvanlieshout: creator and assignee are both users?
[06:49:27] basichash: rvanlieshout: correct
[06:49:42] basichash: rvanlieshout: i haven't differentiated between those two types with different models
[06:49:52] rvanlieshout: no need to do so
[06:50:17] rvanlieshout: you can belongs_to :assignee, class_name: 'User'
[06:50:35] rvanlieshout: and belongs_to :creator, class_name: 'User'
[06:52:13] basichash: rvanlieshout: ah perfect. where would be the best place to store the user type? so i can retrieve all users who are creators, and those that are assignees. I have a profile model, should it be stored in that (which belongs_to user), or in the user class
[06:52:49] rvanlieshout: basichash: user has_many :tasks_as_creator, class_name: 'Task', foreign_key: 'creator_id'
[06:55:29] basichash: rvanlieshout: how would i get a list of all creators?
[06:55:51] rvanlieshout: User.joins(:tasks_as_creator)
[06:56:07] basichash: awesome, thanks for that
[06:56:19] rvanlieshout: based on the assumption .joins uses an sql INNER JOIN
[06:56:26] rvanlieshout: which imples the relationship to be present
[06:57:45] basichash: rvanlieshout: i have to do this by creating a new model, not using generate model right?
[06:58:02] basichash: (creating as in creating a new model.rb file)
[06:58:15] rvanlieshout: you can use generate model if you want
[06:58:20] rvanlieshout: it's not a special model
[06:59:01] basichash: rvanlieshout: how would i do the belongs_to creator, class: 'user'
[06:59:08] basichash: in a 'generate' command
[06:59:13] basichash: for the Task model
[06:59:40] rvanlieshout: edit it after generation
[06:59:56] basichash: what would i put for the actual command beforehand though?
[07:00:17] basichash: e.g. rails generate model Task creator:integer assignee:integer title:string?
[07:00:37] rvanlieshout: the generate model just generates some files
[07:00:50] rvanlieshout: it would be ok if you just type rails generate model task and edit everything in it
[07:02:46] basichash: rvanlieshout: what would i put in my Task model?
[07:03:05] rvanlieshout: 2 belongs_to lines at least
[07:03:15] rvanlieshout: and add an index on creator_id and assignee_id
[07:03:19] rvanlieshout: in your migration
[07:03:31] basichash: so belongs_to creator, class: User\nbelongs_to assignee, class: User?
[07:03:47] rvanlieshout: have you checked documentation on belongs_to ?
[07:03:51] rvanlieshout: cause it's class_name iirc
[07:04:42] basichash: rvanlieshout: ah you're right
[07:05:27] basichash: would I need to add a 'user_type' field to my user moddel?
[07:05:36] rvanlieshout: can't a user be both?
[07:05:51] rvanlieshout: i would not think that you need one
[07:06:37] basichash: rvanlieshout: er yeah, although maybe i need one. For example, if a creator wants to browse all the assignees in a certain area, wouldn't that be helpful?
[07:07:26] rvanlieshout: there is no need for that
[07:07:44] rvanlieshout: you would now somebody is an assignee by using .joins(:assigned_tasks)
[07:08:01] rvanlieshout: if you have a belongs_to :assigned_tasks, class_name: 'Task', foreign_key: :assignee_id
[07:08:07] rvanlieshout: and created_task, ..
[07:10:04] basichash: right i'm in my Task migration, what do I add?
[07:10:22] rvanlieshout: creator_id as integer with index
[07:10:29] rvanlieshout: and assignee_id as integer with index
[07:10:36] basichash: rvanlieshout: er how do I add an index?
[07:10:44] basichash: so t.creator integer
[07:11:07] basichash: sorry t.integer creator
[07:11:52] rvanlieshout: and after the create_table an add_index :tasks, :creator_id
[07:13:06] basichash: what exactly does that do?
[07:14:03] Varun_krishna: I am trying to authenticate user with facebook login , so I am following this post here http://code.tutsplus.com/articles/how-to-use-omniauth-to-authenticate-your-users--net-22094 but when I run the application I am getting this error No route matches {:controller=>"sessions", :action=>"create"} https://gist.github.com/Varun-Krishna-P/223805aeb4f60045ac0c
[07:14:09] basichash: what's an index for?
[07:14:30] rvanlieshout: to allow your db for more efficient joining
[07:14:40] basichash: rvanlieshout: ah ok
[07:16:27] basichash: rvanlieshout: will it be an issue if creators want to contact assignees directly? i.e. instead of assignees applying for Tasks, creators search out assignees?
[07:17:22] basichash: rvanlieshout: so just say i have a group of builders. somoene is looking to build a house, and instead of creating an ad, they want to search out builders directly
[07:17:36] basichash: would i need to add a field for user_type to my user model in this scenario?
[07:18:50] cmckee: Question about writing your own Authentication? Should I use has_secure_password and bcrypt or what I currently have implimented is a password_hash and password_salt in the database. Im just curious what the best implimentation is?
[07:19:14] rvanlieshout: basichash: well.. without the field you would only know somebody is an assignee if assigned to at least one task
[07:19:17] basichash: rvanlieshout: as far as i can tell, there's no way to retrieve all builders/buyers without them either creating a task or applying for a task
[07:20:07] basichash: rvanlieshout: so if i wanted the option of buyers looking through builders profiles, what's the best way of facilitating this?
[07:20:21] rvanlieshout: it's really up to you. if you want to classify a user as either being a creator or an assignee you want to add a field
[07:20:26] rvanlieshout: or create separate models
[07:21:37] basichash: rvanlieshout: what would you suggest? should I create a subclass of user for builders and buyers, or add a field to the user model (of ENUM type?) indicating which type they belong to?
[07:22:00] basichash: not actually sure if that first option is possible
[07:22:06] rvanlieshout: what really is the difference between them?
[07:22:19] rvanlieshout: if you add a field you can always change it later with a new migration
[07:23:03] Varun_krishna: rvanlieshout: Hi
[07:23:25] basichash: rvanlieshout: so just add a user_type:string field?
[07:23:42] basichash: or should it be a string field?
[07:23:58] cmckee: Anyone? Im using bcrypt for both password encryption in the database. They just go about it differently. Whats the rails 4 preferd method?
[07:24:05] basichash: if there are only two options, buyers and builders, maybe a binary field or something? man i've got no idea
[07:25:23] rvanlieshout: basichash: don't worry too much about it. you can change it later on
[07:25:53] basichash: rvanlieshout: ok
[07:28:45] basichash: rvanlieshout: does this mean my user model would change?
[07:29:51] basichash: rvanlieshout: so it would still be, has_many :tasks_as_creator, class_name: "Task", foreign_key: 'creator_id'
[07:30:14] rvanlieshout: with that user type you mean?
[07:33:25] macmattias: Good mornong all! I have this strange error that I cannot wrap my head around. Check the gist and maybe you will see what I am missing. https://gist.github.com/macmattias/d6d967d5bada7a72bc42
[07:34:15] basichash: rvanlieshout: should the field be a string?
[07:34:24] rvanlieshout: you know that
[07:34:26] tbuehlmann: macmattias, use <% instead of <%= for the each
[07:34:28] rvanlieshout: if you tink :)
[07:34:39] macmattias: tbuehlmann: Is it that easy? :D
[07:35:12] macmattias: tbuehlmann: what the h***??? THANK YOU! :D
[07:35:21] basichash: rvanlieshout: well wouldn't using a binary value be better? smaller memory, etc
[07:35:39] basichash: rvanlieshout: and possibly make searches quicker?
[07:36:12] basichash: rvanlieshout: so binary value?
[07:39:04] basichash: rvanlieshout: hmm user.type = 0 throws an error
[07:39:23] basichash: wrong argument type Fixnum (expected String)
[07:39:36] basichash: even though i did "add_column :users, :type, :binary"
[07:42:57] cmckee: Can someone help me? Im writing an authentication from scratch. This is the method im using. https://gist.github.com/cmckee-dev/e92d3cb6783906679b3f Im reading up and has_secure_password uses a different method, which on is prefered or more secure?
[07:47:25] basichash: rvanlieshout: hmm right i've migrated the task model, but not all the fields are showing up
[07:47:37] basichash: rvanlieshout: only the standard ones which every model hsa
[07:48:53] banas: so far I have made my own rails app and have played with a mysql db. I have a friend's rails app I want to help out with
[07:49:01] banas: and I have been provided with a database dump
[07:49:25] banas: I'm not exactly sure how to load that into my clone of his project
[07:49:33] banas: it's postgresql
[07:49:43] banas: what do I google for?
[07:51:21] cleopatra: hello people
[07:55:07] tagrudev: any videos from rubyconf_au
[08:07:27] banas: I'm not exactly sure how to load that into my clone of his project
[08:08:55] macmattias: Ok I need help to think??? I got all the @mainCatogories I need to match that with @allAds. Every ad has an mainCatorgoy. I need to group them by mainCatoegory. In SQL that is not hard. But Rails??? woha! :)
[08:10:24] rvanlieshout: macmattias: .group_by(&:main_category)
[08:10:48] gwho_: you you can always just use .sql() and do raw sql
[08:11:06] macmattias: gwho_: Oh I know. But it looks much neater with avtiverecord. :)
[08:11:51] macmattias: rvanlieshout: Hmm yes. BUt how do I right the whole thing? @grouped = MainCatgery.Ads.where().group_by(&:main_category)
[08:12:10] rvanlieshout: macmattias: what exactly do you want?
[08:12:45] macmattias: rvanlieshout: THe end goal is the see how many ads there is per mainCategory.
[08:13:23] rvanlieshout: Ads.group(:main_category_id).pluck('id, count(*)') ish?
[08:13:56] macmattias: rvanlieshout: And I just suck at ActiveRecird at the moment. So I guess that is correct. Way to advanced AS for me. :)
[08:14:19] macmattias: rvanlieshout: It looks like a good one.
[08:14:28] rvanlieshout: it might need some minor tweaks
[08:14:42] macmattias: rvanlieshout: And that returns an array with the counted values?
[08:22:07] MaDErroR123: My postgres is making trouble. Is it alright to uninstall postgres and try with a fresh installation? Or is this creating more trouble instead?
[08:45:47] macmattias: rvanlieshout: after some small fixes I think it works??? the ads table is empty at the moment, so I get a empty return.
[09:03:22] MaDErroR123: My postgres is making trouble. Is it alright to uninstall postgres and try with a fresh installation? Or is this creating more trouble instead?
[09:05:47] macmattias: rvanlieshout: Hmmm maybe it is not working, I???ve added some ads in the ads table. And still it return []. @countedAds = Ad.group(:mainCategory_id).pluck('id, count(*)');
[09:05:56] rvanlieshout: what's the sql that got executed?
[09:06:02] rvanlieshout: and what if you execute that in a sql console?
[09:06:20] macmattias: rvanlieshout: same thing []
[09:06:37] rvanlieshout: a sql console doesn't return []
[09:06:55] macmattias: rvanlieshout: oh man I was in the rails console sorry
[09:07:36] macmattias: rvanlieshout: there it does the right thing.
[09:08:29] rvanlieshout: then it might be caused by the pluck. i don't know if you're allowed to pluck two things
[09:09:09] macmattias: rvanlieshout: ok I will do some research then.
[09:09:24] macmattias: rvanlieshout: the sql output works like a charm.
[09:10:49] macmattias: rvanlieshout: What I have, two values is ok.
[09:17:01] macmattias: rvanlieshout: Oh my fault. :) I added a ; after??? doh.
[09:17:55] cleopatra: I am CRazyyyy
[09:30:51] apeiros_: with rails 4.2, I'd assume `class Foo < ActiveRecord::Base; serialize :bar, Marshal; end; Foo.create! bar: [1,2,3]` to work, but it raises ("TypeError: instance of IO needed", apparently because rails calls `Marshal.load(nil)`)
[09:31:46] apeiros_: do I misread the docs? http://api.rubyonrails.org/classes/ActiveRecord/AttributeMethods/Serialization/ClassMethods.html#method-i-serialize says "class_name_or_coder: ???object, which responds to `.load` / `.dump`". And that's true for Marshal.
[09:32:14] apeiros_: i.e., Marshal.load(Marshal.dump([1,2,3])) == [1,2,3]
[09:36:12] apeiros_: oh wow, lol, wtf? I implemented a small dummy serializer. it seems a) that rails calls .load 27 times and .dump 7 times in a single(!) Foo.create! bar: [1,2,3]
[09:36:57] tbuehlmann: nice, less than expected
[09:39:11] apeiros_: and it always calls .load with nil as attribute. this seems broken.
[09:51:08] apeiros_: interesting. rails 4.1 fails even worse.
[09:53:00] Macaveli: I have some javascript for GA in application.html.erb but on one certain page this needs to be overwritten. Meaning that the one line of the javascript in the application.html.erb must not be executed. Any Suggestions?
[09:55:10] apeiros_: https://gist.github.com/apeiros/395f161ca002b0abe666 demo case for those interested
[09:56:26] MaDErroR123: after hours of trying to set up a project I need help with postgres
[09:56:32] MaDErroR123: I get the error: could not open directory "pg_stat"
[09:56:50] rvanlieshout: Macaveli: execute it based on body classname
[09:57:12] Macaveli: good suggestion rvanlieshout
[10:06:31] krz: MaDErroR123: https://www.google.com/search?q=pg_stat&ie=utf-8&oe=utf-8#q=could+not+open+directory+pg_stat
[10:06:53] MaDErroR123: krz: This does not help
[10:07:03] errakeshpd: there is another awsom tricks happend like not required deployment "when we run "rails s -b 0.0.0.0 -p 5000" if domain pointed to this then it will run in production !!!!
[10:07:11] MaDErroR123: krz: I have tried all solutions on stackoverflow
[10:07:41] krz: MaDErroR123: how did you install postgres?
[10:09:29] universa1: errakeshpd: what?!
[10:09:30] MaDErroR123: krz: initially, I dont know, because it was done by somebody else. Today I reinstalled it and used brew to install 9.4.
[10:09:59] krz: MaDErroR123: did you uninstall first?
[10:10:15] MaDErroR123: krz: I used the command unlink
[10:10:45] krz: MaDErroR123: clean uninstall postgres. brew update. then brew install
[10:11:33] MaDErroR123: krz: is this already a usable command: clean uninstall postgres ??
[10:11:38] errakeshpd: <universal> in producton server we can up the site by running it as a deamon mode "using -b brodcast and port" no need of production configuration and setups!
[10:11:53] krz: MaDErroR123: no, thatss what you need to find out
[10:12:32] krz: MaDErroR123: assuming osx. http://stackoverflow.com/questions/2715055/how-to-uninstall-postgresql-on-my-mac-running-snow-leopard
[10:12:45] krz: same could apply for later version of osx
[10:13:02] universa1: errakeshpd: if you're binding to 0.0.0.0 it will be accesible under external_ip:5000 + if you don't have a different server added to your gemfile, it will use webrick, which is also not recommended. + rails s will run in dev mode, if you don't specify -e production.
[10:13:07] krz: http://stackoverflow.com/questions/8037729/completely-uninstall-postgresql-9-0-4-from-mac-osx-lion MaDErroR123
[10:13:10] krz: MaDErroR123: https://www.google.com/search?q=osx+clean+uninstall+postgres&ie=utf-8&oe=utf-8
[10:13:57] MaDErroR123: krz: this morning I set up 9.4. When I tried to start the server for the project, I got the msg "The data directory was initialized by PostgreSQL version 9.3, which is not compatible with this version 9.4.0."
[10:14:04] errakeshpd: if i mentioned -e production
[10:14:14] errakeshpd: then in production mode right ?
[10:15:00] universa1: errakeshpd: yes, the other points still hold though.
[10:15:02] MaDErroR123: krz: Is this message telling me, that I need to clean up the data for the project or is the project not working at all with 9.4?
[10:15:28] universa1: MaDErroR123: that is telling you that the data directory of the postgres server needs to be upgraded or rebuild
[10:15:38] universa1: MaDErroR123: that error has nothing to do with your actual app.
[10:16:25] MaDErroR123: universa1: okay, thank you...maybe this can be the easiest approach to get the project to work on my mac
[10:17:08] errakeshpd: <universa1> But That scenerio we not required deployment methods. very simple to run site up
[10:17:55] universa1: errakeshpd: the "deployment" methods are there, so that you can easily update your site, have nginx/apache take care of static files, have nginx/apache take care of ssl,
[10:18:19] universa1: errakeshpd: and that you can easily redeploy your site, if you switch servers...
[10:18:39] errakeshpd: hm ok i understand
[10:19:55] errakeshpd: which gems you prefer to create api rails application ?
[10:20:30] errakeshpd: httpparty or rails_api
[10:20:48] universa1: they both serve different purposes...
[10:20:58] hk3380: how do i learn rails in 1 day w/o knowing ruby
[10:21:18] universa1: errakeshpd: one is basically a client, the other are more conventions for the server
[10:21:23] universa1: hk3380: you don't.
[10:23:02] hk3380: isn't it basically like python and django but more hip
[10:23:54] errakeshpd: <universal> could explain it more specific
[10:24:08] universa1: errakeshpd: have you read the readmes of both projects?
[10:25:18] universa1: hk3380: not really. if you're very familiar with object oriented programming, web programming in general, know a bit about functinoal programming, you might get something running at the end of the day... ...but that doesn't mean you've learned rails.
[10:30:54] jammanbo: So, I'm thinking of using a value object within a model to take care of setting a couple of related attributes. Basically there's a unit and value attr in the model, but the user may supply non-standard units and they need to be saved in SI. That much sound reasonable? (leading question)
[10:32:57] universa1: jammanbo: sounds reasonable so far.
[10:34:24] pyemkey: Hello, anyone could help me figure out best way for create association between User and Addresses table with limitation. I mean, that User have 1 address (residental) and optionally mailing address.
[10:34:47] jammanbo: oh, actually, let me just check something before following up ..
[10:34:51] universa1: pyemkey: so user belongs_to :residential_address
[10:35:06] universa1: pyemkey: user belongs_to :mailing_address
[10:38:36] pyemkey: universa1: If residental_address and mailing_address have same attributes. Is it right to have one Address model and use it as
[10:38:46] universa1: pyemkey: yes
[10:38:55] pyemkey: user belongs_to :residental_address, class_name: 'Address'
[10:39:12] universa1: sounds about right.
[10:41:56] basichash: I tried to install semantic-ui-rails, now i'm getting "couldn't find semantic-ui/modules/accordian.js". How can I fix this?
[10:42:14] hefest: I'm creating delayed job which is downloading file from one http location and uploading to aws s3. any ideas how to pipe that in order not to use up memory of temporary storage of the file before the upload?
[10:42:38] jammanbo: Okay, so yeah, the question was, am I to overwrite #save in the model and do something like `attributes = value_object.standardise; super`, or is there some more appropriate point to update the actual attrs with the ones standardised by the value object?
[10:44:09] basichash: it's an sprockets error
[10:44:26] workmad3: jammanbo: well, you could provide a 'value_object=' method that deconstructs the value object into normalised attributes
[10:44:38] workmad3: jammanbo: or you could provide an attributes= method
[10:44:58] universa1: jammanbo: i'd probably go with: value_object=
[10:45:01] basichash: couldn't find file 'semantic-ui/modules/accordion.js'
[10:45:04] basichash: (in /home/user/Code/Frameworks/Rails/my_app/app/assets/javascripts/semantic-ui.js:1)
[10:45:08] workmad3: jammanbo: that will check if you're assigning a hash or a value object, and act appropriately (super if hash, your own normalised assignments if value object)
[10:45:39] universa1: basichash: so look at the gem files to see what files you actually need to import.
[10:47:12] workmad3: jammanbo: or you could override the setter for the storage value, do your normalisation there and then call 'super'
[10:48:55] workmad3: jammanbo: i.e. plenty of possibilities, none of them include overwriting #save
[10:49:13] workmad3: jammanbo: hell, you could even normalise in a before_save callback and it would be better than overwriting #save, IMO :P
[10:49:16] basichash: universa1: i installed this gem, but the semantic-ui folders in assets/{javascript,stylesheets} aren't there
[10:49:54] workmad3: jammanbo: but I tend to prefer overriding the setters to handle normalisation personally
[10:50:18] workmad3: basichash: did you restart your server?
[10:50:25] universa1: basichash: bundle show semantic-ui-rails
[10:50:47] basichash: workmad3: ye[
[10:50:58] basichash: universa1: says it's installed (semantic-ui-sass)
[10:51:57] workmad3: basichash: semantic-ui-sass != semantic-ui-rails
[10:52:16] basichash: semantic-ui-rails is deprecated
[10:52:30] basichash: well, it's not being developed anymore
[10:52:36] workmad3: basichash: fair enough... doesn't stop semantic-ui-sass != semantic-ui-rails
[10:52:39] jammanbo: workmad3: universa1: This is the direction I was going, which seems to exclude a few of those options. I was trying to make the object behave "normally" up until save ??? i.e. I wasn't going to keep the real attributes up to date, and instead delegate off the the value object. I imagine you disagree?
[10:52:42] jammanbo: http://pastie.org/9891870
[10:52:51] workmad3: basichash: so maybe you should check the docs for the gem you're *actually* using?
[10:53:09] universa1: basichash: then bundle show semantic-ui-sass -- this will print out a drirectory
[10:53:28] workmad3: universa1: the docs for semantic-ui-sass tell him how to use it
[10:53:30] basichash: universa1: it prints out ~/.gem/ruby/2.1.5/gems/semantic-ui-sass-1.8.1.0/
[10:53:35] workmad3: universa1: they're just different to semantic-ui-rails
[10:53:49] universa1: workmad3: yeah, they're also in the folder ;)
[10:53:56] workmad3: universa1: different folder ;)
[10:54:12] universa1: sometimes the docs sucks, so i manually look up the files in the gem ;)
[10:54:22] universa1: haven't checked the specific gem ;)
[10:54:24] workmad3: universa1: but my point is more stop enabling someone from doing their own investigation into the correct gem ;)
[10:54:37] universa1: workmad3: ;-)
[10:55:05] workmad3: universa1: rather than relying on being able to look at completely the wrong shit and then come crying here, giving false information and getting hand-held through to an answer... maybe I'm in a bad mood today...
[10:56:33] basichash: i'm pretty new to rails, so there's a lot of stuff i'm pretty ignorant about
[10:56:47] workmad3: basichash: right... but surely looking at the gem you've actually installed isn't rocket science?
[10:56:53] workmad3: basichash: rather than a completely different one?
[10:57:30] basichash: workmad3: i initially installed s-ui-rails, then removed it once i realised it was deprecated
[10:57:37] arup_r: Radar: Hi I have to implement one feature. Currently each order has been assigned to a same default store address. Now we want to change the logic. We have multiple stores... and we want to route the proper store address as per the availability.. Where to look for to implement this feature
[10:57:41] basichash: should've said that
[10:57:54] workmad3: basichash: yes... and you should then also have looked at the docs for the gem you ended up installing
[10:58:03] workmad3: basichash: rather than assuming that a different gem would work exactly the same
[10:58:21] basichash: the docs on s-ui-sass aren't exactly extensive
[10:58:37] workmad3: basichash: they don't need to be... the information is still there
[10:58:57] workmad3: basichash: and it doesn't make looking at different docs any more valid
[10:59:12] basichash: couldn't see anything about it installing in ~/.gems/
[10:59:40] workmad3: basichash: what would you think if I said "I couldn't find extensive docs for Datetime in ruby, so I looked at PHPs docs instead"?
[11:00:36] workmad3: basichash: what if I then came into a room and didn't admit that, and said that Datetime in ruby was broken?
[11:00:55] workmad3: basichash: and you were trying to help me figure out why it wasn't working as expected?
[11:02:30] workmad3: basichash: if you're not imagining yourself being pissed off at the situation now, you have the patience of a saint :P
[11:03:13] universa1: workmad3: woot! i'm a saint :p
[11:03:32] workmad3: basichash: btw, first thing to do when you change gems is to go back and redo the setup
[11:04:03] workmad3: basichash: which you didn't do... so maybe start there before wondering about things like installation locations (which were exactly the same in semantic-ui-rails)
[11:04:05] basichash: workmad3: once i realised it was deprecated, that's what i did
[11:04:22] workmad3: basichash: obviously not, because you're still using a path to accordion from semantic-ui-rails not semantic-ui-sass
[11:05:02] basichash: at least that's what i tried to do. I removed semantic-ui-rails from my Gemfile, then added s-ui-sass
[11:05:12] workmad3: basichash: did you remove files that semantic-ui-rails had created?
[11:05:20] basichash: workmad3: yeah, that fixed it
[11:05:21] workmad3: basichash: did you undo any changes you'd made?
[11:05:33] _lazarevsky: a quick question
[11:05:49] workmad3: _lazarevsky: sure... but be warned, I may bite your head off if it's caused by stupidity :P
[11:05:59] workmad3: (not that that is any different from normal :) )
[11:06:09] _lazarevsky: I have a hash of the following format -> {"0"=>"357", "1"=>"361", ...
[11:06:26] _lazarevsky: I'd like to reverse the places of the key-value pairs
[11:06:50] workmad3: Hash[hsh.values.zip(hsh.keys)]
[11:06:55] _lazarevsky: so that I end up with {"357"=>"0", "361"=>"1",
[11:07:07] _lazarevsky: is there a way of doing it in one line
[11:07:09] universa1: _lazarevsky: a.each_with_object({}) {|(k,v),b| b[v] = k}
[11:07:10] workmad3: (there may be a method that goes directly there)
[11:07:20] _lazarevsky: I mean I know I can iterate over it and construct it but I am looking for aone liner
[11:07:29] oak_alternate: https://github.com/skr5e/multireddit_splitter/blob/master/app/views/multis/index.html.erb
[11:07:35] workmad3: _lazarevsky: look up :P
[11:07:45] oak_alternate: https://github.com/skr5e/multireddit_splitter/blob/master/app/assets/javascripts/multis.js
[11:07:50] basichash: workmad3: although i'm having trouble getting a search dropdown to show
[11:07:52] universa1: or try that devil's thing called google :D
[11:08:04] universa1: oak_alternate: ?
[11:08:13] oak_alternate: sry getting to a question
[11:08:31] workmad3: _lazarevsky: you've got universa1's each_with_object, or you've got my Hash[hsh.values.zip(hsh.keys)]
[11:08:39] oak_alternate: in multis.js I have multis associated with stack based on the stack's name
[11:08:48] oak_alternate: how can I re-create this association in rails
[11:08:51] |RicharD|: Hi, I have a problem with nested resources...I can create a post with nested resources, but if then I try to update the post object with new/different nested resources, it update the post but not the nested resources
[11:08:52] |RicharD|: https://gist.github.com/anonymous/6a5c327f1bf14024239c
[11:09:02] universa1: !spacenotenter
[11:09:02] helpa: The enter key should not be used as a space bar. Lines on IRC can be up to 400 characters long.
[11:09:05] oak_alternate: I have "stack-id"s that are currently nil :/
[11:09:14] oak_alternate: for each multi
[11:09:37] _lazarevsky: what's the b in {|(k,v),b| b[v] = k}
[11:09:44] _lazarevsky: the actual hash aye?
[11:10:12] universa1: _lazarevsky: look up each_with_object... that's acutally guess coded, so no clue if it actually works.
[11:10:22] workmad3: _lazarevsky: oh... in 2.1.5 at least, there's Hash#invert
[11:10:28] workmad3: _lazarevsky: which does that :P
[11:11:37] workmad3: _lazarevsky: {"a" => "b"}.invert #=> {"b" => "a"}
[11:12:39] workmad3: _lazarevsky: if that's implemented correctly, it'll short-circuit a lot of iteration, and pretty much just create a new hash with keys and values duplicated and switched ;)
[11:15:06] _lazarevsky: is the code that universa1 provided not efficient?
[11:15:41] universa1: it's ok, but if you do it directly you can be more efficient.
[11:16:11] Macaveli: is it possible to invoke an undefined method error on purpose?
[11:16:29] universa1: raise MethodNotIMplementedError or whatever the class is.
[11:17:09] Macaveli: universa1 "raise NotImplementedError" indeed
[11:17:46] basichash: workmad3: working, thanks for the love
[11:18:01] workmad3: _lazarevsky: benchmark ;) https://gist.github.com/workmad3/ce2f87a79f1a682fc769
[11:18:37] workmad3: universa1: sorry... each_with_object seems to be the worst :(
[11:18:42] universa1: workmad3: :-)
[11:18:54] universa1: yeah, might be more memory efficient though...
[11:20:02] workmad3: (updated with benchmark code now too)
[11:20:58] workmad3: universa1: write a benchmark to test? ;)
[11:21:13] universa1: workmad3: i don't know how to test memory in ruby
[11:21:24] workmad3: it'll be a fun friday investigation then :P
[11:21:47] universa1: i usually don't care about it. it's either so obvious too much, that you don't need a program, or it's so marginal that it doesn't matter
[11:23:26] oak_alternate: ok I have a better formulated question now
[11:23:38] universa1: memory profiling seems to be not so straight forward ;)
[11:24:06] workmad3: indeed... you'd basically need to look at the maximum heap size of different attempts
[11:24:30] workmad3: so you'd probably do the test in different ruby processes for each approach and take a look at heap statistics
[11:25:19] oak_alternate: https://github.com/skr5e/multireddit_splitter/blob/master/app/controllers/multis_controller.rb
[11:25:20] workmad3: if you wanted to do a better job, you'd also want to have a look at how it grows over different size inputs (something I didn't bother with in my quick benchmark :) )
[11:25:42] oak_alternate: ^link above, I want to be able to associate a stack to a multi
[11:26:42] oak_alternate: based on the name of the stack
[11:28:21] oak_alternate: yeah, so if I type "sports" as the name of the stack in my app, it will associate that multi to that stack
[11:28:29] oak_alternate: any ideas on how I could make that happen?
[11:29:18] universa1: workmad3: ok, let's create a dummy project. ruby-rpof seems to have some memory measurement stuff ;)
[11:30:46] workmad3: universa1: :)
[11:33:26] universa1: oak_alternate: look for the railscast on nested model forms. that should give you some inspiration.
[11:39:27] universa1: workmad3: hmm, ruby-prof on 2.1.2 doesn't measure memory or allocations :(
[11:40:18] universa1: workmad3: ohh, requires patches ruby :(
[11:42:55] universa1: workmad3: and compiling :D
[11:43:14] workmad3: universa1: hehe
[11:45:42] tagrudev: !isitfriday
[11:47:02] j0dy: Hello, is this the right place to ask questions about RoR? :)
[11:47:18] universa1: j0dy: as indicated by the topic, yes ;)
[11:48:55] j0dy: Oh i see. So my question is: How to add several files (one zip file, 5-10 txt files) to a model. Is there a gem that is dedicated to this? I've found Paperclip and some others, but they seem to be mostly for images.
[11:49:24] universa1: j0dy: you can use them to attach files of whatever type you want. images are just the common example on web pages.
[12:04:06] oak_alternate: universa1: thanks for the link, it seems I do need to accept nested attributes but I can't relate what he does to my project
[12:04:31] oak_alternate: this is a bit advanced for me, I just have to do this one part and my app would be pretty much complete
[12:04:37] wiggl3: Hi, with Ruby 2.2.0 / Rails 4.2.0 do I still need `# encoding: UTF-8` on top of my schema.rb and seeds.rb?
[12:05:39] workmad3: wiggl3: ruby 2.0+ defaults to UTF-8 encoding for source files, so no
[12:06:04] workmad3: wiggl3: but if your code may be run on 1.9 still, you should still have it there
[12:06:29] workmad3: wiggl3: and it's not exactly worthwhile removing it if the encoding comment is autogenerated ;)
[12:06:35] wiggl3: great great
[12:06:40] wiggl3: no they were manually added ;)
[12:07:13] oak_alternate: I think I would need to accept nested attributes for :stacks in my :multi model, and then assign a stack to @multi.stack in my controller
[12:08:18] universa1: oak_alternate: create a dummy project, and create a nested model form there.
[12:08:27] universa1: oak_alternate: to try it out and learn about it.
[12:08:57] oak_alternate: hm ok i'll give it a shot
[12:09:14] arup_r: I want to add a new method to this model -> https://github.com/spree/spree/blob/v2.4.3/core/app/models/spree/stock/prioritizer.rb#L38-L40, what should be my file name ? Extending Classes -> https://guides.spreecommerce.com/developer/logic.html#extending-classes didn't mention about nested models.
[12:09:35] wiggl3: workmad3: yeah the schema.rb one is autogenerated though
[12:09:53] pyemkey: By clicking on button I render partial remotely. Inside this partial I want to trigger js callback, but doesn't work. BTW I don't use turbolinks. For example partial is rendered, there is div with id "foo". When I try to use $('#foo').change(function() { console.log('x') }); nothing is displayed in console
[12:10:16] pyemkey: universa1: I forgot say thank you about previous answer
[12:10:27] universa1: arup_r: Spree::SomeModule::Whatever.class_eval do...
[12:10:34] BLuEGoD: when I use .select('field') on a query with joins, how can I access all of the attributes with query_result.att instead of query_result[:att] ?
[12:10:46] universa1: pyemkey: !code
[12:10:46] helpa: pyemkey: 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.
[12:11:06] arup_r: No.. You might missed my confusion.. That is the file name pattern
[12:11:12] arup_r: what should I use ?
[12:11:28] arup_r: Standard practice for including such changes in your application or extension is to create a file within the relevant app/models/spree or app/controllers/spree directory with the original class name with _decorator appended.
[12:11:33] arup_r: universa1: ^^
[12:11:41] arup_r: https://guides.spreecommerce.com/developer/logic.html#extending-classes
[12:11:57] universa1: arup_r: so.. app/models/spree/stock/prioritizer_decorator.rb ?!
[12:11:57] arup_r: The one I want is nested one.. not directly under Spree in the core
[12:12:10] universa1: it's no different to the "spree" nesting.
[12:12:25] arup_r: Like your previous sugesstion...?
[12:12:42] arup_r: This Gem is killing me.. my Ruby skills.. :(
[12:12:54] arup_r: So now fearing to take an attempt..
[12:13:00] krisquigley: I'm using Postgres 9.4 and have a jsonb column. I am doing the following lookup in postgres which works SELECT "products".* FROM products WHERE (products.data @> '{"variants": [{"sku": "TAC304_SX322"}]}')
[12:13:23] arup_r: universa1: Logically your first suggestions should work
[12:13:23] universa1: arup_r: what is the worst that could happen? you get an error and revert your code? ohh noeeeesss... let's call the president :p
[12:13:28] krisquigley: However, putting this into rails scope :by_variant_sku, -> (sku) { from("products").where("products.data @> '{\"variants\": [{\"sku\": ?}]}'", sku) } doesnt work as it is adding single quotes
[12:13:39] krisquigley: is there anyway to get activerecord to use double quotes?
[12:14:14] krisquigley: or even to not insert quotes at all, then I can hard code the double quotes in
[12:14:36] universa1: krisquigley: this opens you up to sql insertion attacks.
[12:15:03] krisquigley: true, but that is how the query is meant to be run in postgres :/
[12:15:19] workmad3: krisquigley: you could potentially do "products.data @> ?", {variants: [{sku: sku}]}.to_json
[12:16:26] universa1: workmad3: that should work from a quick look at the docs.
[12:16:29] workmad3: krisquigley: which should keep you protected from SQL injection, while still producting the query you want :)
[12:16:42] universa1: workmad3, krisquigley: SELECT * FROM json_test WHERE data @> '{"a":1}';
[12:16:45] krisquigley: awesome, thanks again workmad3
[12:16:55] krisquigley: and universa1
[12:17:01] workmad3: producting? :/ #fridayfail
[12:17:08] helpa: http://youtu.be/kfVsfOSbJY0
[12:19:14] krisquigley: Where are you based workmad3
[12:21:36] tagrudev: usually he is flying on a giant red dragon, solving the rubik cube with his eyes closed
[12:21:56] j0dy: universa1: thanks. what would be the best way to send a .zip file from a client-application (c#) to the rails server? serialize it and put it in a json object (along with a HMAC)? Are there better ways?
[12:21:57] pyemkey: universa1: I've prepare example gist to show you my problem. https://gist.github.com/pyemkey/00a4d7b2e42c908acbf6
[12:22:50] universa1: j0dy: why not do a plain html multipart+form request?
[12:22:52] krisquigley: workmad3: is your name based on strongmad?
[12:23:30] universa1: pyemkey: !fake
[12:23:30] helpa: pyemkey: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[12:24:56] BLuEGoD: If I do, query_result = Blah.joins(:bee).select('bee.att').first, how can I access query_result.att like that instead of query_result[:att] ? - Also, query_result.attribute_present? :att returns true!
[12:25:20] keksike: http://puu.sh/fxT6Z/e0470a8fb9.png any idea what I'm doing wrong? very new to ror
[12:25:23] universa1: BLuEGoD: if you're only selecting a single field: try pluck
[12:25:42] BLuEGoD: universa1: was just an example, I'm selecting multiple fields across a join
[12:26:54] universa1: BLuEGoD: well, my magic bauble is being restored currently, so i can't know that ;) but no clue, i think it worked for me the last time i tried something like that.
[12:27:15] universa1: keksike: you're calling empty? on nil, since there's only one place where you're calling empty?
[12:27:28] universa1: keksike: it means that report.restaurant_street_address is nil
[12:27:45] universa1: keksike: you most likely want .nil? instead of .empty?
[12:27:56] universa1: keksike: and you can rewrite if !some_condition to: unless some_condition
[12:28:40] BLuEGoD: universa1: pluck seems to return an array with just the values on it
[12:28:42] pyemkey: universa1: I didn't know about it. In this case fake data can ilustrate my problem.
[12:28:57] keksike: universa1: ok thanks
[12:29:00] keksike: ill try it
[12:29:12] universa1: keksike: if restaurant_stree_adress is a reference to a model, you can leave out the .nil? / .empty? ... ...if it's a string you might want to have a look at blank?
[12:29:27] jammanbo: Is use of composed_of advocated now or not? I can't tell/
[12:29:30] universa1: pyemkey: your example files have literally no connection to eahc other
[12:29:45] universa1: pyemkey: the html classes don't match, ...
[12:29:47] keksike: universa1: ok thanks, ill check it out
[12:30:00] universa1: keksike: yw :-)
[12:30:12] universa1: and with that of to lunch :-)
[12:33:07] pyemkey: universa1: but html ids matches :)
[12:33:24] keksike: universa1: changing it to nil seemed to solve the problem, thanks alot :)
[12:33:30] pyemkey: in my code I refer to ids
[12:33:36] keksike: also restaurant_street_address is a String entry in MySQL
[12:33:53] keksike: ill check out blank
[12:33:58] keksike: whats the difference with blank and nil
[12:34:08] keksike: or which one should I use
[12:39:31] jammanbo: anyone? opinions on composed_of: super-slick ninja rockstar thing to use, or anti-pattern?
[12:39:47] oak_alternate: universa1 this is way too advanced for me. could you please help walk me through it? . I'm so close I just want to finish the app so I could get to styling it :(
[12:40:18] wiggl3: Hi! I hear DO's disk speed is quite bad. Ie. 132MB/s vs say 868MB/s over at https://openvz.io. Is this true or did this type of benchmark only apply to DO's old infrastructure?
[12:40:27] wiggl3: * DigitalOcean
[12:42:15] oak_alternate: why is it that I can associate a user_id to a multi so simply, but for a stack_id i have to mess around with nested models?
[12:42:33] DaniG2k: wiggl3: I am using a DO droplet and I ran out of RAM after like, 4 months
[12:43:02] wiggl3: DaniG2k: you gotta add swap most likely
[12:43:18] DaniG2k: wiggl3: I did, 1 GB
[12:43:26] DaniG2k: but using swap isn't a good idea
[12:45:45] wiggl3: DaniG2k: how come?
[12:45:59] DaniG2k: you don't want to rely on Swap
[12:46:02] DaniG2k: its slow as balls
[12:46:05] DaniG2k: compared to RAM
[12:46:29] DaniG2k: and RAM is designed for very fast memory access
[12:47:21] wiggl3: i didn't know that
[12:48:01] DaniG2k: you can use swap
[12:48:07] DaniG2k: but I wouldn't suggest it
[12:48:24] DaniG2k: especially if it's an environment that requires high availability
[12:48:42] DaniG2k: RAM will be more responsive
[12:50:45] beauby: wiggl3: swap means using disk space as ram, which has read/write times way slower
[12:51:15] wiggl3: thanks guys
[12:51:20] DaniG2k: unless youre using an SSD which might be faster, but still it's not designed to be RAM
[12:51:41] beauby: DaniG2k: Yeah, I was actually wondering what the pros and cons were for using SSDs as RAM?
[12:52:10] DaniG2k: its probably faster, no doubt
[12:52:18] DaniG2k: I don't know for certain but
[12:52:26] DaniG2k: SSD is waaay faster than hard drives used to be
[12:52:43] beauby: DaniG2k: I think it doesn't age well when using in a too write-intensive environment
[12:52:52] DaniG2k: but still I don't think they were designed with the same intent as RAM was, so I'm assuming that even swap space on SSD is slower than RAM
[12:53:24] beauby: DaniG2k: According to an answer on SuperUser: SSDs can deliver up to about 654MB/s while 1333MHz DDR3 in dual-channel mode can deliver up to 21.3GB/s (21 332MB/s).
[12:53:49] beauby: so there's still quite a speed gap
[12:54:00] universa1: oak_alternate: you don't. you can do it the same way as for the user if it's a belongs_to association.
[12:55:03] universa1: beauby: so, writing at full speed for 2 or 3 years and still working is not good enough? ;)
[12:55:31] DaniG2k: beauby: cool
[12:55:32] beauby: universa1: what do you mean?
[12:56:04] universa1: beauby: durability of ssd's.. there was/is some experiment where they tested how durable ssds are. they just constantly wrote to randmo data to the disk
[12:56:33] beauby: universa1: still, according to some answer on SuperUser, an SSD used as ram in a write intensive environment would wear out the disk in about 2 months
[12:56:38] oak_alternate: universa1: yeah multi belongs to stack, except in my multis contoller i did @multi.user = current_user
[12:56:44] arup_r: universa1: From where you learnt too much Rails..
[12:56:44] oak_alternate: can't do the same thing for stack
[12:57:01] arup_r: It seems DHH feel jealous on you ;)
[12:57:19] universa1: beauby: http://techreport.com/review/27062/the-ssd-endurance-experiment-only-two-remain-after-1-5pb ;-)
[12:57:22] oak_alternate: how else could I do it
[12:57:30] beauby: universa1: Thanks, I'll have a read
[12:57:58] oak_alternate: seems kind of hacky but I'm going to try to pass it as a param to the controller
[12:58:04] arup_r: ACTION feeling proud on you
[12:58:05] universa1: oak_alternate: show your form.
[12:58:35] universa1: arup_r: i know not so much about rails ;) i've just a browser left to my irc window open and am quick to google :D
[12:58:55] universa1: arup_r: but thanks for the praise :-)
[12:59:25] beauby: Anyways, for data to be written on disk, it has to go through RAM first, so I don't really see how it could speed up things to use swap space on an SSD as RAM
[12:59:26] oak_alternate: https://github.com/skr5e/multireddit_splitter/blob/master/app/views/multis/index.html.erb
[12:59:56] oak_alternate: the class stackwindow needs to change to the current value in the text field
[13:00:14] universa1: beauby: i guess you use ssd as ram, when you need more then is usually available through "classical" ram... very specific use cases.
[13:00:16] oak_alternate: instead of being stackwindow it should be a variable based on that
[13:00:26] oak_alternate: it's so easy w/ jquery not so much with rails
[13:00:40] universa1: oak_alternate: o0.
[13:01:26] oak_alternate: in other words, if I create a "sports" stack, I want the id of the div to change to "sports" also
[13:01:48] oak_alternate: if I create a "programming" stack, the id should change to "programming"
[13:02:04] universa1: i'm sorry. i don't understand what you're trying to do there.
[13:02:25] universa1: oak_alternate: create sensible, basic html forms before enhancing it with js.
[13:02:26] solars: hi, how should I create a global variable in a controller? @fu is created with every request, right? I need a var holding a timestamp so I can do a check only every 10 minutes
[13:02:30] arup_r: universa1: That's a good trick to learn fast.. I don't browse for me but for others
[13:02:31] universa1: oak_alternate: !getting_started
[13:02:31] helpa: oak_alternate: http://guides.rubyonrails.org/getting_started.html - Getting started with Ruby on Rails guide written by Mike Gunderloy
[13:03:00] beauby: solars: you have to store it somewhere else
[13:03:19] beauby: solars: Your controller only lives while it processes the request
[13:03:22] universa1: solars: @@timestamp... but given that you're often running multiple processes.
[13:03:23] solars: yeah that's why I'm asking :)
[13:03:38] solars: universa1, I don't care if it gets resetted with a new process
[13:03:44] universa1: solars: you should base the next check on the last check.
[13:03:51] solars: I only want to restrict a livetest so that it doesn't check on each request
[13:04:07] oak_alternate: thanks universa1 I think I'll just shelve this one until I have some more complete knowledge
[13:04:11] beauby: solars: depending on what you cant to do, you could store it in something like redis
[13:04:23] solars: universa1, yeah, I store the timestamp in @@ and check if < 10 mins
[13:04:23] beauby: s/cant/want
[13:04:24] oak_alternate: I'm clearly trying to do stuff that is outside of my scope
[13:04:29] gavit: http://getbootstrap.com/css/#forms <- How does bootstrap get such pretty formatting... whereas mine looks so ugly - http://jsfiddle.net/LkzdcLus/1/
[13:04:34] solars: beauby, sure, but that's too much overhead for a livetest :)
[13:04:39] solars: if @@ works I'll use this
[13:04:46] beauby: solars: but maybe you just want to run some kind of cron task every 10 minutes
[13:04:49] universa1: solars: well then a class level variable might do it. might open up for concurrency issues.
[13:05:05] solars: yeah I think it's enough
[13:05:27] MaDErroR123: hey people, I fu*** my postgres up. Upgraded, deleted, reinstalled, deleted...again and again...nothing works
[13:05:58] MaDErroR123: is there someone who know how to completely remove every postgres thing
[13:06:07] MaDErroR123: and start from scratch?
[13:06:46] beauby: solars: have a look, there are some nice job schedulers specific to rails
[13:07:14] rushed: MaDErroR123: that is going to be highly dependent on your platform and install methods used so far, also might be a question better asked in #postgresql
[13:07:29] solars: beauby, I know, but its only a check that tests for connectivity, not worth it
[13:07:30] MaDErroR123: rushed: thank you
[13:07:58] universa1: gavit: http://jsfiddle.net/m1noo60e/ -- works for me... i forked your fiddle.
[13:08:38] gavit: universa1, I copy pasted the one from bootstrap too and it's just as pretty, but I cant figure out why my code looks so ugly
[13:08:41] universa1: gavit: you're missing form-control class on inputs for example.
[13:09:10] universa1: gavit: you should regenerate / update the simple_form initializer for bootstrap.
[13:09:22] universa1: it generates the correct html for bootstrap if current.
[13:09:24] gavit: universa1, I'll try that
[13:09:29] emilkarl: Hi, how do I setup many-to-many relationships with fixtures?
[13:13:26] gavit: universa1, rails generate simple_form:install --bootstrap <- this is what you meant right? it only updates .rb files it seems. still not prettier. Think it might be related to gem 'simple_form', '~> 3.0'
[13:13:33] gavit: I'll see if updting the gem helps
[13:18:27] Doddlin: Hi all! I want to define a function that combines my Space.address and Space.city into a string for geocode, what is the simplest way to do so? :)
[13:18:36] Doddlin: in my Space.rb that is
[13:18:51] beauby: Doddlin: "#{Space.address} #{Space.city}"
[13:19:04] beauby: #{} allows you to expand expressions inside strings
[13:19:23] Doddlin: beauby, aha! So that would be considered a complete string?
[13:19:43] beauby: Doddlin: what is an "(in)complete" string? :)
[13:20:11] Doddlin: beauby, touch????? ;)
[13:20:18] beauby: basically, ^ this will create a string whose value is the value of address followed by a space followed by the value of the city
[13:21:20] beauby: Doddlin: try it in a ruby interpreter, define two strings a = "Hello", b = "world", and then c = "#{a} #{b}"
[13:21:44] Doddlin: beauby, I see, however, acc to docs it says I should def a function for this, as regularily it validates on :address, I won???t be able to set :???#{Space.address} #{Space.city}???
[13:22:10] beauby: Doddlin: what exactly are you trying to do here?
[13:22:31] emilkarl: Can someone explain how I can add this relationship to my fixture? http://pastie.org/9892128
[13:22:49] gavit: universa1, apparently I need to restart rails-server for the updates :) thought that .rb changes didnt require server restarts. prolly matters if it's a 'library' or smth
[13:22:56] beauby: If you want to make it a function you could just wrap it inside def my_function; "#{address} #{city}"; end
[13:22:59] Doddlin: beauby, haha I???m trying to geocode an address and :address does only hold the street and number, not the city, and since one address can be present on many places in a country I need to use the city as well
[13:23:43] beauby: Doddlin: I'd need a gist to give you more specific help
[13:23:53] Doddlin: beauby, sure thing!
[13:25:49] Doddlin: beauby, https://gist.github.com/Doddlin/cc6a6acb2de22db9f516
[13:26:27] j0dy: universa1: sorry for responding so late. again to the zip-upload: why would you go for a multipart form instead of a serialization?
[13:27:05] beauby: Doddlin: yup, looks good to me (just remove that ; in combine)
[13:27:35] Doddlin: beauby, yeah to me too, but I get undefined local variable ???combine???
[13:27:54] beauby: Doddlin: geocoded_by :combine
[13:28:17] Doddlin: beauby, it???s in the details??? thanks! :)
[13:28:53] beauby: Doddlin: yeah, you need to give geocoded_by a symbol of function, that will later on be called
[13:29:14] Doddlin: beauby, perfect, works just as I wanted it to! :D
[13:39:56] Macaveli: Anyone know a gem that combines: Google Drive / Dropbox / Classic File Upload ?
[13:40:04] Macaveli: or do you have to write that all custom?
[13:42:43] n1lo: Hi folks, I installed faker gem but when I call it in my factorygirl file it keeps me returning a message that he doesn't find faker. Where should I proper need to put this require 'faker' ?
[13:46:13] tommyblue: n1lo: did you try to require faker in the files where you define factory girl objects?
[13:46:44] beauby: n1lo: make sure Faker is in your Gemfile and that you ran bundle install
[13:48:37] gavit: n1lo, how do you 'install' faker
[13:48:46] gavit: n1lo, is it in your Gemfile?
[13:55:02] Doddlin: is it possible to get the path to an image in my assets/images-folder from a controller? Apparently I need that to set the custom marker for my map...
[13:55:11] n1lo: Wow! Love you guys! yes to all! :D gavit, tommyblue and beauby. It's loading well when I put requere 'faker' inside my factorygirl code works well.. but I was thought if is there another way to do this globaly only for my factorygirls files.
[14:05:30] gavit: ACTION is gonna try and replace clearance with devise. Wish me luck!
[14:11:12] tagrudev: gonna get down on Friday
[14:26:25] mschae: tagrudev: good luck.
[14:27:03] mschae: ha, sorry I misread. my IRC client gave you and gavit the same color...
[14:27:21] mschae: you said "no one ?" anything I can help with?
[14:27:42] gavit: mschae, thanks :)
[14:28:00] mschae: you're welcome :)
[14:28:28] tagrudev: <tagrudev> gonna get down on Friday
[14:29:32] mschae: this is obviously not one of my quick days... :)
[14:35:26] tagrudev: mschae, !friday
[14:35:26] helpa: mschae: http://youtu.be/kfVsfOSbJY0
[14:35:55] workmad3: tagrudev: !isitfriday?
[14:35:55] helpa: tagrudev: yes!
[14:36:14] tagrudev: workmad3, where were you I was explaining to a guy where you live
[14:36:23] workmad3: tagrudev: here, where I live :P
[14:36:40] tagrudev: workmad3, <tagrudev> usually he is flying on a giant red dragon, solving the rubik cube with his eyes closed
[14:37:01] workmad3: tagrudev: not really... I suck at rubiks cubes
[14:38:20] gavit: how does rails determine where it is in migrations? for some reason its trying to run migrations which I had already run...
[14:38:32] workmad3: tagrudev: and my 'giant red dragon' is more interested in drinking from my coffee cup... https://www.dropbox.com/s/tyyzbip6vplga2d/Screenshot%202015-02-03%2017.47.03.png?dl=0
[14:38:36] tagrudev: gavit, database it's written in there
[14:38:58] tagrudev: workmad3, hahahaha is that coffee ? D:
[14:39:06] workmad3: gavit: it stores the timestamp in the schema_migrations table in the db, and you can have a look at it with 'rake db:migrate:status'
[14:39:11] workmad3: tagrudev: it's the dregs
[14:39:34] workmad3: tagrudev: I foolishly left the cup on the table when I went to work... my wife came downstairs, saw that and had time to get a camera and take a picture...
[14:40:04] tagrudev: hahaha awesome :D so I was close with the red dragon
[14:40:28] workmad3: s/red/ginger and s/dragon/pussy, so yeah, not far off :)
[14:41:03] workmad3: also, he's a rather tiny cat
[14:41:09] tagrudev: give me some slack it's Friday D:
[14:44:37] gavit: tagrudev, the status for the ones where I get 'duplicatetable' are set to 'down'
[14:45:39] tagrudev: gavit, can you provide more info ?
[14:47:41] gavit: well, for some odd reason I get an error that the table already exists, but that the migration hasnt taken place yet. https://gist.github.com/gavit/6fab3100ccc4c4389ec1
[14:48:07] gavit: tagrudev, I rolled back 1 migration which rolled back #20141112132047
[14:48:57] tagrudev: PG::DuplicateTable: ERROR: relation "states" already exists
[14:49:06] tagrudev: this pretty much sums it up
[14:49:34] gavit: tagrudev, yes, I know the table already exists, but why is it trying to run the migration *again*... it's *that* migration which created the table
[14:49:44] gavit: I didnt create the table by hand
[14:50:17] gavit: either way, what are my options now? just delete the table and run the migration?
[14:50:33] tagrudev: well check the timestamp in the schema_migration table it should not run migration lower that that
[14:51:30] tagrudev: you can rollback but I don't know which syntax you use in your migrations so maybe it's old and the up method doesn't do anything
[14:51:42] workmad3: tagrudev: db:migrate runs all migrations that aren't in schema_migrations
[14:52:09] workmad3: gavit: what's the create_states migration look like?
[14:52:42] tagrudev: workmad3, yeah my bad
[14:53:11] MaDErroR123: hey guys, my Heroku Build fails: https://gist.github.com/benjaminspi/5bb34e98defd4d9868ac
[14:53:12] tagrudev: got confused from activeandroid it was implemented like that in there
[14:54:34] gavit: workmad3, creates a table with column name. nothing fancy. The one before is probably not rollbackable though. https://gist.github.com/gavit/6fab3100ccc4c4389ec1
[14:54:37] universa1: tagrudev: activeandroid? is it better than actionIOS ?
[14:56:13] workmad3: gavit: weird... it's almost like someone renamed a migration, or removed the migration and added it again with a slightly different timestamp
[14:56:40] tagrudev: universa1, https://github.com/pardom/ActiveAndroid/wiki/Schema-migrations
[14:56:46] universa1: workmad3: who on earth would do that? (chuckle)
[14:57:03] gavit: workmad3, where do you see a 'timestamp' difference?
[14:57:07] workmad3: gavit: I'd personally run 'rake db:migrate VERSION=20141107123900' to go back to before the bad migration, remove the states table by hand and then re-run 'rake db:migrate'
[14:57:31] tagrudev: and that's only if the up methods are right
[14:57:33] universa1: tagrudev: ahh ok :-) cool, cool, cool! (www.youtube.com/watch?v=8IIrf_JSuQk)
[14:57:35] safetypin: has anyone heard of a gem that will handle versioning of a model?
[14:57:43] universa1: safetypin: yes.
[14:57:46] workmad3: safetypin: several
[14:58:09] universa1: https://www.ruby-toolbox.com/categories/Active_Record_Versioning
[14:58:20] workmad3: universa1: aww, I was waiting for him to ask 'what' :)
[14:58:41] universa1: workmad3: yeah sorry, busy writing my email :( got impatient.
[14:58:55] tagrudev: bam beer o'clock
[14:58:58] safetypin: which one(s) do you recommend?
[14:59:15] MaDErroR123: someone understands this message? "rake aborted! refer/cream-tooltip@2x.png isn't precompiled" ... it shows after I do "rake assets:precompile"
[14:59:17] universa1: safetypin: none, evaluate them yourselfes and choose the one best fitting your requirements.
[14:59:39] universa1: safetypin: they solve different problems in different ways... ...so there is no general "best" one
[15:08:43] safetypin: have you heard of a versioning gem that will store diff-like detlas for text blobs?
[15:09:28] universa1: safetypin: git ?
[15:09:49] safetypin: in the database?
[15:10:05] universa1: safetypin: create the diff and store it in another column?
[15:12:59] gavit: workmad3, apparently I also need to delete employees & chart_of_accounts
[15:14:07] workmad3: universa1: git doesn't store deltas
[15:14:38] safetypin: universa1: yeah, i found a comment on vestal_versions that is saying something similar
[15:14:58] safetypin: seems promising
[15:15:17] universa1: workmad3: yeah... ...but you can derive them from it, can't you?
[15:15:41] workmad3: universa1: sure, you can diff two commits and get deltas :)
[15:15:54] workmad3: universa1: I think SVN stores deltas though
[15:16:12] universa1: workmad3: yeah, that's what i would do anyways. get two versions and get the diff in whatever format i want ;)
[15:16:24] safetypin: that was what i was thinking about. vestal_versions tracks changes exactly how i want, except when it comes to the long text columns, i would want to store the diff and not the whole text
[15:16:44] workmad3: yeah... that's what secretary-rails does... it stores the 'from' and 'to' values for changed attributes, and uses Diffy to calculate delta diffs if you want them
[15:16:44] universa1: safetypin: why not store the whole text?
[15:16:58] safetypin: maybe i misunderstand what a delta is, but i thought both git and svn store deltas, that is, the changes from one version to the next.
[15:17:17] workmad3: safetypin: git always stores the entire file, and hard-links back to the previous version if it hasn't changed
[15:17:18] safetypin: universa1: because it seems like a lot of database bloat
[15:17:50] universa1: safetypin: "seems" ? what amount of data are we talking about?
[15:17:51] safetypin: if someone writes 300 words on a comment, and then edits one of them, i don???t want to save all 300 words
[15:18:18] workmad3: safetypin: oh no, you just 'wasted' a kilobyte!!!
[15:18:45] safetypin: workmad3: even if it???s a small amount, it???s still wasted
[15:19:17] workmad3: safetypin: depends on how often the version history is viewed
[15:19:34] workmad3: safetypin: if it's viewed a lot, then the computation of reconstructing the old comment from deltas constantly is much more wasteful
[15:20:07] safetypin: i???ve run one drupal web site (not very large) for 4 years, and our database is 700mb+
[15:20:09] workmad3: safetypin: which is why there's different ways of doing versioning... they lend themselves to different usage characteristics :P
[15:20:22] safetypin: yeah, i don???t think the versions will be accessed very often.
[15:20:34] universa1: safetypin: 700mb is basically nothing.
[15:20:56] safetypin: it takes a minute or longer to rebuild that database.
[15:21:14] safetypin: i???d like to keep the database as small and DRY as possible.
[15:21:27] universa1: so? how often are you rebuilding the database? how often are you moving between servers?
[15:21:49] safetypin: universa1: i rebuild the database regularly on my local computer to test and build new features and CSS.
[15:22:16] workmad3: safetypin: basically, the tradeoff is that storing deltas leads to much more complicated code to rebuild versions
[15:22:30] safetypin: workmad3: yeah, that makes sense
[15:22:37] universa1: hmm, i personally have test data in my local db which allows me to do that... i very rarely need production data for that.
[15:22:58] workmad3: safetypin: and storage is really cheap nowadays
[15:24:22] workmad3: safetypin: end of the day, it's up to you... we're just pointing you towards our preferences, which is that there's probably much more useful things for you to be doing with your limited coding time than rebuilding yet another buggy delta-versioning setup ;)
[15:24:37] safetypin: i appreciate the counter-point.
[15:34:54] rikkipitt: hey guys, I have a commentable model that can be used on Posts/News mountable engines. In each of these engines is it possible to nest the comments view folder within the posts folder so the parent can override them independently?
[15:35:41] scrapcode: webrick is that bad that heroku throws #x5 all-cap "WARNING" when you're using it why is it still the default?
[15:35:55] workmad3: scrapcode: because it's part of the ruby stdlib
[15:36:46] scrapcode: workmad3: ah. okay.
[15:39:33] scrapcode: Heroku's warning worried me that my prototype using webrick was a severe mistake
[15:40:19] universa1: scrapcode: well you only need to do gem "puma" to have a modern server in your app
[15:40:41] workmad3: or 'gem "unicorn"
[15:41:09] universa1: yeah, puma works well without any configuration. that's why i personally prefer it over unicorn
[15:42:01] workmad3: I prefer it too, but the multi-threaded aspect scares some people :)
[15:42:21] universa1: workmad3: yeah :-)
[15:43:46] scrapcode: Is there any reason Rails.env.production? would be false on heroku
[15:45:58] rikkipitt: scrapcode: maybe if the environment is set to something else like staging?
[15:46:25] rikkipitt: what's your heroku RAILS_ENV set as?
[15:47:36] scrapcode: Possibly. I just always thought that once a repo was pushed to heroku, it was managed on their end as a production environment
[15:53:26] scrapcode: Nevermind. I'm asking stupid shit when I'm actually having a git issue.
[15:56:07] scrapcode: Ignoring configurations so they don't make it on github, but not realizing that they're not making it to Heroku either
[16:05:40] scrapcode: I don't think Heroku uses webrick anyways... Their logs look just like a foreman process. hmm
[16:10:52] solars: if I have a string primary key, do I need to set this in the migration as well? (I have it in the model), or doesn't this matter?
[16:11:33] solars: or how do I set unique and primary key if I have t.string :property_id in the migration?
[16:14:35] DEA7TH: If I write math proofs instead of unit tests, would that cause me trouble? Dijkstra recommended it, because it's the only way to exhaustively proof correctness. But I've never seen it done in Rails.
[16:20:52] universa1: DEA7TH: i'd be interested to see you proofing the correctness of a rails app...
[16:23:01] crankharder: anyone seen an instance where caches_action layout: false doesn't actually render the layout at all? - basically this issue, but it has a non-solution: http://stackoverflow.com/questions/9551759/conditional-layout-and-action-caching-without-a-layout
[16:33:21] arup_r: is this book good ? https://whatdoitest.com/articles
[16:35:00] arup_r: any body read ?
[16:35:18] universa1: arup_r: haven't heard of it, but not really involved in the book scene currently.
[16:41:59] krzkrz: so ive got Aisle.includes(:products).references(:products).where('LOWER(products.name) LIKE ?', "%wood%")[0].products. which returns the right amount of products (1) that match the where clause. but the minute i append .count or pluck(:id) it returns 2 products
[16:42:03] krzkrz: whats going on?
[16:42:35] krzkrz: i guess instead of count i can use length
[16:42:42] krzkrz: and instead of pluck i can use map
[16:42:46] krzkrz: but thats just ugly
[16:43:43] momomomomo: krzkrz: You???re tricking yourself with that result
[16:43:55] momomomomo: with your ()[0] you???re selecting the first item
[16:44:27] momomomomo: ofcourse its length is going to be 1 Aisle with many products - when you append anything to that query, you???re limiting the response on Aisles, not on its referenced products
[16:45:09] momomomomo: Why are you querying through Aisle if you???re just looking for the number of %wood% products?
[16:45:33] krzkrz: momomomomo: because id like to return the aisles that the product belongs to as well
[16:46:09] momomomomo: so wouldn???t it make more sense to do Product.includes(:aisles)
[16:46:23] krzkrz: then group by aisles?
[16:46:32] momomomomo: explain your use case better
[16:47:35] momomomomo: krzkrz: !ask
[16:47:35] helpa: krzkrz: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[16:48:24] krzkrz: momomomomo: http://ibin.co/1qjrx4L5LH1K
[16:48:46] krzkrz: the screenshot is self explainatory
[16:48:58] momomomomo: krzkrz: can you gist it on a site that I can recognize?
[16:49:00] momomomomo: krzkrz: !gist
[16:49:00] helpa: krzkrz: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[16:49:11] momomomomo: ACTION doesn???t want to chance a random .co site
[16:49:15] krzkrz: thats imagebin.ca
[16:49:28] momomomomo: neat, I???m not clicking though :/
[16:49:42] krzkrz: k anyone else want to have a go?
[16:51:58] gavit: Devise issue: I have a 'before_action :authenticate_user!' in my controller, but I get a undefined method `authorize' for #<mycontroller>
[16:53:20] krzkrz: momomomomo: yea but i do get your point. ill try doing the query against products
[16:53:42] helpa: gavit: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[16:55:33] krzkrz: so ive got Aisle.includes(:products).references(:products).where('LOWER(products.name) LIKE ?', "%wood%")[0].products. which returns the right amount of products (1) that match the where clause. but the minute i append .count or pluck(:id) it returns 2 products
[16:55:35] krzkrz: i just did
[16:55:53] krzkrz: i am wondering why pluck(:id) returns 2 products instead of 1
[17:00:31] pipework: krzkrz: Is it the same id twice?
[17:04:14] |RicharD|: I've a form with nested resources that I can delete in backbone...there is a easy way(like setting an attribute) ,so that rails delete this nested attribute ?
[17:04:22] |RicharD|: I've read something about :_delete
[17:04:27] krzkrz: pipework: nah two different ids
[17:04:31] |RicharD|: but don't remember well :(
[17:05:07] krzkrz: Aisle.includes(:products).references(:products).where('LOWER(products.name) LIKE ?', "%wood%")[0].products.map { |p| p.id } returns 1 id though
[17:05:18] krzkrz: Aisle.includes(:products).references(:products).where('LOWER(products.name) LIKE ?', "%wood%")[0].products.pluck(:id) returns 2 ids
[17:05:29] pipework: krzkrz: Probably has something to do with the join table.
[17:05:42] krzkrz: yea thats what im guessing
[17:06:57] krzkrz: oh well ill just stick with map for now
[17:07:09] krzkrz: getting late and need to hit the sack
[17:07:15] krzkrz: thanks for the help momomomomo pipework
[17:08:01] gavit: sorry, got disced
[17:08:34] banas: I'm on a friend's app that extensively uses this chart library I have no clue about (amcharts). I just noticed they've released a new version that makes the charts responsive
[17:08:42] banas: currently they're stored in the vendor directory
[17:08:50] banas: the js files I mean
[17:09:18] banas: if I download the new version and just replace the js files in the vendor directory, shouldnt things work?
[17:09:30] pipework: Does the charts library ship the files as an engine, or do you need to revendor the assets>
[17:09:38] banas: (assuming the new js updates dont break the old one)
[17:10:19] banas: pipework: by engine you mean gem, correct?
[17:10:36] banas: i don't see an amchart listed on the gemfle, although i know there exists a slightly old gem
[17:11:00] rikkipitt: has anyone here used "new_polymorphic_path" before? This is adding an ID to the end of the URL as the format param - <%= link_to "Reply", new_polymorphic_path([@commentable, comment]) %>
[17:11:46] pipework: banas: No, I mean engine. A gem can hold anything, an engine is an actual thing.
[17:11:50] pipework: It's probably in a gem though.
[17:12:16] banas: pipework: well, um, I'm not too sure - how should I look?
[17:12:37] banas: it's a hugeass js file in the vendor assets
[17:12:53] banas: there is a reference to it in the application.js
[17:13:25] banas: when I open the relevant view and do page source theres this line <script data-turbolinks-track="false" src="/assets/amcharts.js?body=1"></script>
[17:13:58] |RicharD|: ok what I was looking for, it was
[17:14:09] |RicharD|: allow_destroy: true in accepts_nested_attributes_for
[17:15:30] pipework: banas: You said that there was a new release.
[17:15:58] pipework: I often check rubygems for a gem named similarly to the graph project.
[17:16:16] banas: pipework: I was referring to http://www.amcharts.com/download/, where the relevant thing is the first download
[17:16:28] banas: pipework: I loked for it, the rubygem is older than the release
[17:17:01] pipework: banas: Then either vendor or ping amcharts to update their rubbygem. Might want to peruse the gem though, it might automatically download the latest.
[17:18:02] banas: pipework: pinging them isn't an option, I need to complete this in the next few hours - what exactly do you mean by "vendor", you mean I should replace the js?
[17:19:59] pipework: banas: Yeah. download the files, put them in the vendor directory. Probably where the old one is. It might just work as a drop-in, you might have to add code, delete code, or kill yourself.
[17:20:14] pipework: All depends on what changed and what you need to do to use the new chart library version.
[17:20:28] banas: pipework: that answers it! thanks :)
[17:31:20] savish: I have a rails engine that uses name spaced models to access name spaced tables. I have a second app that would use the same relationships and models, so I want to extract the models from the engine to a gem to use in another app. I have a kore detailed question here http://stackoverflow.com/questions/28370316/how-can-i-move-these-models-to-a-gem, any idea how to achieve this?
[17:57:10] rubyonrails644: anyone knows why fields_for in a nested form would give an missing method name error?
[17:57:53] beauby: rubyonrails644: Could you make a gist?
[17:58:08] rubyonrails644: https://gist.github.com/anonymous/2d3e083ebf4958419205
[17:58:29] pyemkey: Hello RoR community. Can you suggest me what approach is correct. User have one profile which has many addresses, contact_phones, emails. I have something like this https://gist.github.com/pyemkey/d243c2dc64d1786281b9 Anyone can provide his own idea how to design this?
[17:59:17] beauby: pyemkey: why not merge the user and profile models?
[17:59:32] pipework: Why merge them?
[17:59:48] pyemkey: beauby: I want to keep them isolated
[18:01:56] beauby: pipework: because in lots of cases it does not really make sense to distinguish between a user and a user profile, and pyemkey asked for feedback
[18:03:25] pyemkey: beauby: Imagine that user is merged with profile. How would you design contact informations
[18:03:26] beauby: pyemkey: do you usually want to access the profile from the user or the user from the profile?
[18:04:07] beauby: pyemkey: since there seems to be a one-to-one mapping between users and profile, I'm not sure what you would leverage for your contact informations
[18:05:35] pipework: Personally, I'd generally suggest to think a bit about it. There's costs and benefits to both ways.
[18:05:45] pipework: pyemkey: When you say design, what do you mean?
[18:05:56] beauby: pyemkey: Are you sure you don't want to have many profiles per user, each having a single email/address/phone number?
[18:05:56] rubyonrails644: can any one helpme with this? https://gist.github.com/anonymous/2d3e083ebf4958419205 in line 20 im getting undefined method hola, but i'm calling object.name
[18:07:50] beauby: rubyonrails644: I think text_field expects a symbol, and you provided a value
[18:09:57] pyemkey: pipework: By saying design I meant database design. Is it correct what I've prepared inside gist or maybe it's something better. I don't have experience and sometimes can't see something what more experience person can.
[18:10:24] pyemkey: beauby: Yes. I'm sure that profile has many each of them (addresses, phone numbers and emails)
[18:10:40] pipework: pyemkey: The relationships reflect your domain. They're valid relations for a database, if they reflect what you want.
[18:11:37] pipework: A user can only have one profile (I'd think about that), each profile can have many of the other models, and those models belong to the profile, which belongs to the user, you don't have the inverse for profile belonging to a user.
[18:11:51] pipework: Why is an address, email, and phone number separate models?
[18:11:55] pipework: Why can't they be fields of a profile?
[18:13:07] beauby: pyemkey: What I suggested (but I have no clear idea of what you're trying to achieve) was that a user may have several profiles, each one having exactly one address, one phone number and one email.
[18:13:42] beauby: pyemkey: which may or may not make sense in your situation, but without more information, I cannot tell you more than "your code is syntactically and semantically correct"
[18:14:33] beauby: and that you may want to add the ivnerse relationship (profile belongs_to :user)
[18:15:24] pyemkey: beauby: Let's change a one model name from profile to resume. Then should make sense have more than one of each fields.
[18:15:29] pipework: You might want to consider the value of having separate tables for the models that belong to a profile. I don't know what you're planning. I'd almost think it'd be cheaper to have many profiles, and use that as more of a join table.
[18:15:41] pyemkey: beauby: I don't understand inverse relationship
[18:17:06] beauby: pyemkey: In your case, a user has a profile, but a profile belongs to a user as well. If you want to be able to do profile.user, so that, given a profile, you can access the user it belongs to, you need to define the inverse relationship
[18:17:09] pcasaretto: is this a good place to ask Arel related questions?
[18:17:22] bricker: pcasaretto: sure
[18:18:06] pcasaretto: Can Arel???s InsertManager be used to insert multiple tuples in a table?
[18:18:52] pcasaretto: Multiple `insert`s do not seem to work
[18:19:52] pyemkey: beauby: Thank you for explanation, but I still don't understand why I need to do that. I've never used inverse_of before. Is it a rule?
[18:20:17] pyemkey: I could access profile.user without inverse_of and works correctly
[18:20:26] bricker: pcasaretto: yes, you pass an array of arrays to #insert
[18:21:00] beauby: pyemkey: I wasn't talkign about inverse_of here, just about adding belongs_to :user to your Profile model, otherwise you wont be able to access profile.user at all
[18:21:22] beauby: using inverse_of will save you some DB queries
[18:22:00] pyemkey: beauby: aaa ok. Yes I know that I need to use belongs_to for profile ;)
[18:22:15] pipework: belongs_to and inverse_of are pretty useful.
[18:22:48] pipework: pyemkey: So, as long as you really think that you want tables for each of the kinds of items a profile has, I don't see why it'd be a problem.
[18:22:51] pcasaretto: bricker: could you clarify the proper syntax for that
[18:22:53] pipework: That's a lot of joins though.
[18:23:28] pcasaretto: I???ve tried `insert_manager.insert([[leads[:name], ['alice','bob???]]])`
[18:23:41] pcasaretto: `insert_manager.insert([[leads[:name], "Alice", "Bob"]])`
[18:26:31] pyemkey: pipework: You are right, but this is one of the requirements. I don't see other way to create separately address, phone number and email.
[18:27:13] beauby: pyemkey: I'm not saying you don't, just that it is not present in the gist you showed me
[18:28:01] bricker: pcasaretto: I misunderstood, maybe try with a String argument instead
[18:28:03] pipework: pyemkey: Have many profiles
[18:28:18] beauby: pyemkey: How many emails/addresses/phone numbers do you recon a user will have, at most?
[18:28:37] bricker: pcasaretto: or possibly something like [leads[:name], '(Alice,Bob)']
[18:28:47] beauby: pyemkey: in case it is, say < 5, you could just have 5 of each on your Profile model (address1, address2, ...)
[18:29:47] pyemkey: beauby: It was quick write up. I just forgot about belongs_to user :) There is no specific number.
[18:29:58] pcasaretto: bricker: "INSERT INTO \"leads\" (\"name\") VALUES ('(alice,bob)')" :/
[18:31:17] pyemkey: beauby: I can't imagine how profile table will looks after that.
[18:31:42] pyemkey: Each address is separate column inside profile table?
[18:32:14] beauby: pyemkey: yes
[18:34:19] pipework: pyemkey: What I would do is make a Contact table that has phone numbers, addresses, whatever. Then have a profile have many Contacts
[18:34:31] pyemkey: beauby: I read also about STI, but this idea was criticize in web.
[18:35:24] pipework: Egh, you only need STI if your fields all match.
[18:36:21] pyemkey: pipework: I know, but initialy I thought about creating abstract class Address as parent and ResidentalAddress and MailingAddress as a children
[18:37:18] pipework: pyemkey: Ah, yeah you could do that, since the fields would match up proper.
[18:40:54] pcasaretto: bricker: getting Arel to properly format fields based on the column would be useful on its own
[18:41:36] latco: Is it possible to get something like error code from record creation failure? E.g. errors.error_code => 'EmailExists'
[18:43:23] pyemkey: beauby: Thanks that you invest your time to look into my problem.
[18:43:25] pyemkey: pipework: up
[18:43:58] bricker: pcasaretto: I must not understand what you're trying todo
[18:44:58] pcasaretto: bricker: I have a batch of records to insert, I???m constructing the SQL manually but I would rather have Arel do it for me. Or at least help me sanitize/translate
[18:46:39] pipework: Some databases support streaming inserts.
[18:47:17] Scient: you could just use AR escape/quote methods when constructing your SQL statements
[18:47:40] Scient: raw SQL will be much faster than working thru AR for sure, most likely arel as well
[18:49:28] pcasaretto: One thing I???d like arel to do for me is translating arrays to Postgres arrays
[18:49:41] pcasaretto: It can do that when I use InsertManager
[18:49:55] Scient: its not that hard to do manually though
[18:50:02] bricker: pcasaretto: I see. I don't think ARel supports batch inserts, at least I can't find anything on it.
[18:50:05] pcasaretto: nope, just error prone
[18:50:36] pcasaretto: well, if it cant be done
[19:00:54] arup_r: Anybody recently downloaded plural sight videos ?
[19:02:29] Senjai: arup_r: I see you everywhere on the internet now..
[19:02:53] arup_r: Yes,, I can't see them in my browser videos.
[19:03:00] |RicharD|: guys anyone use ror+backbone ? I've done an app that is half with rails and half with backbone
[19:03:15] arup_r: so... It seems what I paid is now lost
[19:03:17] |RicharD|: but not I don't know how I can show a different page if the user is logged or not
[19:03:35] tmatthews0020: im making an application where a user would have an availibility(days of the week and times). would i want to implement this as part of the user model or should i make this it's own model and associate to a user?
[19:03:44] |RicharD|: I want do this: if user is not logged in, I want show a rails page, if user is logged in,
[19:04:05] |RicharD|: I want use backbone routes(sorry guys for the whitespace)
[19:04:06] arup_r: Senjai: I see you too...
[19:04:45] Senjai: |RicharD|: I would presume you'd have to determine that in a rails controller. And redirect accordingly
[19:04:50] Senjai: redirect or render*
[19:05:12] |RicharD|: the problem is that I want always the same base path that is ''
[19:05:48] Senjai: |RicharD|: Then have the controller render two seperate templates for that action? Or in the view, only load routes if current_user is present
[19:06:27] |RicharD|: the problem is that there are the backbone routes too...
[19:06:31] |RicharD|: I can't do how you say
[19:07:51] |RicharD|: ok found the solution :D
[19:10:39] arup_r: Senjai: I cancelled my subscription.. bad sight.. Couldn't see any of the videos... :-(
[19:17:04] |RicharD|: arup_r: railscast ?
[19:17:29] arup_r: |RicharD|: No Pluralsight..
[19:17:35] arup_r: I lost my money :-(
[19:18:12] |RicharD|: a beginner ?
[19:29:17] Senjai: |RicharD|: If I can make a request that you don't have to listen to. Could you change your name to something without |, It's annoying to tab complete when addressing you xD
[19:30:01] pipework: Senjai: get a better client!
[19:30:13] Senjai: Weechat is a fantastic client
[19:30:19] pipework: Get better completion!
[19:30:31] Senjai: IMO | should be banned as an allowable character in nicks :P
[19:30:31] pipework: Be okay with using all your keys!
[19:30:38] Senjai: I use all my keys all the time!
[19:30:48] Senjai: So therefore, If I can save keys, I will be happy
[19:30:57] Senjai: That's just cruel
[19:31:09] |work: Not like you highlight me all that often!
[19:31:14] Senjai: I totally do
[19:31:22] |work: I've had the nick for a while though, the |work one.
[19:32:59] tubbo: hey guys, i'm using pow right now and trying to see if i can nail down an issue i had with it
[19:33:25] tubbo: basically if i change anything in the pre-loaded app code (like in ./app/models/**), i have to restart the server because it doesn't reload the code "in the right order"
[19:33:44] tubbo: i get superclass mismatch errors. a restart of pow seems to fix it, but i'm curious as to what's wrong..
[19:34:00] |RicharD|: I will changes it :)
[19:34:05] |RicharD|: (now I'm busy)
[19:34:24] Senjai: |work: Apparently I'm not innocent: NickServ (NickServ@services.): Nicks : Senjai Senjai|AFK richardcw Senjai`home
[19:34:33] Senjai: but I never use Senjai|AFK
[19:38:00] |RicharD|: btw arup_r speak here, so other people can suggests good books
[19:38:07] |RicharD|: arup_r: here :)
[19:38:29] |RicharD|: arup_r is looking for a good book for tests ...a anyone ?
[19:38:46] arup_r: is it good https://whatdoitest.com/ ?
[19:38:56] |RicharD|: arup_r: what you use ? unit test or rpsec ?
[19:39:28] |RicharD|: lol? you can use both ?
[19:40:11] |work: http://www.amazon.com/xUnit-Test-Patterns-Refactoring-Code/dp/0131495054
[19:40:43] arup_r: ACTION running away
[19:41:34] siemprefresco: I have a Rails app that serving as both a JSON api and administration panel for an ember app. Using devise for authentication. What's the best way to separate out my auth system?
[19:41:58] siemprefresco: I'm using active model serializer to serve the json
[19:44:13] |RicharD|: arup_r: honestly I don't would spend $60
[19:44:19] |RicharD|: for a book...
[19:44:59] |RicharD|: imho is better DO and learn while you do and then read a good book if you need it for improve
[19:45:20] |work: Yeah, but then you end up doing whatever you think up, which might be utter shit.
[19:45:29] |work: Most definitely will, as far as testing goes.
[19:47:16] rhizome: siemprefresco: what's your difficulty?
[19:48:09] rhizome: |work: earlier versions are usually worse than later iterations, not including second-system effect
[19:51:31] siemprefresco: rhizome, the admin panel is run as a web app and the ember app is converted to mobile. Find myself dealing with csrf issues and session conflicts in development. Just think it would be better down the road if I can separate out the auth.
[19:52:28] |work: rhizome: Yeah, but improvement isn't necessarily the most important thing. I can start out whale or I can start out terribly.
[20:08:46] rhizome: i don't know what that means
[20:09:21] rhizome: siemprefresco: so are you asking about csrf? not sure what kind of help you're looking for
[20:11:15] tubbo: siemprefresco: why do you think separating out the auth will help in this case?
[20:11:43] tubbo: the last time i tried using devise with ember i ended up just letting devise handle all authentication (e.g., rendering the pages from rails)
[20:12:04] tubbo: because devise (warden) writes to the session, and ember can read the session (even on iOS iirc), you should be good to go
[20:30:33] siemprefresco: rhizome, no I'm not asking about csrf
[20:32:42] siemprefresco: tubbo, separation of concerns in terms of access to API vs access to administration? Might not be worth it. It was a general question on how one would deal with this.
[20:33:17] rhizome: it's all auth though, isn't it?
[20:34:32] siemprefresco: rhizome, you are correct
[20:35:45] siemprefresco: was looking for input on something like this: https://github.com/kolorahl/warden-doorkeeper
[20:37:00] andhof-mt: If I where to use some open source software in my app (creative commons), and than sell the app would that be legal?
[20:37:06] andhof-mt: Using open source calendar in it
[20:40:32] tubbo: andhof-mt: depends on what the license says
[20:43:49] tubbo: andhof-mt: for example, MIT says you don't need to let anyone know the software inside is open source...GPL says you have to at least tell everyone who downloads the software that it uses some open-source components, and provide links to the licenses
[20:43:54] tubbo: basically, "give credit where credit is due"
[20:44:07] tubbo: but MIT is like "yeah we don't care just don't get mad at us if it breaks"
[20:46:10] andhof-mt: I'll probably try to find an MIT calendar than.
[20:46:20] andhof-mt: rolling your own calendar app is actually really hard.
[20:47:47] bl4ckdu5t: Why do I get a error when I have the sass-rails gem and I used image-url in my scss file
[20:48:13] bl4ckdu5t: Invalid CSS after "...5)), image-url(": expected ")", was "../images/aura...."
[20:48:20] bl4ckdu5t: was what I got
[20:49:54] andhof-mt: please post it on a GIST with the whole source than link
[20:50:31] bl4ckdu5t: in my last project I had to use .scss.erb files for such situations. Someone said I could do it with a .scss file
[20:50:41] bl4ckdu5t: andhof-mt: me?
[20:50:57] andhof-mt: and you want .scss
[20:51:18] bl4ckdu5t: I'm on a .scss file
[20:52:34] bl4ckdu5t: Here https://gist.github.com/bl4ckdu5t/7433dc30699b3fc9a454
[20:53:38] bl4ckdu5t: Thought it is too small to require a gist but there it is
[20:55:53] tubbo: bl4ckdu5t: "Thought it is too small to require a gist but there it is" >>> this is never, ever the case.
[20:55:57] tubbo: nothing is too small for a gist.
[20:56:28] tubbo: bl4ckdu5t: try surrounding '../images/..' in quotes
[20:56:36] tubbo: also you shouldn't need ../images
[20:56:44] bl4ckdu5t: ok tubbo. Correction taken
[20:56:49] tubbo: just image-url('aura.jpg') should be ok...it's analogous to image_path('aura.jpg') in ruby
[20:57:16] bl4ckdu5t: and it works that way
[21:00:39] andhof-mt: hey do any of you have the link for the source code for multitenancy with rails
[21:00:45] andhof-mt: lost the link
[21:13:30] andhof-mt: in this database relationship
[21:13:31] andhof-mt: has_many_favorites, :through => :recipes
[21:13:34] andhof-mt: what does :through mean?
[21:20:25] rhizome: it indicates a join model. you need a tutorial.
[21:20:43] rhizome: sorry if that's harsh :)
[21:40:55] rikkipitt: hey guys, would STI be a good way of creating a Menu model with ancestry? I.e. to create separate menus like top/footer/side bar etc
[21:43:51] |work: Why do you need models for your menus?
[21:44:09] tubbo: rikkipitt: check out awesome_nested_set
[21:44:27] tubbo: if you ever need to make anything with ancestry :P
[21:46:27] wiggl3: i love awesome_nested_set
[21:46:45] wiggl3: big ups to parndt
[21:47:25] rikkipitt: tubbo i'll take a look!
[21:48:09] rhizome: closure_tree is also good
[21:50:39] safetypin: how do i order the results of a has_many relationship call? i.e. if node has_many comments, and I collect the comments with @node.comments, how do I order the results?
[21:50:56] rikkipitt: rhizome cheers
[21:51:21] |work: probably with order
[21:51:24] rhizome: safetypin: .order(...)
[21:51:32] |work: Fancy that!
[21:51:44] rikkipitt: does closure_tree and awesome_nested_set allow for multiple nested lists within the same model type?
[21:51:54] |work: rikkipitt: Read the professional level documentation.
[21:52:06] rikkipitt: |work, thanks, will do!
[21:52:26] safetypin: professional level documentation?
[21:52:54] rikkipitt: professional level documentation, good point... can't see that in the wiki
[21:52:57] safetypin: where is that? i???m using closure tree, and I didn???t see anything about special documentation on the github page..
[21:53:01] rikkipitt: which gem are you referring to?
[21:54:37] safetypin: |work: this page (https://github.com/mceachen/closure_tree) doesn???t say anything about additional documentation. can you link me to the ???professional level documentation??? that you mentioned?
[21:55:02] |work: safetypin: Source code is professional level documentation.
[22:03:04] rhizome: safetypin: what do you mean by "multiple nested lists within the same model type?"
[22:03:05] s2013: anyone here uses docker?
[22:03:14] rhizome: ask your real question
[22:03:22] s2013: anyone here uses docker?
[22:03:30] |work: s2013: !use
[22:03:32] |work: s2013: !used
[22:03:36] |work: fucking bot.
[22:03:38] s2013: im familiar with all the !s
[22:03:40] |work: s2013: Try ##docker
[22:03:45] s2013: i dont have any questions on docker
[22:03:45] |work: Err, #docker, whicever.
[22:03:49] s2013: i just want to ask if anyone uses it
[22:03:52] s2013: thats all
[22:03:59] |work: I assume that all of #docker does.
[22:04:08] s2013: but i want to ask people in this channel
[22:04:10] s2013: is that an issue?
[22:04:13] rhizome: nobody uses it, that's why you've heard of it
[22:04:23] |work: Also, I'd be impressed if you knew all the !s, since theres a fuckload.
[22:04:29] s2013: ive been here long enough
[22:04:38] helpa: Just the tips: http://logs.ryanbigg.com/tips
[22:04:58] pipework: I'd be extremely impressed then.
[22:05:02] s2013: be impressed
[22:05:08] savish: I hate people
[22:05:11] s2013: why Savish
[22:05:26] savish: people are just evil
[22:05:31] s2013: which people
[22:06:41] rikkipitt: rhizome: RE - what do you mean by "multiple nested lists within the same model type?" that was my question
[22:07:00] rikkipitt: and what I meant was, if I have a Menu model and want a footer and top menu
[22:07:14] s2013: speaking of hate.. dont you hate when you have to be somewhere until certain time but your parking meter expires like 30 minutes before
[22:07:57] rikkipitt: what's the best way to separate the 2 menus and retrieve them?
[22:08:11] rikkipitt: by name for example...
[22:08:34] s2013: what do you mean ?
[22:09:09] rhizome: rikkipitt: you'd just make the root node the menu name/type
[22:09:49] rikkipitt: rhizome: my only concern is I'm trying to think of a foolproof way to do it in a CMS like rails_admin
[22:10:07] rhizome: i don't know what that means
[22:10:23] tubbo: Savish: wow, you met all 7 billion people? that's incredible! ;)
[22:10:34] s2013: sup tubbo
[22:10:36] agent_white: That's a lot of handshakes!
[22:10:41] s2013: hows it going
[22:10:49] rhizome: the word "synecdoche" comes to mind
[22:10:50] tubbo: chillin, just got a new job
[22:10:53] rikkipitt: rhizome: hard to explain, but in a CMS environment
[22:10:57] tubbo: it's way better than my last job
[22:11:08] rhizome: i bet you miss rails 2
[22:11:23] tubbo: rhizome: lol
[22:11:26] tubbo: that's a good one
[22:11:38] savish: tubbo, almost as incredible as your sarcasm :D
[22:11:42] tubbo: Savish: <3
[22:11:50] safetypin: rhizome: that wasn???t my question, it was asked by rikkipitt
[22:11:50] s2013: woah. where?
[22:11:54] savish: bestie for life ............... gets a gun
[22:12:07] rikkipitt: safetypin: cheers
[22:12:10] safetypin: oh .. already corrected
[22:12:24] savish: wasn't there a rails talk on extracting models to a gem?
[22:12:30] tubbo: s2013: http://weblinc.com
[22:12:37] tubbo: we're hiring like wo
[22:12:57] s2013: where are yall based
[22:13:10] s2013: rails shop?
[22:14:47] savish: I cannot find this talk
[22:15:56] s2013: im hoping to be hiring soon i hope
[22:19:15] TheNet: could a minor theoretically bring down an open source project by contributing a significant amount of code, then withdrawing permission for it's use?
[22:20:30] savish: but you could fork the project after the contribution OR veto the large commit
[22:21:03] savish: you could also just remove the commit if the commuter goes that route.
[22:21:09] s2013: or you could find that minor and beat his ass
[22:21:36] s2013: if someones bugging you TheNet tell us and we will find every child thats bugging you and make them suffer
[22:21:49] TheNet: the code might be vital to the program once the minor decides to withdraw permission
[22:22:28] TheNet: s2013: nah, just looking into CLAs and there seems to be a pretty major oversight
[22:22:33] EminenceHC: s2013: That made me laugh pretty hard.
[22:22:41] TheNet: not that there's anything we can do about that
[22:23:26] s2013: EminenceHC, im glad
[22:23:31] agent_white: I don't think you can contribute code to an open source project, then "withdrawal" that code.
[22:23:40] TheNet: agent_white: yes you can
[22:23:44] agent_white: TheNet: How so?
[22:24:04] TheNet: agent_white: witness bukkit from minecraft (google it)
[22:24:13] agent_white: What about bukkit?
[22:24:15] TheNet: "bukkit dmca"
[22:24:44] TheNet: it was a huge open source project for running minecraft servers, one of the old contributors got upset at the community and shot it down
[22:24:59] TheNet: (at least it was originally open source I think)
[22:25:26] agent_white: TheNet: See I was about to say, is it entirely depends on the license of the project.
[22:25:33] TheNet: agent_white: anyways, that's pretty much the point of having a CLA, right?
[22:25:48] TheNet: agent_white: other than making sure the contributors code is their own
[22:26:19] TheNet: contributors license agreement
[22:26:59] agent_white: TheNet: Ahhh. Yeah looks like bukkit was under GPL3 heh
[22:27:00] TheNet: agent_white: https://www.clahub.com
[22:30:21] savish: Can some one tell me why s.add_dependency 'core_models', '0.0.1-pre-alpha-1a', :git => 'git@github.com:AdamKyle/core_models.git', :tag => '0.0.1-pre-alpha-1a' is giving me issues? You can see the full gist here https://gist.github.com/AdamKyle/0f03a0d7b29da7cbb72e
[22:31:11] capin: Savish: did you solve your rspec test problem from yesterday?
[22:31:39] capin: i checked the SO thread, and it looks like you weren't putting the token in the header(s)
[22:31:59] safetypin: is there a gem that will do something like how forums mark threads as read or unread?
[22:32:47] agent_white: TheNet: Sounds like the bukkit issue was because it was non-gpl code combined with gpl code, so that gave the dude the right to pull his code.
[22:32:49] TheNet: safetypin: for logged in users or for anyone?
[22:32:56] safetypin: authenticated users
[22:33:45] frankson: hey yall. does content_for not work with partials?
[22:33:47] TheNet: agent_white: ah ok. I'm sure a contributor could theoretically legally withdraw their permission for their commits (assuming no contract is in place)
[22:35:18] TheNet: safetypin: this might help you https://github.com/ledermann/unread
[22:36:08] agent_white: Yeah I wonder... I'd hope there'd be safeguards against it :P
[22:36:20] safetypin: TheNet: that certainly looks promising..
[22:37:56] savish: capin, yup.
[22:38:27] savish: has any one had a chance to look at my gist, am I calling the repository wrong? this works in regular gem files, is there something special about gem specs?
[22:38:32] savish: or tag names?
[22:39:46] capin: Savish: why didn't you accept the answer on SO?
[22:43:02] savish: I forgot about it until now honestly, ill do that in a sec I'm trying to fix this issue with gem specs not working properly
[22:50:38] waltz: hey all, i have a problem where my spec thinks a database table is missing
[22:51:03] waltz: i get pg:undefinedtable after doing a `rake db:reset`
[22:52:01] waltz: but when i do `rails dbconsole` and inspect the table; it's there
[22:52:29] capin: waltz: are your specs setup for your dev environment?
[22:52:58] waltz: capin: i'm not sure what you mean?
[22:53:32] capin: waltz: i think you need a test DB specified in your database.yml file ;)
[22:53:47] capin: then you need to run your migrations on your test DB
[22:54:28] waltz: capin: oh yeah! i've got that covered, but good call. i did `rake db:reset RAILS_ENV=test` before running my spec
[22:54:31] capin: generally there's three DB's setup in a database.yml file, 1)dev 2)test 3)prod
[23:00:07] savish: posted a better question here http://stackoverflow.com/questions/28376280/bundle-not-liking-the-way-im-trying-to-install-a-gem and yes capin I did accept the last answer just now. hurray for internet points.
[23:04:18] frankson: okay refining my question: is there a way to get a content_for block in a partial to yield in the layout? I've discovered i can yield to my view fine but due to the order in which stuff gets rendered
[23:04:36] frankson: it wont make it to the layout
[23:05:39] hephaestus_rg: what are your favorite tools for optimizing view draw speed?
[23:05:49] hephaestus_rg: or at least figuring out what's slow
[23:06:06] hephaestus_rg: i'd like to be able to show a lot of data on a page, but i want to make it load faster