« Back to channel list

#RubyOnRails - 26 August 2015

« Back 1 day Forward 1 day »
[00:00:19] Radar: lol turbolinks
[00:00:40] Radar: Best to remove it completely from your apps.
[00:00:43] Radar: Causes more trouble than its worth.
[00:00:59] framling: has joined #RubyOnRails
[00:01:25] johnflux_: For find_by how do I specify the order?
[00:01:45] Radar: johnflux_: Model.order("[field] [order]").find_by(field: value)
[00:03:03] johnflux_: so: page = Page.order(:order).find_by!(project_id: params[:project_id], parent_page: nil)
[00:03:08] johnflux_: like this? it seems to work
[00:03:54] charliesome: has joined #RubyOnRails
[00:06:28] fighella: has joined #RubyOnRails
[00:09:01] axsuul_: has joined #RubyOnRails
[00:09:56] chipotle: has joined #RubyOnRails
[00:11:20] christiandsg: has joined #RubyOnRails
[00:15:29] jholm: has joined #RubyOnRails
[00:16:23] Ropeney: has joined #RubyOnRails
[00:18:08] zz_denym_: has joined #RubyOnRails
[00:18:35] weaksauce: is there a way to run the rails dev server to serve requests on the local network
[00:19:24] fryguy: weaksauce: what ip/subnet do you want to serve
[00:19:45] weaksauce: 192.168.0.x fryguy
[00:20:12] fryguy: weaksauce: and what is the IP of the machine that's your server
[00:20:44] fryguy: rails s -b
[00:22:00] yfeldblum: has joined #RubyOnRails
[00:22:29] baweaver: has joined #RubyOnRails
[00:22:54] rodfersou: has joined #RubyOnRails
[00:24:23] yaymukund: has joined #RubyOnRails
[00:24:32] johnflux_: what's the difference between :foo => 'bar' and foo: 'bar'
[00:24:52] fryguy: johnflux_: nothing
[00:24:55] annlewis: has joined #RubyOnRails
[00:24:58] tubbo: johnflux_: one has an arrow in it
[00:25:07] johnflux_: fryguy: thanks
[00:25:12] johnflux_: tubbo: not thanks
[00:25:19] weaksauce: johnflux_ less typing, the second one doesn't work on old ruby version
[00:25:37] tubbo: ^ this is also true
[00:25:45] tubbo: pre 1.9 in fact
[00:26:15] johnflux_: if i have <a href="localhost:3000/1/view/2#3"> and I'm already on localhost:3000/1/view/2
[00:26:20] johnflux_: will it reload the page?
[00:26:26] bricker: johnflux_: no
[00:26:35] bricker: johnflux_: the answer is yes
[00:26:59] johnflux_: so when I use link_to, I need to find out the current page, and try to be clever about whether I set the url to "#3" or the full url, right?
[00:27:04] johnflux_: (it's for a navigation bar)
[00:27:17] roolo: has joined #RubyOnRails
[00:27:26] bricker: johnflux_: you're trying to avoid unnecesary page reload?
[00:28:18] bricker: johnflux_: yeah you'll need to check the current path with some logic.
[00:29:36] johnflux_: does ruby support a?b:c ?
[00:30:12] RegulationD: has joined #RubyOnRails
[00:30:39] eristic: has left #RubyOnRails: ()
[00:30:44] johnflux_: ah (a)?b:c works
[00:31:54] a1fa: is there a way in activerecord, to tell model, that it should always have specific field in table set to a value?
[00:32:06] a1fa: ie: damage_id is always 5
[00:32:21] bricker: you can set column defaults in your migration
[00:32:24] a1fa: so i dont have to do .where(damage_id :5)
[00:33:21] iateadonut: has joined #RubyOnRails
[00:33:40] n00bDev: has joined #RubyOnRails
[00:34:23] a1fa: bricker: is that the only place?
[00:34:56] n00bDev: anyone here familiar with using devise?
[00:34:57] bricker: a1fa: er... you changed the question after I answered
[00:35:05] bricker: a1fa: you're looking for a default scope
[00:35:12] bricker: n00bdev: lots of people
[00:35:20] a1fa: yeah, default scope
[00:35:23] a1fa: i can google it now :)
[00:35:27] a1fa: didnt know what you would call it
[00:35:30] baweaver: has joined #RubyOnRails
[00:35:41] givanse_: has joined #RubyOnRails
[00:37:41] n00bDev: bricker: the app currently im working on uses devise for registration, no problem. however, im working on a custom backend portal for admins and in that situation the admin will create the user. I was told to use devise_invitable to send the email for the user to create a password. I'm having a little trouble implementing it since devise_invitable is interferring with existing users who are trying to log in
[00:37:42] bricker: who wrote an article about the dangers of default_scope, was that you baweaver ?
[00:38:05] baweaver: ah, you're going to make me reauth
[00:38:11] baweaver: ACTION needs to ghost.
[00:38:24] NBarnes: has joined #RubyOnRails
[00:38:26] baweaver: no, only about methods to deal with a ton of scopes
[00:38:30] n00bDev: does it make sense to use devise_invitable in that situation or just send a custom reset email template?
[00:38:37] bricker: baweaver: musta been another B-
[00:38:39] baweaver: but default scope is dangerous
[00:38:47] bricker: or pontiki maybe?
[00:38:52] bricker: anyways it was a good article
[00:38:56] bricker: !default_scope
[00:38:56] helpa: http://www.innovationontherun.com/activerecord-default_scope-is-an-anti-pattern/
[00:39:14] baweaver: Anything that can possibly be missed in a default search is dangerous
[00:39:48] bricker: maybe tubbo wrote it
[00:39:50] bricker: I think it was tubbo
[00:39:54] bricker: !defaultscope
[00:39:55] helpa: http://www.innovationontherun.com/activerecord-default_scope-is-an-anti-pattern/
[00:42:37] allcentury: has joined #RubyOnRails
[00:43:01] baweaver: bricker: You know if AR has magical multiple self inner join features?
[00:44:17] baweaver: such that you'd: Post.joins(:tags).where(tags: {name: %w(ruby rails javascript)}) except it means it has _all_ of those tags
[00:44:23] baweaver: not just an inclusion
[00:44:28] bricker: no idea I stay away from that shizzzzz
[00:44:43] baweaver: The only way I know of is inner joining repeatedly on self
[00:44:52] baweaver: just trying to find a better way of that one.
[00:45:06] bricker: baweaver: you can probably concat the tags
[00:45:07] baweaver: It's common in SQL at least, just poking around for a nicer AR way to do it.
[00:45:31] baweaver: except they're a separate model entity.
[00:45:38] bricker: in pseudo SQL: `select concat(tags.name) as tag_names` ... seems reasonable
[00:46:17] baweaver: except in the actual case it's amazon instance tags which are key value pairs with other metadata that means it got a database table.
[00:46:36] bricker: yeah it's complex
[00:47:08] bricker: I use Elastic for complex queries like that (I fully realize this does you no good)
[00:47:23] baweaver: so it'd be something like SELECT * FROM amazon_instances WHERE t1.key = environment AND t1.value = production AND t2.key = application AND t2.value = foobar
[00:47:35] baweaver: where you have the inner joins to generate t1 and t2 that I don't want to write.
[00:48:04] bricker: even if you get it that's gonna be a slow-ass query :D sorry I'll stop I'm being rude now
[00:48:14] baweaver: Ha, it's fine
[00:48:24] lele: has joined #RubyOnRails
[00:48:25] baweaver: It's kinda a confounded way to make it in the first place....
[00:48:42] baweaver: but you play with the cards you're dealt I suppose.
[00:49:25] bricker: gotta jet good luck
[00:49:29] JoshuaPaling: has joined #RubyOnRails
[00:51:06] annlewis: has joined #RubyOnRails
[00:52:58] seank_: has joined #RubyOnRails
[00:53:32] ellisTAA: has joined #RubyOnRails
[00:54:10] chipotle: has joined #RubyOnRails
[00:54:23] sevenseacat: has joined #RubyOnRails
[00:55:00] pontiki: i haven't written anything on default_scope. only thing i've got is a linkylink to justin weiss's article on preloading scopes
[00:57:06] maz-dev: has joined #RubyOnRails
[00:57:52] NBarnes: has joined #RubyOnRails
[00:57:58] jesterfraud: has joined #RubyOnRails
[00:58:00] jeadre: has joined #RubyOnRails
[00:59:00] choke: has joined #RubyOnRails
[01:02:53] joshkovach: has joined #RubyOnRails
[01:03:34] Creeves: has joined #RubyOnRails
[01:03:58] givanse: has joined #RubyOnRails
[01:08:34] LambdaSource: has joined #RubyOnRails
[01:08:49] Askar: has joined #RubyOnRails
[01:09:22] ashleyw: has joined #RubyOnRails
[01:10:01] Axsuul: has joined #RubyOnRails
[01:12:02] hardtail: has joined #RubyOnRails
[01:12:04] iceyec_: has joined #RubyOnRails
[01:12:44] Kallis: has joined #RubyOnRails
[01:15:37] askar75: has joined #RubyOnRails
[01:20:15] unreal_: has joined #RubyOnRails
[01:20:22] ledestin: has joined #RubyOnRails
[01:21:17] askar75: has joined #RubyOnRails
[01:21:33] smathy: has joined #RubyOnRails
[01:23:19] manfrin`laptop: has joined #RubyOnRails
[01:23:39] arooni-mobile: has joined #RubyOnRails
[01:26:25] jher: has joined #RubyOnRails
[01:27:13] nettoweb: has joined #RubyOnRails
[01:32:26] i: has joined #RubyOnRails
[01:34:12] bronson: has joined #RubyOnRails
[01:35:08] Axilla: has joined #RubyOnRails
[01:35:45] n00bDev: is there a way for a controller to inheirit multiple controllers?
[01:35:51] n00bDev: im trying to do something like this
[01:35:52] n00bDev: https://gist.github.com/gwong89/341db143c0014c07aa30
[01:39:13] helpa: has joined #RubyOnRails
[01:39:36] helpa: has joined #RubyOnRails
[01:39:44] Radar: !botsnack
[01:39:44] helpa: Nom nom. Thanks, Radar!
[01:40:43] hotpancakes: has joined #RubyOnRails
[01:42:09] drale2k: has joined #RubyOnRails
[01:50:47] Ropeney: Radar you've been playing with elasticsearch alot, do you use cancan with it?
[01:51:25] Radar: Ropeney: I don't use CanCan with it at all.
[01:51:38] Radar: Ropeney: You can probably use a filter on ES to get a similar kind of feature though
[01:51:43] Radar: Depends on how complex your CanCan rules are
[01:52:32] Ropeney: yeah fair enough, was just looking at it and first thought was having to reload the objects from the db to get it to work
[01:53:50] j_mcnally: has joined #RubyOnRails
[01:55:18] hahuang65: has joined #RubyOnRails
[01:55:55] n1lo: has joined #RubyOnRails
[01:56:00] michael_mbp: has joined #RubyOnRails
[01:57:45] dopamean_: has joined #RubyOnRails
[01:58:09] Creeves: has joined #RubyOnRails
[01:58:35] IrishGringo: has joined #RubyOnRails
[01:59:24] charliesome: has joined #RubyOnRails
[01:59:41] yatish27: has joined #RubyOnRails
[01:59:48] quazimodo: has joined #RubyOnRails
[02:01:57] hahuang65: has joined #RubyOnRails
[02:03:52] jholm: has joined #RubyOnRails
[02:09:36] seank_: has joined #RubyOnRails
[02:09:56] one_zero: has joined #RubyOnRails
[02:12:58] hotpancakes: Quick question. When a signed cookie is saved by rails (cookies.signed[:foo] = bar), why is it necessary to read the cookie with the signed method?
[02:13:22] arooni-mobile: has joined #RubyOnRails
[02:13:48] hotpancakes: e.g. cookies.signed[:foo] works, while cookies[:foo] doesn't seem to.
[02:13:51] arooni-mobile: has joined #RubyOnRails
[02:15:23] roolo: has joined #RubyOnRails
[02:15:54] jher: n00bdev, if you're inheriting from multiple controllers, then you're doing something wrong. Try DRYing it up into one controller and inheriting from that.
[02:15:55] christiandsg: has joined #RubyOnRails
[02:18:11] jonee: has joined #RubyOnRails
[02:18:44] salexa: has joined #RubyOnRails
[02:22:44] n1lo: has joined #RubyOnRails
[02:25:22] salexa: has left #RubyOnRails: ()
[02:27:38] Creeves: has joined #RubyOnRails
[02:32:11] RegulationD: has joined #RubyOnRails
[02:32:21] jackdesert: has joined #RubyOnRails
[02:33:04] jackdesert: Anybody here from Portland, Oregon?
[02:35:06] sdwrage: has joined #RubyOnRails
[02:36:19] sudiptamondal: has joined #RubyOnRails
[02:36:58] mheld: has joined #RubyOnRails
[02:42:25] idd2d: has joined #RubyOnRails
[02:47:28] jonee: has joined #RubyOnRails
[02:47:43] hotpanca_: has joined #RubyOnRails
[02:48:00] jeadre: has joined #RubyOnRails
[02:53:17] sacarlson: has joined #RubyOnRails
[02:53:25] patrick_star: has joined #RubyOnRails
[02:53:41] baweaver: has joined #RubyOnRails
[02:54:01] decuser: has left #RubyOnRails: ()
[02:54:10] quazimodo: has joined #RubyOnRails
[02:54:12] hotpancakes: has joined #RubyOnRails
[02:55:09] Stuffness: has joined #RubyOnRails
[02:55:57] dideler: has joined #RubyOnRails
[02:58:39] hotpanca_: has joined #RubyOnRails
[02:59:10] northfurr: has joined #RubyOnRails
[02:59:13] smathy: has joined #RubyOnRails
[03:02:17] beauby: has joined #RubyOnRails
[03:02:30] ellisTAA: has joined #RubyOnRails
[03:04:17] krz: has joined #RubyOnRails
[03:04:27] hotpancakes: has joined #RubyOnRails
[03:05:17] sacarlson: /home/sacarlson/.rbenv/versions/1.9.3-p484/bin/ruby: symbol lookup error: /home/sacarlson/.bundle/gems/json-1.8.3/lib/json/ext/parser.so: undefined symbol: rb_str_new_static
[03:05:49] sevenseacat: sacarlson: have you just updated your ruby?
[03:05:59] sacarlson: seems there is some kind of conflict when I change ruby version in rbenv
[03:06:33] northfurr_: has joined #RubyOnRails
[03:06:46] arooni-mobile: has joined #RubyOnRails
[03:06:51] sacarlson: I kind of downgraded I had a problem with 2.2.1 yestarday had to delete all ./bundle now today I go back to another app that requires 1.9.1 and I get this again
[03:06:54] Guest19679: has joined #RubyOnRails
[03:06:55] fryguy: yah, you might not want to use bundle install --deployment when using rbenv
[03:07:02] sacarlson: or at least the same gem gson
[03:07:04] givanse_: has joined #RubyOnRails
[03:07:31] sacarlson: I just used bundle install
[03:07:37] sevenseacat: you may need to run a `gem pristine`. other than that, if you've just been randomly deleting stuff, good luck to you
[03:08:15] sacarlson: oh it was on more than one it also failed on ffi I ran pristine on that and must have fixed it
[03:08:53] sacarlson: so I have to also run pristine on json but I guess I will have the same problem when I return to 2.2.1 again so will again have to do each time
[03:09:15] sevenseacat: if theyre using the same installation folder (which they really shouldnt be), then probably
[03:09:38] _3dwardsharp: has joined #RubyOnRails
[03:10:09] quazimodo: capistrano's doing something uber weird
[03:10:13] sacarlson: so I can set a different bundler gem dir for each version as it seems they must share some gems
[03:10:19] sevenseacat: quazimodo: you've been warned about using 'guys'
[03:10:33] sevenseacat: sacarlson: if you're needing to do that, you're doing something fishy
[03:10:51] quazimodo: sevenseacat: have I, what's wrong with guys?
[03:11:03] helpa: We're not all guys here - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[03:11:13] sacarlson: when I google I see others with similar problems and they fix the same way as me with delete all gems
[03:11:35] quazimodo: wow that's some potent word replacementism
[03:12:03] braincrash: has joined #RubyOnRails
[03:12:49] sevenseacat: they're suggestions. do you have better ones we should add instead?
[03:13:01] quazimodo: don't have the thinnest skin on earth?
[03:13:18] sevenseacat: I guess that's a no
[03:13:25] sevenseacat: you just want to argue
[03:13:47] quazimodo: i've never been told saying 'guys' is offensive... it blows my mind
[03:13:57] sevenseacat: its not 'offensive'. its exclusionary.
[03:14:24] quazimodo: moving along
[03:14:58] sacarlson: wow new problem with Restoring gems to pristine condition...
[03:14:58] sacarlson: Cached gem for json-1.5.5 not found, attempting to fetch...
[03:14:58] sacarlson: Fetching: json-1.5.5.gem (100%)
[03:14:58] sacarlson: ERROR: While executing gem ... (Gem::Exception)
[03:14:58] sacarlson: Cannot load gem at [/home/sacarlson/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/cache/json-1.5.5.gem] in /home/sacarlson/github/stellar/stellar_utility
[03:15:23] quazimodo: https://gist.github.com/siassaj/2c55962f62ada0f0ef4b
[03:15:33] quazimodo: capistrano is doing some super odd stuff
[03:15:45] quazimodo: my ssh forwarding works, verified and its all good
[03:15:50] notori0us: has joined #RubyOnRails
[03:16:26] quazimodo: i can ssh in, useforwarding to hit up github, and the deploy file configs are pretty much a mirror of another project running on a server configured the same way
[03:16:34] SirFunk_: has left #RubyOnRails: ()
[03:16:38] sacarlson: I might be using this pristine wrong with rbenv I think
[03:16:45] quazimodo: it asks for password, and when suppled with the password it still doesn't work
[03:16:53] sevenseacat: sacarlson: #rbenv might be able to help you
[03:17:07] sacarlson: good idea sevenseacat
[03:17:11] Maletor: has joined #RubyOnRails
[03:17:53] quazimodo: doesn't even say who @xxx.xxx.xxx.xxx
[03:18:12] sudiptamondal: has joined #RubyOnRails
[03:18:46] christiandsg: has joined #RubyOnRails
[03:21:26] annlewis: has joined #RubyOnRails
[03:24:41] Radar: wait, people still use rbenv?
[03:24:59] Radar: There are people out there who have read my guide and NOT seen the One True Light?
[03:25:10] LambdaSource: has joined #RubyOnRails
[03:25:42] rushed: has joined #RubyOnRails
[03:26:34] chouhoulis: has joined #RubyOnRails
[03:28:37] nettoweb: has joined #RubyOnRails
[03:29:05] sevenseacat: Radar: you might be interested in https://twitter.com/eMalaGupta/status/636363165849255936
[03:29:05] chouhoulis: has joined #RubyOnRails
[03:31:24] Radar: ACTION finds a dog quickly to see if cat will get on with it
[03:31:30] Radar: ACTION looks out window, sees pigs taking to the skies in droves
[03:31:38] Radar: ACTION touches ground, it's frozen
[03:31:45] Radar: (because Hell has frozen over, geddit?)
[03:31:52] sevenseacat: i see what you did there
[03:32:17] Radar: About fucking time.
[03:32:20] Radar: It only took them 5 years.
[03:32:23] Radar: At least.
[03:33:00] Radar: Maybe Marjan (head guy at Manning) died and they actually were able to change things.
[03:34:11] Radar: ACTION checks cart
[03:34:25] Radar: Damn, still Yahoo.
[03:36:07] Radar: Well, it's a damn sight much better than what it USED to be. Thanks sevenseacat.
[03:40:35] diegoviola: has joined #RubyOnRails
[03:43:17] ellisTAA: has joined #RubyOnRails
[03:45:55] nya: has joined #RubyOnRails
[03:46:27] petricore: has joined #RubyOnRails
[03:49:09] chipotle: has joined #RubyOnRails
[03:49:58] ecnalyr: has joined #RubyOnRails
[03:50:25] rmoriz: has joined #RubyOnRails
[03:52:21] jholm: has joined #RubyOnRails
[03:53:40] frzn: has joined #RubyOnRails
[03:57:18] gamov: has joined #RubyOnRails
[04:00:55] Lightsword: has joined #RubyOnRails
[04:01:20] hotpancakes: has joined #RubyOnRails
[04:02:47] strcmp2: has joined #RubyOnRails
[04:03:46] roolo: has joined #RubyOnRails
[04:05:27] hotpancakes: has joined #RubyOnRails
[04:05:50] gamov: hi guys. I'm struggling with this: I have a scope (Shipment.departed). I would like to get the where_sql of it BUT I need to alias the table name first. I tried:
[04:05:51] gamov: sm = Shipment.departed.arel; sm.ast.cores.last.froms.alias('my alias') but when I invoke sm.where_sql the alias is not used (if I look in sm.ast.cores.last.froms, I see my alias in the object???) Anybody knows arel well? Thanks in advance
[04:06:10] Radar: gamov: You're explaining the solution you've come up with but not the problem.
[04:06:15] max_Q: has joined #RubyOnRails
[04:06:21] Radar: Why do you want the where_sql?
[04:08:25] quazimodo: anchor has put rvm in /usr/local :/
[04:08:37] gamov: Radar: I need it in a subquery and I don't want to duplicate the code of the scope (in case it changes and we forget to update the manual SQL query)
[04:08:56] jenrzzz: has joined #RubyOnRails
[04:10:20] seank_: has joined #RubyOnRails
[04:10:42] gamov: Radar: my problem is that in my SQL subquery, I use an alias for the table the scope is on so I need to alias the table in the where
[04:10:52] Radar: I don't know how to do that, sorr.y
[04:11:18] gamov: Radar: thx anyway!
[04:11:22] chipotle: has joined #RubyOnRails
[04:11:32] chipotle: why would you want to use a managed sql service from google cloud rather than instlal sql on its server that you have root access to?
[04:11:33] gamov: Digging in arel is a bit scary...
[04:12:12] rhizome: chipotle: paying a sysadmin
[04:12:39] chipotle: i don't get it? i've run drupal sites in the past and i just build a ubuntu server with mysql and do some optimization to it and i'm done
[04:12:45] chipotle: is it different when building ror apps?
[04:13:15] rhizome: no, but mysql needs to be updated from time to time
[04:13:44] chipotle: that's true
[04:13:50] chipotle: apt-get update
[04:14:01] chipotle: it isn't cheap. a 1gb mysql server is like $80/month
[04:14:07] chipotle: so it covers updates? i don't get it?
[04:14:31] sevenseacat: chipotle: you're not a sysadmin are you
[04:14:35] rhizome: it probably depends on the customer, but you know the old joke about the plumber and the knocking on the pipe?
[04:14:50] chipotle: sevenseacat: i can build servers on vps's if that makes me a sysadmin?
[04:15:02] sevenseacat: when your mysql server falls over, are you going to figure out why?
[04:15:07] rhizome: it makes you a junior at least
[04:15:07] sevenseacat: chipotle: it doesnt
[04:15:29] JDeen: has joined #RubyOnRails
[04:15:31] chipotle: ime it falls over because i don't ahve enough ram
[04:15:41] chipotle: is google going to figure out why for me if i pay for their sql product?
[04:16:14] sevenseacat: i have no idea what their product does. you should probably look into it.
[04:16:22] chipotle: managed sql
[04:16:25] chipotle: whatever that means
[04:16:26] sevenseacat: seeing as you're the one asking about it
[04:16:31] sevenseacat: read the details?
[04:17:19] Guest19679: has joined #RubyOnRails
[04:17:44] melonstorm: has joined #RubyOnRails
[04:18:10] chipotle: i have to an extent. i guess i'm an idiot as to why i shouldn't just launch another compute engine instance and run mysql myself
[04:18:15] chipotle: espeically since i prefer mariadb
[04:18:36] Aeyrix: If you don't know
[04:18:38] Aeyrix: you don't need it
[04:19:07] JDeen: Hi there, sorry to interrupt a conversation. I am trying to create a form using simple_form_for. The rout it needs to post to is like /admin/owners (admin is the namespace). I generate the from like this: <%= simple_form_for [:admin, @owner] do |f| %>. Since 'owner' is an admin it kind of `chooses admin_admins_path`. Can I customize this to look for 'owners' (which there is no modal) insted?
[04:19:10] sevenseacat: well you might, but you won't look into why
[04:19:47] chipotle: Aeyrix: yeah, i hate that answer
[04:19:49] sevenseacat: jdeen: you just need to add the `url` option to simple_form_for
[04:19:52] chipotle: sorry to annoy you sevenseacat
[04:19:54] Aeyrix: chipotle: That's a shame.
[04:20:07] sevenseacat: chipotle: well you want us to do your work and research for you, and to that the answer is no
[04:20:09] rakm: has joined #RubyOnRails
[04:20:12] chipotle: Aeyrix: i am trying to learn. being told that since i don't understand the question doesn't help me learning
[04:20:17] JDeen: sevenseacat: Thanks, will have a look (y)
[04:20:35] k1t: has joined #RubyOnRails
[04:20:59] Guest19679: has left #RubyOnRails: ()
[04:21:18] i: has joined #RubyOnRails
[04:22:10] dopie: has joined #RubyOnRails
[04:22:11] annlewis: has joined #RubyOnRails
[04:24:00] wldcordeiro: has joined #RubyOnRails
[04:26:15] sevenseacat: devise invitable does some very strange things.
[04:27:00] jeadre: has joined #RubyOnRails
[04:27:46] x-light: that is the second mention of devise invitable today.
[04:28:31] x-light: next it'll be christmas.
[04:29:27] wldcordeiro: has joined #RubyOnRails
[04:33:19] lsone: has joined #RubyOnRails
[04:33:20] maz-dev: has joined #RubyOnRails
[04:33:46] RegulationD: has joined #RubyOnRails
[04:34:05] dopamean_: has joined #RubyOnRails
[04:35:12] Radar: chipotle: One reason to choose Google over roll-your-own is that Google will do a better job at security than you will
[04:35:38] chipotle: Radar: that's probably true
[04:35:45] Radar: The caveat is this: You'll want to be running your app on their infrastructure too, otherwise each query will take the time it USUALLY takes, plus transit time to Google's servers.
[04:35:47] chipotle: although i run mysql_secure_installation, isn't that all it takes? :)
[04:36:04] chipotle: have you used amazon RDS? i read that RDS doesn't let you tweak mysql so i don't see the point?
[04:36:20] Radar: No I haven't used it.
[04:36:23] Radar: Same caveat applies.
[04:36:26] christiandsg: has joined #RubyOnRails
[04:36:32] chipotle: i guess i'm going try amazon's free tier. i get a free t2.micro which is a 600mb vps essentially
[04:36:55] Radar: I like Amazon's offerings over Google's... mainly because I find Google's dashboards to be hit and miss.
[04:38:09] sevenseacat: 'probably' true?
[04:38:46] srinidhi: has joined #RubyOnRails
[04:40:15] rushed: has joined #RubyOnRails
[04:42:26] jonee: has joined #RubyOnRails
[04:43:02] sevenseacat: devise invitable needs a 'no, don't try to find existing users, I want to only invite new users' setting
[04:44:55] Radar: sevenseacat: MTWR Chapter 3 writes a custom invitations system. Good idea or bad idea?
[04:45:05] Radar: (compared with devise-invitable)
[04:46:06] wldcordeiro: has joined #RubyOnRails
[04:46:27] sevenseacat: I've used devise invitable a lot before, and every time I run into some random issue with it
[04:46:41] sevenseacat: this is one I haven't seen before that I now wonder if it affects every app I've ever used it on
[04:50:17] hotpancakes: has joined #RubyOnRails
[04:50:20] Aeyrix: I've tried not to use it for that reason
[04:50:34] ellisTAA: has joined #RubyOnRails
[04:53:54] baweaver: Did someone call for a SysAdmin?
[04:54:06] baweaver: Oh, MySQL optimization
[04:54:10] baweaver: ACTION runs
[04:55:17] baweaver: Amazon RDS allows enough customization to be useful, not sure where you got that idea chipotle
[04:57:33] sevenseacat: probably in the vein if 'if i make a random statement, people will jump all over themselves to prove me wrong and thus i will learn'
[04:58:08] rvanlieshout: has joined #RubyOnRails
[04:58:13] baweaver: ACTION shrugs
[04:58:31] baweaver: depends on what time it is.
[04:58:35] riotjones: has joined #RubyOnRails
[04:59:19] baweaver: some people are a lot more prone to bouts of visceral anger and vitriolic soap boxing than others
[05:02:04] baweaver: don't suppose anyone's particularly good with AREL/AR? Looking into multiple self-joins for a has_many
[05:02:25] baweaver: AmazonInstance has_many Tags, find where it has Tags (key: Application, value: Foo) AND (key: Environment, value: Prod)
[05:02:49] baweaver: don't have the code with me, more of musing how I can do that with AREL or AR instead of making my own INNER JOIN concoction.
[05:03:33] baweaver: failing that I just bake it into an alias and make it reusable for later. Just curious if I've missed something blaringly obvious I should be looking at.
[05:04:02] moei: has joined #RubyOnRails
[05:04:40] jesterfraud: has joined #RubyOnRails
[05:05:30] baweaver: right now the only two viable options for this one would be either subqueries or aliased inner self joins
[05:11:53] rvanlieshout: what's the problem with your sql thing?
[05:12:18] baweaver: It works but I get twitchy writing out plain sql
[05:12:27] baweaver: as there's likely a built in way to do it already.
[05:12:34] Rubie: has joined #RubyOnRails
[05:12:44] baweaver: I just don't know if aforementioned built in method exists or not.
[05:12:58] rvanlieshout: AmazonInstance.where(id: Tag.where(key: :application, value: :foo).select(:id)).where(id: Tag.where(key: :environment, value: :prod).select(:id))
[05:13:04] rvanlieshout: cause you don't really want to use joins for this
[05:13:13] rvanlieshout: you want 1 amazonInstance joined with tags 2 times
[05:13:35] rogue_koder: has joined #RubyOnRails
[05:14:03] baweaver: Hm, and would that get a proper intersection of those IDs?
[05:14:09] baweaver: I'll have to test around a bit later.
[05:14:12] rvanlieshout: using 2 subselects
[05:14:17] baweaver: mostly esoteric poking by this point.
[05:15:14] baweaver: either way doing some form of writeup on whatever I end up finding out works
[05:15:25] baweaver: I'll give it a shot tomorrow rvanlieshout, thanks!
[05:15:40] rvanlieshout: that statement will use a SELECT * FROM amazone_instances WHERE id IN (SELECT something FROM tags WHERE key = ... AND value = ...) AND id IN (...)
[05:15:49] rvanlieshout: note that the .select shouldn't be :id
[05:15:56] rvanlieshout: but something that returns the amazoninstance id
[05:16:28] baweaver: it's about this point I wish I could get a hold of postgresql's json fields
[05:16:39] rvanlieshout: it's not postgres specific
[05:16:49] rvanlieshout: problem with innner join is that you cannot query it for conditions twice
[05:16:52] rvanlieshout: you sould join it twice though
[05:17:23] baweaver: yeah, if you join n times you can get n conditionals as long as you alias the table
[05:17:27] baweaver: but that still feels a bit off
[05:17:35] rvanlieshout: it's a right way to do this
[05:17:38] baweaver: reading through SQL cookbooks.
[05:17:38] rvanlieshout: but the subselect also is
[05:17:53] baweaver: yeah, also going to poke around benchmarks a bit.
[05:18:51] strcmp1: has joined #RubyOnRails
[05:18:52] baweaver: It's working with manually written inner joins, just seeing if I can clean it up a bit
[05:19:13] jenrzzz: has joined #RubyOnRails
[05:19:33] jonee: has joined #RubyOnRails
[05:19:47] baweaver: also found something slightly interesting due to an asinine relationship in one of the models
[05:19:48] RegulationD: has joined #RubyOnRails
[05:20:24] baweaver: Model.joins(:others).where(other: {name: 'foo'}) vs Model.joins(:others).where('other.name = foo')
[05:20:44] baweaver: first one hits reflectors and the works for aliases and other such things while the second just goes to sql or skips a lot of the steps
[05:20:51] baweaver: more fun to poke about for later.
[05:21:22] rvanlieshout: that's relevant if you would use .includes
[05:21:34] ellisTAA: has joined #RubyOnRails
[05:21:39] baweaver: ends up being about twice as fast though, so someone could probably make an ApatheticRecord which just destructs hashes into strings for lighter weight
[05:21:46] baweaver: fair, still experimenting for kicks on that one.
[05:22:23] rvanlieshout: is that also twice as fast when running in production env?
[05:22:43] charliesome: has joined #RubyOnRails
[05:22:44] baweaver: haven't looked into it too much quite yet
[05:22:48] jcd6: has joined #RubyOnRails
[05:22:55] annlewis: has joined #RubyOnRails
[05:23:12] baweaver: someone just wrote something stupid like: belongs_to :model, has_many :models through: :other
[05:23:27] rakm: has joined #RubyOnRails
[05:23:28] baweaver: and it borked the first one while the second didn't complain.
[05:23:47] aganov: has joined #RubyOnRails
[05:23:49] baweaver: now granted the relationship was totally at fault on that one.
[05:24:21] LambdaSource: has joined #RubyOnRails
[05:31:16] jgt1: has joined #RubyOnRails
[05:36:00] riotjones: has joined #RubyOnRails
[05:36:47] abuzze: has joined #RubyOnRails
[05:39:03] rogue_koder: has joined #RubyOnRails
[05:40:29] jholm: has joined #RubyOnRails
[05:42:51] jonee: has joined #RubyOnRails
[05:46:07] yardenbar: has joined #RubyOnRails
[05:46:48] roolo: has joined #RubyOnRails
[05:48:12] tagrudev: has joined #RubyOnRails
[05:50:02] petricore: has joined #RubyOnRails
[05:51:06] riotjones: has joined #RubyOnRails
[05:54:00] jeadre: has joined #RubyOnRails
[05:56:21] febuiles: has joined #RubyOnRails
[06:00:24] havenwood: has joined #RubyOnRails
[06:05:28] lele: has joined #RubyOnRails
[06:09:50] kies: has joined #RubyOnRails
[06:10:48] dopie: has joined #RubyOnRails
[06:11:06] seank_: has joined #RubyOnRails
[06:12:33] sinkensabe: has joined #RubyOnRails
[06:13:00] _djbkd: has joined #RubyOnRails
[06:15:02] rogue_koder: has joined #RubyOnRails
[06:22:24] maz-dev: has joined #RubyOnRails
[06:23:43] annlewis: has joined #RubyOnRails
[06:24:15] christiandsg: has joined #RubyOnRails
[06:24:53] stardiviner: has joined #RubyOnRails
[06:25:32] Creeves: has joined #RubyOnRails
[06:25:39] bruno-: has joined #RubyOnRails
[06:27:27] dhjondoh: has joined #RubyOnRails
[06:32:05] ELCALOR: hi ya! how would i do the following: i want to show a check_box in a form. if it is selected i want to set the model.type field to the string 'DynamicRebateResult'. If it's not selected `type` should stay to nil.
[06:32:09] jgt1: has joined #RubyOnRails
[06:33:31] srinidhi: has joined #RubyOnRails
[06:33:46] srinidhi: has joined #RubyOnRails
[06:34:12] bmalum: has joined #RubyOnRails
[06:35:23] rvanlieshout: ELCALOR: create a checkbox for field type with value DynamicRebateResult
[06:36:36] comrad: has joined #RubyOnRails
[06:36:50] Macaveli: has joined #RubyOnRails
[06:36:59] ELCALOR: rvanlieshout: wow, that's easy. i didn't know that was possible
[06:37:29] ELCALOR: rvanlieshout: the only problem now is that the unselected checkboxes resolve to '0', instead of nil.
[06:37:57] rvanlieshout: you can set the value for the unchecked variant
[06:38:16] ELCALOR: rvanlieshout: oh, and the selected type is '1', instead of 'DynamicRebateResult'
[06:38:22] ddv: has joined #RubyOnRails
[06:38:52] rvanlieshout: http://api.rubyonrails.org/classes/ActionView/Helpers/FormBuilder.html#method-i-check_box
[06:40:03] eprasad: has joined #RubyOnRails
[06:44:04] wethu: has joined #RubyOnRails
[06:44:04] charliesome: has joined #RubyOnRails
[06:44:58] ELCALOR: rvanlieshout: wow cool! i'm using nested attributes, is check_box() suitable for that too?
[06:45:33] ELCALOR: oki! thanks!
[06:46:24] ELCALOR: for example, this is the desired output: year[rebate_results_attributes][1][type], where the [1] is dynamic.
[06:46:35] cornerma1: has joined #RubyOnRails
[06:48:14] Linuus: has joined #RubyOnRails
[06:49:25] solars: has joined #RubyOnRails
[06:50:48] kimegede: has joined #RubyOnRails
[06:59:34] ecnalyr: has joined #RubyOnRails
[07:03:07] chrissonar: has joined #RubyOnRails
[07:03:20] jas02: has joined #RubyOnRails
[07:07:00] ghostlines: has joined #RubyOnRails
[07:07:34] x-light: has joined #RubyOnRails
[07:09:06] zpe: has joined #RubyOnRails
[07:09:23] duncannz: has joined #RubyOnRails
[07:10:35] rubyonrails196: has joined #RubyOnRails
[07:12:06] towski_: has joined #RubyOnRails
[07:13:00] alphaatom: has joined #RubyOnRails
[07:15:55] Axighi: has joined #RubyOnRails
[07:17:36] johnflux_: has joined #RubyOnRails
[07:18:03] comrad: has joined #RubyOnRails
[07:19:14] atzorvas: has joined #RubyOnRails
[07:19:25] johnflux: has joined #RubyOnRails
[07:20:17] matcouto: has joined #RubyOnRails
[07:20:46] sandstrom: has joined #RubyOnRails
[07:23:12] tyil: has left #RubyOnRails: ("system has died")
[07:24:29] annlewis: has joined #RubyOnRails
[07:24:34] Axighi: I have uniqueness validation on a attribute of a model, when I try to create an object of the model, the attribute keeps saying 'has been used'
[07:25:52] Axighi: 'has already been taken'
[07:26:15] sevenseacat: then guess what - its been taken already
[07:26:19] sevenseacat: use another value
[07:27:57] arup_r: has joined #RubyOnRails
[07:31:14] quazimodo: ELCALOR: :D
[07:31:47] quazimodo: axighi: has it been used??
[07:32:31] Axighi: I changed it to : sequence(:code)
[07:32:40] duncannz: has joined #RubyOnRails
[07:32:42] Axighi: still not working
[07:32:50] xhosae: has joined #RubyOnRails
[07:32:51] Axighi: quazimodo: no
[07:33:41] srinidhi: has joined #RubyOnRails
[07:33:46] srinidhi: has joined #RubyOnRails
[07:34:49] Karpah: has joined #RubyOnRails
[07:37:45] livathinos: has joined #RubyOnRails
[07:40:47] denovez: has joined #RubyOnRails
[07:41:39] jbrinkmusic: has joined #RubyOnRails
[07:41:52] bruno-: has joined #RubyOnRails
[07:42:33] roolo: has joined #RubyOnRails
[07:42:40] skroon: has joined #RubyOnRails
[07:46:42] arup_r: content_for not showing the data inside my view. Any idea what is wrong here ? https://gist.github.com/aruprakshit/d0b6116335c6a27707c0
[07:47:10] bmalum: has joined #RubyOnRails
[07:48:11] atzorvas: omniauth with devise works on localhost but not on server.. any idea?
[07:48:48] sppp: has joined #RubyOnRails
[07:48:51] artto: has joined #RubyOnRails
[07:50:23] leehambley: has joined #RubyOnRails
[07:54:14] fighella: has joined #RubyOnRails
[07:55:39] darutoko: has joined #RubyOnRails
[07:56:13] livathinos: has joined #RubyOnRails
[07:59:17] charliesome: has joined #RubyOnRails
[08:03:42] srinidhi: has joined #RubyOnRails
[08:03:46] srinidhi: has joined #RubyOnRails
[08:04:28] arup_r: well content_for don't replace data dynamically inside the link_to it seems
[08:06:00] NBarnes: has joined #RubyOnRails
[08:06:19] jsrn_: has joined #RubyOnRails
[08:07:19] kitsuneyo: has joined #RubyOnRails
[08:11:49] seank_: has joined #RubyOnRails
[08:13:49] jenrzzz: has joined #RubyOnRails
[08:14:50] yardenbar: Hi all, I'm trying to profile some code using "rails profiler --output /tmp/failure_alerter.profile 'Background::FailureAlerter.perform'". after it finishes to run, the output file doesn't exist. Any idea?
[08:15:18] kitsuneyo: has joined #RubyOnRails
[08:23:28] tonios57: has joined #RubyOnRails
[08:24:12] Linuus: has joined #RubyOnRails
[08:25:16] annlewis: has joined #RubyOnRails
[08:25:45] maz-dev: has joined #RubyOnRails
[08:26:14] Hates_: has joined #RubyOnRails
[08:26:27] Hates_: has joined #RubyOnRails
[08:27:07] christiandsg: has joined #RubyOnRails
[08:28:04] maz-dev: has joined #RubyOnRails
[08:29:24] null__: has joined #RubyOnRails
[08:29:24] null__: has joined #RubyOnRails
[08:32:54] jgt1: has joined #RubyOnRails
[08:33:55] srinidhi: has joined #RubyOnRails
[08:35:08] tvw: has joined #RubyOnRails
[08:37:59] kitsuneyo: has joined #RubyOnRails
[08:42:30] jgt1: has joined #RubyOnRails
[08:43:41] bmalum: has joined #RubyOnRails
[08:47:13] harikrishna: has joined #RubyOnRails
[08:48:00] qejk: has joined #RubyOnRails
[08:48:01] quazimodo: has joined #RubyOnRails
[08:48:53] startupality: has joined #RubyOnRails
[08:49:19] ecnalyr: has joined #RubyOnRails
[08:50:46] yfeldblum: has joined #RubyOnRails
[08:51:30] harikrishna: has joined #RubyOnRails
[08:52:30] krz: has joined #RubyOnRails
[08:53:07] MartinElvar: has joined #RubyOnRails
[08:56:04] Grundell: has joined #RubyOnRails
[08:57:53] techsethi: has joined #RubyOnRails
[09:00:30] mikecmpbll: has joined #RubyOnRails
[09:02:21] rubyonrails554: has joined #RubyOnRails
[09:06:05] rubyonrails554: /join #rubyonrails
[09:07:18] null__: has joined #RubyOnRails
[09:07:18] null__: has joined #RubyOnRails
[09:08:04] workmad3: has joined #RubyOnRails
[09:11:55] kitsuneyo: has joined #RubyOnRails
[09:15:10] El3ktra: has joined #RubyOnRails
[09:15:58] wethu: has joined #RubyOnRails
[09:16:06] techsethi_: has joined #RubyOnRails
[09:17:09] marr: has joined #RubyOnRails
[09:17:24] Macaveli: How long will I receive security update after I upgrade to Rails 3.2.22?
[09:17:24] jgt: has joined #RubyOnRails
[09:17:41] xoron: has joined #RubyOnRails
[09:18:00] workmad3: Macaveli: until rails 5 is released, iirc
[09:18:18] Macaveli: so upgrading to rails 4 is advised
[09:18:24] Macaveli: just to keep everything safe
[09:18:41] workmad3: Macaveli: yes, it has been for well over a year now
[09:18:50] mikecmpbll: even now it's only receiving updates for severe security issues
[09:18:58] mikecmpbll: not you're regular everyday security issues ;)
[09:19:09] Macaveli: `gem install brakeman`
[09:19:09] Macaveli: `gem install bundler-audit`
[09:19:12] Macaveli: going to install these
[09:19:17] Macaveli: and audit the current app we have
[09:20:32] null__: has joined #RubyOnRails
[09:20:32] null__: has joined #RubyOnRails
[09:21:01] Macaveli: Session secret should not be included in version control near line 7 --> So I can just remove the session secret?
[09:22:11] workmad3: Macaveli: that depends... are you relying on it being in source control for your deployed apps atm?
[09:23:00] beauby_: has joined #RubyOnRails
[09:23:29] richipargo: has joined #RubyOnRails
[09:24:00] chouhoul_: has joined #RubyOnRails
[09:24:18] techsethi_: has joined #RubyOnRails
[09:24:58] a1fa_: has joined #RubyOnRails
[09:25:07] AckZ_: has joined #RubyOnRails
[09:25:09] hellschreiber_: has joined #RubyOnRails
[09:25:28] startupality_: has joined #RubyOnRails
[09:26:00] annlewis: has joined #RubyOnRails
[09:26:02] johnflux_: has joined #RubyOnRails
[09:27:02] kitsuneyo: has joined #RubyOnRails
[09:27:55] Macaveli_: has joined #RubyOnRails
[09:27:59] Olipro-: has joined #RubyOnRails
[09:28:00] swistak35_: has joined #RubyOnRails
[09:28:18] silverdust: has joined #RubyOnRails
[09:28:39] El3ktra: has joined #RubyOnRails
[09:28:39] El3ktra: has joined #RubyOnRails
[09:28:46] iateadonut1: has joined #RubyOnRails
[09:29:11] amon777: has joined #RubyOnRails
[09:29:18] lele: has joined #RubyOnRails
[09:29:27] liquid-silence: has joined #RubyOnRails
[09:29:53] liquid-silence: has joined #RubyOnRails
[09:29:56] shilon: has joined #RubyOnRails
[09:29:59] liquid-silence: hi all, anyway to remove certain routes from authentication via grape?
[09:30:06] aaronr: has joined #RubyOnRails
[09:30:36] amon777: i have a variable "class_name" which has value either "required" or empty...and i want to display that in the class="" in order a radio field to be required or not in the form. My output for the radio field is : output << (radio_button_tag "form_submission[form_selections_attributes][#{key}][value]", f.name)
[09:30:37] johnflux: has joined #RubyOnRails
[09:30:41] roolo: has joined #RubyOnRails
[09:30:46] liquid-silence: I see it does not support before filters
[09:31:18] leeky: has joined #RubyOnRails
[09:31:25] jbrinkmusic: what would be the best way to go about installing Rolify if I already have devise and pundit installed, and currently have a enum based role in my user model with "user", "superuser" and "admin" roles?
[09:31:48] amon777: i tried this: output << (radio_button_tag "form_submission[form_selections_attributes][#{key}][value]", f.name, :class => "#{class_name}") but this fir some reason made the checked="checked" instead of class="required" as it should
[09:32:19] amon777: any idea, is really appreciated ...thank you
[09:32:29] xoron: has joined #RubyOnRails
[09:34:24] bin_005: has joined #RubyOnRails
[09:35:30] comrad: has joined #RubyOnRails
[09:37:41] doritostains: has joined #RubyOnRails
[09:39:02] bin_005: has joined #RubyOnRails
[09:39:46] workmad3: amon777: third value to radio_button_tag is the value it should take... you passed in a truthy value, so the radio button is checked
[09:40:38] amon777: workmad3: so, where should i put that parameter? i am confused..
[09:40:42] workmad3: s/value it should take/checked status it should have
[09:40:44] amon777: workmad3: thank sin advance mate
[09:40:58] workmad3: amon777: the docs are pretty clear: http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-radio_button_tag
[09:43:23] srinidhi: has joined #RubyOnRails
[09:43:43] amon777: workmad3: hm...so this is the correct ? output << (radio_button_tag "form_submission[form_selections_attributes][#{key}][value]", f.name, nill, :class => "#{class_name}")
[09:43:55] jeadre: has joined #RubyOnRails
[09:46:17] amon777: workmad3: it worked
[09:46:20] amon777: workmad3: thanks mate!
[09:47:37] arup_r: has joined #RubyOnRails
[09:48:49] blnkammo_: has joined #RubyOnRails
[09:51:48] Macaveli: has joined #RubyOnRails
[09:51:50] djbkd: has joined #RubyOnRails
[09:53:21] jbrinkmusic: is somebody able to help me with installing Rolify?
[09:59:16] fighella: has joined #RubyOnRails
[10:04:52] k1t: has joined #RubyOnRails
[10:05:09] k1t: has joined #RubyOnRails
[10:08:05] xoron: has joined #RubyOnRails
[10:09:08] Ergo: has joined #RubyOnRails
[10:12:17] alex88: has joined #RubyOnRails
[10:12:34] seank_: has joined #RubyOnRails
[10:14:12] yashinbasement: has joined #RubyOnRails
[10:15:02] yashinbasement: hi guys , how do I render a template as json
[10:18:17] bin_005_u: has joined #RubyOnRails
[10:18:37] stamina: has joined #RubyOnRails
[10:20:41] rickmasta: has joined #RubyOnRails
[10:21:12] Gribo: has joined #RubyOnRails
[10:25:05] Gribo: Hey, I'm getting tons of errors when running me.section_edits. First of all I do me = AdminUser.find(1) , admin_users is the corresponding table. I added has_many :section_edits shouldn't ruby go ahead an add the method section_edits?
[10:26:06] yashinbasement: do I need to hard code the json file ?
[10:26:13] sevenseacat: Gribo: !debug
[10:26:13] helpa: Gribo: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[10:26:45] annlewis: has joined #RubyOnRails
[10:27:44] yashinbasement: is anyone here ?, I am waiting for 10 mins, no one has come
[10:28:10] Gribo: sevenseacat, Should I include the full trace in the gist with the code?
[10:28:18] sevenseacat: Gribo: please do.
[10:30:04] christiandsg: has joined #RubyOnRails
[10:31:51] frzn: has joined #RubyOnRails
[10:32:53] SteenJobs: has joined #RubyOnRails
[10:35:10] Gribo: sevenseacat, This is one of those rubber ducky scenarios, ended up figuring out the problem.
[10:35:21] sevenseacat: good stuff :)
[10:39:48] fighella: has joined #RubyOnRails
[10:39:59] liquid-silence: anyone here doing SPA with rails?
[10:40:11] waseem_: yardenbar: !welcome
[10:40:11] helpa: yardenbar: Welcome to #rubyonrails, the support channel where you can get help with your Ruby on Rails questions. Please take a moment to familiarize yourself with the rules: https://gist.github.com/radar/996779
[10:40:38] jonee: has joined #RubyOnRails
[10:40:54] mikecmpbll: liquid-silence: sure, gem 'turobolinks' :d
[10:41:13] liquid-silence: mikecmpbll will that allow me to have a static uploader, so navigate while uploading files?
[10:41:24] liquid-silence: I guess it wount?
[10:41:30] waseem_: yardenbar: Oops. Sorry. :)
[10:41:44] cgfbees: has joined #RubyOnRails
[10:41:49] liquid-silence: mikecmpbll so not SPA
[10:41:51] yardenbar: waseem_, I don't understand...
[10:42:02] waseem_: yardenbar: That was for someone else.
[10:42:07] mikecmpbll: SPA != a javascript uploader that allows you to upload files while navigating
[10:42:28] liquid-silence: mikecmpbll if you navigate, any uploader will stop
[10:42:34] liquid-silence: thats the nature of the game
[10:42:46] mikecmpbll: i've no idea what you're actually getting at.
[10:42:54] liquid-silence: so SPA == will allow me to upload while navigating
[10:42:55] bruno-: has joined #RubyOnRails
[10:43:04] mikecmpbll: no, not necessarily
[10:43:12] mikecmpbll: ACTION facepalms
[10:43:18] sevenseacat: on a lot of things.
[10:43:24] mikecmpbll: SPA is a concept that has nothing to do with "uploading while navigating"
[10:43:32] mikecmpbll: it may facilitate it in some circumstances
[10:43:44] liquid-silence: mikecmpbll If one removes navigation from the app, the upload element will stay static
[10:43:48] mikecmpbll: but the two things are so far removed from one another that this whole conversation is ridiculous.
[10:44:04] liquid-silence: mikecmpbll sure then don;t respond
[10:44:32] mikecmpbll: that's not what question and answering is about.
[10:45:47] dEPy: has joined #RubyOnRails
[10:46:07] liquid-silence: mikecmpbll why comment if you think its silly?
[10:46:13] ayonkhan: has joined #RubyOnRails
[10:46:35] mikecmpbll: to let you know your mistake? that's generally the purpose of this channel.
[10:47:08] joe2: has joined #RubyOnRails
[10:48:11] shmoon__: has joined #RubyOnRails
[10:48:53] shmoon__: any idea why token authenticatable was removed from devise ?
[10:49:51] mikecmpbll: shmoon__: https://github.com/plataformatec/devise/issues/2739
[10:50:17] rushed: liquid-silence: this is a thing that exists: data-turbolinks-permanent
[10:51:22] liquid-silence: rushed thanks appreciate the decent answer :)
[10:53:50] shmoon__: it doesn't speak about why mikecmpbll
[10:54:00] sevenseacat: shmoon__: the blog post it links to does
[10:54:02] mikecmpbll: shmoon__: sorry, there's a link on that page to http://blog.plataformatec.com.br/2013/08/devise-3-1-now-with-more-secure-defaults/ ;)
[10:54:06] sandstrom: has joined #RubyOnRails
[10:54:11] tvw: has joined #RubyOnRails
[10:54:25] shmoon__: oops thanks
[10:55:54] nettoweb: has joined #RubyOnRails
[10:56:57] lele: has joined #RubyOnRails
[10:58:22] Creeves: has joined #RubyOnRails
[10:59:09] rodfersou: has joined #RubyOnRails
[11:00:33] Axilla: has joined #RubyOnRails
[11:02:04] baash05: has joined #RubyOnRails
[11:02:36] bruno-: has joined #RubyOnRails
[11:04:03] voker57: has joined #RubyOnRails
[11:05:46] jholm: has joined #RubyOnRails
[11:06:24] leslie: I'm having trouble with module loading. I have a class "class CostEstimators::CostEstimator" in models/cost_estimators/cost_estimator.rb but I get the error Unable to autoload constant CostEstimator, expected ..../app/models/cost_estimators/cost_estimator.rb
[11:06:49] Macaveli: has joined #RubyOnRails
[11:07:01] bmalum: has joined #RubyOnRails
[11:07:43] leslie: am I not meant to include the module name?
[11:08:01] sevenseacat: leslie: !debug
[11:08:01] helpa: leslie: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[11:09:02] noodman: has joined #RubyOnRails
[11:09:24] leslie: I'm not quite sure what information I'm missing. it works fine in development, so it's an issue with eager loading.
[11:10:47] mikecmpbll: leslie: what env is it not working in?
[11:11:13] leslie: production
[11:11:28] Voker57|2: has joined #RubyOnRails
[11:11:34] srcnik: has joined #RubyOnRails
[11:12:06] seank_: has joined #RubyOnRails
[11:12:18] leslie: actually, it's an issue somewhere else
[11:13:04] leslie: oh, it's a class I forgot to delete that obviously doesn't matter in development, but in production it loads everything
[11:15:25] cgfbee: has joined #RubyOnRails
[11:15:46] joe2: has joined #RubyOnRails
[11:16:23] techsethi: has joined #RubyOnRails
[11:17:19] ardian: has joined #RubyOnRails
[11:17:28] strcmp1: has joined #RubyOnRails
[11:17:59] ardian: Hello I am having trouble doing a foreign key association, I am not really sure how to do that in rails (activerecord)
[11:18:51] roolo: has joined #RubyOnRails
[11:18:57] rvanlieshout: how what is done, ardian?
[11:20:03] ardian: rvanlieshout, use foreign key between two different tables
[11:20:32] rvanlieshout: what tables do you have? with what attributes? and what rails models did you create?
[11:21:17] ardian: I have two tables store and shoes
[11:21:23] ardian: both have an id field
[11:21:42] dstarh: has joined #RubyOnRails
[11:22:40] rvanlieshout: and that's it?
[11:22:52] qejk: has joined #RubyOnRails
[11:23:33] michael_mbp: has joined #RubyOnRails
[11:24:00] ardian: rvanlieshout, http://fpaste.org/259492/
[11:24:20] rvanlieshout: and rails models?
[11:24:37] ardian: so in sql to set the key I would ALTER TABLE ORDERS
[11:24:37] ardian: ADD FOREIGN KEY (Customer_ID) REFERENCES CUSTOMERS (ID);
[11:24:52] ardian: rvanlieshout, I am planning the database first I have not yet created any model
[11:25:23] rvanlieshout: ah ok. so what's the issue you bump in?
[11:25:35] ardian: I am learning rails but I don't understand how I would go with a foreign key
[11:25:41] rvanlieshout: in a migration?
[11:25:44] Oxynum: has joined #RubyOnRails
[11:26:00] ardian: yes but the syntax it is different from ADD FOREIGN KEY (Customer_ID) REFERENCES CUSTOMERS (ID);
[11:26:21] rvanlieshout: a migration is totally different
[11:26:29] rvanlieshout: t.references :customer
[11:26:44] rvanlieshout: i'm not even sure if it actually adds a foreign key
[11:26:51] rvanlieshout: cuase not all db engines support foreign keys
[11:26:53] rvanlieshout: and you handle them in your model
[11:26:55] voker57: has joined #RubyOnRails
[11:27:16] mikecmpbll: foreign_key: true
[11:27:18] srinidhi: has joined #RubyOnRails
[11:27:34] annlewis: has joined #RubyOnRails
[11:27:41] mostlybadfly: has joined #RubyOnRails
[11:27:47] ardian: mikecmpbll, umm how do I specify which field in the table ? like Customer_ID
[11:27:54] mikecmpbll: ardian: show us your migration
[11:28:01] mikecmpbll: there's various ways of doing it.
[11:30:57] ldnunes: has joined #RubyOnRails
[11:32:28] Macaveli: has joined #RubyOnRails
[11:33:08] wosuopu: has joined #RubyOnRails
[11:33:14] rustymyers: has joined #RubyOnRails
[11:33:35] arsim: has joined #RubyOnRails
[11:33:45] wosuopu: has left #RubyOnRails: ()
[11:34:59] wosuopu: has joined #RubyOnRails
[11:37:14] curses: has joined #RubyOnRails
[11:38:08] syath: has joined #RubyOnRails
[11:38:46] strcmp1: has joined #RubyOnRails
[11:38:57] cfloare_: has joined #RubyOnRails
[11:39:54] maz-dev: has joined #RubyOnRails
[11:40:32] curses: Hi guys, sorry if this is somewhat off-topic, but has anyone had any issues with Sass not rendering correctly in IE9 with Rails? I'm using the @import directive to bundle all my Sass files, however IE9 fails to render parts of the stylesheet if certain files are imported before others... it makes no sense.. if I comment out certain parts of the stylesheet it works too. I literally can't find any link to why it's doing this, it's fine in all other br
[11:41:41] arsim: Hi, I am trying to add a foreign key in my model this is my schema http://fpaste.org/259498/ I want to add foreign keys in the table "REQUESTS" on the field UserIDTo and UserIDFrom
[11:41:58] arsim: how can i do that
[11:42:17] cfloare_: has left #RubyOnRails: ()
[11:43:35] rvanlieshout: curses: there is a limit in how many css may contain in ie
[11:44:03] rvanlieshout: in 6..9: A sheet may contain up to 4095 rules
[11:44:06] rvanlieshout: A sheet may @import up to 31 sheets
[11:44:08] rvanlieshout: @import nesting supports up to 4 levels deep
[11:44:53] curses: rvanlieshout: ahhh that could well be the problem, I'll do some testing, thank you!
[11:45:48] jso: has joined #RubyOnRails
[11:45:56] drupald: has joined #RubyOnRails
[11:46:25] cfloare: has joined #RubyOnRails
[11:49:20] njero: has joined #RubyOnRails
[11:51:50] lele: has joined #RubyOnRails
[11:54:44] Guest99787: has left #RubyOnRails: ()
[11:55:46] silverdust: has joined #RubyOnRails
[11:56:36] redmaverick: has joined #RubyOnRails
[11:58:23] jonee: has joined #RubyOnRails
[12:00:57] DoubleMalt: has joined #RubyOnRails
[12:03:07] erich: has joined #RubyOnRails
[12:03:16] emilebosch: has joined #RubyOnRails
[12:06:10] EiNSTeiN_: has joined #RubyOnRails
[12:12:34] bios: has joined #RubyOnRails
[12:14:47] Creeves: has joined #RubyOnRails
[12:15:14] jkamenik: has joined #RubyOnRails
[12:15:26] noodman: has joined #RubyOnRails
[12:18:54] Hates__: has joined #RubyOnRails
[12:18:56] Linuus: has joined #RubyOnRails
[12:19:38] livathinos: has joined #RubyOnRails
[12:20:35] emilebosch: has joined #RubyOnRails
[12:21:00] sdwrage: has joined #RubyOnRails
[12:23:13] emilebosch: has joined #RubyOnRails
[12:24:07] joshkovach: has joined #RubyOnRails
[12:24:26] acti0nman: has joined #RubyOnRails
[12:26:17] baash05: has joined #RubyOnRails
[12:26:24] emilebosch: has joined #RubyOnRails
[12:26:38] stardiviner: has joined #RubyOnRails
[12:26:51] baash05: has joined #RubyOnRails
[12:27:45] ecnalyr: has joined #RubyOnRails
[12:28:18] annlewis: has joined #RubyOnRails
[12:28:28] emilebosch: has joined #RubyOnRails
[12:29:53] redmaverick: I am trying to refactor my code. http://pastie.org/private/zmdzwouutu7laaccvuze9q Is this the standard way of doing it?
[12:31:15] rvanlieshout: redmaverick: no
[12:31:25] rvanlieshout: it's something totally different
[12:31:29] rvanlieshout: youu use params[:price][:low] before
[12:31:41] rvanlieshout: then you switch to undeclared @low, @high and @sort
[12:31:48] rvanlieshout: and you still use params[:price][:low] in that method
[12:31:57] redmaverick: yeah.. editing mistake
[12:32:02] rvanlieshout: what's wrogin with that initial code?
[12:32:16] redmaverick: it has a lot of variables and doesn't feel right
[12:32:40] christiandsg: has joined #RubyOnRails
[12:32:56] redmaverick: I want things to be on a high level in the product_finder code
[12:33:11] redmaverick: and the details taken care of in other methods
[12:39:01] emilebosch: has joined #RubyOnRails
[12:41:19] wethu: has joined #RubyOnRails
[12:43:20] maz-dev: has joined #RubyOnRails
[12:44:27] centrx: has joined #RubyOnRails
[12:44:45] syath: why not like this? http://pastebin.com/n73kjEpv
[12:45:31] syath: err, here: http://pastie.org/10376902
[12:47:32] fighella: has joined #RubyOnRails
[12:49:24] Ropeney: has joined #RubyOnRails
[12:50:15] emilebosch: has joined #RubyOnRails
[12:51:00] dstarh: has joined #RubyOnRails
[12:51:20] redmaverick: syath: that seems to be a decent approach
[12:52:25] redmaverick: I have a question about cache. It seems to work off the bat without configuring anything. Rails.cache.fetch. But the guide asks to configure it. Wondering what I am missing.
[12:53:59] workmad3: redmaverick: the default cache store is a file-system store with no cleanup or expiry
[12:54:05] jholm: has joined #RubyOnRails
[12:54:21] emilebosch: has joined #RubyOnRails
[12:54:44] michael_mbp: how's u workmad3
[12:54:52] poli: has joined #RubyOnRails
[12:54:52] fighella: has joined #RubyOnRails
[12:54:58] workmad3: redmaverick: that works pretty well to start with, as rails 4 cache keys are calculated in such a way that they change (removing the need to expire the old data) but it means that using the default cache in production will result in ever-increasing file system usage
[12:55:19] michael_mbp: anyone here caught Prag Dave's talk on Elixir?
[12:55:21] workmad3: michael_mbp: going ok, just been banging my head against a wall of marketing-related JS recently :(
[12:55:55] jesterfraud: has joined #RubyOnRails
[12:56:05] redmaverick: Rails.cache.fetch("products", expires_in: 1.day) do
[12:56:07] redmaverick: workmad3: so this piece of code will not work as it is then:
[12:56:23] redmaverick: I mean.. will not expire
[12:56:24] workmad3: redmaverick: it'll 'work' in the sense that it'll serve from cache
[12:56:55] workmad3: redmaverick: hell, I may even be wrong on expiration (I know at one point the file system cache didn't expire, they may have put in something to pay attention to file times since then)
[12:57:11] redmaverick: yeah.. things might be different in Rails 4
[12:58:18] workmad3: redmaverick: but that's the reason to configure the cache... it's serving from the file system (which isn't exactly the speediest thing), it has limitations, it doesn't get cleaned up
[12:58:45] workmad3: redmaverick: as opposed to using something like memcache or redis as a LRU cache that serves from memory
[12:59:44] emilebosch: has joined #RubyOnRails
[12:59:55] blackmesa: has joined #RubyOnRails
[12:59:55] jonee: has joined #RubyOnRails
[13:00:02] workmad3: redmaverick: and once you get to larger scale apps, with multiple app servers, sharing a file-system cache is a nightmare (or you're maintaining half a dozen different caches with similar data and probably different expiry times)
[13:00:15] workmad3: redmaverick: none of which bodes well :)
[13:02:52] sandstrom: has joined #RubyOnRails
[13:04:51] jbrinkmusic: can anyone point me in the direction of what I need to make a form that has a multiple choice box and a plus sign on the line after it to get another instance of the same choice box?
[13:05:37] jbrinkmusic: and this should work ad infinitum to create as many lines as the user wants
[13:06:59] Pumukel: has joined #RubyOnRails
[13:06:59] roolo: has joined #RubyOnRails
[13:07:08] jbrinkmusic: I obviously need a has_many relation behind it but I'm more interested in the actual form part
[13:07:09] workmad3: jbrinkmusic: cocoon or nested_form, if you don't fancy writing the JS yourself
[13:07:40] jbrinkmusic: workmad3: thank you, I'll have a look at those
[13:07:42] emilebosch: has joined #RubyOnRails
[13:08:52] n1lo: has joined #RubyOnRails
[13:10:04] arup_r: has joined #RubyOnRails
[13:11:04] ddv: has joined #RubyOnRails
[13:11:16] RegulationD: has joined #RubyOnRails
[13:11:21] sacarlson: has joined #RubyOnRails
[13:12:45] fast_scooter: has joined #RubyOnRails
[13:12:52] annlewis: has joined #RubyOnRails
[13:17:32] emilebosch: has joined #RubyOnRails
[13:19:38] arup_r: has joined #RubyOnRails
[13:19:45] givanse: has joined #RubyOnRails
[13:21:36] sameerynho: has joined #RubyOnRails
[13:23:27] fmcgeough: has joined #RubyOnRails
[13:24:32] emilebosch: has joined #RubyOnRails
[13:25:40] victortyau: has joined #RubyOnRails
[13:26:31] alphaatom: has joined #RubyOnRails
[13:27:00] allcentury: has joined #RubyOnRails
[13:27:24] nettoweb: has joined #RubyOnRails
[13:27:50] sung: has joined #RubyOnRails
[13:27:50] sung: has joined #RubyOnRails
[13:30:03] devdazed: has joined #RubyOnRails
[13:34:01] JoshL: has joined #RubyOnRails
[13:35:07] Cervajz: has joined #RubyOnRails
[13:35:25] sankaber: has joined #RubyOnRails
[13:36:17] johnflux: has joined #RubyOnRails
[13:37:29] Cervajz_: has joined #RubyOnRails
[13:39:02] atomical: has joined #RubyOnRails
[13:39:35] emilebosch: has joined #RubyOnRails
[13:39:59] noodman: has joined #RubyOnRails
[13:42:39] kinduff: has joined #RubyOnRails
[13:43:09] greengriminal: has joined #RubyOnRails
[13:47:24] Mr_Corealis: has joined #RubyOnRails
[13:48:00] HalcyonicStorm: has joined #RubyOnRails
[13:49:15] fast_scooter_: has joined #RubyOnRails
[13:50:27] christiandsg: has joined #RubyOnRails
[13:52:04] skroon: has joined #RubyOnRails
[13:52:16] fast_scooter_: has left #RubyOnRails: ()
[13:53:04] greengriminal: has joined #RubyOnRails
[13:53:11] fast_scooter_: has joined #RubyOnRails
[13:53:21] fast_scooter_: has left #RubyOnRails: ()
[13:54:10] kitsuneyo: has joined #RubyOnRails
[13:55:06] fast_scooter: has joined #RubyOnRails
[13:56:34] dojobo: has joined #RubyOnRails
[13:57:16] AzaToth: has joined #RubyOnRails
[13:58:32] Mr_Corealis: has joined #RubyOnRails
[13:58:34] nickenchuggets: how's it going?
[13:58:35] paulcsmith: has joined #RubyOnRails
[13:58:54] voltalio: has joined #RubyOnRails
[13:59:30] yardenbar: has joined #RubyOnRails
[14:00:51] naftilos76: has joined #RubyOnRails
[14:06:18] jhack: has joined #RubyOnRails
[14:06:25] Macaveli: has joined #RubyOnRails
[14:06:46] naftilos76: Hi, i am a little bit confused as far as ajax calls in jquery shipped with rails 4.2 is concerned but with link_to helpers when i use [remote: true] to send an ajax request. Does a rails 'link_to' helper uses request body or query string based on method used (get or post or others)?
[14:07:20] naftilos76: No matter what i use i see in FF that the params sent are sent as a query string
[14:07:33] naftilos76: what am i missing?
[14:08:05] Kallis: has joined #RubyOnRails
[14:08:20] kinduff: has joined #RubyOnRails
[14:09:07] atomical: has joined #RubyOnRails
[14:09:36] eprasad: has joined #RubyOnRails
[14:09:51] Spami: has joined #RubyOnRails
[14:10:50] Spami: I'm getting this error message while using geocoded: Caught an error during Google geocoding call: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
[14:11:14] pontiki: naftilos76: link_to defaults to a GET
[14:11:18] Spami: Found the github ticket related to it here: https://github.com/alexreisner/geocoder/issues/850
[14:11:24] rvanlieshout: Spami: people stopped using SSLv3 a while ago
[14:11:31] rvanlieshout: but got to run. cheers.
[14:11:48] Spami: But even after re-installing ruby without binaries I'm still getting it
[14:12:01] RegulationD: has joined #RubyOnRails
[14:12:38] naftilos76: pontiki, i have also tried method: :post. I still see in FF that the params are sent as a query string.
[14:12:41] pontiki: naftilos76: actually, i don't know what link_to sends remotely when you change to method: :post
[14:13:13] pontiki: naftilos76: i haven't actually ever used remote: true; i can't say with any conviction what it does
[14:13:25] naftilos76: pontiki, ok np
[14:13:38] RegulationD: has joined #RubyOnRails
[14:13:40] pontiki: naftilos76: you may want to look at button_to
[14:14:21] naftilos76: pontiki, let me see that
[14:15:18] Lightsword: has joined #RubyOnRails
[14:16:13] naftilos76: pontiki, makes no difference except for the button!
[14:16:47] pontiki: button_to wraps it in a form
[14:17:11] naftilos76: pontiki, yes i noticed that
[14:17:39] ecnalyr: has joined #RubyOnRails
[14:17:51] naftilos76: pontiki, i can still see in FF debuging that a query string is being used
[14:17:54] fast_scooter: has joined #RubyOnRails
[14:18:37] pontiki: naftilos76: please gist the code and the generated html; i'd like to look at it
[14:18:37] Detch: has joined #RubyOnRails
[14:18:47] Detch: has joined #RubyOnRails
[14:18:53] shilon: has joined #RubyOnRails
[14:19:53] Kallis: has joined #RubyOnRails
[14:20:56] naftilos76: pontiki, https://gist.github.com/anonymous/f9e1eb6ce3cb13c006a2
[14:21:12] Macaveli: has joined #RubyOnRails
[14:22:00] pontiki: hum, could you tell me where the line with the link is?
[14:22:18] j_mcnally: has joined #RubyOnRails
[14:22:48] pontiki: oh i see it
[14:23:17] naftilos76: pontiki, http response: https://gist.github.com/anonymous/dee0fa406344e2cbbb1e
[14:23:24] pontiki: when you use URL constructors, such as your `column_delete_path` and give it all those parameters, that's creating the query string
[14:23:48] naftilos76: it is the link_to '???', column_edit_path ....
[14:24:02] pontiki: look at the html that is generated from those
[14:24:12] hashrocket: has joined #RubyOnRails
[14:24:32] naftilos76: so what am i supposed to do if i still need to send all those params?
[14:25:07] naftilos76: it makes no sense to just send only the action name, doesn't it?
[14:25:43] pontiki: if you actually want to send it as post data, you'll have to build that separately.
[14:26:09] pontiki: let me ask, is there an issue with using the query string? does it end up being too long?
[14:26:12] dopamean_: has joined #RubyOnRails
[14:26:16] emilebosch: has joined #RubyOnRails
[14:26:54] ariarijp: has joined #RubyOnRails
[14:27:23] naftilos76: No it does not exceed the limit imposed by the server. My question is about making thinks the right way.
[14:27:29] livathinos: has joined #RubyOnRails
[14:27:32] michael_mbp: anyone here looked at moving the frontend to a grunt/gulp flow, i.e. isolating Sprockets/pipeline?
[14:28:12] umdstu: has joined #RubyOnRails
[14:28:14] michael_mbp: Some frontends love a non-pipeline based workflow. Just curious at the moment. I've looked a few Yeoman based configs.
[14:28:32] pontiki: naftilos76: this is probably where my lack of experience using remote: true plays out. i don't/haven't used it, and i build my AJAX queries separately :(
[14:28:55] naftilos76: pontiki, with jquery ajax?
[14:28:57] Macaveli: has joined #RubyOnRails
[14:29:00] michael_mbp: pontiki: remote: true simply triggers the rails UJS driver.
[14:29:11] MartinElvar: has joined #RubyOnRails
[14:29:12] michael_mbp: so all you need to do is hook into the UJS events instead.
[14:29:23] pontiki: naftilos76: more specifically Backbone and Angular
[14:29:29] pontiki: michael_mbp: not my question
[14:29:44] naftilos76: ok thanks for your time
[14:29:51] umdstu: hey all... having an issue in rails 4.2.2 where `rake db:drop` results in two DNE errors when it's not there. rake create results in one error but creates it, and drop results in one error but drops it. looks like each rake command is run twice. what gives?
[14:30:03] Macaveli_: has joined #RubyOnRails
[14:30:15] michael_mbp: naftilos76: https://github.com/rails/jquery-ujs/wiki/ajax
[14:30:58] pontiki: michael_mbp: for your question; i've only done so by separating the rails bit into strictly an API and the front end in Angular using gulp + webpack
[14:31:14] badmadrad: has joined #RubyOnRails
[14:32:21] kitsuneyo: what's the best way to create anchors that can be linked to with domain.com/page#my-link? do you gave to use <a> tags?
[14:32:28] michael_mbp: pontiki: yeah, something similar
[14:32:55] michael_mbp: this way, you can always pull out the frontend and get another non-rails guy to work on it.
[14:33:15] naftilos76: michael_mbp, thanks but i have already built my own version of jquery's ajax to make it more efficient like evaluating strings with a "#" char instead of having to get them with method $() first and pass their value to ajax
[14:33:15] pontiki: kitsuneyo: that's done with an <a name="my-link"></a> tag
[14:33:47] kitsuneyo: pontiki, ok, thought there might be another way to do it
[14:34:48] pontiki: not that i'm aware of; of course that covers a whole lot of territory
[14:36:41] havenwood: has joined #RubyOnRails
[14:38:35] kies: has joined #RubyOnRails
[14:39:28] jobewan: has joined #RubyOnRails
[14:41:12] SteenJobs: has joined #RubyOnRails
[14:42:31] jholm: has joined #RubyOnRails
[14:43:09] zpe: has joined #RubyOnRails
[14:44:09] wethu: has joined #RubyOnRails
[14:47:00] ngscheurich: has joined #RubyOnRails
[14:47:11] eprasad: has joined #RubyOnRails
[14:51:45] johnflux: My views take 4 seconds to render
[14:51:51] johnflux: What could I do to try to find out why?
[14:51:54] johnflux: (I'm a bit of a noob)
[14:52:26] ecnalyr: has joined #RubyOnRails
[14:55:08] roolo: has joined #RubyOnRails
[14:55:25] pontiki: johnflux: if you look in the log, it will show the breakdown of where the time is spent. that's the first step
[14:55:37] ellisTAA: has joined #RubyOnRails
[14:55:42] mary5030: has joined #RubyOnRails
[14:56:17] tonios57: has joined #RubyOnRails
[14:57:00] artto: has joined #RubyOnRails
[14:58:33] pixelhandler: has joined #RubyOnRails
[15:01:09] Encapsulation: has joined #RubyOnRails
[15:09:43] xhosae: has joined #RubyOnRails
[15:10:50] xhosae_: has joined #RubyOnRails
[15:11:07] Ropeney: has joined #RubyOnRails
[15:11:13] drale2k: has joined #RubyOnRails
[15:12:57] NodeNagant: has joined #RubyOnRails
[15:13:00] jeadre: has joined #RubyOnRails
[15:13:31] Maletor: has joined #RubyOnRails
[15:13:39] cornerma1: has joined #RubyOnRails
[15:13:44] nettoweb: has joined #RubyOnRails
[15:16:02] andybernard: has joined #RubyOnRails
[15:19:48] The_Phoenix: has joined #RubyOnRails
[15:23:04] oscarb92: has joined #RubyOnRails
[15:24:09] paulcsmith: has joined #RubyOnRails
[15:27:21] skroon: has joined #RubyOnRails
[15:27:49] lagweezle: Ooh! Busy in here! Maybe I'll have luck this morning!
[15:28:53] maia: has joined #RubyOnRails
[15:28:56] oscarb92: how can I define a _params.permit() hash that contains 3 level of nested attributes? Meaning, would this be correct? Because the fields from the 3rd level association are not saving to the DB and I'm not sure what could possibly be wrong
[15:29:00] oscarb92: https://gist.github.com/OscarBastardo/d7fb8a83aae7bb2a498a
[15:30:21] lagweezle: When I specify username in my database.yml, rails fails to connect to the DB and appears to be trying to auth as user ''@'localhost' ... I can't seem to get rails to connect to mysql as not-root. https://gist.github.com/ncolton/1f1c372a3691081e6e81 with many details, and I've run out of things that make sense to try. Please help!
[15:30:26] riotjones: has joined #RubyOnRails
[15:32:39] tercenya: has joined #RubyOnRails
[15:34:23] lagweezle: ACTION killed chat, it seems. :(
[15:34:35] pontiki: i haven't used mysql on rails in ages
[15:35:03] pontiki: i don't know why that wouldn't work
[15:35:09] SteenJobs: has joined #RubyOnRails
[15:35:20] pontiki: i'm going to try something
[15:37:08] maz-dev: has joined #RubyOnRails
[15:37:19] kinduff: has joined #RubyOnRails
[15:37:53] rakm: has joined #RubyOnRails
[15:38:15] Cache_Money: has joined #RubyOnRails
[15:40:37] mikecmpbll: :D :D just solved some shitty annoying JS problem that i've spent the last two days on
[15:40:57] disgrntld: has joined #RubyOnRails
[15:42:25] Linuus: has joined #RubyOnRails
[15:42:27] ellisTAA: mikecmpbll: gj!
[15:42:31] Cervajz: has joined #RubyOnRails
[15:42:37] krisquigley: has joined #RubyOnRails
[15:43:22] annlewis: has joined #RubyOnRails
[15:43:31] ellisTAA: lagweezle: did u read this: http://edgeguides.rubyonrails.org/configuring.html#configuring-a-database
[15:44:06] sandstrom: has joined #RubyOnRails
[15:44:46] ellisTAA: oscarb92: https://stackoverflow.com/questions/18436741/rails-4-strong-parameters-nested-objects
[15:44:47] yatish27: has joined #RubyOnRails
[15:45:18] Cervajz: has joined #RubyOnRails
[15:46:13] mikecmpbll: lagweezle: i don't think that's an issue with the username
[15:46:32] NodeNaga_: has joined #RubyOnRails
[15:47:07] maia: has left #RubyOnRails: ()
[15:47:09] kinduff: oscarb92: also make sure the params that are coming to your rails controller action matches the nested attributes names. If you're using nested attributes from the model, param names will change.
[15:47:10] mikecmpbll: lagweezle: how did you create the user?
[15:48:29] mikecmpbll: nvm ignore me.
[15:50:30] pontiki: idk, i'm stumped. the only thing that seems odd is having to explicity give the socket
[15:53:10] mikecmpbll: isn't it meant to be GRANT ALL PRIVILEGES ON your_mom_dev.* TO 'dev'@'localhost'
[15:53:17] christiandsg: has joined #RubyOnRails
[15:53:33] mikecmpbll: depends on how the user was created i guess
[15:53:33] Norrin: has left #RubyOnRails: ("Dueces")
[15:54:23] smathy: has joined #RubyOnRails
[15:54:26] pontiki: i did it just the way lagweezle did, and it works fine for me :(
[15:54:42] mikecmpbll: then he liessssss
[15:55:09] jmpp: has joined #RubyOnRails
[15:56:22] pontiki: only thing is that it doesn't like the socket entry, but i get a different error for that. "1Can't connect to local MySQL server through socket '/var/run/mysqld/mysql.sock' (2)"
[15:56:27] maz-dev: has joined #RubyOnRails
[15:56:31] nickenchuggets: assimilate to the hive borg, resistance is futile
[15:57:13] i: has joined #RubyOnRails
[15:57:18] lagweezle: pontiki: Yeah. AFAIK is what I've got SHOULD work without a damned problem.
[15:57:35] lagweezle: EllisTAA: I did read it, and it has nothing about the specifics of MySQL configuration.
[15:57:52] ellisTAA: lagweezle: : \
[15:57:53] lagweezle: I did convert from sqlite3 but ... not like there is much I can screw up.
[15:58:15] lagweezle: mikecmpbll: Look down at the bottom of https://gist.github.com/ncolton/1f1c372a3691081e6e81 for the user and DB creation commands.
[15:58:18] pontiki: the error indicates it's trying to log in with an empty user
[15:58:30] lagweezle: Additionally, I can use mysql the CLI to log in w/o a problem as the dev user for DB access.
[15:58:34] johntrails: has joined #RubyOnRails
[15:58:37] mikecmpbll: lagweezle: i can't see the user creation commands?
[15:58:40] lagweezle: pontiki: PRECISELY! That make my head hurt.
[15:58:41] ellisTAA: lagweezle: did u try what you are doing in a new app to see if the problem is with your approach or some conflict with your code?
[15:58:55] lagweezle: mikecmpbll: in the first comment at the bottom of the gist. Starts with, "In case it matters..."
[15:59:19] mikecmpbll: lagweezle: grant all privileges doesn't create a user ... does it?
[15:59:25] mikecmpbll: ACTION is not a mysql expert
[15:59:34] lagweezle: mikecmpbll: It's weird, I know.
[15:59:36] pontiki: iirc, you don't need to create the user first
[15:59:45] svankmajer: has joined #RubyOnRails
[15:59:45] mikecmpbll: lagweezle: there's a CREATE USER command
[15:59:51] mikecmpbll: http://dev.mysql.com/doc/refman/5.1/en/adding-users.html
[15:59:54] marr: has joined #RubyOnRails
[16:00:01] srinidhi: has joined #RubyOnRails
[16:00:06] JoshL: has joined #RubyOnRails
[16:00:33] svankmajer: Hello everyone! Is there a way to use validates_uniqueness_of scoping by a nested association?
[16:00:35] pontiki: in my wee check just now, i di not have to create user before granting privs
[16:00:41] lagweezle: "If an account named in a GRANT statement does not already exist, GRANT may create it under the conditions described later in the discussion of the NO_AUTO_CREATE_USER SQL mode."
[16:01:01] lagweezle: I can also log in using the CLI mysql client program as the 'dev' user w/o an issue.
[16:01:03] towski_: has joined #RubyOnRails
[16:01:20] mikecmpbll: everyday is a school day
[16:01:25] lagweezle: SOMETHING fucky is happening to get rails to ack that I did specify the username, but NOT actually USE the specified username. >.<
[16:01:26] lea: has joined #RubyOnRails
[16:01:41] mikecmpbll: my instinct is that it's not rails, but meh
[16:01:50] lagweezle: I begin to think I should create a rails bug.
[16:02:03] rogue_koder: has joined #RubyOnRails
[16:02:08] yaymukund: has joined #RubyOnRails
[16:02:11] oscarb92: EllisTAA: I read it and then read this article http://patshaughnessy.net/2014/6/16/a-rule-of-thumb-for-strong-parameters
[16:02:19] tubbo: lagweezle: you're not giving your user proper access
[16:02:20] lagweezle: mikecmpbll: There is still a rails 'issue' even if using root and mysql2: https://gist.github.com/ncolton/1f1c372a3691081e6e81#file-output
[16:02:27] tubbo: lagweezle: it's not a rails bug, mysql is just not configured properly
[16:02:28] lagweezle: tubbo: I'm not? Please enlighten!
[16:02:39] mikecmpbll: lagweezle: what's that issue?
[16:02:59] lagweezle: mikecmpbll: Using deprecated arguments.
[16:03:07] tubbo: lagweezle: i remember this all the way back from the php days. there are two ways to connect to mysql afaik: over TCP and over a local socket.
[16:03:08] rapidbus: has joined #RubyOnRails
[16:03:09] Rubie: has joined #RubyOnRails
[16:03:20] rapidbus: has left #RubyOnRails: ()
[16:03:29] lagweezle: tubbo: I was figuring it was a rails side thing because of "Access denied for user ''@'localhost' to database 'your_mom_dev'" not actually having a username.
[16:03:38] tubbo: lagweezle: if you have mysql configured to only accept local socket connections (makes sense on a dev workstation), no one will be able to ever connect through the localhost loopback interface, which runs over TCP
[16:04:13] lagweezle: tubbo: Well, yes...
[16:04:40] badmadrad: has joined #RubyOnRails
[16:04:46] oscarb92: I think I get it and I changed the code to this ( adding the to the nested model attrs to note that there can be multiple in the form{}) but still does not save that data https://gist.github.com/OscarBastardo/d7fb8a83aae7bb2a498a
[16:05:02] lagweezle: tubbo: Wouldn't that be counteracted by my specifying the socket to connect with in database.yml ?
[16:05:46] oscarb92: Im using this gem to generate the dynamic inputs https://github.com/ncri/nested_form_fields
[16:05:57] lea: has joined #RubyOnRails
[16:06:13] tubbo: lagweezle: it would. i'd be more curious as to why you're not getting socket connections up and running. that should definitely work.
[16:06:36] Denarii: has joined #RubyOnRails
[16:06:45] mikecmpbll: lagweezle: what's the command you've used to log in through the mysql shell successfully?
[16:06:47] lagweezle: tubbo: Er, not getting socket connections up and running? As in, the /tmp/mysql.sock connection route is not working?
[16:07:23] craysiii: has joined #RubyOnRails
[16:07:28] mikecmpbll: also, am i understanding that gist right that it works if you use the configuration from the database.yml file on gist?
[16:07:36] umgrosscol: has joined #RubyOnRails
[16:07:44] BLuEGoD: has joined #RubyOnRails
[16:08:03] lagweezle: Oh son of a bitch ...
[16:08:04] jeadre: has joined #RubyOnRails
[16:08:16] lagweezle: Command: mysql -S /tmp/mysql.sock -u dev
[16:08:47] lagweezle: Although I just ran "USE your_mom_dev;" after that and got "ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'your_mom_dev'" ... -.-
[16:08:51] Sonicrida: has joined #RubyOnRails
[16:08:56] tubbo: hmmmmmmmmmmmmmmmmmm
[16:09:00] lagweezle: ACTION glares at MySQL.
[16:09:02] tubbo: definitely a rails bug ;)
[16:09:08] lagweezle: tubbo: Absolutely!
[16:09:27] lagweezle: This ... this is why I gripe at my coworkers about crappy error messages.
[16:09:29] BLuEGoD: in a controller when I have inside the "new" method @blah = Blah.new. How do I use that object when I post to the "create" method ?
[16:09:43] mikecmpbll: you can pass anything to -u and it'll open the shell
[16:10:10] tubbo: BLuEGoD: you don't, the params from that object get passed through the http request and you instantiate a new object in the create action, then persist it
[16:10:28] tubbo: BLuEGoD: instead of Blah.new you'd probably do something like Blah.new(blah_params)
[16:10:39] tubbo: and then check blah.save to choose whether to show a sunny-day response or an error
[16:11:21] maz-dev: has joined #RubyOnRails
[16:11:32] BLuEGoD: tubbo: that makes sense, but in that case the first object is not the same as the second.. As in, you don't really need that first Blah.new inside "new"
[16:11:53] Guest65069: has left #RubyOnRails: ()
[16:12:00] tubbo: BLuEGoD: well, you only need it if you want to use the nice form_for helpers
[16:12:03] rakm: has joined #RubyOnRails
[16:12:11] lagweezle: Huh. Interesting -->
[16:12:11] lagweezle: MySQL does not support wildcards in user names. To refer to an anonymous user, specify an account with an empty user name with the GRANT statement:
[16:12:14] lagweezle: GRANT ALL ON test.* TO ''@'localhost' ...;
[16:12:19] strcmp1: has joined #RubyOnRails
[16:12:21] badmadrad: has joined #RubyOnRails
[16:13:17] BLuEGoD: tubbo: I see. Okay. In the new action I have some params that I receive basically, so it's Blah.new(some_params) and in the create method I have Blah.new(more_params). What's the best way to pass those params from new to create? Perhaps in the URL helper of the form tag ?
[16:13:33] mikecmpbll: lagweezle: 'dev'@'localhost' ...
[16:13:50] tubbo: BLuEGoD: you don't receive params in the new action, a user would type said params into a form of some sort. the new action is just a GET request for showing the form, that's it
[16:14:03] lagweezle: mikecmpbll: Oh. The GRANT was part of the text I copied from the MySQL docs that I was quoting. Or trying to quote.
[16:14:04] liquid-silence: has joined #RubyOnRails
[16:14:17] NodeNagant: has joined #RubyOnRails
[16:14:23] lea: has joined #RubyOnRails
[16:14:29] mikecmpbll: lagweezle: i don't know what you mean
[16:14:41] tubbo: BLuEGoD: have you seen this? http://guides.rubyonrails.org/form_helpers.html most of the questions you've asked so far can be answered by a thorough read of this guide
[16:15:05] lagweezle: The bit about referring to an anonymous user is ''@'<some host>'
[16:15:16] BLuEGoD: tubbo: the form is a GET, but I'm using devise invitable and somehow I pass a token and an ID in there. That's why the new action has some params
[16:15:27] mikecmpbll: lagweezle: yes..
[16:15:42] drale2k: has joined #RubyOnRails
[16:16:01] lagweezle: mikecmpbll: I thought you were responding to me having written "GRANT ALL ON test.* TO ''@'localhost' ...;
[16:16:08] johnflux: from an application helper, how do I use helpers like image_tag ?
[16:16:22] johnflux: and foo_path
[16:16:35] liquid-silence: has joined #RubyOnRails
[16:16:38] BLuEGoD: tubbo: basically the form URL is something like myform?token=blah.
[16:16:40] mikecmpbll: lagweezle: i was
[16:17:32] lagweezle: mikecmpbll: That GRANT command was part of my copy and paste, regarding 'anonymous users', not me fumbling for the correct grant statement.
[16:17:32] meatherly: has joined #RubyOnRails
[16:18:00] mikecmpbll: ok, then i've no idea why you pasted any of it
[16:18:04] lagweezle: Interesting. I can NOT use a wildcard hostname for permissions over socket connections. O.o
[16:18:21] lagweezle: GRANT ALL ON your_mom_test.* TO 'test'@'%'; -- doesn't grant the user the necessary access rights O.o
[16:18:51] mikecmpbll: lagweezle: how are you confirming that
[16:19:26] liquid-silence: has joined #RubyOnRails
[16:19:39] lagweezle: Apply in one window, flush privileges, connect in different shell to DB as user test, show databases doesn't list the your_mom_test. If I do 'test'@'localhost' however, I CAN see the DB as the test user.
[16:20:02] lagweezle: I made sure to disconnect and reconnect to ensure that permissions are applied to each given connection / login.
[16:20:06] mikecmpbll: well, that kind of makes sense because you can't connect with the socket from anything other than localhost right?
[16:20:20] lpil: has joined #RubyOnRails
[16:20:30] lagweezle: I concur. I am confused that the wildcard host does not include 'localhost', though.
[16:21:09] meatherly: has joined #RubyOnRails
[16:21:10] bricker: has joined #RubyOnRails
[16:21:23] Rubie: has joined #RubyOnRails
[16:21:23] mikecmpbll: lagweezle: "The 'monty'@'localhost' account is necessary if there is an anonymous-user account for localhost. Without the 'monty'@'localhost' account, that anonymous-user account takes precedence when monty connects from the local host and monty is treated as an anonymous user."
[16:21:44] mikecmpbll: "he reason for this is that the anonymous-user account has a more specific Host column value than the 'monty'@'%' account and thus comes earlier in the user table sort order."
[16:22:01] shinnya: has joined #RubyOnRails
[16:25:04] krisquigley: has joined #RubyOnRails
[16:25:21] lagweezle: Ooooooooooh. So more specific has precidence based on host first, then on name. So with ''@'localhost', since localhost matches, the @'%' rules are completely ignored, and I get forced into user '' even if I specify a user that does actually ahve a user-host match?
[16:25:55] armyriad: has joined #RubyOnRails
[16:26:06] johnflux: include ActionView::Helpers::AssetTagHelper
[16:26:13] johnflux: this lets me use the image_tag helper
[16:26:30] johnflux: what would I need to use the foo_path helper though?
[16:26:41] mikecmpbll: lagweezle: i believe that's what it's saying, yes.
[16:27:11] sarink: has joined #RubyOnRails
[16:27:13] johnflux: oh, FooHelper i think
[16:27:37] mikecmpbll: ''@'localhost' will match with higher precedence than 'monty'@'%' for a connection as 'monty'@'localhost'
[16:27:53] AlexW2611: has joined #RubyOnRails
[16:27:56] sacarlson: has left #RubyOnRails: ()
[16:28:12] pontiki: johnflux: it depends on where you want to use it. normally in controllers and views, you don't have to do anything
[16:30:14] johnflux: pontiki: from a helper
[16:30:47] jholm: has joined #RubyOnRails
[16:31:59] banjara: has joined #RubyOnRails
[16:32:00] kinduff: has joined #RubyOnRails
[16:32:58] michaeldeol: has joined #RubyOnRails
[16:34:09] qejk: has joined #RubyOnRails
[16:35:06] pontiki: johnflux: i think you want ActionView::Helpers::UrlHelper
[16:36:16] bmalum: has joined #RubyOnRails
[16:36:37] mikecmpbll: has joined #RubyOnRails
[16:37:12] lagweezle: mikecmpbll: That is subtle ... and annoying. Thank you very much!
[16:38:25] float12129: has joined #RubyOnRails
[16:39:35] CanTonic: has joined #RubyOnRails
[16:40:25] johnflux: pontiki: I tried that, but it wasn't sufficient
[16:40:36] d2dchat: has joined #RubyOnRails
[16:40:49] johnflux: undefined method `preview_path' for #<ApplicationHelper::HTMLwithFileInfo:0x007fec70ceaea0>
[16:40:52] voltalio: has joined #RubyOnRails
[16:41:32] johntrails: Can someone help me out with a relationship issue.. I have a model for "Company" which has many "warehouses and customers", I have a "Customer" model which beelongs to "Company" . Now I am creating a new model for customer schedules. Would my relationship to customer be "belongs_to" or "has many" ?
[16:42:55] tubbo: johntrails: what's a customer schedule?
[16:43:19] roolo: has joined #RubyOnRails
[16:43:55] johntrails: a schedule of what day he gets deliveries.
[16:44:13] johntrails: each customer will have various delivery schedules, depending on the day of the week
[16:44:27] annlewis: has joined #RubyOnRails
[16:45:23] zpe: has joined #RubyOnRails
[16:45:38] zendrix: has joined #RubyOnRails
[16:45:47] hackeron: has joined #RubyOnRails
[16:46:03] bruno-: has joined #RubyOnRails
[16:46:07] johnflux: pontiki: ah, using: Rails.application.routes.url_helpers.preview_path works
[16:48:18] ethicalhack3r: has joined #RubyOnRails
[16:48:51] voltalio: has joined #RubyOnRails
[16:49:13] ethicalhack3r: Hi! Does anyone know how I can access the object id within a node when using a collection in Rabl? https://gist.github.com/ethicalhack3r/354a5268007344b89a8b
[16:50:06] tubbo: johnflux: i suppose a delivery schedule belongs_to a customer then
[16:50:24] tubbo: and then a customer has_many schedules
[16:50:38] tubbo: but you could also just have one schedule, that has many times or something. who knows
[16:50:59] annlewis: has joined #RubyOnRails
[16:51:28] lagweezle: Thank you EVERYONE for helping me be less stupid with my rails-mysql configuration!
[16:52:12] float12129: has joined #RubyOnRails
[16:53:35] bulldawgden: has joined #RubyOnRails
[16:53:38] NodeNagant: has joined #RubyOnRails
[16:54:08] float12129: johntrails, is there a "Schedule" model as well? Are there only a certain number of schedules, that follow a certain format? Or is each one custom, and describing the particular customer it relates to
[16:54:13] wldcordeiro: has joined #RubyOnRails
[16:54:13] tubbo: lagweezle: no worries...now all you have to do is convert to postgresql to solve all your problems ;)
[16:54:36] lagweezle: tubbo: I wanted to use PostgreSQL, but we're a MySQL using shop here.. :/
[16:55:02] tubbo: understood
[16:55:25] dici: has joined #RubyOnRails
[16:56:40] ryan_000: has joined #RubyOnRails
[16:57:05] a1fa: has joined #RubyOnRails
[16:57:43] petricore: has joined #RubyOnRails
[16:57:51] a1fa: in activerecord, what is the action that occurs prior to create (insert); i want to modify the default create statement to ensure something is inserted into the INSERT query
[16:58:12] a1fa: is it before_save?
[16:58:29] tubbo: a1fa: here's the entire callback lifecycle http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html
[16:58:48] johntrails: float12129: there is a schedule model. there are only a certain number of schedules, and the schedules can change from week to week
[16:59:03] mikecmpbll: lagweezle: it's not really that subtle, it would have to decide one way or another which is the preference?
[16:59:15] mikecmpbll: if it was decided the other way you'd have people saying the opposite!
[16:59:58] mikecmpbll: eh, maybe there's a better way. /shrugs
[17:00:34] float12129: johntrails, so CustomerSchedule sits between Customer, and Schedule, and is effectively the join b/t those two models, correct?
[17:01:00] dudo: has joined #RubyOnRails
[17:01:31] svankmajer: has joined #RubyOnRails
[17:01:45] float12129: johntrails, so I envision the customer_schedules table has having a customer_id, and a schedule_id, and CustomerSchedule belongs_to both Customer and Schedule
[17:04:15] float12129: johntrails, to clarify, can a Customer change its associated Schedule week-to-week, or are you saying the Schedules themselves may change week-to-week. May be important if you need to track history of what the previous Schedule/CustomerSchedule was
[17:04:58] ethicalhack3r: Hi! Does anyone know how I can access the object id within a node when using a collection in Rabl? https://gist.github.com/ethicalhack3r/354a5268007344b89a8b
[17:05:55] jmpp: has joined #RubyOnRails
[17:06:33] johntrails: float12129: there is no customer schedule... i have a customers model/controller
[17:06:44] johntrails: i want to create a new model/controller for schedules that relate to customers
[17:06:53] johntrails: the relationship is from schedules straight to customers
[17:09:45] choke: has joined #RubyOnRails
[17:10:09] nfk: has joined #RubyOnRails
[17:13:31] arup_r: has joined #RubyOnRails
[17:14:09] mikebonar: has joined #RubyOnRails
[17:14:43] arup_r: why in my Rails console I am getting -- helper.sanitize "<a href='test.com'>test</a>" #=> "<a href=\"test.com\">test</a>"
[17:14:50] arup_r: I expected test
[17:16:12] badmadrad: has joined #RubyOnRails
[17:16:47] romdi: has joined #RubyOnRails
[17:17:09] NodeNagant: has joined #RubyOnRails
[17:17:54] cnk: has joined #RubyOnRails
[17:18:00] frzn: has joined #RubyOnRails
[17:20:18] DoubleMalt: has joined #RubyOnRails
[17:20:18] tubbo: arup_r: i think you have to exclude that tag from the whitelist of tags, but there's another method that does what you want a little better
[17:20:30] tubbo: arup_r: http://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-strip_links
[17:21:24] cschneid_: has joined #RubyOnRails
[17:21:45] ziggles: has joined #RubyOnRails
[17:23:22] badmadrad1: has joined #RubyOnRails
[17:23:32] float12129: johntrails, Yeah I think there's a missing model there... CustomerSchedule
[17:23:52] float12129: johntrails, or at least a missing join table and HABTM... where else would the foreign keys go?
[17:24:37] tubbo: johntrails: i think the concept of a "schedule" doesn't need to have an actual model associated with it. a user's "schedule" is simply all of the deliveries that they own
[17:25:18] aaron: has joined #RubyOnRails
[17:25:49] arup_r: tubbo: >> helper.sanitize "<a href='test.com'>test</a>", tags: ['a'] #=> "<a href=\"test.com\">test</a>"
[17:26:32] hazelux: has joined #RubyOnRails
[17:26:42] tubbo: arup_r: i don't really use sanitize() all that often, but i remember it being around mostly to escape out weird tags like <script> or something
[17:26:47] tubbo: arup_r: what are you trying to do here?
[17:26:54] tubbo: i think you might be using the wrong tool for the job
[17:27:13] Mr_Corealis: has joined #RubyOnRails
[17:27:14] hazelux: hey there folks! Is there a method that you can call on ["one", "two", "three"] that returns "one, two and three"?
[17:27:47] tubbo: hazelux: try to_sentence
[17:27:52] arup_r: ok.. tubbo just trying to see how to works.. but not getting how doco is said about it
[17:27:59] tubbo: hazelux: except i think it also includes the oxford comma :)
[17:28:21] tubbo: arup_r: ok cool, well i'm not sure how much help i'll be in this domain
[17:28:23] arup_r: I found strip_tags helpful also with method you recommended
[17:28:49] arup_r: but sanitize... not doing much help as documented
[17:28:56] arup_r: thanks tubbo anyway
[17:29:42] hazelux: thanks tubbo! What's wrong with the oxford comma?
[17:29:45] johntrails: in pure SQL... I have a "Customers" Table, PK of ID, I have a Schedules Tables, PK of ID and FK of Customer_ID
[17:29:55] elv: has joined #RubyOnRails
[17:30:03] johntrails: how do i translate that to rails as far as has_many / belongs_to
[17:30:31] johntrails: tubbo: deliveries are important because it's what the warehouse uses for picking and staging
[17:30:39] johntrails: and it changes constantly by corporate
[17:30:45] tubbo: hazelux: nothing wrong with it
[17:30:55] johntrails: so it cnanot solely be based on passed deliveries if the schedule is really for future deliveries
[17:30:55] centrx: hazelux, You can use one of the options in to_sentence to change the "last word connector"
[17:31:28] fast_scooter: has joined #RubyOnRails
[17:31:29] BBonifield: has joined #RubyOnRails
[17:31:32] sandstrom: has joined #RubyOnRails
[17:31:39] tubbo: johntrails: ActiveRecord is a little hard to use if you're supplying your own column names. it's better to have lowercase column names like customer_id and id. don't fight the framewrok.
[17:31:41] tubbo: framework*
[17:32:17] romdi`: has joined #RubyOnRails
[17:32:28] lagweezle: Okay, to_sentence is rather nifty...
[17:32:33] bmalum: has joined #RubyOnRails
[17:33:04] BBonifield: I am trying to customize my `rails server` command to always use SSL in development. I am already using thin, and I have things configured so I can start it up with a big `thin start` command. However, I???d like to just make the `rails server` command be the correct shorthand. How do I customize the command to send default arguments to thin?
[17:33:22] tubbo: johntrails: this whole thing is super confusing. i don't even know if you already have a schema or not. if you already have one, everything i've suggested to you up until this point has been totally useless.
[17:34:09] hazelux: sweet. It is nifty indeed! Yup, seems much less verbose than the pure ruby version I got on #ruby
[17:34:51] tubbo: haha hazelux...to_sentence is a feature of ActiveSupport, so #ruby wouldn't suggest it to you since you'd need AS to be installed. but since you're using rails, AS is already in your bundle
[17:34:59] float12129: johntrails, so a handy rule of thumb is that if the foreign key i.e. "customer_id" lives in the schedules table, then Schedule belongs_to Customer
[17:35:26] paulcsmith: has joined #RubyOnRails
[17:35:29] float12129: You can think of a Customer "Rubber Stamping" a Schedule row with it's primary key and saying "You belong to me"
[17:35:42] krisquigley: has joined #RubyOnRails
[17:35:54] hazelux: tubbo: Yup. I was just making sure there wasn't a simple method that was pure Ruby instead of relying on AS
[17:36:08] hazelux: Nothing wrong with it, for that matter
[17:36:25] float12129: johntrails, So if you are working with an underlying existing table structure that is what you should go with. Whether that actually matches the problem domain you're describing is a different story
[17:38:00] _djbkd: has joined #RubyOnRails
[17:39:00] Zackio: has joined #RubyOnRails
[17:40:37] jmpp: has joined #RubyOnRails
[17:41:05] meatherly: has joined #RubyOnRails
[17:42:40] RegulationD: has joined #RubyOnRails
[17:43:26] johntrails: thanks you.. that really helped clear things up
[17:43:27] arup_r: why is it giving 7 ? Time.at(2.hours.to_i).hour # 7
[17:43:44] krisquigley: has joined #RubyOnRails
[17:43:45] arup_r: It should give 2 hours
[17:43:45] towski_: has joined #RubyOnRails
[17:44:34] arup_r: well got it
[17:44:44] BBonifield: has joined #RubyOnRails
[17:45:37] kristofferR: has joined #RubyOnRails
[17:46:16] BBonifield: has joined #RubyOnRails
[17:46:32] baweaver: has joined #RubyOnRails
[17:47:03] Lightsword: has joined #RubyOnRails
[17:48:18] NodeNagant: has joined #RubyOnRails
[17:49:34] Cervajz: has joined #RubyOnRails
[17:49:53] jsrn_: has joined #RubyOnRails
[17:50:16] gusrub: has joined #RubyOnRails
[17:50:17] zendrix: has joined #RubyOnRails
[17:54:11] MrNagoo: has joined #RubyOnRails
[17:55:01] RegulationD: has joined #RubyOnRails
[17:56:02] christiandsg: has joined #RubyOnRails
[17:56:03] IrishGringo: has joined #RubyOnRails
[17:59:36] DEA7TH_: has joined #RubyOnRails
[18:01:32] tubbo: rhizome: welcome to it
[18:01:44] swept: has joined #RubyOnRails
[18:02:36] dopamean1: has joined #RubyOnRails
[18:03:21] choke: has joined #RubyOnRails
[18:03:28] gabeodess: has joined #RubyOnRails
[18:03:28] towski_: has joined #RubyOnRails
[18:03:35] RegulationD: has joined #RubyOnRails
[18:03:49] hightower4: has joined #RubyOnRails
[18:05:12] gabeodess: Hello all. I???m having trouble with my HTTPS settings on Heroku. Most traffic works: http://domain.com redirects to https://www.domain.com however, https://domain.com gets a connection refused error. I???m not sure what I???m missing in my configuration??? could someone help me with this?
[18:06:27] rhizome: i'm guessing you have to add another rule to redirect to the bare domain instead of www
[18:06:56] gabeodess: rhizome: would I do that in godaddy or Heroku?
[18:07:04] rhizome: or, more probably, www is the only one configured to respond to https
[18:07:18] rhizome: gabeodess: heck if i know. also, don't use godaddy
[18:08:19] MartinElvar: has joined #RubyOnRails
[18:09:01] paulcsmith: has joined #RubyOnRails
[18:12:16] badmadrad: has joined #RubyOnRails
[18:12:20] bmalum_: has joined #RubyOnRails
[18:12:25] chrisja: has joined #RubyOnRails
[18:13:15] hightower4: Hey, any ideas where in Rails there would be a limit on the max value in an int/bigint? I've tried overriding the default field 'id' to be bigint in the database (and all foreign key fields to also be bigint), and on a 64bit architecture a value of e.g. 1060258517765587969 still fits nicely into a Fixnum and Ruby uses a Fixnum for it. But when it goes through the whole rails stack, I get some (intermittent) errors.
[18:14:05] smathy: arup_r, because Time.at(2.hours.to_i) is the time at 2 hours from the epoch in your local timezone.
[18:14:05] oscarb92: has joined #RubyOnRails
[18:14:08] MrNagoo: I'm having an issue with Scrollmagic gem for rails
[18:14:28] tubbo: hightower4: your database may have size limits on your int types
[18:14:40] hightower4: tubbo, yes, I've taken care of the db fields by making them bigint
[18:14:45] tubbo: afaik, rails does not...and ruby should turn numeric literals into the correct object
[18:14:54] arup_r: yes smathy you are right
[18:15:08] tubbo: hightower4: i'm not positive on whether active_record respects that when it comes out of the DB
[18:15:14] smathy: arup_r, sorry, I only just noticed you saying that you worked it out.
[18:15:29] arup_r: its ok.. :)
[18:15:30] baweaver: has joined #RubyOnRails
[18:15:34] workmad3: hightower4: what sort of errors are you getting?
[18:15:44] tubbo: hightower4: the docs for Fixnum say "Holds Integer values that can be represented in a native machine word (minus 1 bit). If any operation on a Fixnum exceeds this range, the value is automatically converted to a Bignum."
[18:15:46] hightower4: tubbo, right. I've assumed that to rails/ruby it would make no difference, because this value should still fit nicely into Fixnum, which is the default (used even for plain ints)
[18:15:57] bronson: has joined #RubyOnRails
[18:16:32] MrNagoo: it creates an application.js.coffee file to do the two require and then I get an error on the jquery.scrollmagic one
[18:16:35] tubbo: hightower4: seems to me like your problem is elsewhere, saying "when it goes through the whole rails stack" indicates to me that this is merely a guess as to whats
[18:16:45] tubbo: what's happening, and not backed up by any hard evidence
[18:16:57] hightower4: tubbo, it's a guess, yes. Based on the fact that if I remove two digits from this large number, the error does not happen
[18:17:23] oscarb92: Hello guys, I'm trying to save dynamic nested fields (2nd level association) using the nested_form_fields gem https://github.com/ncri/nested_form_fields but the nested elements for the deepest associations are not being sent when I submit the form. Here's the view: https://gist.github.com/OscarBastardo/e8de9fc902f0a3f26a43
[18:17:27] hightower4: workmad3, in some table, there is a foreign key containing the ID of a record in another table, and following that association does not work. I'm not sure exactly why (I will go and reproduce it)
[18:17:44] tubbo: hightower4: afaik, ruby shouldn't be screwing around with your integers. that is, a modern 1.9+ ruby
[18:17:53] NodeNagant: has joined #RubyOnRails
[18:17:59] tubbo: and MRI of course...i have no experience w/jruby or rbx
[18:18:14] hightower4: Right, I agree with all that's been said. I'll follow up in here if I get more evidence/pointers to where the issue may be
[18:18:17] workmad3: hightower4: did you make sure that your FK was changed to a bigint too? or is it experience wraparound errors because mysql sucks and doesn't error-out when you do something like try to insert a number that's too large?
[18:18:18] tubbo: MrNagoo: could be an error with the actual jquery.scrollmagic
[18:18:37] hightower4: workmad3, yes, made sure it was bigint, and the database is postgres
[18:18:40] yardenbar: has joined #RubyOnRails
[18:18:42] MrNagoo: yeah, i don't know where that library is
[18:18:42] arup_r: any body know this answer? http://stackoverflow.com/questions/32233004/how-can-i-know-what-activesupport-duration-was-used
[18:18:58] jholm: has joined #RubyOnRails
[18:19:00] arup_r: #SOreadytohelp
[18:19:24] tubbo: MrNagoo: here is the version of scrollmagic that gem is installing -> https://github.com/venturit/scrollmagicjs-rails/blob/master/vendor/assets/javascripts/jquery.scrollmagic.js#L2, and here is the current version of scrollmagic from their own git repo -> https://github.com/janpaepke/ScrollMagic/blob/master/scrollmagic/uncompressed/ScrollMagic.js#L2
[18:19:29] workmad3: hightower4: ah ok :)
[18:19:45] tubbo: MrNagoo: so it might be outdated
[18:20:20] tubbo: MrNagoo: if the asset gem is not working for you, i suggest using something like https://rails-assets.org/ which is a bridge between bower and rubygems, and allows you to pull in bower packages to your rails app via the Gemfile
[18:20:37] MrNagoo: would it just be easier for me to add the .js file to the tree and not worry about the gem?
[18:20:51] workmad3: hightower4: out of curiosity, how did you get the columns into bigints?
[18:22:06] workmad3: hightower4: not sure it'll help... intermitent errors are a real PITA to sort
[18:22:23] momomomomo: has joined #RubyOnRails
[18:23:52] MrNagoo: are you typing my name to reply or is there a shortcut?
[18:24:05] workmad3: MrNagoo: tab-completion
[18:24:16] MrNagoo: workmad3: ha sweet
[18:24:29] MrNagoo: I'm a noob
[18:24:50] MrNagoo: tubbo: I dont know what bower is
[18:25:01] tubbo: MrNagoo: http://bower.io
[18:25:13] hightower4: workmad3, I wanted to do this implicitly, without modifying the migrations, so I overwrote create_table and add_reference in ActiveRecord::ConnectionAdapters::SchemaStatements to insert an explicit "id: 'bigint not null default ..." into the parameters if the type of :id was not already specified or if it was specified as int. Also, possibly not necessary, but I have overwritten function aliased_types in ActiveRecord::ConnectionAdapters::Table
[18:25:13] hightower4: Definition to treat 'int' and 'integer' as aliases for 'bigint'
[18:25:23] tubbo: MrNagoo: eh, "easier" is a subjective term. sure it would be easier now, but definitely not when someone has to update it. especially if there's extra assets like CSS or images.
[18:26:11] workmad3: hightower4: is this an app in production? :/
[18:26:21] hightower4: workmad3, no, testing
[18:26:28] MrNagoo: tubbo: ok thanks. I'm using cloud9 so I'll see how this bower install goes
[18:26:36] workmad3: hightower4: and you completely destroyed all databases and re-ran your migrations?
[18:27:07] arooni-mobile: has joined #RubyOnRails
[18:27:19] hightower4: workmad3, yes. Also to make sure I didn't make a mistake (or that rails used some other functions I did not overwrite), for test I have also replaced all int(eger)? with bigint in all migrations, and then ran them
[18:27:22] workmad3: hightower4: because I'd seriously have just done 't.integer :id, limit: 8' for this and taken it as a cost of needing that extra width
[18:27:23] hightower4: But had same result
[18:27:55] hightower4: workmad3, is the limit: number of digits or bytes?
[18:28:01] workmad3: hightower4: bytes for integers
[18:28:55] hightower4: Great, let me try that just to test another approach. Let you know of the results
[18:29:06] workmad3: hightower4: using that, you also encode the information in the rails schema, you don't need to monkey-patch anything, and rails can make sure it doesn't do anything weird internally to try to narrow the width of values
[18:29:33] workmad3: (not sure it would, but given your intermittent errors, *something* is screwed up, and given you're monkey-patching the internals of the connection, my suspicion would go straight there)
[18:29:59] baweaver_: has joined #RubyOnRails
[18:30:43] workmad3: hightower4: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb#L524 there's the code in the connection adapter btw ;)
[18:31:06] emilebosch: has joined #RubyOnRails
[18:31:28] roolo: has joined #RubyOnRails
[18:31:48] drale2k: anyone tried this https://upcase.com/ ?
[18:32:02] baweaver_: has left #RubyOnRails: ()
[18:32:44] Depili: has joined #RubyOnRails
[18:32:52] hightower4: workmad3, right, certainly. My concern in that approach is the need to modify literally all migrations, and to always use the method of installing extensions using that step-by-step approach in which I can checkout, modify migrations, then run them
[18:33:39] manfrin: has joined #RubyOnRails
[18:33:55] workmad3: hightower4: is there any particular reason you need to increase the width of your ids btw?
[18:34:14] SuMo_D: has joined #RubyOnRails
[18:34:50] zendrix: has joined #RubyOnRails
[18:34:54] bruno-: has joined #RubyOnRails
[18:34:54] workmad3: hightower4: i.e. do you actually have billions of rows here?
[18:34:55] hightower4: A couple combined reasons (I'd prefer IDs all having equal number of digits, and also have sharding and global unique ID)
[18:35:27] hightower4: (well, global, within the databases and shards, not globally like uuids or something)
[18:35:37] workmad3: hightower4: ironically, uuids would be simpler than this ;)
[18:36:08] MrNagoo: tubbo: the main thing it seems is that when I install the scrollmagic gem, it doesn't seem to load jquery.scrollmagic file
[18:36:37] dideler12: has joined #RubyOnRails
[18:36:54] MrNagoo: with bower can i delete this application.js.coffee file? I only use application.js right now
[18:38:08] tubbo: MrNagoo: oh yeah, you never mentioned that it didn't load jquery.scrollmagic, you said it errored. i can only know what you tell me, so i went off that assumption.
[18:38:33] tubbo: MrNagoo: if jquery.scrollmagic isn't loading you have other issues. one thing is that rails has an order it checks manifest files. it will use application.js before application.js.coffee
[18:38:48] tubbo: MrNagoo: so when you do = javascript_include_tag 'application', it's grabbing the .js file before the .js.coffee if that is found
[18:38:54] tubbo: so i think that's your problem
[18:39:08] tubbo: just add the require lines to application.js instead of application.js.coffee which you shouldn't even have in the first place :D
[18:39:39] hightower4: workmad3, well, actually I just realized I can't just add :limit, because as mentioned I'd like to have the IDs unique, so I'm doing that by assigning them a default value which is coming from a sequence, rather than a fixed value + auto_increment
[18:39:53] bin_005: has joined #RubyOnRails
[18:40:04] voltalio: has joined #RubyOnRails
[18:40:08] hightower4: workmad3, but, maybe that for IDs, plus limit: for foreign keys
[18:40:38] workmad3: hightower4: dunno then... you're completely off-piste for rails here, which usually means you'll need to fight the framework constantly to do this
[18:41:02] QKO: has joined #RubyOnRails
[18:41:28] benlieb: has joined #RubyOnRails
[18:41:54] NBarnes: has joined #RubyOnRails
[18:41:56] erts: has joined #RubyOnRails
[18:42:22] Depili: has joined #RubyOnRails
[18:42:39] dstarh: Is there any easy wan in rack to do content negoation? We want to use rack-ssl-enforcer but only for html requests not json requests
[18:42:50] dstarh: s/wan/way/
[18:43:04] MartinElvar: has joined #RubyOnRails
[18:43:25] JoshGlzBrk: has joined #RubyOnRails
[18:44:26] thang: has joined #RubyOnRails
[18:45:08] tubbo: hightower4: why not use random hashes as IDs then, a la mongo?
[18:45:29] MartinElvar: has joined #RubyOnRails
[18:45:41] centrx: did you say mango or mondo?
[18:45:43] tubbo: it's a little confusing as to why you don't want UUIDs, as this is a feature most likely baked into your datbaase
[18:45:45] tubbo: database*(
[18:45:56] hightower4: tubbo, I'll look into that option
[18:46:00] yatish27: has joined #RubyOnRails
[18:46:20] MrNagoo: tubbo: "couldn't find file 'jquery.scrollmagic' with type 'application/javascript'"
[18:46:44] MrNagoo: I haven't started using it yet because I just am trying to install it
[18:47:45] rhizome: where is the file located in your filesystem?
[18:48:05] MrNagoo: do I have to make that file? and the greensock file or shouldn't the gem install them
[18:48:28] MrNagoo: rhizome: I don't know, I just followed the gem instructions
[18:48:31] tubbo: no, the gem installs them. they're here: https://github.com/venturit/scrollmagicjs-rails/tree/master/vendor/assets/javascripts
[18:49:36] MrNagoo: so is it safe to say that the gem is broken?
[18:49:37] towski__: has joined #RubyOnRails
[18:49:52] twotwo: has joined #RubyOnRails
[18:49:54] MrNagoo: I haven't had any other problems installing gems btw
[18:50:20] tubbo: MrNagoo: not really. we still haven't seen you post your application.js file
[18:50:24] tubbo: MrNagoo: or any code for that matter
[18:50:46] siddart: has joined #RubyOnRails
[18:50:59] Spami: has joined #RubyOnRails
[18:51:05] MrNagoo: do i type anything special to post code?
[18:51:27] rhizome: well la de da
[18:51:34] MrNagoo: !gist //= require jquery //= require jquery_ujs //= require bootstrap //= require turbolinks //= require_tree . //= require jquery.scrollmagic //= require greensock/TweenMax.min
[18:51:46] rhizome: no, but ok.
[18:52:01] emilebosch: has joined #RubyOnRails
[18:52:09] rhizome: i don't like require_tree, but try putting that at the end
[18:52:45] MrNagoo: rhizome: no change
[18:52:50] NodeNagant: has joined #RubyOnRails
[18:53:01] MrNagoo: i require tree for my custom js files
[18:53:14] workmad3: MrNagoo: did you add it to your gemfile, run 'bundle install' and then restart your server?
[18:53:15] rhizome: also doesn't the instructions indicate greensock should go first?
[18:53:30] rhizome: specify your custom js files individually so there's never confusion
[18:53:35] tubbo: lol MrNagoo
[18:54:27] tubbo: oh yeah that's one other thing, you have to make sure to restart your server *and* make sure the gem is installed before trying this out
[18:54:29] netzfisch: has joined #RubyOnRails
[18:54:30] MrNagoo: rhizome: I swapped them multiple times (insanity)
[18:55:07] BBonifield: has joined #RubyOnRails
[18:55:49] code1o6: has joined #RubyOnRails
[18:56:09] johnflux: has joined #RubyOnRails
[18:57:25] dudo: has joined #RubyOnRails
[18:57:31] rhizome: start with the minimum working case and rebuild from there
[18:58:02] dideler: has joined #RubyOnRails
[18:58:39] hightower4: workmad3, tubbo : actually, it looks like my approach with overwriting create_table and add_reference to re-define the type of field worked, and the "intermittent issue" was related to using jruby instead of ruby. The only thing is that one also has to define int/integer to be alias for bigint, because some fields end up being integers in the database without it, even though I've replaced all ints with bigints in the migrations. (So I assume th
[18:58:40] hightower4: ese are implicitly created fields)
[18:58:58] christiandsg: has joined #RubyOnRails
[18:59:30] hightower4: It's not as clean as I had hoped though, certainly.
[19:00:01] stef1a: has joined #RubyOnRails
[19:00:20] stef1a: is there any way to do path scope interpolation with variables in the params hash?
[19:00:31] tubbo: hightower4: ah, i think i already mentioned earlier that i have no idea about jruby. consider everything i've told you with a grain of salt. jruby could very well be fucking with your ints.
[19:00:34] tubbo: probably not though
[19:00:51] MrNagoo: tubbo: rhizome: I needed to restart my server.
[19:01:09] tubbo: MrNagoo: haha
[19:01:14] tubbo: MrNagoo: that's why we kept asking you :)
[19:01:20] tubbo: it's a common solution to many weird problems
[19:01:32] maz-dev: has joined #RubyOnRails
[19:01:45] MrNagoo: tubbo: it's like when someone tells you the only thing wrong with your car is that its out of gas
[19:02:25] tubbo: MrNagoo: yeah but if it's actually out of gas and the person you're trying to tell you is saying "I ALREADY CHECKED THE GAS GAUGE THATS NOT THE PROBLEM"... :) we get that a lot in here haha
[19:02:37] tubbo: MrNagoo: in your case, you just didn't know where the gas gauge was
[19:02:58] MrNagoo: tubbo: yeah, I'm like what's gas?
[19:03:00] rhizome: except in this case it's like the gas gauge doesn't change until you leave the station
[19:03:33] MrNagoo: Thanks for the help
[19:04:33] MrNagoo: I'm going to try and build a sweet scrollmagic website for my employer, utilizing scroll magic and parallax.js for mobile
[19:04:41] RegulationD: has joined #RubyOnRails
[19:04:51] havenn: has joined #RubyOnRails
[19:05:43] twotwo: has joined #RubyOnRails
[19:05:47] audy: has joined #RubyOnRails
[19:05:59] stef1a: i'm currently generating paths scoped within "/:year/:season", but i want to change these paths to "/:year-#{year % 100 + 1}/:season/". what's the easiest way to do this?
[19:06:07] RegulationD: has joined #RubyOnRails
[19:06:19] yatish27: has joined #RubyOnRails
[19:06:19] stef1a: i'd rather not modify all my `link_to`s
[19:07:27] tubbo: stef1a: what? haha
[19:07:44] stef1a: tubbo: what doesn't make sense?
[19:07:55] n00bDev: has joined #RubyOnRails
[19:08:11] tubbo: stef1a: i don't know what :year-#{year % 100 + 1} means, can you give me an example of what that route might look like (with sample data0
[19:08:26] jhack32: has joined #RubyOnRails
[19:08:36] baweaver: has joined #RubyOnRails
[19:08:36] tubbo: stef1a: or do you just want /2001/summer and /01/summer to point to the same page?
[19:08:40] stef1a: tubbo: if the year is 2014, the path scope could be "/2014-15/winter"
[19:08:45] tubbo: ohhh ok :D
[19:09:09] tubbo: stef1a: if you're using active_record, you might be able to accomplish that with a custom slug generator and friendly_id
[19:09:13] stef1a: tubbo: but when generating paths and specifying redirect paths, etc., i want to supply _only_ the year (2014), not the whole string ("2014-15")
[19:09:36] linoespinoza: has joined #RubyOnRails
[19:09:36] tubbo: stef1a: i don't think that's going to work, rails doesn't do any processing in between iirc
[19:09:52] emilebosch: has joined #RubyOnRails
[19:10:20] beauby: has joined #RubyOnRails
[19:10:57] stef1a: tubbo: I could monkey-patch some fundamental path generation method, but that seems a bit too heavy for something like this. I was hoping there would be a less messy solution.
[19:11:40] stef1a: rhizome: what?
[19:11:40] tubbo: stef1a: perhaps you could use a helper/controller method like year_for('2014') that does the logic you want it to do...
[19:12:02] tubbo: but yeah this is a little convoluted
[19:12:06] centrx: has joined #RubyOnRails
[19:12:12] stef1a: tubbo: yes, that's what i was in the middle of doing (and then i thought "this sucks, there should be an easier way to do this")
[19:12:39] tubbo: stef1a: honestly i think the sucky part is not figuring out these params before you get to the url_for (or route helper, same thing) part
[19:12:49] yatish27: has joined #RubyOnRails
[19:12:54] stef1a: what do you mean?
[19:13:01] diegorv: has joined #RubyOnRails
[19:13:45] maz-dev_: has joined #RubyOnRails
[19:14:00] lele: has joined #RubyOnRails
[19:14:23] tubbo: stef1a: to me it seems like an extra level of indirection. why not just hard-code 2014-15, for example?
[19:14:38] tubbo: or why not have the attr you're passing into there return 2014-15 rather than just 2014?
[19:17:13] stef1a: there are some methods that just want to use the int, which is how it's currently set up
[19:17:58] bigredboots: has joined #RubyOnRails
[19:18:02] stef1a: whether i modify those methods to convert the string to the int, or modify all the path generation methods to use the string instead of the int, i'm still going to have to change a bunch of method arguments
[19:18:23] rhizome: it will involve typing, yes.
[19:18:47] stef1a: this is the opposite of what programmers do
[19:18:57] mary5030: has joined #RubyOnRails
[19:19:08] rhizome: frankly, i'm confused as to the actual business case for this
[19:19:30] stef1a: it makes the URLs slightly less confusing.
[19:19:48] rhizome: you learn something new every day
[19:20:46] stef1a: within the context of the app, a year spans two years (so 2014 maps to 2014-2015), and is composed of "summer 2014", "autumn 2014", "winter 2015", and "spring 2015".
[19:21:16] tubbo: seems like that should be what it says
[19:21:22] tubbo: /summer/2014, or /winter/2015
[19:21:30] tubbo: if this is a fashion website that is totally acceptable
[19:21:41] stef1a: haha. it's not a fashion website.
[19:22:23] annlewis: has joined #RubyOnRails
[19:22:27] mordocai: has joined #RubyOnRails
[19:22:29] NodeNagant: has joined #RubyOnRails
[19:22:53] smathy: Sounds like a school year.
[19:23:01] stef1a: smathy: It is indeed a school year.
[19:23:23] smathy: I worked for 6 years with this issue (edu-tech company).
[19:23:53] smathy: I was always pushing for people to just STFU and use the year that the school year began in as the year.
[19:24:09] stef1a: smathy: actually??? this is the same problem i have
[19:24:27] stef1a: i mean, i think the change makes sense, but it's more technically involved and cumbersome than it appears to be
[19:24:43] rhizome: to_param and process it in the model
[19:24:45] krisquigley: has joined #RubyOnRails
[19:25:09] smathy: It was especially frustrating for me, because I'm Australian, and in the southern hemisphere our school years run like March to December.
[19:25:21] rhizome: metric school year
[19:25:27] stef1a: rhizome: hahaha
[19:25:49] stef1a: rhizome: "process it in the model?"
[19:26:23] smathy: Problem was that from parents to school staff to govt bodies - the "2014-2015" nomenclature was the existing standard.
[19:26:44] rhizome: well, i guess not to_param, but yes, schoolyear_find(params[:yearthing])
[19:26:46] stef1a: smathy: yeah. how did you get solve it?
[19:27:22] johnflux: map() turns a list into another list. What's the function for turning a list into a single string?
[19:27:28] stef1a: rhizome: yeah, it looks like i'll have to type stuff or use some kludgy regex with sed
[19:27:40] johnflux: I have a collection of tags that I want to turn into a string
[19:27:51] stef1a: johnflux: .join()?
[19:27:53] smathy: stef1a, we ended up just writing a class that would accept either a date, or a "2014-2015" string and return our own internal "school year" concept. It's .to_s method would output the "2014-2015" style string.
[19:27:55] fast_scooter: has joined #RubyOnRails
[19:28:17] johnflux: stef1a: with join I'd have to do a map first, then a join?
[19:28:35] stef1a: johnflux: nope, you can call join on an array
[19:28:51] johnflux: stef1a: but how do I specify how to stringif each item of the array?
[19:28:54] stef1a: johnflux: you can call map first if you want to somehow alter every element
[19:29:19] yatish27: has joined #RubyOnRails
[19:29:19] smathy: stef1a, we were looking to expand into Chile and Brazil, so we actually added a "starts_on" and "ends_on" to our School models, so we could have variable starting dates, and based on whether both those dates were in the same or different years we would generate different strings.
[19:29:21] denisemccoy: has joined #RubyOnRails
[19:29:24] johnflux: stef1a: okay thanks. I was wonder if there was some sort of efficient map_and_join
[19:29:27] stef1a: johnflux: [1, 2, 3].join("") => "123"
[19:30:17] stef1a: smathy: i see.
[19:30:24] stef1a: so it looks like i will have to get my hands dirty here :-(
[19:30:33] stef1a: ah well, that's good to know. thanks!
[19:30:38] smathy: ...and actually write some damn code for a change!
[19:30:43] smathy: Yeah, no way around it.
[19:30:43] jhack32: has joined #RubyOnRails
[19:30:53] smathy: ...not without changing the world.
[19:31:03] johnflux: stef1a: yeah I'm doing more like: tags = file_info.tags.map{|tag| "#" + tag.name}.join(",")
[19:31:09] johnflux: stef1a: I think this is the optimal one
[19:31:11] johnflux: stef1a: I think this is the optimal way
[19:31:20] jglover: has joined #RubyOnRails
[19:31:26] stef1a: johnflux: that looks fine to me!
[19:31:28] d2dchat: has joined #RubyOnRails
[19:31:40] kegan_: has joined #RubyOnRails
[19:32:14] jglover: Using Devise, is there some way to find out if a specific user has an active session?
[19:32:18] stef1a: okay, thanks smathy, tubbo, and rhizome! much appreciated! :-)
[19:32:33] smathy: stef1a, you're welcome.
[19:32:44] yaymukund: has joined #RubyOnRails
[19:32:50] kegan_: update button on a modal... is it better to check for changed params client side or send the entire data-set and check server-side?
[19:32:56] smathy: stef1a, OH! I nearly forgot.
[19:33:01] jglover: mm think I found a stack overflow post nvm
[19:33:05] stef1a: (though i wonder if this is something worth requesting as a feature for future versions of rails?)
[19:33:12] jhack: has joined #RubyOnRails
[19:33:12] jhack: has joined #RubyOnRails
[19:33:26] smathy: stef1a, one of the guys also used I18n to make the school year strings, although I never really liked that approach - but worth thinking about.
[19:33:57] smathy: Sorry, cleaning keyboard.
[19:34:13] MrNagoo: is there a way to do pm's on this?
[19:34:50] stef1a: MrNagoo: irc? I think /query username message should work
[19:34:53] kinduff: has joined #RubyOnRails
[19:35:06] MrNagoo: just wondering
[19:35:12] stef1a: smathy: thanks, i'll consider it.
[19:35:15] cschneid_: has joined #RubyOnRails
[19:35:18] MrNagoo: i'm on freenode
[19:38:46] smathy: MrNagoo, you're on the web client, /PRIVMSG the_nickname Your message.
[19:39:10] MrNagoo: it was already answered, just double click the username.
[19:39:24] MrNagoo: but thanks, that will be good for offline users
[19:40:45] kinduff: has joined #RubyOnRails
[19:41:31] hazelux: has joined #RubyOnRails
[19:42:13] cball: has joined #RubyOnRails
[19:42:58] sandstrom: has joined #RubyOnRails
[19:43:08] iliketurtles: has joined #RubyOnRails
[19:43:08] n00bDev: is a newly created objects id only exist afters its saved into db?
[19:44:04] dionysus69: has joined #RubyOnRails
[19:44:13] nickyd: has joined #RubyOnRails
[19:44:46] bin_005: has joined #RubyOnRails
[19:46:02] jtperreault: n00bdev: correct
[19:47:30] nya: has joined #RubyOnRails
[19:47:56] stef1a: has joined #RubyOnRails
[19:48:27] bulldawgden: has joined #RubyOnRails
[19:48:36] bruno-: has joined #RubyOnRails
[19:49:12] MrNagoo: i'm using cloud9, fresh out of hartl's book. I don't do anything locally. Whats the best place to store my images so I don't have to load them into cloud9. I'm on all the free versions so there isn't a bunch of space.
[19:49:17] bulldawgden: has joined #RubyOnRails
[19:49:55] finnnnnnnnnnn: has joined #RubyOnRails
[19:50:17] finnnnnnnnnnn: I???m trying to unit test my User model that I???ve created using devise - https://gist.github.com/anonymous/f9d7451ea301cfc6681d
[19:50:39] joseph13: has joined #RubyOnRails
[19:50:45] finnnnnnnnnnn: that test should fail as I???ve not yet made first_name required
[19:50:52] finnnnnnnnnnn: but it???s passing
[19:51:26] joseph13: has left #RubyOnRails: ()
[19:51:45] joseph13r: has joined #RubyOnRails
[19:51:59] joseph13r: has left #RubyOnRails: ()
[19:52:00] joseph13r: has joined #RubyOnRails
[19:52:38] rhizome: maybe because you've not yet made first_name required
[19:52:53] kadoppe: has joined #RubyOnRails
[19:53:09] joseph13r: has joined #RubyOnRails
[19:53:12] jkamenik: has joined #RubyOnRails
[19:54:00] finnnnnnnnnnn: rhizome: don???t think so, the test should be failing. I???m using assert_not
[19:54:55] rhizome: ah. well, check validation errors
[19:55:26] finnnnnnnnnnn: hmm, how do I fo that in the test suite?
[19:55:48] rhizome: assert the save, and display the model errors in the failure message
[19:56:22] rhizome: or assert .valid? to stay off the db
[19:56:48] finnnnnnnnnnn: that???s a good idea, will try now
[19:57:19] Lightsword: has joined #RubyOnRails
[20:00:00] mary5030: has joined #RubyOnRails
[20:00:37] baweaver: has joined #RubyOnRails
[20:01:10] MrNagoo: is anyone good with relational database planning?
[20:01:32] manfrin: has joined #RubyOnRails
[20:01:52] centrx: no, not one
[20:02:05] bricker: I like pinapple
[20:02:09] bricker: pineapple*
[20:02:26] ethicalhack3r: has joined #RubyOnRails
[20:02:32] ethicalhack3r: Hi, can any one help me figure out how to access an individual object id from a collection in RABL? https://gist.github.com/ethicalhack3r/354a5268007344b89a8b
[20:02:39] MrNagoo: I'm wondering how someone would make a fantasy football app, how all the databases would relate
[20:02:51] smathy: Literally LOL.
[20:03:23] MrNagoo: i'm not interested in making one, but how the databases work together
[20:03:25] rhizome: with some level of sophistication
[20:03:30] mloy: MrNagoo, you mean how the tables within the db would relate. And that depends on what different tables you have.
[20:03:40] MrNagoo: yes sorry.
[20:04:00] smathy: Using foreign keys.
[20:04:04] mloy: no need to apologize, I'm just being pedantic
[20:04:07] MrNagoo: between users, leagues, players/teams and what not.
[20:04:18] jgpawletko: has joined #RubyOnRails
[20:04:28] mloy: and smathy is right, you'd have a column for foreign keys within each table
[20:04:31] MrNagoo: You get the true Pedant Reward for the day
[20:04:36] tubbo: MrNagoo: have you read much on the relational algebra? https://en.wikipedia.org/wiki/Relational_algebra
[20:04:43] tubbo: on relational algebra*
[20:04:53] MrNagoo: I will take a look
[20:04:55] Motoservo: has joined #RubyOnRails
[20:05:14] tubbo: might be a little too math-centric but that's essentially where it all starts imho
[20:05:49] smathy: MrNagoo, http://guides.rubyonrails.org/association_basics.html also does a decent job of explaining this all.
[20:05:49] tubbo: but yeah, that's why DBAs exist :)
[20:06:17] a1fa: i have two tables (Customer, and Orders (belongs_to: customer). I want to list all orders that dont have a customer.
[20:06:27] NBarnes: I'm not honestly sure what's complicated about it. Teams have many player-
[20:06:51] NBarnes: I was trying to backspace so that I could advance the idea of a three-way join table for player_team_seasons. Because I hate DBAs and want them to suffer.
[20:07:09] jholm: has joined #RubyOnRails
[20:07:22] a1fa: what would be the best way to go about doing that
[20:07:36] smathy: a1fa, Order.where customer_id: nil
[20:07:52] smathy: a1fa, although, how you have an order with no customer I don't know.
[20:07:55] NBarnes: what smathy said
[20:08:12] NBarnes: @smathy; data reconciliation with legacy data?
[20:08:13] MrNagoo: Well, I am making an app that would be mush less sophisticated than a fantasy app, so I figured mastering the way that works would help me create mine
[20:08:33] ethicalhack3r: maybe used Customers and Orders as a simplified example
[20:08:37] kegan_: best practices... ajax update using editable fields in a modal... check for changes client-side and send only necessary data, or send set and process in the controller?
[20:08:40] smathy: Ok, let me rephrase: "Make sure you know why you have orders with no customers, because that should be an exceptional situation."
[20:08:46] kegan_: send entire set*
[20:08:51] a1fa: smathy: it's just an example.. but its actually issues, and customers
[20:09:00] a1fa: smathy: you can log an issue without associating it to the customer
[20:09:11] smathy: a1fa, ok, that makes more sense :)
[20:09:16] MrNagoo: Thanks, I will go over the resources given and give more specific questions as I go forward.
[20:09:28] a1fa: smathy: i was just using it as an example, as i'm going through http://guides.rubyonrails.org/association_basics.html
[20:09:42] benlieb: has joined #RubyOnRails
[20:09:42] ethicalhack3r: Can any one help me figure out how to access an individual object id from a collection in RABL? https://gist.github.com/ethicalhack3r/354a5268007344b89a8b
[20:09:42] NodeNagant: has joined #RubyOnRails
[20:09:47] johnflux: smathy: 'exceptional situations' are the bane of my life
[20:09:49] smathy: a1fa, *nod*
[20:09:56] johnflux: me: "Can situation X ever happen?"
[20:09:59] johnflux: customer: "no"
[20:10:00] NBarnes: Nagoo; well, I assume you'd start with Player, Team, Season, and PlayerSeason. And then SeasonTeam and PlayerTeam if you needed what they offer.
[20:10:05] smathy: johnflux, :)
[20:10:07] johnflux: me: "Never ever ever?"
[20:10:13] johnflux: customer: "Right"
[20:10:22] smathy: "What about if...."
[20:10:23] johnflux: me: "Great that simplifies things"
[20:10:28] smathy: "Oh, yeah, it could happen then."
[20:10:35] NBarnes: johnflux; did lightning strike your customer? If not, there's no justice in the world.
[20:10:37] johnflux: customer: "Well it happens occasionally, but pretty rarely..."
[20:10:52] smathy: johnflux, we must have the same customer, I hate that guy.
[20:11:02] a1fa: smathy: Order.where customer_id: nil < but that would display only null
[20:11:16] mloy: I think PJAX might be my salvation after trying to get Turbolinks to do what I want it to do
[20:11:19] a1fa: smathy: this is more of a join that i need to do with orders table
[20:11:26] mloy: I mean Turbograft* not Turbolinks
[20:11:27] ethicalhack3r: Order.where.not(customer_id: nil)
[20:11:40] NBarnes: Where I work, we have a gigantic database of years of customer data, from multiple previous schema and models. It's kinda a nightmare.
[20:11:59] smathy: a1fa, you asked how to display all orders with no customer, and you said Order belongs_to :customer
[20:12:00] kegan_: mloy did you ever get your ajax working
[20:12:03] JoshL: has joined #RubyOnRails
[20:12:12] smathy: a1fa, the answer to your question is: Order.where customer_id: nil
[20:12:16] rushed: has joined #RubyOnRails
[20:12:19] mloy: kegan_, no :( I kept getting 500 internal server errors
[20:12:20] a1fa: smathy: yes, i an trying to word this a bit different
[20:12:24] smathy: a1fa, you could also just do: Order.where customer: nil
[20:12:31] kegan_: mloy did you decide on a different approach?
[20:12:34] NBarnes: If there are multiple ways that 'no customer' is defined in the database, you'd need a more complex argument to where, but the principle maintains.
[20:12:43] MrNagoo: nbarnes: Users: can be in multiple Leagues, League: one user per league. Creates team from global database of players. lists of league and private leagues. on and on... haha
[20:12:44] a1fa: smathy: lets say i am trying to create customers based on orders
[20:12:54] a1fa: (issues)
[20:12:57] mloy: kegan_, https://github.com/defunkt/jquery-pjax
[20:13:00] smathy: a1fa, why don't you use issues in your question.
[20:13:06] mloy: kegan_, it's pushState + ajax
[20:13:07] a1fa: i need to stop doing that
[20:13:09] rhizome: why are you calling your issues orders
[20:13:17] NBarnes: I'd call them 'Owners'. I tend to only use 'User' for system users, for logins and stuff.
[20:13:26] a1fa: rhizome: hypothetical, as i am going through the ror guide
[20:13:41] a1fa: so, issue is entered (legacy), and it has a customer_id
[20:13:41] smathy: If I have a model Pineapple which belongs_to :tree
[20:13:46] MrNagoo: nbarnes: you're good
[20:13:55] NBarnes: And you'll want to distinguish between league_v1 i.e. fantasy football league and league_v2 i.e. the NFC or AFC
[20:14:02] rhizome: so the story as i understand it goes, "i am making a bug tracker, and..."
[20:14:21] kegan_: mloy sick! i'm not good at this business but i got my ajax working and was gonna offer any help. if you run into more trouble hit me up. i probably won't be of much use but I know that it can be difficult to get answers in this channel at times
[20:14:22] a1fa: now i want to go and have a page, Add Customer, that does a uniq on all Issues
[20:14:39] a1fa: and only finds customers that are not in the Customer database
[20:14:42] waseem_: kegan_: !lod
[20:14:42] helpa: kegan_: ಠ_ಠ
[20:14:42] antonelli: has joined #RubyOnRails
[20:14:53] a1fa: currently, i am doing this with find_by_sql with a nasty join
[20:14:59] smathy: a1fa, then Customer.where "1 = 0"
[20:15:10] rhizome: a1fa: you lost me at that last part
[20:15:11] smathy: That will return all customers not in your database.
[20:15:17] mloy: kegan_, omg thanks! It really can be hard to get answers sometimes, I feel it's usually due to me not structuring my questions well enough. I'll most likely take you up on that :)
[20:15:21] kegan_: waseem_ I said at times :))))
[20:15:27] kitsuneyo: has joined #RubyOnRails
[20:15:44] kegan_: yeah mloy exactly. i don't think my questions are very good and that is why they get glossed over often times. it's hard to ask the right questions before you know more of what you are doing
[20:15:46] a1fa: smathy: so i dont have to reference the order as long as the customer has many issue?
[20:15:57] kegan_: I don't blame people at all for it. they all have their own business to attend to
[20:16:02] a1fa: and issues belongs_to customers
[20:16:09] smathy: a1fa, wait, now we have "orders" and "issues" in the same question?
[20:16:13] bulldawgden: has joined #RubyOnRails
[20:16:18] a1fa: same qustion. i keep mixing the two
[20:16:21] a1fa: issues = orders
[20:16:28] NBarnes: a1fa, I think you'd benefit from being a bit more precise in your language.
[20:16:31] a1fa: because i am getting myself confused with the guide
[20:16:34] smathy: a1fa, you literally asked: "so i dont have to reference the order as long as the customer has many issue?"
[20:16:37] NBarnes: Computers can be terribly literal, and so can programmers.
[20:16:44] smathy: ...and I'm meant to know that "order" and "issue" mean the same thing?
[20:16:45] allcentury: has joined #RubyOnRails
[20:16:59] a1fa: yes, i interchanged them like an idiot ;)
[20:17:06] smathy: a1fa, things like "and only finds customers that are not in the Customer database" makes no sense either.
[20:17:24] a1fa: let me rephrase, currently i doing this the wrong way
[20:17:30] smathy: a1fa, just take a breath, and tell me in words what you're trying to do?
[20:17:33] smathy: You're adding a new customer.
[20:17:43] a1fa: i do a find_by_sql where i slap a nasty SELECT with JOIN between CUSTOMERS and ISSUES
[20:17:48] NBarnes: smathy; I read that as 'only finds Issues where the customer_id is not found in the Customers table'
[20:17:52] smathy: ...and you want to be able to select an issue that's not currently assigned to another customer already?
[20:17:55] NBarnes: (it's the only way it makes sense)
[20:18:20] kies: has joined #RubyOnRails
[20:18:23] a1fa: but i want to find customer_ids from issues that dont have their customer record
[20:18:25] smathy: a1fa, and Issue belongs_to :customer ?
[20:18:31] blackmesa: has joined #RubyOnRails
[20:18:34] a1fa: Issues belongs_to :customer
[20:18:42] a1fa: and Customers "have many" issues ;)
[20:18:56] smathy: Rephrase "but i want to find customer_ids from issues that dont have their customer record" so it makes sense.
[20:18:58] NBarnes: Or, to put it another way. a1fa has an issues table. issues have customer_ids, which MAY be populated with a value that is NOT in the customers table. He wants a list of all the issues where that is the case.
[20:19:09] smathy: You meant issue ids?
[20:19:35] a1fa: Customers (id) | Issues (customer_id)
[20:19:37] roolo: has joined #RubyOnRails
[20:19:51] smathy: a1fa, oh, is nbarnes right? The Issue might have a customer_id that doesn't match one of your Customer records?
[20:20:04] rhizome: deleted customers?
[20:20:15] a1fa: Not yet added to the database
[20:20:27] rhizome: how do they have an id?
[20:20:50] fast_scooter: has joined #RubyOnRails
[20:20:51] a1fa: Joe goes, hey CUSTOMER-whatever-your-name-is
[20:20:58] a1fa: that's now your ID
[20:21:04] a1fa: its not numeric
[20:21:13] finnnnnnnnnnn: has joined #RubyOnRails
[20:21:18] a1fa: it's a varchar
[20:21:24] smathy: Issues.includes(:customer).where(customers: { id: nil } )
[20:21:30] a1fa: ACTION hits self upside the head.
[20:21:37] yfeldblum: has joined #RubyOnRails
[20:21:55] a1fa: smathy: should i add .uniq to that?
[20:21:56] rhizome: sounds more like a NOT IN
[20:22:15] SuMo_D: has joined #RubyOnRails
[20:22:19] s2013: has joined #RubyOnRails
[20:22:31] smathy: a1fa, no, that'll be unique issues already.
[20:22:41] smathy: ...because you're starting on the Issue side.
[20:22:59] smathy: a1fa, you could also do it as a sub-query like rhizome suggested.
[20:23:10] annlewis: has joined #RubyOnRails
[20:23:18] a1fa: smathy: i'm using find_by_sql today, and its pain (LEFT JOIN)
[20:23:33] NBarnes: NOT IN sounds like a possibility
[20:23:39] rhizome: it's going to be a pain no matter what
[20:23:56] a1fa: i was doing this automatically using find_by_sql and adding a record to CUSTOMERS table.. but now, i am going to make it a manual thing
[20:23:59] smathy: Issue.where.not customer_id: Customer.pluck(:id)
[20:24:16] smathy: That won't get NULLs though.
[20:24:25] a1fa: that's ok
[20:24:32] a1fa: that field can't be null
[20:24:40] smathy: Id' use the left outer join - but both will work.
[20:24:56] rhizome: i would suggest considering just creating the customer when the issue is accessed if it doesn't already exist
[20:25:23] smathy: rhizome, the user accessing the issue might not have the customer details.
[20:25:31] a1fa: rhizome: that's what i'll end up doing for new things
[20:25:32] baweaver: has joined #RubyOnRails
[20:25:46] a1fa: when they add an issue, and put a customer, it will eaither create or update
[20:25:49] rhizome: i didn't know details were even a part of this, just creating the record
[20:26:03] a1fa: this is just for legacy records
[20:26:04] rhizome: oh, find_or_create then?
[20:26:14] a1fa: yeah, i'll do that for new issues being created
[20:26:25] smathy: Well, he has a form for creating these customers - so I assumed there was some data.
[20:26:27] rhizome: i don't get how old ones differ
[20:26:47] a1fa: rhizome: technically, i should just do this on the backend side, and ignore it on the frontend
[20:26:51] smathy: Old ones are pointing to customers that haven't been imported into the DB (yet).
[20:26:52] SuMo_D: has joined #RubyOnRails
[20:27:10] a1fa: that would probably be the easiest
[20:27:24] a1fa: do it on the backend for legacy, and everything new gets find_or_create
[20:27:28] smathy: a1fa, why not just import the missing customers?
[20:27:42] smathy: ...or is that what you're talking about now?
[20:27:51] a1fa: might as well
[20:27:53] smathy: Yeah, do that.
[20:28:03] smathy: ...especially if you've already kept the primary key
[20:28:10] rhizome: so you do have extra info for the legacy customers...
[20:28:41] smathy: You could even just do the query above to get a list of customer IDs to import.
[20:28:44] a1fa: rhizome: not much, just the "id" that can be split (-) and some info could be plucked out
[20:28:59] jeadre: has joined #RubyOnRails
[20:29:09] smathy: Issue.includes(:customer).where(customers: { id: nil } ).pluck :customer_id
[20:29:38] sinkensabe: has joined #RubyOnRails
[20:30:01] j_mcnally: has joined #RubyOnRails
[20:30:54] finnnnnnnnnnn: anyone have any advice on how I can make this more dry - https://gist.github.com/b6bf547b5773aedd2e46
[20:31:03] finnnnnnnnnnn: or can point me towards a tutorial?
[20:31:15] s2013: data-ajax = false but data-remote = true
[20:31:27] s2013: for an ajax form should both be true
[20:31:33] s2013: i never saw data-ajax before tbh
[20:32:01] naftilos76: has joined #RubyOnRails
[20:32:30] a1fa: smathy, rhizome : so, i'll just add this to the issues model before_validation :check_if_customer_exists
[20:32:44] VeryBewitching: has joined #RubyOnRails
[20:32:56] MartinElvar: has joined #RubyOnRails
[20:33:59] shilon: has joined #RubyOnRails
[20:36:00] s2013: nvm about that.. looks like that was custom
[20:37:40] s2013: hmmm so for some reason my remote form when i do request.xhr? it returns nil
[20:37:52] s2013: it redirects to the JS file instaed of urnning the JS
[20:38:12] stef1a: has joined #RubyOnRails
[20:39:23] annlewis: has joined #RubyOnRails
[20:39:58] ethicalhack3r: has joined #RubyOnRails
[20:42:07] kitsuneyo: has joined #RubyOnRails
[20:43:00] JoshL_: has joined #RubyOnRails
[20:43:49] momomomomo: has joined #RubyOnRails
[20:45:12] Motoservo: has joined #RubyOnRails
[20:46:40] [Butch]: has joined #RubyOnRails
[20:46:58] jholm: has joined #RubyOnRails
[20:47:52] kitsuneyo: has joined #RubyOnRails
[20:48:06] hahuang65: has joined #RubyOnRails
[20:49:18] x-light: has joined #RubyOnRails
[20:49:25] NodeNagant: has joined #RubyOnRails
[20:49:47] cschneid: has joined #RubyOnRails
[20:50:02] sfr^: has joined #RubyOnRails
[20:53:48] havenwood: has joined #RubyOnRails
[20:54:18] kinduff: has joined #RubyOnRails
[20:54:45] cschneid: has joined #RubyOnRails
[20:54:56] redondo: has joined #RubyOnRails
[20:55:04] george2: has joined #RubyOnRails
[20:56:34] danlucraft: has joined #RubyOnRails
[20:56:38] bulldawgden: has joined #RubyOnRails
[20:56:58] jgt: has joined #RubyOnRails
[20:57:12] chancancode: has joined #RubyOnRails
[20:59:02] jenrzzz: has joined #RubyOnRails
[21:00:48] voltalio: has joined #RubyOnRails
[21:01:09] Leak: has joined #RubyOnRails
[21:01:39] christiandsg: has joined #RubyOnRails
[21:02:22] greengriminal: has joined #RubyOnRails
[21:02:36] redondo: Hi all. I'm learning about engines (and rails itself) and how to integrate them within the main app. I've found that using decorators you can override engine's controllers, views, etc??tera, as you want. But I would like to write an engine that, conversely, override main app's controllers, views, etc??tera. Does that make sense?
[21:03:43] cornerma1: has joined #RubyOnRails
[21:03:53] rushed: has joined #RubyOnRails
[21:04:14] bronson: nope. :) why would you want to override the app? let the app call/mixin your engine?
[21:04:26] Motoservo: has joined #RubyOnRails
[21:04:40] yfeldblum: has joined #RubyOnRails
[21:04:46] shawnacscott: has joined #RubyOnRails
[21:05:37] ecnalyr: redondo That's weird. . . Typically you don't override in that direction. More details about your intent may help us help you.
[21:05:45] bin_005: has joined #RubyOnRails
[21:05:54] universa1: has joined #RubyOnRails
[21:05:55] Scriptonaut: has joined #RubyOnRails
[21:07:07] NodeNaga_: has joined #RubyOnRails
[21:07:23] Scriptonaut: has left #RubyOnRails: ()
[21:07:28] finnnnnnnnnnn: simple ruby question - I have an array of models that I loop through and save, can I do something on save success - https://gist.github.com/7b9e2290efa0fd9bfae0
[21:08:03] craysiii: callback on the model?
[21:08:08] finnnnnnnnnnn: my ruby is quite weak, I just need to know if save returns something and how to do callback on that
[21:08:29] craysiii: http://guides.rubyonrails.org/active_record_callbacks.html
[21:08:33] finnnnnnnnnnn: ohh, you???re suggesting writing a callback on the model itself rather than in the save
[21:08:47] Leak: has left #RubyOnRails: ()
[21:09:04] finnnnnnnnnnn: I???m trying to keep a count of how many have saved, so I though it would be easier to do in the loop
[21:11:15] finnnnnnnnnnn: something like this - https://gist.github.com/3e2e24d70b8d6a26066e
[21:11:51] redondo: Thanks, let me try: the main app have a controller that do something I would like to do in a different way. Also, this doing things differently implies also differences in views and models.
[21:11:57] FernandoBasso: has joined #RubyOnRails
[21:12:23] s2013: rendering a partial with remote: true.. has anyone faced an issue where the ajax wasnt working properly?
[21:12:36] JoshGlzBrk: has joined #RubyOnRails
[21:13:00] Leak: has joined #RubyOnRails
[21:13:44] Leak: has joined #RubyOnRails
[21:13:50] tubbo: s2013: pretty sure if you have a redirect_to it will always redirect, it won't request and evaluate the JS like normal
[21:14:04] tubbo: s2013: you might need to check if the request is XHR and then do a format.js or whatever
[21:14:23] s2013: this is the same issue i had long time ago if you remember.. the rails 3 crap
[21:14:28] s2013: request.xhr? is nil
[21:14:48] s2013: thing is the form works the way its supposed to if i refresh the page.. but if the form is loaded via ajax then it wont work
[21:15:31] acti0nman: has joined #RubyOnRails
[21:16:00] s2013: think of it as step 2.. if you fill out step1 it loads step2 form .. but when you submit step2 it redirects to the actual js that its supposed to run.. however if you reload the page (after completeing step1) and step2 is loaded then it works fine
[21:16:11] s2013: let me try to gist it
[21:16:15] Criten: Hey guys! I have two models that i want a relation between... but its basically a has_many that includes all withing a geo location
[21:16:46] Criten: I would use a method for it.. but im trying to serialize it with active model serializers
[21:17:28] smathy: finnnnnnnnnnn, .save is blocking - just: if competition.save; number_saved +=1; end
[21:17:45] workmad3: Criten: so write a method to generate the array in your serializer, then add the method name to your list of serialized attributes
[21:17:55] finnnnnnnnnnn: smathy: just figured that, thanks mucho
[21:18:25] MartinElvar: has joined #RubyOnRails
[21:18:43] hazelux: has joined #RubyOnRails
[21:19:01] n00bDev: i'm writng my own custom controller for devise_invitable, is there a way to save attributes to the database without it complaining about password?
[21:20:11] s2013: https://gist.github.com/ss2k/de0727af32ed7759057e kegan_ tubbo
[21:21:40] tubbo: s2013: heh...funny story...turbolinks 3 has this baked in
[21:21:42] tubbo: s2013: so you can just do respond_with @item, change: 'results'
[21:21:44] tubbo: (in your controller)
[21:22:42] s2013: its rails3 if that matters
[21:24:37] tubbo: i think turbolinks would work with rails 3+, since the engine syntax hasn't really changed much
[21:24:47] ur5us: has joined #RubyOnRails
[21:24:49] PlasmaSt-: has joined #RubyOnRails
[21:25:42] krisquigley: has joined #RubyOnRails
[21:25:44] Criten: workmad3: then that will embed the records and i want them included
[21:25:46] Criten: sideloaded
[21:25:56] zendrix: has joined #RubyOnRails
[21:25:57] Criten: and if i do has_many :methodname in the serializer
[21:25:59] Criten: it almost works
[21:26:22] Criten: but it doesnt give me a way to change the root key name
[21:26:43] Criten: Ill keep playing with it
[21:27:02] chichou: has joined #RubyOnRails
[21:28:02] nahtnam: has joined #RubyOnRails
[21:28:21] nahtnam: Hey! Quick question. Do gems like sidekiq or resque need some sort of other software running or do they just work as part of rails s?
[21:29:29] nahtnam: Oh it looks like you need "redis"
[21:29:47] shawnacscott: has joined #RubyOnRails
[21:29:48] martinbjeldbak: has joined #RubyOnRails
[21:29:51] nahtnam: are there any gems that dont use redis and work with rails out of the box?
[21:30:06] ashleyw: has joined #RubyOnRails
[21:30:36] GreatDanton: has joined #RubyOnRails
[21:30:45] chichou: you can still use delayed_job that'll use the database for queuing if it's for testing thing I suppose
[21:31:02] andybernard: i know of none of them that don't use redis
[21:31:12] a1fa: i have two models that need to use the same logic to update a table. should i create a new model for that?
[21:31:55] a1fa: issues, requests => customers
[21:32:05] d2dchat: has joined #RubyOnRails
[21:32:19] a1fa: should the logic go under customers?
[21:33:32] nahtnam: chichou: That will be much slower right?
[21:33:54] BBonifield: has joined #RubyOnRails
[21:34:03] nahtnam: Basically I just wanted to make my app so that all you have to do is type `rails s` and it will boot up everything
[21:34:12] nahtnam: So I wanted to make everything a part of rails
[21:34:13] chichou: indeed but you don't have to install redis as it was one of your requirements :)
[21:34:34] workmad3: nahtnam: consider using foreman instead
[21:34:35] andybernard: are you still in the process of learning rails nahtnam?
[21:34:59] workmad3: nahtnam: then you can create a Procfile for your project which specifies all the processes your app needs, and start them all with a single 'foreman start'
[21:35:36] andybernard: i constantly have redis running on my dev machine so I still type rails s and everything starts
[21:35:50] workmad3: andybernard: it doesn't start sidekiq workers though, right? ;)
[21:36:06] shilon: has joined #RubyOnRails
[21:36:08] workmad3: andybernard: it just means that any jobs that get enqueued don't cause redis errors
[21:36:10] andybernard: workmad3: forgot about those, yep it doesnt
[21:36:17] nertzy: has joined #RubyOnRails
[21:36:28] nahtnam: andybernard: Sort of
[21:36:33] nahtnam: I dont learn the conventional way
[21:36:35] nahtnam: I just build
[21:36:40] nahtnam: and ask when I get stuck :D
[21:36:49] workmad3: nahtnam: if you use ActiveJob, I think the default backend for that is a synchronous job processor
[21:36:52] VeryBewitching: Best way to learn is to try.
[21:36:53] nahtnam: workmad3: Thanks. ill check it out
[21:37:04] andybernard: nahtnam: the reason I ask is because as you learn more it will be inevitable you have other services running parallel to rails
[21:37:15] workmad3: nahtnam: which means you can ignore the background tasks during dev mode, and configure an async worker after the fact
[21:37:29] allcentury: has joined #RubyOnRails
[21:37:31] nahtnam: workmad3: Wait so what will active job do by default?
[21:37:43] workmad3: nahtnam: I *believe* it'll just run the job synchronously straight away
[21:37:50] workmad3: but you should confirm that ;)
[21:37:56] nahtnam: Oh well then whats the point?
[21:38:09] nahtnam: Isnt the point of a delayed job to run asynchronously?
[21:38:12] workmad3: nahtnam: because you can configure it to use sidekiq with a config setting
[21:38:20] workmad3: nahtnam: and then it'll be async
[21:38:53] workmad3: nahtnam: the point is that you code to the interface, you don't need to run any extra processes during your first-stage dev, and you can change your queue backend to an async one down the line
[21:38:55] nahtnam: Ill check it out
[21:38:58] tubbo: nahtnam: activejob is just a common interface for background jobs, fwiw
[21:39:29] terrellt: has joined #RubyOnRails
[21:40:06] nahtnam: Is there an alternative to redis written in ruby that I can use in a gemfile and then use foreman to start it?
[21:40:41] wethu: has joined #RubyOnRails
[21:40:44] lupine: has joined #RubyOnRails
[21:41:15] workmad3: nahtnam: do you mean 'an alternative to sidekiq that doesn't require a separate process'?
[21:41:28] workmad3: nahtnam: or, more precisely, a separate application
[21:41:30] NodeNagant: has joined #RubyOnRails
[21:41:30] Radar: ps good morning
[21:41:40] nahtnam: Lol morning
[21:41:42] tubbo: nahtnam: nothing that is any good
[21:41:45] Radar: "Running Redis is hard :'(((" <- nobody ever
[21:42:05] workmad3: nahtnam: if you want self-contained within processes started by foreman - delayed_job
[21:42:37] nahtnam: workmad3: Oh ok.
[21:42:45] nahtnam: So in the end, if i want to make it effecient, ill need redis?
[21:42:50] workmad3: nahtnam: which, again, ok for dev, but I'd suggest using something like redis+sidekiq or rabbitmq+sneakers in production, depending on what services you want to set up
[21:42:52] nahtnam: *efficient
[21:42:57] momomomomo: has joined #RubyOnRails
[21:43:24] workmad3: nahtnam: if you want something high-performance, you'll want something that's more dedicated to queueing than a process that polls the database, yeah
[21:43:36] nahtnam: And last question
[21:43:56] nahtnam: Does the redis memory get cleared once the process is done?
[21:43:58] workmad3: nahtnam: redis & dedicated queue systems all have push mechanisms for connected clients, rather than relying on polling... that's a key feature
[21:43:59] a1fa: how do you trigger another models action? Model::Action?
[21:44:10] polpak: has joined #RubyOnRails
[21:44:24] workmad3: nahtnam: wondering about queue persistence now? :)
[21:44:44] nahtnam: workmad3 well heroku limits to 25 mb which is where my staging server is hosted
[21:44:54] baweaver: has joined #RubyOnRails
[21:45:00] nahtnam: I guess that is enough for staging
[21:45:03] a1fa: or is it Model.Action?
[21:45:18] workmad3: nahtnam: yeah, and the jobs are deleted from redis by sidekiq once they're processed too
[21:45:26] nahtnam: Thanks for your help
[21:45:45] NBarnes: Should I be forcing my entire site to SSL via config.force_ssl = true?
[21:45:47] andybernard: nahtnam: we have 8 gb on our servers and we max out around a queue size of 40,000
[21:45:57] workmad3: nahtnam: also, radar's comment of '"Running Redis is hard :'(((" <- nobody ever' is even more true when you're on heroku ;)
[21:46:41] VeryBewitching: workmad3: I have a site in Heroku, what specifically is the issue with Redis in their cloud?
[21:47:05] tubbo: VeryBewitching: there's no issue that's the point
[21:47:06] workmad3: VeryBewitching: nothing... it's super-easy to use, simple to set up!
[21:47:35] VeryBewitching: workmad3: Oh, I misunderstood the context from Radar's comment
[21:47:37] nahtnam: andybernard: so about 0.2 mb per key?
[21:47:57] a1fa: smathy, rhizome are you guys around?
[21:48:00] Radar: andybernard: hi
[21:48:01] andybernard: probably somewhere around there, and thats only when its queued to run asap
[21:48:05] Radar: andybernard: You PM'd me a couple of days ago?
[21:48:21] sinkensabe: has joined #RubyOnRails
[21:48:21] andybernard: Radar: yes! I heard you can give out access to the !commands
[21:48:38] helpa: Nom nom. Thanks, VeryBewitching!
[21:48:40] workmad3: andybernard: !worthy
[21:48:40] helpa: andybernard: You are worthy of this bot!
[21:48:51] workmad3: andybernard: !notworthy
[21:48:55] Radar: !unworthy
[21:48:55] helpa: You are not worthy of this bot!
[21:48:58] helpa: http://imgur.com/fDYtcCt
[21:49:00] workmad3: ^^ that's the one I wanted :D
[21:49:01] helpa: Nom nom. Thanks, andybernard!
[21:49:08] andybernard: yay! thanks very much
[21:49:11] tubbo: u just ate ass face
[21:49:21] Radar: a1fa: Assume not. Other people in the channel can answer your question.
[21:49:26] smathy: a1fa, yes, models don't have actions.
[21:49:51] a1fa: smathy: i was thinking of adding after_save to my issues module
[21:50:09] a1fa: smathy: also have requests module with the same problem
[21:50:25] a1fa: when a change gets made to either one of those, i want to update Customers table
[21:50:54] a1fa: so should my def go into Customers module, and after_save triggers into Issues, and Requests calling Customers.whatever
[21:51:35] paulcsmith: has joined #RubyOnRails
[21:53:16] Radar: a1fa: You're conflating modules and models. Be careful.
[21:54:00] a1fa: i meant to say models
[21:54:47] smathy: a1fa, you'll want a method in Issue and Request too, to make the callback simple to declare, not sure if you'll need anything in Customer, but if there's anything specific to that domain then sure.
[21:55:17] stef1a: has joined #RubyOnRails
[21:55:49] stef1a: I'm getting "You have already activated rack 1.5.2, but your Gemfile requires rack 1.5.5. Using bundle exec may solve this. " I'm unsure what this means, and I don't have permission to bundle install --no-deployment if I remove Gemfile.lock. Help?
[21:56:19] kegan_: I have a pre-existing bootstrap modal that contains a table with data populated from an ajax call. i would like to change the last column (final item in each row I guess?) to a form that can be used to update values
[21:56:26] kegan_: is there an easy way to do this
[21:56:43] a1fa: smathy: ok so after_save :dowhatever in both issues, and requests, and declare dowhatever in both models
[21:57:04] kegan_: i would like to change them to input number fields used to submit a form
[21:57:40] kegan_: or any other way that will let me post it with ajax, if there is an easier way than through a form helper
[21:58:00] IrishGringo: has joined #RubyOnRails
[21:58:56] kegan_: do i just make the whole thing a form and the inputs the only form-controls? or do I create the column outside of the table itself and style it?
[22:00:56] disgrntld: has joined #RubyOnRails
[22:05:25] jenrzzz: has joined #RubyOnRails
[22:05:52] SuMo_D: has joined #RubyOnRails
[22:06:01] a1fa: NoMethodError (undefined method `find_or_create'
[22:07:43] a1fa: I did Model.find_or_create
[22:07:46] roolo: has joined #RubyOnRails
[22:07:52] a1fa: i guess i am missing _by
[22:08:10] jeadre: has joined #RubyOnRails
[22:08:19] andybernard: isnt that deprecated? shouldnt it be where(...).first_or_create?
[22:09:07] NodeNagant: has joined #RubyOnRails
[22:09:16] sdwrage: has joined #RubyOnRails
[22:09:29] fighella: has joined #RubyOnRails
[22:09:41] a1fa: smathy: do attributes move across model?
[22:10:28] jenrzzz: has joined #RubyOnRails
[22:10:30] a1fa: for example, if in Requests i do Customers.do_an_update, do Request attributes get passed to do an update?
[22:11:42] a1fa: one way to find out :)
[22:12:11] drale2k: has joined #RubyOnRails
[22:13:02] jholm: has joined #RubyOnRails
[22:14:27] a1fa: when in doubt, run it
[22:14:31] a1fa: production!
[22:14:46] krisquigley: has joined #RubyOnRails
[22:16:01] j_mcnally: has joined #RubyOnRails
[22:16:16] a1fa: well it didnt like that ;(
[22:17:18] timdotrb: has joined #RubyOnRails
[22:17:24] timdotrb: afternoon, all
[22:17:48] a1fa: is that not possible. From Model1 to Say Model2.do_what_ever
[22:18:30] smathy: a1fa, only if do_what_ever is a class method.
[22:19:29] timdotrb: i'm struggling with a capistrano issue. i'm getting conq: repository access denied when i try to do a deploy:check, however - when i'm ssh'd into the server, i can execute commands and clone the repository without a problem
[22:19:41] maz-dev: has joined #RubyOnRails
[22:19:49] timdotrb: here's a gist of my deploy.rb, local capistrano output and git output on the server: https://gist.github.com/willc0de4food/110ebfea159540513828
[22:19:56] a1fa: smathy: it's a def inside a classmethod, that does not count?
[22:19:58] Mendenhall: has joined #RubyOnRails
[22:21:07] jeadre: has joined #RubyOnRails
[22:21:17] fryguy: timdotrb: i'm going to guess it has something to do with pty: true in your capistrano config
[22:21:26] fryguy: since you are using ssh -T as the test down below
[22:21:29] smathy: a1fa, !gist your codes
[22:21:29] helpa: a1fa: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[22:22:03] finnnnnnnnnnn: has joined #RubyOnRails
[22:22:21] a1fa: my models are blank
[22:22:44] a1fa: at the moment Class Customer < ActiveRecord::Base
[22:22:52] smathy: a1fa, if true then no surprises that the method can't be found.
[22:23:09] a1fa: def do_what_ever
[22:23:23] a1fa: but inside that i have Find_or_Create_By
[22:23:36] timdotrb: fryguy, tried removing that line to no avail. exact same output as before
[22:23:42] andybernard: a1fa, be careful about what you capitalize when referring to code.
[22:24:06] smathy: a1fa, so (a) that's not a class method, and (b) Find_or_Create_By is not an AR::Base method (with those capitalizations)
[22:24:32] a1fa: smathy: its lower case in the code
[22:24:33] Mia: has joined #RubyOnRails
[22:24:34] Mia: has joined #RubyOnRails
[22:24:39] fryguy: timdotrb: are you using ssh forwarding, or is a deploy private key copied to the server?
[22:24:42] a1fa: smathy: so i can difine a sub class method inside a method?
[22:24:53] kies^: has joined #RubyOnRails
[22:24:55] smathy: a1fa, see, this would be the value of creating a gist. I'm out until you do that.
[22:25:34] rhizome: ugh, integration not mirroring site behavior
[22:25:41] lurkmaster: has joined #RubyOnRails
[22:26:02] choke: has joined #RubyOnRails
[22:26:52] doublemalt_: has joined #RubyOnRails
[22:26:53] s2013: anyone here good with activeadmin? (I know) i wanna do a conditional column based on the id of the item being shown.. no clue how to do that..
[22:26:53] timdotrb: fryguy, in my ssh_options, i have forward_agent: true, as well as the ssh port specified
[22:26:58] s2013: if it even makes ense
[22:27:10] rhizome: conditional how?
[22:28:36] fryguy: timdotrb: why are you running ssh -T from the server?
[22:29:53] s2013: if the company id is 123 then display these 2 columns.. otherwise dont display them
[22:30:13] rhizome: one specific company?
[22:30:14] s2013: but i have no idea how to get the company's id from the ActiveAdmin.register block
[22:30:30] s2013: cause those fields only exist for that specific company
[22:30:31] rhizome: show do |company| something like that
[22:30:58] s2013: hmm let me try
[22:31:02] s2013: now i just have index do ... end
[22:31:30] timdotrb: fryguy, that was just to ensure i had repository access
[22:31:56] fryguy: timdotrb: what happens if you don't do that and instead just execute the git command
[22:32:06] timdotrb: fryguy, that's later on in that same output
[22:32:29] s2013: no that ont ork.. it returns as a table
[22:32:34] fryguy: timdotrb: right, in the same shell
[22:32:45] fryguy: timdotrb: what happens if you do it from a clean environment
[22:32:51] timdotrb: fryguy, ahh, sec.
[22:32:55] lurkmaster: when i try to generate a new rails app in /users/lurkmaster i get this error: http://pastie.org/10378060 , if i run it in the root directory or under any other user, I don't get this weird error. does anyone know what's happening here?
[22:33:21] lurkmaster: running OS X 10.10.5
[22:33:34] timdotrb: fryguy, access denied
[22:33:40] NodeNagant: has joined #RubyOnRails
[22:34:04] timdotrb: fryguy, i lied. sorry, ssh'd in as the wrong user
[22:34:20] timdotrb: fryguy, when ssh'd in as the correct user, the command executes successfully
[22:34:45] lurkmaster: and buldner 1.10.6
[22:35:15] fryguy: timdotrb: not sure then
[22:35:29] hazelux: has joined #RubyOnRails
[22:35:54] lurkmaster: if anyone has any idea of what's going on please let me know, id appreciate it
[22:36:19] christiandsg: has joined #RubyOnRails
[22:37:04] hazelux: has joined #RubyOnRails
[22:37:20] timdotrb: i've gone as far as deleting the VPS and completely setting up a new one
[22:37:38] kitsuneyo: has joined #RubyOnRails
[22:37:53] havenwood: has joined #RubyOnRails
[22:37:55] rhizome: what can i look at when an integration apparently doesn't reflect the database state I thought I was setting up? i'm suspecting they're separate instances of the app.
[22:38:28] rhizome: create(:item, :active); visit '/store' # no items
[22:38:40] a1fa: smathy: https://gist.github.com/anonymous/50ca6bf2afde917de3ca
[22:38:43] JoshGlzBrk: has joined #RubyOnRails
[22:39:21] a1fa: so this works fine when invoked from the same model as before_save or what not
[22:39:28] a1fa: but why cant i call this from a different model?
[22:39:34] NodeNagant: has joined #RubyOnRails
[22:39:59] a1fa: Customer.create_or_update_customer
[22:40:28] andybernard: correct me if I am wrong, but with models you can only call methods on the @object
[22:40:33] andybernard: not the class
[22:40:44] neanderslob: has joined #RubyOnRails
[22:41:26] fryguy: timdotrb: where are you specifying agent forwarding in your config?
[22:41:44] rhizome: you can call methods on the class. scopes are an example of these.
[22:41:47] momomomomo: has joined #RubyOnRails
[22:42:49] a1fa: so what am i doing wrong?
[22:42:59] ebbflowgo: has joined #RubyOnRails
[22:43:07] j_mcnally: has joined #RubyOnRails
[22:43:27] fryguy: a1fa: create_or_update_customer probably isn't a class method
[22:43:44] timdotrb: fryguy, in config/deploy/production.rb
[22:44:07] timdotrb: fryguy, looks like it's an issue with bitbucket. i uploaded the code to github, and the issue is gone
[22:44:17] a1fa: no it's not, it's a def inside a class
[22:45:01] fryguy: a1fa: being inside of a class doesn't make it a class method
[22:45:11] a1fa: should i just create a subclass ?
[22:45:22] fryguy: a1fa: change your def to def self.create_or_update_customer
[22:45:35] jmpp: has joined #RubyOnRails
[22:45:44] fryguy: or one of the other half-dozen ways of defining a class method
[22:45:52] andybernard: rhizome, scopes are different than def method; end
[22:46:57] rhizome: right, they're def self.method
[22:47:10] Mendenhall: has joined #RubyOnRails
[22:47:18] a1fa: awesome - that's better. now i need to figure out how to pass attributes from 1 class to another
[22:47:19] rhizome: if they return a relation, they're essentially identical to scops
[22:47:24] a1fa: do you pass them as params?
[22:47:32] andybernard: def self.method(params); end
[22:47:41] a1fa: ok thought so
[22:48:27] a1fa: so that d = attributes should be changed to d = params?
[22:48:55] jesterfraud: has joined #RubyOnRails
[22:49:00] andybernard: it can be attributes if thats what you want
[22:49:06] andybernard: its just a variable being passed
[22:49:18] fryguy: a1fa: you need to pass params into the function, read more closely what andybernard suggested
[22:49:35] fryguy: "params" isn't a special word here. it has no special meaning in models. it's just a variable name
[22:50:50] fr0n7: has joined #RubyOnRails
[22:51:38] Kallis: has joined #RubyOnRails
[22:54:01] ledestin: has joined #RubyOnRails
[22:54:07] superlou: has joined #RubyOnRails
[22:54:35] dmz: has joined #RubyOnRails
[22:54:35] dmz: has joined #RubyOnRails
[22:55:19] jglover: has joined #RubyOnRails
[22:55:55] chipotle: has joined #RubyOnRails
[22:55:55] timdotrb: fryguy, super weird. i added to a different bitbucket account and that also worked. must be something wonky with that account, specifically
[22:57:42] baweaver: has joined #RubyOnRails
[22:58:23] quazimodo: has joined #RubyOnRails
[22:58:30] joshkovach: has joined #RubyOnRails
[23:00:10] RegulationD: has joined #RubyOnRails
[23:00:29] NodeNagant: has joined #RubyOnRails
[23:00:31] hahuang65: So it looks like after_touch was triggered on update in Rails 4.1, but not in 4.2... How do I confirm this?
[23:00:51] Lightsword: has joined #RubyOnRails
[23:01:51] fryguy: hahuang65: one maybe reasonable way is to git diff -Safter_touch 4.1..4.2
[23:02:10] hahuang65: fryguy: good idea. thanks
[23:03:42] workmad3: hahuang65: also, throw together a sample rails 4.1 app and a sample rails 4.2 app with after_touch callbacks, so you can point to them as demonstrating the different behaviour
[23:03:50] fryguy: hahuang65: another reasonable way would be to set up a test case and use git bisect to see when the behavior changed
[23:04:26] givanse: has joined #RubyOnRails
[23:05:03] hahuang65: workmad3: I can see it happening in my app between two branches
[23:05:14] hahuang65: workmad3: but are you suggesting it might be a bug?
[23:05:29] Intii: has joined #RubyOnRails
[23:05:43] workmad3: hahuang65: I'm suggesting that if you want to pin it down to a rails change, you should produce a minimal reproduction case
[23:05:56] hahuang65: workmad3: gotcha.
[23:06:00] RandyT_: has joined #RubyOnRails
[23:06:02] j_mcnally: has joined #RubyOnRails
[23:06:11] Intii: Hi everyone, I'm using the delayed_job gem to schedule emails going out, but for some reason it creates two tasks and sends two copies of the same email
[23:06:36] joshkovach: has joined #RubyOnRails
[23:06:55] fryguy: Intii: probably not the answer you are looking for, but don't use delayed_job. use something more modern
[23:07:06] workmad3: hahuang65: it sounds like a change that shouldn't have happened between a minor version change too, so if you can reproduce in a minimal case, I'd suggest throwing it up as an issue on the rails repo (double-check it doesn't already exist first)
[23:07:20] Intii: fryguy: Do you have any suggestions on what I can use?
[23:07:32] fryguy: Intii: sidekiq or resque
[23:07:36] Intii: Something that doesn't require redis if possible
[23:08:06] workmad3: Intii: also, use the activejob wrapper to delay your emails in rails 4.0+
[23:08:28] workmad3: Intii: it's seriously as easy as doing 'SomeMailer.mail_method(whatever).deliver_later'
[23:08:36] fryguy: except that activejob_scheduler is 0.0.1 and super beta
[23:08:40] hahuang65: Intii: why not something that doesn't require Redis?
[23:08:43] mary5030: has joined #RubyOnRails
[23:08:48] hahuang65: workmad3: okay, I'll check it out.. thanks
[23:09:05] Intii: hahuang65: I want something that is quick to implement that's why
[23:09:12] Intii: I've never used redis before
[23:09:18] andybernard: Intii, redis is amazingly quick
[23:09:29] Intii: workmad3: Do you have any documentation for this?
[23:09:33] hahuang65: Intii: you actually don't need to know anything about Redis for Resque... you just need to install and run the server.. that's all
[23:09:43] hahuang65: of course, it's good to learn about Redis :)
[23:09:46] andybernard: and for my 2 cents, use sidekiq over resque
[23:09:50] Intii: hahuang65 and andybernard: I will check it out right now
[23:10:05] workmad3: Intii: http://edgeguides.rubyonrails.org/active_job_basics.html#action-mailer
[23:10:06] n00bDev: is there a way to get the selected objects id and be used for a hidden field value?
[23:10:23] annlewis: has joined #RubyOnRails
[23:10:38] Intii: workmad3: Can I schedule with active job as well? Say send it 24 hours from now?
[23:10:40] andybernard: n00bdev, that is very vague
[23:10:52] workmad3: Intii: .deliver_later(wait: 24.hours)
[23:11:38] Intii: workmad3: Okay thanks! and this works out of the box?
[23:11:46] n00bDev: andybeard: something like this
[23:11:47] n00bDev: https://gist.github.com/gwong89/cd8dcabbc159b5230008
[23:11:56] bronson: has joined #RubyOnRails
[23:11:56] doerteDev: has joined #RubyOnRails
[23:12:06] andybernard: its bernard :p
[23:12:48] n00bDev: andybernard:
[23:12:53] workmad3: Intii: you need to set up some form of background queue process, there's adapters for the major players (sidekiq, rabbitmq, etc.)
[23:13:19] Intii: okay... how the hell do I get rid of delayed_job?
[23:13:30] Intii: I've removed the gem but it has a table created in my db
[23:13:38] workmad3: Intii: create a migration to drop that table
[23:14:10] Intii: Thanks everyone! I think I'm going to install redis and then mess around with sidekiq
[23:14:26] andybernard: n00bdev, if you want it to be in the view you will have to use javascript to populate. I'd handle it at the controller level
[23:14:39] andybernard: Intii, if you have any sidekiq questions I'd be more than happy to help you out
[23:14:44] dmz: has joined #RubyOnRails
[23:14:46] Cache_Money: has joined #RubyOnRails
[23:15:11] workmad3: fryguy: can't say that I've ever needed activejob_scheduler btw ;) ActiveJob itself has most of the delaying features built in for supporting backends, and if I want a job regularly repeated, I'll use clockwork to trigger the job
[23:15:21] hahuang65: Intii: same here. Redis and Sidekiq are awesome
[23:15:42] andybernard: that they are
[23:16:04] fryguy: clockwork seems cool
[23:16:52] mordocai: has joined #RubyOnRails
[23:18:13] safety_cut: has joined #RubyOnRails
[23:19:07] rhizome: <input name="commit" type="submit" value="&lt;span class=" translation_missing"="" title=...
[23:19:35] workmad3: rhizome: I have a suspicion you're missing a translation... ;)
[23:19:48] choke: has joined #RubyOnRails
[23:20:03] rhizome: nope. some capybara-webkit or integration bug. hunting now...
[23:20:19] andybernard: rhizome, have you tried turning it off and on again?
[23:20:39] rhizome: active-admin is implicated, but i'm guessing a distant third in the possibilities
[23:20:53] Radar: !activeadmin
[23:20:53] helpa: *makes a cross with fingers and says a prayer*
[23:21:06] rhizome: this test in general is twisting my melon
[23:21:25] rhizome: going through active-admin to make it pass is the *workaround*
[23:21:39] Aeyrix: !activeadmin
[23:21:39] helpa: *makes a cross with fingers and says a prayer*
[23:21:42] helpa: Please do not use active_admin, rails_admin or any other gems to build your admin interfaces. Instead, build it yourself. This will lead you to a safe path of understanding of the code, rather than to the Hell that is those gems.
[23:21:46] Aeyrix: w e w l a d
[23:22:00] andybernard: hahahahahha that is great
[23:22:35] rhizome: i'm pretty well versed in AA, i'm not afraid
[23:22:43] Radar: Fun Sidekiq story: we had a rogue job that was looping on one of our servers and it ran a no-op about 100 million times... *and we didn't notice*
[23:23:08] Radar: Boy did I feel stupid when I found that one.
[23:23:21] TheNet: has joined #RubyOnRails
[23:23:28] Radar: Here's our stats from bikeexchange.com.au: http://i.imgur.com/3NlvLqK.png
[23:23:29] chipotle: has joined #RubyOnRails
[23:23:30] TheNet: Is there a recommended way to have a namespaced applicationcontroller?
[23:23:45] Radar: TheNet: !8ball
[23:23:50] Radar: HELPA HAS SPOKEN
[23:23:56] andybernard: is there more than one way to have a namespaced app controller?
[23:23:57] Radar: TheNet: Maybe explain better what you want, in code?
[23:24:07] Radar: HELPA IS WRONG
[23:24:13] hnanon: has joined #RubyOnRails
[23:24:19] andybernard: you and i both know that is not true
[23:24:25] andybernard: helpa never lies
[23:24:34] Aeyrix: Actually sometimes.
[23:24:35] hahuang65: workmad3: I see the problem. It's not that update used to call after_touch... It's the `belongs_to: :foo, touch: true` that's misbehaving.
[23:24:36] Radar: God damn it,.
[23:24:43] andybernard: you have angered it
[23:24:47] rhizome: ACTION unshaves the AA yak
[23:24:49] TheNet: I have an admin namespace and I want to render a different layout for it than the rest of my app
[23:24:58] hnanon: <%= order.fulfillment_status.exist? ? order.fulfillment_status.humanize : "NA" %>
[23:25:06] andybernard: damn broken...
[23:25:07] rhizome: now to figure out why store items aren't appearing in this stupid integ
[23:25:11] Criten: TheNet: you can speciy the template you want to use
[23:25:20] hnanon: Why am I getting this error: undefined method `humanize' for nil:NilClass
[23:25:27] Radar: ACTION enjoys it when people talk about code using words instead of actual code.
[23:25:33] Radar: hnanon: use present?, not .exist?
[23:25:43] TheNet: Criten: yes with layout 'other_layout', right?
[23:25:55] TheNet: but I don't want to call that for every controller in the admin namespace
[23:25:59] Radar: TheNet: This is how I would do it: https://gist.github.com/radar/553fd40464bbb3fc8b88
[23:26:00] NodeNagant: has joined #RubyOnRails
[23:26:10] Radar: TheNet: Or maybe it's layout 'admin'. I can never remember.
[23:26:18] Radar: TheNet: Then all admin controllers inherit from that layout.
[23:26:21] Radar: From that controller.
[23:26:23] andybernard: Radar, why is my code not working? def divide_by_zero; return 15/0; end
[23:26:25] Radar: Wow, go brain today.
[23:26:36] workmad3: Radar: string == layout name, symbol == layout-lookup-method name
[23:26:39] Radar: andybernard: Ask Siri what is 0 divided by 0.
[23:26:45] TheNet: Radar: should I put that in controllers/ or controllers/admin/ ?
[23:26:54] andybernard: Radar, pffffft I'll use cortana
[23:27:04] workmad3: Radar: also: 0.fdiv(0)
[23:27:07] hnanon: Radar: Thanks. That was simple enough.
[23:28:00] kies^: has joined #RubyOnRails
[23:30:01] hydrozen: has joined #RubyOnRails
[23:31:11] replay: has joined #RubyOnRails
[23:33:47] Dreamer3: what is that method that turns anything into a queryable thingy? Rails.env.production?
[23:33:55] northfurr: has joined #RubyOnRails
[23:33:57] Dreamer3: someting("production").production?
[23:34:29] ellisTAA: has joined #RubyOnRails
[23:35:21] smathy: New to me Dreamer3
[23:35:24] ellisTAA: i???m trying to write a controller test and i???m getting this error message, ??? Failure/Error: expect(response).to redirect_to :action => :show
[23:35:25] ellisTAA: Expected response to be a <redirect>, but was <200>??? is there something wrong with my syntax? https://gist.github.com/ellismarte/83e61d1cfc6bccea39cd#file-city_spec-rb-L14
[23:36:03] Dreamer3: ActiveSupport::StringInquirer.new
[23:36:31] benlieb: has joined #RubyOnRails
[23:36:55] smathy: EllisTAA, not with that line.
[23:37:19] smathy: EllisTAA, you're not actually performing any request in your setup.
[23:37:29] smathy: Dreamer3, nice
[23:37:56] ellisTAA: smathy: are you saying that i???m not hitting the controller action?
[23:37:57] choke: has joined #RubyOnRails
[23:38:43] smathy: EllisTAA, correct, not unless rspec controller tests are a lot more magical than I realize.
[23:38:54] charliesome: has joined #RubyOnRails
[23:39:07] hnanon: Shopify starts their order numbers at 1001. Is this their order_id field or did they create a new attribute like order_number?
[23:39:26] jholm: has joined #RubyOnRails
[23:41:30] ecnalyr: has joined #RubyOnRails
[23:41:59] blnkammo: has joined #RubyOnRails
[23:43:10] rhizome: factorygirl/integrations fix appears to be #3 here: http://blog.plataformatec.com.br/2011/12/three-tips-to-improve-the-performance-of-your-test-suite/
[23:45:40] rhizome: green. kill me later.
[23:46:13] HalcyonicStorm: has joined #RubyOnRails
[23:47:13] nya: has joined #RubyOnRails
[23:49:05] Mendenhall: has joined #RubyOnRails
[23:49:05] ellisTAA: how do i send data when i test my controller? https://gist.github.com/ellismarte/83e61d1cfc6bccea39cd#file-city_spec-rb-L13
[23:49:06] poli: has joined #RubyOnRails
[23:50:46] NodeNagant: has joined #RubyOnRails
[23:51:49] blnkammo: has joined #RubyOnRails
[23:54:35] michael_mbp: has joined #RubyOnRails
[23:55:40] jesterfraud: has joined #RubyOnRails
[23:55:53] roolo: has joined #RubyOnRails
[23:58:07] andybernard: has joined #RubyOnRails
[23:58:28] nya: has joined #RubyOnRails