« Back to channel list

#RubyOnRails - 19 May 2016

« Back 1 day Forward 1 day »
[00:03:14] King_Rex: has joined #RubyOnRails
[00:03:29] HenriettaSalt: has joined #RubyOnRails
[00:06:39] jstr: has joined #RubyOnRails
[00:06:45] dandaman: has joined #RubyOnRails
[00:07:41] refinerysource: has joined #RubyOnRails
[00:07:57] macsteps: has joined #RubyOnRails
[00:09:30] hive-mind: has joined #RubyOnRails
[00:09:51] Axilla: has joined #RubyOnRails
[00:10:48] PlasmaStar: has joined #RubyOnRails
[00:12:46] maxdoubt: has joined #RubyOnRails
[00:17:56] sypheren: has joined #RubyOnRails
[00:19:31] quazimodo: so I think I'll try actioncable soon
[00:20:13] quazimodo: oh wow did they remove celluloid as a dep??
[00:21:20] quazimodo: that's surprising. I thuoght they wanted to go to celluloid over eventmachine
[00:21:26] quazimodo: looks like both gonna go
[00:26:26] diegoviola: has joined #RubyOnRails
[00:27:20] _Tariq: has joined #RubyOnRails
[00:28:15] Axilla: has joined #RubyOnRails
[00:28:30] stardiviner: has joined #RubyOnRails
[00:29:56] quazimodo: Ah i see, performance improvements
[00:30:11] Inside: has joined #RubyOnRails
[00:34:01] macsteps: has joined #RubyOnRails
[00:37:25] crystal77: has joined #RubyOnRails
[00:40:46] Radar: I have an events table which has an events_type column. I'm trying to come up with a way to group the data into a HTML table like this: http://i.imgur.com/5VYr3PJ.png
[00:40:58] Radar: Anyone got a tip?
[00:41:31] Radar: I'm thinking that I might just show the last 7 days of events and do a few queries for that.
[00:42:04] baweaver: What's an event look like?
[00:42:23] Radar: <Event event_type: "impression", created_at: <timestamp>>
[00:42:34] Radar: Other event types are quotes, and redirections.
[00:42:52] baweaver: Event.group(:event_type).count
[00:43:07] baweaver: not sure on quote value.
[00:43:40] baweaver: or: Event.where(event_type: %w(impression quotes redirections)).group(:event_type).count
[00:44:28] Radar: Won't group by day... Might just scrap this whole page since they only really care about the CSV export.
[00:44:30] baweaver: Ah, probably date based too
[00:44:47] d0nn1e: has joined #RubyOnRails
[00:44:54] Radar: One of those "remove it and see if they complain" type dealios
[00:46:04] baweaver: oooo: https://alexpeattie.com/blog/grouping-activerecord-by-day-or-week-with-datetrunc
[00:46:09] baweaver: that looks promising
[00:46:19] Radar: Yup, it'll do the thing
[00:46:30] Radar: I'll remove it and then if they complain I'll use date_trunc. Thanks for finding that :)
[00:46:39] flashpoint9: has joined #RubyOnRails
[00:46:58] baweaver: ACTION didn't know it existed until a few minutes ago
[00:47:27] nettoweb: has joined #RubyOnRails
[00:48:16] cnk: glad to see it tells you how to create indexes that will make that more reasonable on the db side
[00:48:50] baweaver: Radar / cnk: http://www.commitstrip.com/en/2014/06/03/the-problem-is-not-the-tool-itself/
[00:50:12] cnk: indeed. But some sorts of queries force full table scans unless you have indices on the results of a function
[00:51:07] Radar: Took the activity query for logs.ryanbigg.com from 2 sec to 40ms by adding an index.
[00:51:19] maxdoubt: has joined #RubyOnRails
[00:52:16] cnk: how very satisfying!
[00:54:04] maxdoubt: has joined #RubyOnRails
[00:55:57] Axilla: has joined #RubyOnRails
[00:56:34] konsolebox: has joined #RubyOnRails
[00:57:48] maxdoubt: has joined #RubyOnRails
[00:58:44] glasz: has joined #RubyOnRails
[01:00:01] maxdoubt: has joined #RubyOnRails
[01:03:08] wldcordeiro: has joined #RubyOnRails
[01:05:38] purrkode: has joined #RubyOnRails
[01:06:53] centrx: has joined #RubyOnRails
[01:08:23] adre: has joined #RubyOnRails
[01:10:53] Maletor: has joined #RubyOnRails
[01:11:41] arBmind: has joined #RubyOnRails
[01:12:01] macsteps: has joined #RubyOnRails
[01:17:33] one_zero: has joined #RubyOnRails
[01:21:26] quazimodo: indexing huuuuuge text searches with solr blew my mind
[01:22:02] refinerysource: has joined #RubyOnRails
[01:22:05] quazimodo: it's so amazing to see unfathomably large sets of data (like googles site dbs) get queried in an instant
[01:22:29] quazimodo: it's like watching a huge jumbojet take off from nearby. You get how it works, but it's still hard to believe
[01:22:37] _Tariq: It's expensive on Heroku right?
[01:22:39] _Tariq: Is there a free version of text search out there?
[01:24:06] maxdoubt: has joined #RubyOnRails
[01:26:43] pawnbox: has joined #RubyOnRails
[01:30:32] gambl0re: has joined #RubyOnRails
[01:34:27] evansparkman: has joined #RubyOnRails
[01:34:46] evansparkman: what's up party peoplez
[01:36:58] Ropeney: has joined #RubyOnRails
[01:42:38] dandaman: has joined #RubyOnRails
[01:44:50] macsteps: has joined #RubyOnRails
[01:45:08] SteenJobs: has joined #RubyOnRails
[01:46:09] jenrzzz: has joined #RubyOnRails
[01:46:38] HenriettaSalt: has joined #RubyOnRails
[01:49:11] jancel: has joined #RubyOnRails
[01:58:02] sevenseacat: has joined #RubyOnRails
[01:58:24] centrx: has joined #RubyOnRails
[02:01:13] macsteps: has joined #RubyOnRails
[02:02:26] pawnbox: has joined #RubyOnRails
[02:03:23] Tempesta: has joined #RubyOnRails
[02:06:34] stardiviner: has joined #RubyOnRails
[02:08:27] emachnic: has joined #RubyOnRails
[02:09:02] emachnic: has joined #RubyOnRails
[02:10:37] aghalarp: has joined #RubyOnRails
[02:11:24] AmiMoench: has joined #RubyOnRails
[02:11:49] maxdoubt: has joined #RubyOnRails
[02:11:56] arBmind1: has joined #RubyOnRails
[02:23:26] macsteps: has joined #RubyOnRails
[02:25:23] chouhoulis: has joined #RubyOnRails
[02:26:05] King_Rex: has joined #RubyOnRails
[02:26:19] chouhoul_: has joined #RubyOnRails
[02:26:23] AnoHito: has joined #RubyOnRails
[02:30:04] mrgreenfur: has joined #RubyOnRails
[02:36:20] eljimmy: has joined #RubyOnRails
[02:37:57] jancel: has joined #RubyOnRails
[02:38:59] nanothief: has joined #RubyOnRails
[02:40:19] _Tariq: has joined #RubyOnRails
[02:40:30] refinerysource: has joined #RubyOnRails
[02:42:51] kgrz: has joined #RubyOnRails
[02:42:58] chipotle: has joined #RubyOnRails
[02:43:56] King_Rex: has joined #RubyOnRails
[02:44:42] pepee: has joined #RubyOnRails
[02:50:45] MaDErroR123: has joined #RubyOnRails
[02:54:06] pawnbox: has joined #RubyOnRails
[02:55:07] jancel: has joined #RubyOnRails
[03:02:11] Lonloren: has joined #RubyOnRails
[03:02:31] _Tariq: has joined #RubyOnRails
[03:03:58] nibbo: has joined #RubyOnRails
[03:05:41] maxx88_: has joined #RubyOnRails
[03:07:39] RegulationD: has joined #RubyOnRails
[03:11:58] Maletor: has joined #RubyOnRails
[03:12:17] arBmind: has joined #RubyOnRails
[03:16:08] braincrash: has joined #RubyOnRails
[03:17:24] nettoweb: has joined #RubyOnRails
[03:18:12] purrkode: has joined #RubyOnRails
[03:20:27] akshat: has joined #RubyOnRails
[03:23:32] pawnbox: has joined #RubyOnRails
[03:28:42] aghalarp: has joined #RubyOnRails
[03:30:23] maxdoubt: has joined #RubyOnRails
[03:44:32] ereslibre: has joined #RubyOnRails
[03:44:32] ereslibre: has joined #RubyOnRails
[03:49:36] bronson: has joined #RubyOnRails
[03:49:54] humd1ng3r: has joined #RubyOnRails
[03:50:05] refinerysource: has joined #RubyOnRails
[04:00:10] njero: has joined #RubyOnRails
[04:04:19] nettoweb: has joined #RubyOnRails
[04:05:29] crystal77: has joined #RubyOnRails
[04:06:07] LBRapid: has joined #RubyOnRails
[04:11:51] djbkd: has joined #RubyOnRails
[04:13:08] LBRapid: has joined #RubyOnRails
[04:24:00] SteenJobs: has joined #RubyOnRails
[04:24:10] flashpoint9: has joined #RubyOnRails
[04:27:42] naavinm: has joined #RubyOnRails
[04:31:31] pawnbox: has joined #RubyOnRails
[04:32:13] duncannz: has joined #RubyOnRails
[04:33:02] aghalarp: has joined #RubyOnRails
[04:35:00] Macaveli: has joined #RubyOnRails
[04:39:05] MaDErroR123: has joined #RubyOnRails
[04:43:57] k3rn31: has joined #RubyOnRails
[04:45:53] alfie_max15: has joined #RubyOnRails
[04:52:10] Devalo: has joined #RubyOnRails
[04:55:09] k3rn31: has joined #RubyOnRails
[04:57:27] duncannz: has joined #RubyOnRails
[05:02:42] moeabdol: has joined #RubyOnRails
[05:04:49] hahuang65: has joined #RubyOnRails
[05:04:52] refinerysource: has joined #RubyOnRails
[05:05:48] dandaman: has joined #RubyOnRails
[05:09:03] njero: has joined #RubyOnRails
[05:09:57] adre: has joined #RubyOnRails
[05:12:47] arBmind: has joined #RubyOnRails
[05:13:11] fmcgeough: has joined #RubyOnRails
[05:18:25] chopin: has joined #RubyOnRails
[05:24:05] moeabdol: has joined #RubyOnRails
[05:27:47] insanedreamer: has joined #RubyOnRails
[05:30:10] yfeldblum: has joined #RubyOnRails
[05:31:19] yfeldblum: has joined #RubyOnRails
[05:31:56] iamvery: has joined #RubyOnRails
[05:39:15] rvanlieshout: has joined #RubyOnRails
[05:39:49] d0nn1e: has joined #RubyOnRails
[05:40:56] xall: has joined #RubyOnRails
[05:43:00] troys: has joined #RubyOnRails
[05:45:41] emilkarl: has joined #RubyOnRails
[05:46:49] hcnewsom: has joined #RubyOnRails
[05:47:04] Axilla: has joined #RubyOnRails
[05:48:45] xall_: has joined #RubyOnRails
[05:48:55] roelof: has joined #RubyOnRails
[05:49:38] roelof: Hello, I have 10 images and I want to display them in 2 rows of 5. How can I make a new row on the 5th image ?
[05:49:45] Dimik: has joined #RubyOnRails
[05:50:13] alfie_max15: you are looking for each_slice
[05:51:40] bronson: has joined #RubyOnRails
[05:52:37] roelof: alfie_max15: oke, like this page : http://stackoverflow.com/questions/14528919/new-row-every-3-items
[05:54:04] alfie_max15: the accepted answer there is using `in_group_of`, i haven't used that before though
[05:57:10] janebootydoe: has joined #RubyOnRails
[05:58:01] roelof: alfie_max15: thanks
[05:58:46] alfie_max15: roelof, wc :)
[05:59:14] roelof: wc ?? I think yoiu mean yw(your welcome) ?
[06:02:28] fckyoufreenode: has joined #RubyOnRails
[06:06:02] ur5us: has joined #RubyOnRails
[06:06:03] chouhoulis: has joined #RubyOnRails
[06:06:28] hahuang65: has joined #RubyOnRails
[06:06:43] aghalarp: has joined #RubyOnRails
[06:07:45] raunicolae: has joined #RubyOnRails
[06:07:58] raunicolae: has left #RubyOnRails: ()
[06:11:05] Dimik: has joined #RubyOnRails
[06:14:00] jancel: has joined #RubyOnRails
[06:14:10] tildes_: has joined #RubyOnRails
[06:19:44] refinerysource: has joined #RubyOnRails
[06:25:02] rafaelfranca: has joined #RubyOnRails
[06:26:23] syzygy_: has joined #RubyOnRails
[06:27:04] Oog: has joined #RubyOnRails
[06:29:35] Oog: i have a model it can be on for days of the week for example Monday and Tuesday
[06:29:44] Oog: what is the best way to store this? 7 booleans? one for each day of the week?
[06:30:26] agent_white: has joined #RubyOnRails
[06:35:05] janebootydoe: Oog, how would 7 booleans work?
[06:35:42] Oog: one for each day of the week
[06:36:25] janebootydoe: like 6 false 1 true? why not just an int 1-7
[06:37:48] janebootydoe: oh multiple days
[06:37:58] janebootydoe: postgres array text if you're using that, otherwise yeah 7 booleans
[06:38:12] SteenJobs: has joined #RubyOnRails
[06:39:00] tetraktys: has joined #RubyOnRails
[06:40:44] _3dwardsharp: has joined #RubyOnRails
[06:41:45] gingray: has joined #RubyOnRails
[06:42:00] tvw: has joined #RubyOnRails
[06:44:05] janebootydoe: has left #RubyOnRails: ("Leaving")
[06:45:21] MaDErroR123: has joined #RubyOnRails
[06:49:02] tildes: has joined #RubyOnRails
[06:57:57] kgrz: has joined #RubyOnRails
[06:58:14] aghalarp: has joined #RubyOnRails
[06:59:52] ur5us: has joined #RubyOnRails
[06:59:58] comrad: has joined #RubyOnRails
[07:00:47] WilfredTheGreat: has joined #RubyOnRails
[07:05:45] rafaelfranca: has joined #RubyOnRails
[07:06:39] neanderslob: has joined #RubyOnRails
[07:09:06] RegulationD: has joined #RubyOnRails
[07:10:01] fbandov: has joined #RubyOnRails
[07:18:11] tildes: has joined #RubyOnRails
[07:19:20] emachnic: has joined #RubyOnRails
[07:22:57] aganov: has joined #RubyOnRails
[07:23:03] antgel: has joined #RubyOnRails
[07:26:26] p1k: has joined #RubyOnRails
[07:26:43] newmanships: has joined #RubyOnRails
[07:26:47] giom: has joined #RubyOnRails
[07:29:26] FCser: has joined #RubyOnRails
[07:30:58] tildes: has joined #RubyOnRails
[07:32:15] ql6wlld: has joined #RubyOnRails
[07:32:53] siaw23: has joined #RubyOnRails
[07:33:04] siaw23: good morning.
[07:33:11] artto: has joined #RubyOnRails
[07:33:12] siaw23: in Rails speak, what’s a “decorator”?
[07:33:25] siaw23: i’m trying to get the hang of this https://github.com/drapergem/draper
[07:34:01] refinerysource: has joined #RubyOnRails
[07:36:03] darutoko: has joined #RubyOnRails
[07:37:45] p1k: it seems to be specific to that gem
[07:37:47] universa1: siaw23: http://railscasts.com/episodes/286-draper
[07:38:23] universa1: siaw23: and: http://railscasts.com/episodes/287-presenters-from-scratch -- you might find the video on youtube o0 ;)
[07:38:30] siaw23: universa1: thank you :)
[07:38:51] alfie_max15: If i have a User model and has an email field, i would believe that there would be a protected method called `email_required?` which would be used for validation checks
[07:39:19] universa1: alfie_max15: no.
[07:39:34] universa1: what makes you think that?
[07:39:38] njero: y like so?
[07:40:41] alfie_max15: because, when i do `User.first.email_required?`
[07:40:58] alfie_max15: i get => `NoMethodError: protected method `email_required?' called for #<Store:0x0000000317c548>`
[07:41:06] universa1: devise might add that method ;) or if you add validates :email, presence: true
[07:41:12] universa1: lemme check ;)
[07:41:43] njero: oic I'm devise dump :P
[07:41:46] alfie_max15: i'm just trying to make sense of a codebase i got, none of the present developers in the project are of any help
[07:42:10] universa1: alfie_max15: looks like devise.
[07:42:20] alfie_max15: the problem is that there was a custom method called `email_changed?` defined in the model, and which returns `false`
[07:42:46] universa1: alfie_max15: whoa... ATTRIBUTE_changed? is from rails
[07:43:27] universa1: alfie_max15: probably some weird hack to not hit the db if you only changed the email.
[07:44:01] alfie_max15: yeah, i know about ATTRIBUTE_changed?, but not sure why they have written overide methods for both changed? and required?
[07:44:14] alfie_max15: both to return false
[07:44:34] universa1: email_required? is most likely from and for devise
[07:44:52] universa1: because for other attributes it is not present.
[07:45:12] alfie_max15: i'll dig deeper in devise source
[07:45:17] alfie_max15: universa1, thanks
[07:45:18] alaing: has joined #RubyOnRails
[07:45:42] alaing: has joined #RubyOnRails
[07:45:45] pawnbox: has joined #RubyOnRails
[07:46:22] bookies: has joined #RubyOnRails
[07:46:25] universa1: alfie_max15: https://www.quora.com/What-are-good-ways-to-remove-email-as-a-required-field-in-devise
[07:46:46] alaing: Hi, I'm using a custom form builder as my default form builder. Is there a way I can go back to the standard rails form builder on specific forms?
[07:46:55] bookies: is there a rails gem/or any other way that can quickly properly indent all files?
[07:47:14] alfie_max15: universa1, that makes sense, but i don't think that is a "good" way
[07:47:23] universa1: alfie_max15: ;)
[07:47:24] alfie_max15: its more like a hack
[07:47:28] Axilla: has joined #RubyOnRails
[07:48:35] matthias_: has joined #RubyOnRails
[07:49:58] noobsu: has joined #RubyOnRails
[07:53:11] norc: has joined #RubyOnRails
[07:53:19] bronson: has joined #RubyOnRails
[07:54:38] noobsu: has joined #RubyOnRails
[07:57:17] universa1: alaing: <%= form_for @person, url: { action: "create" }, builder: LabellingFormBuilder do |f| %> ... so if you pass in the original class name, then yes, you can use the default rails form builder again ;)
[07:57:23] alfie_max15: universa1, is it possible in devise to make email field optional and use phone number?
[07:58:00] universa1: alfie_max15: looks like it. haven't done it, so off to google ;) should be similar to: do not use email as login, but a "login" string
[07:58:31] alfie_max15: scenario is that there are two types of users, implemented using STI, one type uses email as login field, second uses phone number or email
[07:59:12] universa1: alfie_max15: https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-sign-in-using-their-username-or-email-address
[07:59:24] alaing: alfie_max15: so where LabellingFormBuilder is in your example do I simply use "ActionView::Helpers::FormBuilder"
[07:59:41] alaing: universa1: ^
[07:59:43] universa1: alaing: try ;)
[08:00:06] universa1: alaing: did you overwrite FormBuilder or how did you implement your form builder?
[08:00:36] p1k: so I wrote on the mailing list regarding a MemoryLeak in Rails Server and haven't really gotten any more info
[08:00:50] edwinvdgraaf: has joined #RubyOnRails
[08:01:05] p1k: is it worth filing a bug? I don't know how useful such a report would be since I really don't know what to point my finger at
[08:01:26] universa1: p1k: rails server is rather unspecific. what server are you actually using? dev mode? prod mode?
[08:01:51] artto: has joined #RubyOnRails
[08:02:36] jancel: has joined #RubyOnRails
[08:02:42] konsolebox: has joined #RubyOnRails
[08:02:57] xall: has joined #RubyOnRails
[08:03:51] adre: has joined #RubyOnRails
[08:06:26] Dbugger: has joined #RubyOnRails
[08:06:51] Dbugger: Hi everyone. i am trying to load my images from other domain, on my dev environment, but for some reason it is nor working. Can someone tell me why this code fails? http://hastebin.com/sipeqocovo.ruby
[08:06:59] alaing: Hi, I'm getting 'undefined method `sub!' for nil:NilClass' error for a label https://gist.github.com/aliuk2012/cd1624f584a0c586e1e418a499045ae3
[08:07:00] Dbugger: I keep getting them from localhost
[08:07:01] bookies: I have this line of code (https://gist.github.com/stefioan/e62a3b7e858e33d51d0a851b1745fc43) that throughts an XSS vulnerability. How can I escape it?
[08:07:43] universa1: dbugger: how does it fail? what is the output? ....
[08:08:01] adre: has joined #RubyOnRails
[08:08:29] universa1: alaing: full file + full error trace please.
[08:09:07] universa1: bookies: where does @order.txid come from?
[08:09:56] hahuang65: has joined #RubyOnRails
[08:10:59] bookies: universa1: orders_controller
[08:11:22] universa1: bookies: where does txid come from? is it automatically generated? is it some number? ...
[08:11:48] bookies: yes, it is automatically generated
[08:12:33] pwnd_nsfw: has joined #RubyOnRails
[08:12:35] blackmesa: has joined #RubyOnRails
[08:12:35] bookies: after the user buys bitcoin it gets the txid to show the transaction was made
[08:13:02] marr: has joined #RubyOnRails
[08:13:21] alaing: universa1: full file is there not sure about how to get full error trace
[08:13:44] universa1: alaing: the terminal where you started the rails server has it.
[08:13:50] universa1: alaing: the development.log has it
[08:14:19] universa1: alaing: and also, the default rails setup shows it when an error happens
[08:14:22] Ch4rAss: has joined #RubyOnRails
[08:14:29] universa1: *shows it in the browser
[08:15:59] yfeldblum: has joined #RubyOnRails
[08:16:09] universa1: bookies: so the name part of your link gets escaped anyways. now you need to "fix" your link part. if your txid is not user changeable and has only a limited set of allowed values (only numbers, ...) there should not be a xss vulnerability.
[08:16:43] jhass: yeah, just validate the format on the model
[08:16:44] artto: has joined #RubyOnRails
[08:16:57] tetraktys: has joined #RubyOnRails
[08:17:02] bookies: universa1: I see. Thank you
[08:17:36] alfie_max15: anyone used instagram api before? i'm trying to fetch the user id using the users name
[08:17:44] alfie_max15: ref : http://stackoverflow.com/questions/8800459/how-to-get-the-id-for-accessing-user-details-in-instagram
[08:17:52] universa1: bookies: but you can always html_escape the txid, but not sure what would happen if you put it into an attribute
[08:18:01] universa1: alfie_max15: question?!
[08:18:03] alfie_max15: but i'm getting `The access_token provided is invalid.` when i try
[08:18:11] bookies: universa1: i'll try it out
[08:18:39] alfie_max15: i just created new client in the instagram dev console, and used the client_id access_token provided
[08:19:17] alaing: universa1: thanks. error stack is there
[08:19:22] alaing: internal 500 errors
[08:19:44] liquid-silence: has joined #RubyOnRails
[08:20:15] liquid-silence: Hi all, has anyone here added a nonce to a devise session cookie / database session before?
[08:20:20] universa1: alaing: gist the actual form file!
[08:20:31] liquid-silence: I am trying to stop replay attacks while the user is logged in
[08:20:50] liquid-silence: replay cannot happen if the user is signed out, which is great
[08:20:55] alaing: universa1: its there _form.html.haml
[08:21:00] universa1: alaing: no.
[08:21:22] universa1: alaing: https://gist.github.com/aliuk2012/cd1624f584a0c586e1e418a499045ae3#file-error-stack-L55
[08:21:47] universa1: alaing: just do a complete copy of the _form.html.haml. because right now it does not match your error trace.
[08:21:57] Dbugger: universa1, the output is that it does not change the host. It keeps using localhost
[08:22:57] universa1: dbugger: so your condition probably does not match?! shouldn't be too hard to debug... some if condition; puts "matched"; ...; else puts "not matched"; ...; end
[08:22:59] alaing: universa1: sorry I thought I had updated it
[08:23:04] alaing: universa1: its in there now
[08:23:10] jenrzzz: has joined #RubyOnRails
[08:24:02] Dbugger: universa1, yeah, but the app I am working makes crazy output on the server... it is hard to read that happens after 1 request
[08:24:49] universa1: dbugger: ok: puts "############i find it now################## matched" ...
[08:24:56] universa1: dbugger: or write to a different file...
[08:25:06] Dbugger: I will try to think of something
[08:25:07] universa1: dbugger: and you should debug that locally.
[08:25:15] Dbugger: I am talking locally...
[08:25:32] arBmind: has joined #RubyOnRails
[08:25:45] universa1: dbugger: so just do raise "matched"
[08:26:04] universa1: alaing: this only happens if you overwrite the builder?
[08:26:32] noobsu: has joined #RubyOnRails
[08:27:38] jhass: liquid-silence: shouldn't Rails CSRF protection already protect against these too, make them harder at least?
[08:28:38] liquid-silence: I attached fiddler on my proxy server, and was able to replay requests even over https while the user was logged in, this is from another computer on the network
[08:29:17] liquid-silence: I need to make sure that cannot happen and the only way I can think of is attaching a nonce to the session.
[08:29:40] jhass: I don't quite follow how a nonce helps there, it would stay valid while the user is still logged, no?
[08:29:45] liquid-silence: but that might require the server and client to be synchronised in time
[08:29:54] liquid-silence: the nonce changes per request
[08:30:12] liquid-silence: so user makes a request, after the request is done, the nonce gets updated
[08:30:21] jhass: sounds a lot like the CSRF token again, do you do destructive actions in a GET?
[08:30:39] liquid-silence: so that the pervious request cannot be replayed, the next request will contain a new nonce
[08:30:46] GorillaApe: has joined #RubyOnRails
[08:30:55] GorillaApe: I found a script that produces this sql
[08:30:59] liquid-silence: jhass its mainly for GET requests, the content is pretty valuable
[08:31:00] GorillaApe: (byebug) substatement.to_sql
[08:31:00] GorillaApe: "(\"spree_product_properties\".\"property_id\" = 2 AND \"spree_product_properties\".\"value\" = 'honda' OR \"spree_product_properties\".\"value\" = 'kawasaki')"
[08:31:44] GorillaApe: isnt that wrong ? I mean value equalities should be in ( )
[08:33:04] liquid-silence: jhass so I think it will be way more secure to make a request only valid once in the system
[08:34:07] liquid-silence: I know that authenticity_token works similar for POST, PATCH requests
[08:34:28] universa1: GorillaApe: without seeing the query/script it is impossible to tell.
[08:35:06] Ch4rAss: has joined #RubyOnRails
[08:36:11] liquid-silence: jhass I am more just trying to figure out how I can convince the client so that this is not required or have a viable solution to his concerns
[08:36:29] jsrn: has joined #RubyOnRails
[08:36:42] jhass: liquid-silence: it's only for some resources, right? like downloading a video
[08:37:06] liquid-silence: jhass well for fetching "resources" from the database
[08:38:04] liquid-silence: I would like to do it, in a way that once the request is made it cannot be made again if it was sniffed
[08:38:20] liquid-silence: GET, POST, PATCH requests
[08:38:22] jhass: one argument I would have is that, given HTTPS, if I can capture the cookie/request to replay, I can capture the initial response too
[08:38:53] deur-_: has joined #RubyOnRails
[08:38:53] liquid-silence: but if there is a once of nonce
[08:39:11] universa1: liquid-silence: yes, you can. in the same way you captured the cookie
[08:39:14] jhass: I mean the legitimate response, not the one for the replay
[08:39:39] liquid-silence: @universa1 well the request would have been made already
[08:39:53] liquid-silence: http://stackoverflow.com/questions/1848532/how-can-you-use-rails-authenticitytoken-infrastructure-to-explicitly-protect-a-g
[08:40:07] GrizzlyZolam: has joined #RubyOnRails
[08:40:26] Ropeney: has joined #RubyOnRails
[08:40:42] Pupeno: has joined #RubyOnRails
[08:40:46] jhass: alright, as question then, how do I capture a request and why wouldn't that allow me to capture the response of the specific request I'm capturing while I'm capturing the request too?
[08:40:47] universa1: liquid-silence: yes, but what jhass is trying to say: if you can capture the cookie, you can also capture all requests made by a user, you probably can not make new requests
[08:41:12] liquid-silence: I am between to sides of a coin here, the one side, I think this is secure enough and I should find a way to convince him that its fine as is, the other side the client is super paranoid and I find a solution
[08:41:24] jhass: then try to follow my argument
[08:41:30] universa1: so an attacker sees all the data the user sees
[08:41:36] liquid-silence: jhass I am following :)
[08:42:15] universa1: http://security.stackexchange.com/questions/3001/what-is-the-use-of-a-client-nonce
[08:42:41] liquid-silence: but what if I leave my computer unlocked and the session_id is still in the browser's cookie (we store session information in the database) and he copies the encrypted cookie, runs off and starts making requests against the server
[08:43:01] liquid-silence: he should then gain access to the data, but if there is a rolling value
[08:43:06] liquid-silence: he will not be able to do so
[08:43:16] universa1: liquid-silence: if you leave your computer unlocked, he just installs a root kit, gets your user / password and is done with it ;)
[08:43:46] liquid-silence: universa1 yeah, I am just trying to formulate a decent response, to this
[08:44:02] universa1: liquid-silence: yep, just playing the opposite, stupid side ;)
[08:44:08] GrizzlyZolam: Interesting conversation
[08:44:22] liquid-silence: yeah, its required in this case, hehe
[08:44:38] jhass: liquid-silence: also in that scenario, how will the legitimate user receive the nonce while the attacker doesn't? do you plan to bind the nonce to the source IP or something?
[08:44:46] AimlessRAven: has joined #RubyOnRails
[08:44:56] liquid-silence: the main security venerability here is the user it self.
[08:45:00] AimlessRAven: hi all, i have model events and 2 type of users.. admin and normal user
[08:45:22] AimlessRAven: i have field :contact... in my admin form i dont wanna validate this field but in normal form to storefront i wanna do it
[08:45:25] AimlessRAven: how to create my method
[08:45:30] liquid-silence: jhass apparently I cannot use the IP, as it many users in one company so their IPs will be the same
[08:46:01] liquid-silence: I was planning on tying the nonce to something like the time of request
[08:46:51] liquid-silence: so once the request is made, I generate a new nonce that is tied to a unix timestamp, a random string and a sha of the users email,
[08:46:52] jhass: but I got the cookie, I either have the same timeframe as the legitimate user or can use the same way to obtain the nonce as the legitimate user
[08:47:14] liquid-silence: yes but you can only replay 1 request
[08:47:32] jhass: that replay would give me a new valid cookie, no?
[08:47:54] liquid-silence: not particularly, because the nonce might have expired..
[08:48:03] liquid-silence: and cannot be used and you will be logged out
[08:48:25] liquid-silence: unless I tie it to something like CPUID of the machine
[08:48:30] jhass: I'm talking about within the timeframe
[08:48:31] refinerysource: has joined #RubyOnRails
[08:48:37] jhass: sounds easily fakable
[08:48:48] liquid-silence: jhass within the timeframe yes, I am pretty screwed
[08:49:47] AimlessRAven: how to validate mode filed for user but not for admin user
[08:49:48] liquid-silence: I explained to this person that the session data is stored in the database, we use SSL, cookies only contain the session id, and how authenticity tokens work
[08:49:52] jhass: so, you should be able to achieve the same with simply expiring the session quickly and refreshing the timeout on each request
[08:50:38] liquid-silence: jhass sure, we do this already
[08:50:41] weckl: has joined #RubyOnRails
[08:50:59] jhass: so the nonce will have again no gain towards the actual goal
[08:51:05] njero: that client needs a medical checkup.. lol
[08:51:10] startupality: has joined #RubyOnRails
[08:51:24] liquid-silence: but when reading content inside the application, and the user is not making requests, the session will die
[08:51:59] liquid-silence: with the nonce, when the attacker captures the request, and the user completes the request, that request is invalid
[08:52:26] jhass: AimlessRaven: all validations take a if: and unless: parameter expecting a proc/lambda
[08:52:35] comrad: has joined #RubyOnRails
[08:52:46] bookies: In this resource do (https://gist.github.com/stefioan/1bf2fd4af03378d4a17ad4d9f0997138) how can I add the :only option so I can limit the routes to the ones I only use?
[08:53:29] jhass: liquid-silence: well again, if I can capture the request as a whole, I can also capture the response right away
[08:53:33] liquid-silence: so in a scenario, attacker watches the requests, while the user is navigating the application, the attacker has on a split second to complete the replay, as the user would have completed the request and the nonce (maybe not the correct usage, could be a request token) would be invalided
[08:53:56] liquid-silence: so replay will only be possible in a very small window of time, the time it takes the server to invalidate that token
[08:53:56] pawnbox: has joined #RubyOnRails
[08:54:14] jhass: the argument that even doing a replay attack would be unnecessary
[08:54:25] AimlessRAven: jhass: validates_presence_of :contact, unless: User.has_role?(:admin)
[08:54:28] AimlessRAven: something like this
[08:55:13] liquid-silence: yeah I understand if he can capture the request, he has the response anyway so why block replay? The attacker has already gained access to the content.
[08:55:18] moep: has joined #RubyOnRails
[08:55:25] jhass: AimlessRaven: unless: ->(u) { u.has_role?(:admin) } or make a method is_admin? and unless: :is_admin?
[08:55:49] circuit_eight: has joined #RubyOnRails
[08:55:55] jhass: liquid-silence: yes, that's my point
[08:56:46] Coldblackice: has joined #RubyOnRails
[08:56:55] snowy: has joined #RubyOnRails
[08:57:11] liquid-silence: but now he has the request, cookie and so forth, we block the him from capturing requests, he leaves, user is still logged in, he can replay
[08:57:22] Palsson: has joined #RubyOnRails
[08:57:31] liquid-silence: jhass mind a quick PM? just want to paste a short paragraph to give context?
[08:57:39] liquid-silence: s/context?/context
[08:57:42] workmad3: has joined #RubyOnRails
[08:57:57] liquid-silence: we can further the conversation here
[08:58:07] jhass: I kinda do, I don't consider myself a total expert and would prefer for others to be able to chime in if I'm talking bullshit
[08:58:49] liquid-silence: sure its just an instruction that I dont want to paste publically
[08:59:08] AimlessRAven: jhass: how would be look like my method
[08:59:22] AimlessRAven: def is_admin? slef.has_role(:admin) end
[08:59:36] jhass: AimlessRaven: yup, no need for the self.
[09:00:09] siaw23: has left #RubyOnRails: ()
[09:00:20] jenrzzz: has joined #RubyOnRails
[09:00:26] moeabdol: has joined #RubyOnRails
[09:00:42] ur5us: has joined #RubyOnRails
[09:01:38] liquid-silence: jhass I actually think with the measures we have in place its pretty secure
[09:01:51] startupality: has joined #RubyOnRails
[09:03:07] jhass: if you have HTTPS/TLS obtaining the cookie/request in the first place is hard enough, that is if you manage to do that you probably already fully own the client anyway
[09:03:28] jhass: and at very least can already see the responses
[09:04:10] jhass: and destructive actions should already be protected against replay through Rails authenticity token
[09:04:12] emilkarl: has joined #RubyOnRails
[09:05:18] p1k: universa1: devmode webrick
[09:05:43] jhass: GorillaApe: yes, AND binds stronger than OR, so it's (property_id = 2 AND value = 'honda') OR value = 'kawasaki'
[09:06:02] universa1: p1k: you can reproduce the problem in a plain new rails app, without any custom gems?
[09:06:09] GorillaApe: I see thanks I fixed that
[09:06:12] p1k: universa1: it's pretty unlikely but I could try
[09:06:33] universa1: p1k: well, then it is most likely not a memory leak in rails, but in one of your gems ;)
[09:06:38] jhass: bookies: just resources :address_books, only: %i(index, ...) do
[09:06:51] bookies: jhass, thank you!
[09:06:57] p1k: universa1: well it also might not be noticable on the scale with a new app
[09:07:16] jhass: bookies: eh, without the , inside %i of course
[09:07:31] bookies: yes it worked with just :only
[09:07:52] universa1: p1k: do you know what is causing the memory leak?
[09:08:13] liquid-silence: jhass the problem is formulating a response to this request
[09:08:14] p1k: universa1: Yeah I can reproduce it by reloading a page many times
[09:08:18] p1k: universa1: https://groups.google.com/forum/#!topic/rubyonrails-talk/UL7TUV1Uefk
[09:09:49] pawnbox: has joined #RubyOnRails
[09:10:02] p1k: universa1: but I didn't get much out of object space when running it, and valgrind seems nearly impossible to get to work with ruby
[09:10:08] p1k: so idk what the next step is
[09:10:23] universa1: p1k: well if you reload one page, and memory usage increases, then there shouldn't be too much code involved. so running the model parts from console and looking at memory consumption
[09:10:25] jhass: liquid-silence: I'd probably reconstruct the thread model (attacker gets protected content), list the resulting attacks (rootkit client, MTIM, replay, ...), elaborate that in order to commit replay one of the other ones is necessary and that if one of these has happened the attackers desire for replay has vanished
[09:10:34] jhass: *threat, even
[09:10:56] p1k: universa1: model parts from console? you mean mocking requests to the controller
[09:11:26] universa1: p1k: whatever code you have that in your controller action, run only that (except the render) 1000 times and look at memory
[09:11:37] universa1: p1k: if memory increases then, you know it is somewhere in your model ;)
[09:11:44] p1k: universa1: I'm 99% sure it's not controller action code
[09:11:45] alfie_max15: universa1, figured it out, that was instagram changed their policies last year, and require an access_token for every user to fetch their public data, idk why
[09:11:58] p1k: universa1: that would show up in objectspace
[09:12:14] universa1: p1k: if not, you know it is in the view somewhere that is rendered.
[09:12:36] p1k: universa1: or any of XXX middleware/caching layers ?
[09:12:51] universa1: p1k: ok, somewhere in the rendering pipeline ;)
[09:12:58] liquid-silence: jhass yeah thanks for the insight, I appreciate it
[09:13:10] p1k: universa1: yeah...
[09:13:17] mdw: has joined #RubyOnRails
[09:13:25] universa1: p1k: have you also tried reproducing this with any of the common servers like puma, thin?
[09:14:44] p1k: universa1: haven't, actually that's a good thing to check before I go deep into the current config
[09:15:33] universa1: p1k: i might misremember, but years back i think there were some problems with webrick and memory
[09:15:47] workmad3: universa1: who still uses thin? :)
[09:15:56] universa1: workmad3: i don't know
[09:15:59] p1k: but that memory profile looks pretty crazy right? https://lh3.googleusercontent.com/-jj4OTSVJPYA/VyX60Ak4oQI/AAAAAAAAAJM/t8Uq7u2YFxUu5sLvkFCNEy2xoHduZqk0QCLcB/s1600/rails_s_mem.png
[09:16:58] universa1: workmad3: i almost exclusively use puma, and haven't active checked lately what is the latest and hippest in the server scene ;)
[09:17:09] p1k: unicorn?
[09:17:12] workmad3: universa1: puma and unicorn are the most common, I believe ;)
[09:17:18] universa1: yes! unicorn ;)
[09:17:37] universa1: i had one more on my mind, but couldn't pin it ;)
[09:21:40] AimlessRAven: https://gist.github.com/anonymous/09d77a51fd3fda3530a87bd3691c9451
[09:21:54] AimlessRAven: how to escape validation for :corporate users
[09:25:25] tbuehlmann: AimlessRaven: what does "escape validation" mean?
[09:25:40] edwinvdgraaf: has joined #RubyOnRails
[09:26:27] AimlessRAven: tbuehlmann: i wanna validate :contact only for current_admin
[09:26:50] AimlessRAven: but if my current_admin.has_role?(:corporate) i wanna skip validation for :contact field
[09:27:53] moeabdol: has joined #RubyOnRails
[09:28:13] AimlessRAven: tbuehlmann: how to do it
[09:29:44] mooru: has joined #RubyOnRails
[09:31:19] srinidhi: has joined #RubyOnRails
[09:31:37] p1k: it might have been webrick
[09:31:55] p1k: at least I hope so because debugging a memory leak in same native extension would be eww
[09:32:28] workmad3: p1k: did it seem to vanish when you started using unicorn?
[09:33:02] mark_66: has joined #RubyOnRails
[09:34:16] p1k: workmad3: haven't tried unicorn, just switched to thin
[09:34:23] AimlessRAven: tbuehlmann: here?
[09:34:34] Macaveli: has joined #RubyOnRails
[09:34:46] p1k: I do still have some increase but that might get cleaned when there is enough gc preasure, will see
[09:36:06] artto: has joined #RubyOnRails
[09:36:07] yfeldblum: has joined #RubyOnRails
[09:37:04] MaDErroR123: has joined #RubyOnRails
[09:37:32] startupality: has joined #RubyOnRails
[09:39:01] neanderslob: has joined #RubyOnRails
[09:39:17] MaDErroR123: has joined #RubyOnRails
[09:39:24] ferr: has joined #RubyOnRails
[09:46:19] liquid-silence: has joined #RubyOnRails
[09:46:19] liquid-silence: has joined #RubyOnRails
[09:47:55] aghalarp: has joined #RubyOnRails
[09:48:17] Axilla: has joined #RubyOnRails
[09:48:32] pawnbox_: has joined #RubyOnRails
[09:48:55] defsdoor: has joined #RubyOnRails
[09:50:17] mdw: has joined #RubyOnRails
[09:55:42] bronson: has joined #RubyOnRails
[09:55:43] crystal77: has joined #RubyOnRails
[09:57:57] Pumukel: has joined #RubyOnRails
[09:58:07] ericmeds: has joined #RubyOnRails
[09:58:56] mfoo: has joined #RubyOnRails
[09:59:18] jsrn_: has joined #RubyOnRails
[09:59:28] Macaveli: has joined #RubyOnRails
[10:01:08] Polysics: has joined #RubyOnRails
[10:01:32] Polysics: hello! anyone using Capybara RSpec scenarios can please help me figure out why selecting an option is not working?
[10:01:42] aghalarp: has joined #RubyOnRails
[10:01:58] bookies: I have this (format.js { render action: 'exchange_address' }) and what to just do render 'exchange_address'. Is that fine or is it an issue that the format is .js . Does it matter if it is .js or .html?
[10:02:39] vyorkin: has joined #RubyOnRails
[10:02:54] refinerysource: has joined #RubyOnRails
[10:03:24] srinidhi: has joined #RubyOnRails
[10:04:46] vyorkin: has joined #RubyOnRails
[10:05:33] vyorkin: has joined #RubyOnRails
[10:06:28] Polysics: find("select[name=preferred_location_id]").find("option[value='#{location.id}']").select_option
[10:06:53] universa1: polysics: define not working!
[10:07:56] universa1: bookies: it does not matter what the format is, it will render the appropriate file, so if your format is js, it will look for exchange_address.js(.XXXX) file
[10:08:34] universa1: bookies: it works the same as for html
[10:08:43] bookies: I see thank you
[10:09:06] Polysics: universa1: the option is not being selected
[10:09:11] vedu: Hello. Is it a good idea to perform (un-important) minor tasks in the background using ruby threads, like `Thread.new { # send slack notification... }`
[10:09:24] Polysics: parameters in the request have preferred_location_id as missing
[10:09:41] Polysics: and note that the selector IS working, if I put in something wrong I get an error at the selector level
[10:09:52] vedu: I understand its better to active job but that seems overkill for my use case
[10:10:32] srinidhi: has joined #RubyOnRails
[10:10:45] universa1: vedu: there is a rails cast about exactly yet, even though it is a bit old, the general idea should still be ok.
[10:11:01] vedu: universa1: oh nice. will check it out
[10:11:06] universa1: vedu: but implementing something with activejob isn't hard and is the cleaner solution imho
[10:11:13] mfoo: is there a message length limit here? I believe I just asked a fairly long question but don't see it
[10:11:18] hahuang65: has joined #RubyOnRails
[10:11:27] universa1: mfoo: i think the irc limit is 400chars
[10:11:45] Polysics: you can start using ActiveJob with the inline worker, or use sucker_punch
[10:12:34] centrx: has joined #RubyOnRails
[10:14:27] universa1: or delayed_job, which is also quite simple to set up, or sidekiq / resque
[10:15:31] vedu: polysics: I thought the inline worker would block
[10:15:43] mfoo: universa1: thanks, I'll split it up then
[10:15:55] Polysics: it probably does block, but any of the above handlers does not
[10:16:35] Polysics: how do I debug something like the above? selector is fine (or it would fail), yet it does not seem to select the option
[10:17:26] vedu: universa1: I could not find the rails cast :( http://railscasts.com/?page=2&tag_id=32
[10:17:54] mfoo: Hi all - I'm having an issue with rolling restarts on unicorn. The master successfully cycles the children after a SIGUP, yet occasionally they get stuck in a respawn loop due to a crash in initialisation.
[10:17:58] mfoo: This is from a call (in this case in a model, I'm unsure if are other triggers) to a function provided by a gem that didn't exist before the upgrade.
[10:18:04] mfoo: The gems have definitely been installed at this point and restarting the unicorn service brings it back up fine.
[10:18:11] mfoo: As I understand it the default option for unicorn is to set "preload_app" to false which disables shared memory allocation and forces rails to be reloaded when the unicorn worker comes up. We haven't changed this option.
[10:18:34] mfoo: why might my gems be causing problems here?
[10:19:00] mfoo: I assume the crash is on initialisation due to config.cache_classes=true
[10:19:08] mfoo: The initialiser is not our own code
[10:19:17] universa1: vedu: yeah, can't find it either anymore :(
[10:20:01] vedu: universa1: is Ryan Bates here, maybe we could ask him why did he remove it :)
[10:20:43] universa1: vedu: i doubt he removed it, i just can't remember under which title it was ;) or well i might also misremember ;)
[10:21:17] vedu: universa1: hehe. okay. I'll do this and tell you how it went ;-)
[10:26:55] sameerynho: has joined #RubyOnRails
[10:28:14] JonasOSDever: has joined #RubyOnRails
[10:29:36] alaing: I'm using paperclip to upload files to AWS S3. I have legacy data(not from paperclip) and files in S3 that I would like to populate my tables from. How do I do this using seeds?
[10:30:26] hcnewsom: has joined #RubyOnRails
[10:30:53] alaing: I was thinking it would involve me downloading/looking up the original file on s3 and then use it when I create a new record
[10:31:17] GrizzlyZolam: has joined #RubyOnRails
[10:36:36] fbandov: has joined #RubyOnRails
[10:39:04] SalexW: has joined #RubyOnRails
[10:43:14] netzfisch: has joined #RubyOnRails
[10:43:34] nettoweb: has joined #RubyOnRails
[10:44:38] umdstu: has joined #RubyOnRails
[10:46:26] pawnbox: has joined #RubyOnRails
[10:46:36] PaulePanter: Hi. Is there something shorter than the command below to delete for records?
[10:46:43] PaulePanter: Something.find(2449669, 2449670, 2449671, 2449672).map(&:delete)
[10:46:45] ur5us: has joined #RubyOnRails
[10:47:00] blackhuey: has joined #RubyOnRails
[10:47:12] circuit_eight: That seems pretty short to me
[10:48:10] apeiros: Something.delete_all(id: [a,b,c])
[10:48:32] PaulePanter: apeiros: Awesome. Thank you.
[10:48:39] apeiros: at least iirc
[10:49:03] PaulePanter: That probably will also do a better query.
[10:49:11] apeiros: with the find you force a deserialization for naught
[10:49:20] PaulePanter: apeiros: That worked!
[10:49:26] PaulePanter: apeiros: Indeed.
[10:49:35] apeiros: and 3 individual delete queries
[10:49:47] pawnbox: has joined #RubyOnRails
[10:50:10] tbuehlmann: Something.where(id: [2449669, 2449670, 2449671, 2449672]).delete_all should work as well
[10:50:27] PaulePanter: tbuehlmann: Indeed. But that’s even longer.
[10:50:58] tbuehlmann: use shorter ids
[10:53:03] MaDErroR123: has joined #RubyOnRails
[10:53:32] mozzarella: has joined #RubyOnRails
[10:54:00] MaDErroR123: has joined #RubyOnRails
[10:57:25] jgt: has joined #RubyOnRails
[10:58:39] tetraktys: has joined #RubyOnRails
[10:59:21] Axilla: has joined #RubyOnRails
[11:02:16] startupality: has joined #RubyOnRails
[11:05:34] srinidhi: has joined #RubyOnRails
[11:07:25] pawnbox: has joined #RubyOnRails
[11:08:54] rodfersou: has joined #RubyOnRails
[11:09:06] Macaveli: has joined #RubyOnRails
[11:10:45] RegulationD: has joined #RubyOnRails
[11:11:19] pawnbox: has joined #RubyOnRails
[11:11:59] hahuang65: has joined #RubyOnRails
[11:13:38] njero: has joined #RubyOnRails
[11:14:07] artto: has joined #RubyOnRails
[11:14:21] emilkarl: has joined #RubyOnRails
[11:17:40] hcnewsom: has joined #RubyOnRails
[11:17:53] refinerysource: has joined #RubyOnRails
[11:19:17] AzaToth: has joined #RubyOnRails
[11:21:56] Dysp: has joined #RubyOnRails
[11:23:04] Dysp: Hi there! I am fairly new to Ruby and complete newbie in Rails. If I want to inherit methods and stuff from another controller, is it correct to do xController::yController < ApplicationController ?
[11:23:22] arup_r: has joined #RubyOnRails
[11:23:30] Dysp: And the "has many", "belongs to" etc.. only has to do with models, right?
[11:24:28] jhass: extract the common methods into a module that you can include into both controller
[11:24:29] Dysp: Okay, how should I inherit methods from the x controller in the y controller?
[11:24:53] Dysp: Explain module, if you are so kind :P
[11:25:25] jhass: http://ruby-doc.org/core-2.3.0/Module.html
[11:26:42] Dysp: Lovely. But lets say the "show" method is defined in xController. Should I create the module in this controller? Or is modules something completely external to controllers?
[11:27:23] ldnunes: has joined #RubyOnRails
[11:27:24] jhass: a controller is just a Ruby class definition
[11:27:53] Dysp: Why wouldn't it be preferable to just inherit methods in that class, then?
[11:28:23] jhass: does it make semantically sense?
[11:28:25] helpa: Please do not use fake values, as they can be confusing or misleading. Sometimes both.
[11:29:36] jhass: if all your reason is "this code looks the same everywhere", inheritance is not communicating the right thing
[11:30:16] jhass: however if one controller is a specialization of the other, it can make sense
[11:30:28] Dysp: I am surely still quite new in understanding the grand scale of these things.
[11:30:40] Dysp: Can I try to explain to you what I wanna do?
[11:31:03] jhass: sure, if you keep !fake in mind
[11:31:14] Dysp: I don't know what a fake value is
[11:31:33] jhass: xController would be one
[11:31:34] c355E3B: has joined #RubyOnRails
[11:31:50] jhass: opposed to what you really have there
[11:32:36] Dysp: I have a collection of subjects in a database. The way I wanna show them has to be in a table where progression is the key to where they are placed.
[11:32:49] Dysp: But when I think about it, why not just include this in the subjectsController..
[11:33:08] Dysp: It's not like I am going to create or update subjects outside that class.
[11:34:12] Dysp: You definetly clarified something for me. Would you - maybe in the future - mind looking through my code to evaluate if I am doing stuff stupidly?
[11:36:09] jhass: no reason to make this a personal commitment, ask the channel and if I'm around I may do that, among others
[11:36:49] Dysp: Alrighty. I am just sure I could need some help evaluating whenever I get so far.
[11:37:10] jancel: has joined #RubyOnRails
[11:37:23] Dysp: It is to be used in research, so I am actually a little afraid to just throw something out there that could potentially be really horrible.
[11:37:27] Dysp: I will return!
[11:37:30] Dysp: Thank you.
[11:37:42] Pazician: has joined #RubyOnRails
[11:37:56] k3rn31: has joined #RubyOnRails
[11:38:04] maucar: has joined #RubyOnRails
[11:44:40] flashpoint9: has joined #RubyOnRails
[11:49:44] artto: has joined #RubyOnRails
[11:51:19] |2701: has joined #RubyOnRails
[11:56:29] _Tariq: has joined #RubyOnRails
[11:57:56] bronson: has joined #RubyOnRails
[12:03:52] srinidhi: has joined #RubyOnRails
[12:08:35] Palsson: has joined #RubyOnRails
[12:12:01] blackmesa: has joined #RubyOnRails
[12:13:10] flashpoint9: has joined #RubyOnRails
[12:14:20] emachnic: has joined #RubyOnRails
[12:17:44] fbandov: has joined #RubyOnRails
[12:18:04] pawnbox: has joined #RubyOnRails
[12:18:24] King_Rex: has joined #RubyOnRails
[12:22:01] King_Rex: has joined #RubyOnRails
[12:23:00] gingray: has joined #RubyOnRails
[12:26:23] Lonloren: has joined #RubyOnRails
[12:27:11] hcnewsom: has joined #RubyOnRails
[12:28:29] voidDotClass: has joined #RubyOnRails
[12:28:54] voidDotClass: Is it possible to do a query like where('student.school = ' , school)?
[12:29:31] voidDotClass: Inside a scope?
[12:30:44] rbr: just like in normal AR-usage
[12:31:10] giom: has joined #RubyOnRails
[12:31:40] alfie_max15: and it should be `student.school = ?`, school
[12:32:02] jhass: or just where(student: {school: school})
[12:32:12] glasz: has joined #RubyOnRails
[12:32:28] alfie_max15: that's better, go with what jhass said. ;)
[12:33:22] mdw: has joined #RubyOnRails
[12:33:34] jhass: liquid-silence: !logs
[12:33:34] helpa: liquid-silence: Check your logs. Namely everything in the log folder of your rails app and the error and access logs from Apache or whatever else you're using.
[12:33:42] voidDotClass: this isn't working: scope :reviewable, -> (city, school) { where(city: city, status: REVIEWING).where(student: {school: school}) unless team.nil? }
[12:33:45] jhass: sorry that's the wrong one
[12:34:06] Macaveli: has joined #RubyOnRails
[12:34:10] jhass: liquid-silence: !irclogs
[12:34:10] helpa: liquid-silence: http://logs.ryanbigg.com/
[12:36:10] jhass: voidDotClass: "isn't working" is not useful
[12:36:42] voidDotClass: isnt querying on the school table. i had to add a join
[12:37:09] jhass: you can perfectly fine write that into a single .where call btw
[12:37:31] jhass: .where(a: b, c: {d: e})
[12:38:12] voidDotClass: i prefer chaining
[12:38:17] jancel: has joined #RubyOnRails
[12:38:17] voidDotClass: this is what i had to end up doing:
[12:38:52] voidDotClass: scope :reviewable, -> (city, school) { where(city: city, status: REVIEWING).where('students.school_id = ?', school.id).joins(:student)
[12:39:00] voidDotClass: any suggestions to clean it up appreciated
[12:39:58] jhass: .where(student: {school: school}) should pluck the id out for you
[12:40:00] SalexW: has joined #RubyOnRails
[12:40:24] jhass: also if you prefer chaining, why not .where(city: city).where(status: REVIEWING) ?
[12:40:24] artto: has joined #RubyOnRails
[12:41:29] artto: has joined #RubyOnRails
[12:42:15] ferr1: has joined #RubyOnRails
[12:42:33] giom: has joined #RubyOnRails
[12:43:04] jhass: I think I'd put the joins call in front personally
[12:44:07] rafaelfranca: has joined #RubyOnRails
[12:44:07] rafaelfranca: has joined #RubyOnRails
[12:44:24] rvanlieshout: and .where(students: { school_id: school.id }) allows you to use a single where
[12:45:00] Craigimus: has joined #RubyOnRails
[12:45:19] _Tariq: has joined #RubyOnRails
[12:47:21] ddv: hi rvanlieshout :)
[12:48:39] crystal77: has joined #RubyOnRails
[12:50:11] liquid-silence: jhass this is what I am thinking we are trying to block
[12:50:28] liquid-silence: I intercepted a request with Charles and copied it as a curl request
[12:50:32] liquid-silence: sent it to someone else
[12:50:38] liquid-silence: and boom he gained access
[12:50:43] akshat: has joined #RubyOnRails
[12:50:47] King_Rex: has joined #RubyOnRails
[12:51:51] jhass: so you want to prevent it if the impersonated user collaborates?
[12:52:14] jhass: if not we're just back to the a MITM can just read the response too
[12:52:38] liquid-silence: yes but I am capturing the request and sending it to you in an email
[12:52:40] liquid-silence: you can replay it
[12:52:52] jhass: I don't follow the "but"
[12:53:00] liquid-silence: but the user can just as well write it down
[12:53:19] liquid-silence: jhass, I have a curl request the Charles outputted, and I gave it to a person on the other side of the world
[12:53:29] liquid-silence: he was able to execute the curl request and see the content
[12:53:38] jhass: I do understand what you do, you don't need to repeat it every other sentence, thank you
[12:54:13] rvanlieshout: what's the issue?
[12:54:14] jhass: if it's a plain "yes" to my initial question, then my question is why is that worse/different from sharing the response?
[12:54:19] liquid-silence: but in all honesty, if the user wanted to do that, he could screenshot the content anyway and forward it off
[12:54:42] liquid-silence: jhass I did not mean to offend or upset you, sorry
[12:55:38] liquid-silence: with the current setup only the user that has access to the content can leak the content, not anyone else
[12:56:04] liquid-silence: you have to be at the physical computer where the application is open and the user needs to log in
[12:56:10] liquid-silence: *to be logged in
[12:57:29] jhass: so, no issue again?
[12:58:06] defsdoor: has joined #RubyOnRails
[12:58:30] hcnewsom: has joined #RubyOnRails
[13:01:29] ramortegui: has joined #RubyOnRails
[13:01:32] sevenseacat: has joined #RubyOnRails
[13:03:09] knamehost: has joined #RubyOnRails
[13:04:20] crystal77: has joined #RubyOnRails
[13:05:27] _Tariq: has joined #RubyOnRails
[13:08:42] wolfravenous: has joined #RubyOnRails
[13:11:15] dgynn_: has joined #RubyOnRails
[13:11:38] sameerynho: has joined #RubyOnRails
[13:11:51] RegulationD: has joined #RubyOnRails
[13:13:04] hahuang65: has joined #RubyOnRails
[13:14:13] wilsonc91: has joined #RubyOnRails
[13:15:58] aegis3121: has joined #RubyOnRails
[13:15:59] tetraktys: has joined #RubyOnRails
[13:17:38] alfie_max15: has joined #RubyOnRails
[13:18:34] etiago: has joined #RubyOnRails
[13:19:25] blackmesa: has joined #RubyOnRails
[13:19:42] pawnbox_: has joined #RubyOnRails
[13:21:26] silverdust: If I had 2 or more routes that leads to a controller method is there a way to group them e.g get ['/foo','/bar'] => 'myController#method'
[13:21:28] aegis3121: has joined #RubyOnRails
[13:24:48] rvanlieshout: silverdust: you could use '/:foo' => 'controller#action'
[13:24:51] rvanlieshout: and apply constraints on :foo
[13:25:27] VeryBewitching: has joined #RubyOnRails
[13:26:31] macsteps: has joined #RubyOnRails
[13:30:34] JakFrist: has joined #RubyOnRails
[13:30:51] Macaveli: has joined #RubyOnRails
[13:33:17] silverdust: rvanlieshout: how may I apply constraints? '/:anything' scares me because of how it overrides some other routes
[13:34:07] noobsu: has joined #RubyOnRails
[13:34:46] Danielpk: has joined #RubyOnRails
[13:34:59] noobsu: has joined #RubyOnRails
[13:37:29] shibly: has joined #RubyOnRails
[13:37:45] shibly: has left #RubyOnRails: ("Leaving")
[13:39:30] rvanlieshout: silverdust: http://guides.rubyonrails.org/routing.html#segment-constraints
[13:39:34] pawnbox: has joined #RubyOnRails
[13:41:16] pawnbox: has joined #RubyOnRails
[13:43:10] diegoaguilar: has joined #RubyOnRails
[13:44:56] gremly: has joined #RubyOnRails
[13:45:44] alevy: has joined #RubyOnRails
[13:46:54] duderonomy: has joined #RubyOnRails
[13:50:12] quazimodo: has joined #RubyOnRails
[13:52:40] moeabdol: has joined #RubyOnRails
[13:53:58] mfoo: has joined #RubyOnRails
[13:54:41] jancel: has joined #RubyOnRails
[13:54:50] jscheel: has joined #RubyOnRails
[13:55:57] truenito: has joined #RubyOnRails
[13:57:31] startupality: has joined #RubyOnRails
[14:01:16] idefine: has joined #RubyOnRails
[14:02:23] k3rn31: has joined #RubyOnRails
[14:03:57] hcnewsom: has joined #RubyOnRails
[14:03:57] Ch4rAss: has joined #RubyOnRails
[14:05:24] emachnic_: has joined #RubyOnRails
[14:05:28] emachnic: has joined #RubyOnRails
[14:07:44] Craigimus: has joined #RubyOnRails
[14:08:02] macsteps: has joined #RubyOnRails
[14:08:16] marr: has joined #RubyOnRails
[14:09:06] alfie_max15: is there anything available in ruby that would help me use a third party SOAP api?
[14:10:04] artto: has joined #RubyOnRails
[14:10:12] alfie_max15: i read somewhere that `Ruby has basically dropped SOAP in favor of REST`
[14:11:24] Craigimus: has joined #RubyOnRails
[14:11:40] TheMonster: alfie_max15: check savon
[14:12:13] xcesariox: has joined #RubyOnRails
[14:12:15] chouhoulis: has joined #RubyOnRails
[14:12:39] alfie_max15: seems that's one of the two gems which are actively maintained
[14:12:45] srinidhi: has joined #RubyOnRails
[14:12:48] alfie_max15: the other one i saw was lolsoap
[14:12:58] alfie_max15: any comments about that?
[14:13:43] hahuang65: has joined #RubyOnRails
[14:15:14] snowy: has joined #RubyOnRails
[14:15:36] artto: has joined #RubyOnRails
[14:19:15] helpa: has joined #RubyOnRails
[14:19:35] pwnd_nsfw: has joined #RubyOnRails
[14:21:35] pawnbox_: has joined #RubyOnRails
[14:22:09] blackmesa: has joined #RubyOnRails
[14:24:09] artto: has joined #RubyOnRails
[14:25:52] mostlybadfly: has joined #RubyOnRails
[14:26:49] suchness: has joined #RubyOnRails
[14:29:41] tetraktys: has joined #RubyOnRails
[14:32:29] adre: has joined #RubyOnRails
[14:34:24] axl_: has joined #RubyOnRails
[14:35:43] maxdoubt: has joined #RubyOnRails
[14:36:27] ql6wlld: has joined #RubyOnRails
[14:39:23] eljimmy: has joined #RubyOnRails
[14:39:27] alaing: has joined #RubyOnRails
[14:40:33] wilsonc91: has joined #RubyOnRails
[14:40:43] SalexW: has joined #RubyOnRails
[14:40:47] AmiMoench: REST is best
[14:40:58] alfie_max15: AmiMoench, ??
[14:41:26] pwnd_nsfw: has joined #RubyOnRails
[14:41:28] polishdub: has joined #RubyOnRails
[14:41:52] monoprotic: has joined #RubyOnRails
[14:42:16] AmiMoench: REST follows the HTTP standard. No need to add a new pattern when the underlying protocol already has one.
[14:42:36] universa1: AmiMoench: does not help you if some third party only has a soap api
[14:42:49] alfie_max15: just read a comparison between the both
[14:42:50] alfie_max15: http://spf13.com/post/soap-vs-rest
[14:43:01] universa1: and the soap standard has a lot more stuff, which you usually do not need iirc ;)
[14:43:19] AmiMoench: universa1: yeah, you'll need to maintain a SOAP library for that specific need.
[14:44:54] chipotle_: has joined #RubyOnRails
[14:49:23] AmiMoench: alfie_max15: those points do not convince me that SOAP's a valid choice. IMHO, encryption must be handled end-to-end and not at the protocol level.
[14:50:14] AmiMoench: alfie_max15: I know there are legacy needs for SOAP, tho... that would require self-management of SOAP libraries.
[14:50:43] alfie_max15: honestly, i have no idea, but i know that almost all banking api's i know of are built using SOAP
[14:51:13] BaNzounet: I've this models `User`, `Organization < User` and `Project` that has `belong_to :user`, is it possible to cast :user depeding on a field on User ? Since Organization == User with a field set to specific value. I don't want to have a polymorphic association between the two :/
[14:51:21] alfie_max15: i've always went by the "The general rule of thumb I’ve always heard is ‘Unless you have a definitive reason to use SOAP use REST’"
[14:51:37] alfie_max15: for which my answer was always REST
[14:51:43] AmiMoench: alfie_max15: from my experience, it tends to be because they inherited some .NET ASP application. Microsoft developers tend to not like standards.
[14:51:45] universa1: alfie_max15: sounds reasonable ;)
[14:52:28] AmiMoench: alfie_max15: it's not because SOAP is more secure
[14:53:13] gambl0re: has joined #RubyOnRails
[14:53:13] gambl0re: has joined #RubyOnRails
[14:53:14] alfie_max15: oh, that makes more sense
[14:56:01] artto: has joined #RubyOnRails
[14:57:44] gavit: I have three type of memberships. A single, couple, family. They have as attributes: start_date, end_date and persons with a limit of 1,2,no real limit, but I guess 20 is crazy enough. Would you make 3 models or an STI? I'd like to add a payment for all three memberships etc
[14:58:47] Danielpk: has joined #RubyOnRails
[15:00:12] gavit: I guess I can store the people as an array and not even make an STI
[15:00:45] alfie_max15: you mean as an association?
[15:00:50] bronson: has joined #RubyOnRails
[15:00:51] stannard: has joined #RubyOnRails
[15:01:05] AmiMoench: BaNzounet: why do you not want the association to be polymorphic?
[15:01:48] jhack: has joined #RubyOnRails
[15:02:24] jhass: gavit: so all the membership type determines is how many people can be associated (and the price I guess)?
[15:02:38] artto: has joined #RubyOnRails
[15:02:40] gavit: alfie_max15: yeah, between Person and membership
[15:02:49] yellow5: has joined #RubyOnRails
[15:02:56] gavit: jhass: basically, start/end_date, when to send an email
[15:03:12] Pazician: has joined #RubyOnRails
[15:03:12] Danielpk: has joined #RubyOnRails
[15:03:26] jhass: gavit: gotta get this right, when you say basically, what else does the membership type influence then?
[15:03:41] gavit: jhass: I can't think of anything else
[15:03:49] jhass: can a person have more than one membership?
[15:04:00] gavit: jhass: some point in time a person might become single, and thus needs to change his membership
[15:04:19] gavit: or a child becomes big enough that he no longer fits in the family category and needs to start his own membership
[15:04:27] Devalo: has joined #RubyOnRails
[15:04:27] gavit: jhass: max 1 membership per person
[15:04:38] gavit: jhass: sorry, max 1 active membership per person
[15:05:03] gavit: jhass: I'm going to store memberships with dates. so the data is always 'valid'
[15:05:07] jhass: okay I think I wouldn't go polymorphic here
[15:05:20] gavit: john was a member from 2011-2012, and then from 2012-2013 etc
[15:05:22] Ch4rAss: has joined #RubyOnRails
[15:05:39] jhass: so it's many to many after all
[15:06:08] jhass: you want to keep the old one associated, no?
[15:06:13] gavit: I guess, but 'max' 1 per point in time
[15:07:11] AmiMoench: gavit: a membership class can only have at most one user/account associated to it, right?
[15:07:15] gavit: membership_type_of(john, Date.now) will always result in 1 result
[15:07:58] gavit: AmiMoench: 1 membership can have many, e.g. 1 family has mother, father, child.
[15:08:09] gavit: AmiMoench: 1 single has 1 person though
[15:08:13] jhass: still it's many to many
[15:08:23] gavit: jhass: so whats the conclusion?
[15:08:28] jhass: let's rename your membership to SocialGroup or so
[15:08:36] gavit: jhass: to array, to sti, or to cry
[15:08:59] gavit: whats in a name :)
[15:09:06] jhass: that just as the id, type, perhaps a name in the case of family and probably some business logic in the long run
[15:09:30] jhass: then introduce a new Membership (or better SocialGroupMembership)
[15:09:34] ejnahc: has joined #RubyOnRails
[15:09:44] jhass: that has a social_membership_id, person_id, start_date, end_date
[15:10:19] gavit: so 3 tables?
[15:10:43] jhass: Person has_many :social_group_memberships; Person has_many :social_groups, through: :social_group_memberships
[15:11:15] jhass: SocialGroup has_many :social_group_memberships; SocialGroup has_many :persons, through: :social_group_memberships
[15:11:35] jhass: SocialGroupMembership belongs_to :person; SocialGroupMembership belongs_to :social_group
[15:12:31] jhass: then most validations should go to SocialGroupMembership
[15:12:46] artto: has joined #RubyOnRails
[15:12:48] jhass: since its creation is what could validate constrains
[15:12:59] jhass: (more than one active one, more than 2 in a couple etc)
[15:13:55] nettoweb: has joined #RubyOnRails
[15:14:36] jhass: eh, violate constraints I mean
[15:15:36] chouhoul_: has joined #RubyOnRails
[15:15:45] hobodave: has joined #RubyOnRails
[15:15:54] AmiMoench: Now that I'm thinking it through, jhass may be correct. One user can have multiple memberships, I'm guessing 1 currently active membership, and 'n' past memberships. So many-to-many would work.
[15:16:35] finnnnnnnnnnn: has joined #RubyOnRails
[15:17:28] gavit: jhass: http://imgur.com/FdQw91s
[15:17:34] jhass: well you could reduce some database bloat by using a single SocialGroup instance with type=single and making sure to return 1 for the amount of members always etc
[15:17:39] jhass: but that's optimizations
[15:18:17] distruggle: has joined #RubyOnRails
[15:19:10] mdw: has joined #RubyOnRails
[15:19:27] distruggle: need help parsing this url in ruby https://www.google.ca/?gws_rd=ssl#q=raptors+scores
[15:19:44] ramortegui: has joined #RubyOnRails
[15:19:56] jhass: gavit: yes, though take care, if you make a single instance of SocialGroup with type=family/couple you can't reconstruct the distinct sets of those, there is only a single family and couple in the world so to speak
[15:20:46] gavit: jhass: I dont think I understand what you're trying to warn me about
[15:20:58] jhass: distruggle: URI.parse("https://www.google.ca/?gws_rd=ssl#q=raptors+scores") #=> #<URI::HTTPS https://www.google.ca/?gws_rd=ssl#q=raptors+scores> that went great for my tastes
[15:21:41] jhass: gavit: add a second family or couple to your example data set, it might get clearer then
[15:22:12] jhass: or actually you already have multiple couples
[15:22:36] jhass: so let's answer the question, who's the partner of Alladin?
[15:22:37] AmiMoench: distruggle: that's in the *net/http* library, btw
[15:22:53] jhass: no, URI is its own stdlib
[15:22:54] kies: has joined #RubyOnRails
[15:23:19] jhass: gavit: ... and why isn't it Barney
[15:23:46] jhass: you probably want different SocialGroup ids for those
[15:23:50] gavit: jhass: oow, that makes sense
[15:24:05] disgrntld: has joined #RubyOnRails
[15:25:26] jhass: distruggle: !rule12
[15:25:27] helpa: distruggle: Do not PM members of the channel without first asking if that is OK.
[15:25:29] garietyxxx: has joined #RubyOnRails
[15:25:35] gavit: jhass: so how about add a 'responsible member' to SocialgroupMembership. aka Alladin, couple, date, Alladin; Jasmin, coupld, date, Alladin
[15:25:57] garietyxxx: What are the best books for learning ruby on rails?
[15:25:58] jhass: gavit: I'd simply allow multiple SocialGroup instances with the same type
[15:26:16] garietyxxx: Ideally written for someone coming from a node.js/frontend background.
[15:26:28] helpa: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[15:26:32] distruggle: new to this life, https://www.google.ca/?gws_rd=ssl#q=raptors+scores, trying to get the name using nokogiri
[15:26:40] distruggle: for the raptors
[15:27:24] gavit: jhass: that could work, but I'm wondering about the reasoning why its better. In your solution I need to query 2 tables, in my solution I need to query 1 table (for most operations)
[15:27:42] King_Rex: has joined #RubyOnRails
[15:27:58] gavit: or am I complicating things for no reason?
[15:28:12] jhass: gavit: how do you do your solution for family? how do you it when you later want to add commune or whatever?
[15:29:16] gavit: jhass: the last column(responsible will be the 'father') for mother, father, children.
[15:29:41] moei: has joined #RubyOnRails
[15:30:17] jhass: second part of the question?
[15:30:41] smathy: has joined #RubyOnRails
[15:30:42] jhass: I think it's too complicated
[15:31:13] jhass: opposed to simply grouping by social_group_id
[15:31:18] gavit: jhass: okay.
[15:31:24] gavit: I'll just listen then :)
[15:31:26] sameerynho: has joined #RubyOnRails
[15:31:46] artto: has joined #RubyOnRails
[15:31:53] jhass: distruggle: !code
[15:31:53] helpa: distruggle: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[15:32:20] jhass: and some actual description of what you're stuck at specifically would be great
[15:32:36] alfie_max15: has left #RubyOnRails: ("Leaving")
[15:32:58] gavit: now to migrate. Next problem will be how I can make that in possible in a form :'(
[15:33:12] gavit: but thats a problem for later
[15:34:51] stannard: has joined #RubyOnRails
[15:35:24] distruggle: here it is https://github.com/daniel2234/web_parser
[15:36:20] garietyxxx: helpa: thanks
[15:37:15] pepee: has joined #RubyOnRails
[15:39:12] jhass: distruggle: do you understand the anatomy of an URL, in particular anchors (#) ?
[15:40:07] [Butch]: has joined #RubyOnRails
[15:41:29] artto: has joined #RubyOnRails
[15:42:17] distruggle: where could I read up on it?
[15:42:21] chipotle: has joined #RubyOnRails
[15:43:56] JesseH: has joined #RubyOnRails
[15:44:02] Birol: has joined #RubyOnRails
[15:44:04] jhass: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier https://en.wikipedia.org/wiki/Fragment_identifier
[15:44:52] distruggle: just to be clear, what im trying to do is get scrape the data of the html page in the search results with that link
[15:45:34] frem_: has joined #RubyOnRails
[15:46:13] jhass: and you're not using a browser, so no javascript runs
[15:46:24] jhass: which could interpret the fragment
[15:46:36] distruggle: so my end goal is to dig through the div elements to get the name and team icon
[15:46:38] jhass: because the remote webserver doesn't, it isn't even send it
[15:47:44] distruggle: javascript is an open idea as well
[15:50:42] norc: has joined #RubyOnRails
[15:51:52] smathy: Before continuing this discussion in public, you might want to read the terms of use of Google's website distruggle
[15:52:02] wolfravenous: has joined #RubyOnRails
[15:52:24] [Butch]: has joined #RubyOnRails
[15:54:06] Birol: has joined #RubyOnRails
[15:55:28] nettoweb: has joined #RubyOnRails
[15:56:13] smoitra: has joined #RubyOnRails
[15:58:22] distruggle: just looking learn, I will read them later
[16:00:38] chouhoul_: has joined #RubyOnRails
[16:01:14] srinidhi: has joined #RubyOnRails
[16:04:01] blackmesa: has joined #RubyOnRails
[16:07:48] davidw: has joined #RubyOnRails
[16:08:55] lacce: has joined #RubyOnRails
[16:09:19] zave: has joined #RubyOnRails
[16:09:29] insanedreamer: has joined #RubyOnRails
[16:09:56] xenthree3: has joined #RubyOnRails
[16:09:56] xenthree3: has left #RubyOnRails: ()
[16:10:01] stannard: has joined #RubyOnRails
[16:10:20] kies: has joined #RubyOnRails
[16:10:44] liquid-silence: has joined #RubyOnRails
[16:10:44] liquid-silence: has joined #RubyOnRails
[16:11:55] iamvery: has joined #RubyOnRails
[16:12:23] gavit: argh, type is for STI. should've used a diff name
[16:14:50] kgrz: has joined #RubyOnRails
[16:15:19] centrx: has joined #RubyOnRails
[16:15:31] hahuang65: has joined #RubyOnRails
[16:15:56] jhass: or just set another name for the sti :P
[16:20:00] macsteps: has joined #RubyOnRails
[16:20:47] agent_white: has joined #RubyOnRails
[16:25:17] kgrz: has joined #RubyOnRails
[16:26:45] noobsu: has joined #RubyOnRails
[16:28:20] RegulationD: has joined #RubyOnRails
[16:30:38] meoblast001: has joined #RubyOnRails
[16:31:15] artto: has joined #RubyOnRails
[16:32:32] JFlash: has joined #RubyOnRails
[16:33:15] JFlash: has left #RubyOnRails: ()
[16:33:20] Regulati_: has joined #RubyOnRails
[16:36:49] Craigimus: has joined #RubyOnRails
[16:37:42] emilkarl: has joined #RubyOnRails
[16:40:53] etiago: has joined #RubyOnRails
[16:41:55] SalexW: has joined #RubyOnRails
[16:43:15] noobsu_: has joined #RubyOnRails
[16:44:58] konsolebox: has joined #RubyOnRails
[16:45:45] startupality: has joined #RubyOnRails
[16:45:51] Cohedrin: has joined #RubyOnRails
[16:53:13] rogue_koder: has joined #RubyOnRails
[16:55:02] wolfravenous: has joined #RubyOnRails
[16:55:30] javierbuilder: has joined #RubyOnRails
[16:55:58] stannard: has joined #RubyOnRails
[16:56:30] voidDotClass: has joined #RubyOnRails
[16:56:49] wilsonc91: has joined #RubyOnRails
[16:59:04] arup_r: has joined #RubyOnRails
[17:00:20] javierbuilder: hello i try build interface for controll assitence. i have model people , activity , and i want load the assistence with select activity and add people.. this with simple_form and haml
[17:01:03] adgtl: has joined #RubyOnRails
[17:01:03] adgtl: has joined #RubyOnRails
[17:01:32] javierbuilder: but the comman is maybe rails g controller assitence index new .. and how build the nested field
[17:02:37] jhack: has joined #RubyOnRails
[17:03:13] bronson: has joined #RubyOnRails
[17:03:25] stannard: has joined #RubyOnRails
[17:03:30] hahuang65: has joined #RubyOnRails
[17:05:23] sneakerhax: has joined #RubyOnRails
[17:08:35] Craigimus: has joined #RubyOnRails
[17:13:09] aegis3121: has joined #RubyOnRails
[17:18:23] centrx: has joined #RubyOnRails
[17:21:21] chouhoulis: has joined #RubyOnRails
[17:22:15] netzfisch: has joined #RubyOnRails
[17:22:47] cnk: has joined #RubyOnRails
[17:25:02] mdw: has joined #RubyOnRails
[17:28:34] jsrn: has joined #RubyOnRails
[17:29:11] Devalo: has joined #RubyOnRails
[17:29:59] kgrz: has joined #RubyOnRails
[17:30:51] jancel: has joined #RubyOnRails
[17:31:36] shinnya: has joined #RubyOnRails
[17:31:36] momomomomo: has joined #RubyOnRails
[17:36:07] Craigimus: has joined #RubyOnRails
[17:39:54] ferr1: has joined #RubyOnRails
[17:40:42] phredus: has joined #RubyOnRails
[17:41:47] cold_zero: has joined #RubyOnRails
[17:41:53] gremly: has joined #RubyOnRails
[17:42:02] cold_zero: Hello is anybody here ?
[17:42:40] tubbo: cold_zero: !ask
[17:42:40] helpa: cold_zero: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[17:43:12] yellow5: has joined #RubyOnRails
[17:43:57] stannard: has joined #RubyOnRails
[17:44:10] _3dwardsharp: has joined #RubyOnRails
[17:44:28] cold_zero: My question is following. When I user form helper in view for exaple <%= form_for(@user) do |f| %> I'm essentially sending a message to some implicit "self" I'm wonder what the class of instance I'm sending message "form_for"
[17:45:03] rcc: has joined #RubyOnRails
[17:45:12] cold_zero: What class of instance that actually handling this "form_for" message
[17:46:27] tubbo: cold_zero: a way to find out is to throw a `binding.pry` into your view code, then call `self`. i can't remember what this is called off-hand.
[17:46:56] tubbo: the short answer is there isn't really a "view class" that you can inherit from in the same way that there's controller and model base classes.
[17:47:07] arBmind: has joined #RubyOnRails
[17:47:19] joeytwiddle: has joined #RubyOnRails
[17:47:28] AnoHito_: has joined #RubyOnRails
[17:47:52] edwinvdgraaf: has joined #RubyOnRails
[17:48:54] cold_zero: I have sort of general question. I was curious about mechanics of controller's actions and how each action creates instance of ActionView and copy all it's instance vars to this instance and he suggested to use debugger to get full execution stack up to the point where I guess method "render" gets called on some View related object
[17:49:16] wilsonc91: has joined #RubyOnRails
[17:49:27] cold_zero: but I don't know how to do this in rails
[17:50:00] cold_zero: how to get all execution stack up to the point where action of controller creates instance of ActionView for example
[17:50:21] cold_zero: may be there is some debugger technique I can use
[17:51:24] jancel: has joined #RubyOnRails
[17:54:02] tubbo: cold_zero: !xy
[17:54:02] helpa: cold_zero: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[17:54:04] ramortegui: has joined #RubyOnRails
[17:54:34] tubbo: cold_zero: more accurately...are you trying to solve a problem right now? or just looking into how rails works?
[17:55:36] tubbo: for the latter, i suggest reading the source code to ActionView::Rendering and ActionView::Template. but that's not going to solve any problems for you i don't imagine.
[17:56:01] cold_zero: it's kinda both I'm looking for solution for specific problem, but this solution helps me understand how Rails works better :)
[17:56:01] _3by8: has joined #RubyOnRails
[17:56:10] tubbo: cold_zero: so what's the specific problem
[17:56:16] centrx: has joined #RubyOnRails
[17:56:18] maxdoubt: has joined #RubyOnRails
[17:56:47] cold_zero: how to get full stack of execution up to the point where particular action of some controller creates instance of ActionView and copies its instance vars
[17:57:13] tubbo: cold_zero: debugger inside your view template.
[17:57:34] nofxx: has joined #RubyOnRails
[17:57:43] cold_zero: does it provide content of execution stack ?
[17:57:48] tubbo: cold_zero: sure
[17:57:58] tubbo: cold_zero: why would you ever need this?
[17:58:07] tubbo: that's more the question i was asking
[17:58:45] cold_zero: you mean why do I want to know what methods on what objects get called ?
[17:59:20] tubbo: cold_zero: but that's not what you want to know. you want to know why $FEATURE doesn't $WORK_AS_EXPECTED, right? :)
[17:59:46] nofxx: best practice question... when I got "submodels", we're using, supposing User: User::Reviews, User::Whatever (app/models/user/whatever.rb). That makes you have 2 paths on views: 'users/*' and 'user/whatevers/*'.... Question... should the namespace be plural? Users::Review... so my views are in the same folder?
[17:59:58] cold_zero: well, yeah it's kinda where I started, but problem already solved
[18:00:23] cold_zero: tubbo: thank you for your help
[18:00:24] tubbo: cold_zero: well the debugger will get you there, but i think it's probably easier to read the docs at api.rubyonrails.org
[18:00:31] tubbo: http://api.rubyonrails.org/files/actionview/lib/action_view/renderer/renderer_rb.html
[18:00:49] tubbo: that'll get you started i think. the render() method in there is documented as "Main render entry point shared by AV and AC."
[18:00:52] tubbo: seems like the way to go :)
[18:01:09] rcc: has joined #RubyOnRails
[18:01:15] cold_zero: tubbo: nice :)
[18:01:47] giom: has joined #RubyOnRails
[18:02:34] jhack: has joined #RubyOnRails
[18:02:54] cold_zero: AV stands for ActionView but what is AC ? ActionController ?
[18:03:12] sameerynho: has joined #RubyOnRails
[18:04:08] nofxx: cold_zero, Edison's nightmare. =D yeah... controller
[18:05:34] chouhoulis: has joined #RubyOnRails
[18:06:53] crystal77: has joined #RubyOnRails
[18:08:58] ql6wlld: has joined #RubyOnRails
[18:12:54] GodFather: has joined #RubyOnRails
[18:13:00] nofxx: Found a workaround for my earlier question. Use namespace singular, but use controller plural: http://blog.makandra.com/2014/12/organizing-large-rails-projects-with-namespaces/
[18:13:49] gavit: jhass: I was right, it isn't an easy task: https://gist.github.com/gavit/92ecfb70ca8564d942fb5571e3a34d1c
[18:14:20] qejk: has joined #RubyOnRails
[18:16:00] Devalo: has joined #RubyOnRails
[18:17:33] gavit: is it normal to rewrite a 'new' method of a class?
[18:18:30] kgrz: has joined #RubyOnRails
[18:18:30] gingray: has joined #RubyOnRails
[18:19:11] macsteps: has joined #RubyOnRails
[18:19:35] GodFather: has joined #RubyOnRails
[18:20:28] norc: has joined #RubyOnRails
[18:20:47] hello9: has joined #RubyOnRails
[18:21:45] stannard: has joined #RubyOnRails
[18:25:47] PatJ: has joined #RubyOnRails
[18:26:07] hello9: is there a way to use union in an ActiveRecord query that will return an AR relation and not an array?
[18:26:24] GodFather: has joined #RubyOnRails
[18:26:28] hello9: they have different joins, so using a well placed or isnt an option
[18:26:39] Liothen: has joined #RubyOnRails
[18:26:39] Liothen: has joined #RubyOnRails
[18:26:40] noah256: has joined #RubyOnRails
[18:26:44] darrik: has joined #RubyOnRails
[18:26:46] gregf_: has joined #RubyOnRails
[18:26:48] Puffball: has joined #RubyOnRails
[18:26:50] samuelkadolph: has joined #RubyOnRails
[18:27:02] jstransky: has joined #RubyOnRails
[18:27:02] urkle: has joined #RubyOnRails
[18:27:04] xMopxShell: has joined #RubyOnRails
[18:27:07] csmb: has joined #RubyOnRails
[18:27:12] Dimik: has joined #RubyOnRails
[18:27:47] tw1sted: has joined #RubyOnRails
[18:28:11] bodie_: has joined #RubyOnRails
[18:28:22] suffice: has joined #RubyOnRails
[18:28:56] jpterry: has joined #RubyOnRails
[18:29:29] Danielpk: has joined #RubyOnRails
[18:30:23] bbrowning: has joined #RubyOnRails
[18:30:30] srinidhi: has joined #RubyOnRails
[18:32:13] nibbo: has joined #RubyOnRails
[18:33:00] k3rn31: has joined #RubyOnRails
[18:33:11] smathy: gavit, no.
[18:33:15] Zackio: has joined #RubyOnRails
[18:33:43] smathy: hello9, no, although there are some union gems out there, not sure how they work.
[18:33:45] lipoqil: has joined #RubyOnRails
[18:34:33] barttenbrinke: has joined #RubyOnRails
[18:34:34] jhass: gavit: :person_id[] is not doing what you think it does
[18:35:13] speakingcode: has joined #RubyOnRails
[18:37:21] gavit: jhass: it makes an array right?
[18:38:02] jhass: no, it calls the method named [] on the Symbol :person_id
[18:38:35] jhass: you probably meant :'person_id[]' but iirc :person_id should work for arrays
[18:39:11] RegulationD: has joined #RubyOnRails
[18:40:28] gavit: I recall using something like: params.require(:social_group).permit(:category, :name, :description, socialgroup_memberships_attributes: [:start_date, :end_date, :_destroy, :person_id => []])
[18:41:04] tweeeaks: has joined #RubyOnRails
[18:41:13] durexlw: has joined #RubyOnRails
[18:41:21] gavit: jhass: "person_id"=>["2", ""] gives as error Unpermitted parameter: person_id (So :person_id)
[18:42:29] durexlw: trouble gavit ?
[18:42:31] Terens: http://i.imgur.com/mgrWcdr.jpg
[18:42:31] SalexW: has joined #RubyOnRails
[18:42:32] kgrz: has joined #RubyOnRails
[18:42:45] Terens: For searching products by filters
[18:43:13] Terens: elasticsearch / solr are the most elegant solutions ?
[18:43:20] durexlw: Terens: that your girlfriend?
[18:43:22] gavit: durexlw: yep, I'm trying to make a many to many relationship which requires entering multiple rows with 1 submit
[18:43:55] Terens: Currently I use spree
[18:43:57] truenito: has joined #RubyOnRails
[18:44:06] Terens: It has Products ProductProperties and Properties
[18:44:12] gavit: durexlw: https://gist.github.com/gavit/92ecfb70ca8564d942fb5571e3a34d1c
[18:44:13] Terens: however searching is a pain like that
[18:44:41] yfeldblum: has joined #RubyOnRails
[18:44:51] gavit: durexlw: I want to add a membership for mom, dad, child1, child2. I can do it with 4 adds
[18:44:58] durexlw: that's a long ass gist man :)
[18:45:09] gavit: durexlw: I am now trying to do it with a nested attributes
[18:45:46] durexlw: so you like to sign up a family?
[18:45:58] gavit: durexlw: http://imgur.com/FdQw91s
[18:46:05] silverdust: Can I run a migration to change a table name. I'm working with a poorly built rails app and it has a lot of users on production but poorly named model names
[18:46:46] gavit: durexlw: yes
[18:46:47] durexlw: ok, so aladin likes jasmin, right
[18:46:49] silverdust: It shouldn't matter but my role is to create APIs on it and I can't do that with the poor routes that exist now
[18:47:17] durexlw: silverdust: you can, but that's gonna be a mess: lotsa files to clean up
[18:47:19] silverdust: Changing the routes leads to changing the controllers which leads to changing models
[18:47:50] Terens: silverdust it might cause you trouble
[18:48:15] Terens: silverdust I think you can have alternative name for routes
[18:48:22] silverdust: To just change the database table name
[18:49:13] pawnbox: has joined #RubyOnRails
[18:49:33] silverdust: You mean leaving the existing routes and creating new routes that point to the actions I want
[18:49:48] durexlw: gavit: so a person belongs to a social_group, you defined that social group and the persons belonging in it and now you want one query statement to create the whole thing, right?
[18:50:09] Terens: I deploy at cloud66
[18:50:22] durexlw: silverdust: changing routes doesn't need to lead to changing controllers at all, right?
[18:50:26] Terens: how can I write 301 redirects efficiently ?
[18:50:53] gavit: durexlw: I want a query statement to create 1 social group and several memberships
[18:51:04] durexlw: Terens: http://stackoverflow.com/questions/10055545/rails-301-redirection
[18:51:10] tubbo: Terens: did you try redirect_to status: 301?
[18:51:19] tubbo: i feel like you can set a status with redirect_to but don't quote me on that
[18:51:37] durexlw: tubbo: spot on :)
[18:52:03] gavit: tubbo: redirect_to action: 'index', status: 303
[18:52:24] durexlw: gavit: I kinda suspect you'd need a method to handle that... it's kinda suprise me if this can go out of the box
[18:52:57] silverdust: durexlw: it does when it's resource routes
[18:53:26] gavit: durexlw: I suspect so too, but how do I do that. I remove @social_group = SocialGroup.new(social_group_params) and parse social_group_params myself?
[18:53:35] gambl0re: when i deploy my app to heroku and run a migration, it only migrates the tables but how do i actually migrate the table data as well
[18:54:58] stannard: has joined #RubyOnRails
[18:57:23] durexlw: gavit: I'd be inclined to think you need to create something like "@social_group.add_members(socialgroup_memberships_attributes)" just after the line "@social_group = SocialGroup.new(social_group_params)"
[18:58:07] tubbo: gambl0re: it depends on what data you need to migrate
[18:58:55] gavit: durexlw: I don't think an add_members function exists, so that should be written
[18:59:08] gambl0re: i have like 6 tables inside my db, it migrates the tables but the tables are not populated with my data
[18:59:12] durexlw: then an social_group_params.each { |hash| self.persons << Person.new!(hash) } ?
[18:59:32] durexlw: gavit: yes... that's the point, you need to write it indeed
[18:59:42] gavit: also I dont think I can access the params like that: I think: social_group_params[:persons]
[18:59:47] durexlw: as far as my knowledge goes... which is pretty limited
[19:00:10] tubbo: gambl0re: you're talking about moving data from your local workstation to your heroku deploymnet?
[19:00:12] tubbo: deployment*
[19:00:27] tubbo: or changing data that's already on the deployed server
[19:00:31] rogue_koder: has joined #RubyOnRails
[19:00:33] tubbo: e.g. converting type Integer to type String
[19:00:42] gambl0re: no moving data from local to heroku deployment
[19:00:58] gambl0re: i want to move my local db to heroku server
[19:01:07] durexlw: gavit: the self in the each probably won't work... you'll need to inject the self into the iterator I guess
[19:01:09] gambl0re: isnt that what migrate supposed to do?
[19:01:15] tubbo: gambl0re: !migrations
[19:01:15] helpa: gambl0re: http://guides.rubyonrails.org/migrations.html - Migrations Guide by Frederick Cheung
[19:01:37] tubbo: gambl0re: migrations are really designed for changing table schema. changing the data is different on a per-user basis so it isn't something rails prescribes.
[19:01:53] gambl0re: ok so how do i move my local db to heroku development
[19:01:55] tubbo: imho you shouldn't use migrations to change data at all. instead, run rake tasks that are idempotent.
[19:02:43] tubbo: gambl0re: i bet if you googled "move my local db to heroku server", the first result would give you a good starting point :)
[19:02:59] gambl0re: ive been googling for the past 24 hours
[19:03:15] tubbo: gambl0re: i know for a fact that you didn't google that exact string that i just sent you.
[19:03:29] gavit: durexlw: which self in which each?
[19:03:35] tubbo: because if you did, you would have found the first article linking to heroku's blog, and then a link inside that article pointing to devcenter.heroku.com that tells you how to use pg:pull and pg:push
[19:03:35] voidDotClass: has joined #RubyOnRails
[19:03:40] k3rn31: has joined #RubyOnRails
[19:04:12] durexlw_: has joined #RubyOnRails
[19:04:33] tubbo: huge fan of pg:pull and pg:push...really useful when you need to stand up your production data on a staging server or locally.
[19:05:04] gambl0re: ok i always though doing a migration did all this stuff for you
[19:05:11] gambl0re: i didnt know you had to import/export
[19:05:31] bronson: has joined #RubyOnRails
[19:06:13] tubbo: gambl0re: well, for some teams that may not be possible.
[19:06:23] durexlw: has joined #RubyOnRails
[19:06:30] tubbo: for example, my teammates don't have access to the database or the production servers. only i do.
[19:06:31] durexlw: Does anyone know a way to do this in AR-query? a user has_many :bundles, through: :activations; a bundle has_and_belongs_to_many :articles; given a random article, I want to see if a user is entitled to see it. Anyone has a suggestion how to query for that?
[19:07:04] momomomomo: has joined #RubyOnRails
[19:08:01] meoblast001: has joined #RubyOnRails
[19:08:22] arthurl: has joined #RubyOnRails
[19:08:28] gavit: durexlw: I get a undefined method `each' for nil:NilClass, but I have no clue where the each popped up from :(
[19:09:02] durexlw: gavit: you passed a nil object
[19:09:07] tubbo: gavit: it tells you on the first line of the backtrace. the file and line of code.
[19:09:12] durexlw: look what you pass... that went wrong
[19:09:33] durexlw: heh, i see myself leaving :)
[19:09:38] arthurl: hi guys- i have an older rails project (doesn't have gemfile/gemfile.lock) that i'm attempting to deploy with capistrano but having some issues due to the fact that the codebase doesn't have a gemfile - i'm somewhat new to cap/rails deployments etc , any thoughts on what i can do to work around this issue?
[19:09:42] Danielpk: has joined #RubyOnRails
[19:09:52] SalexW: has joined #RubyOnRails
[19:10:34] tubbo: arthurl: gem install capistrano? haha
[19:11:54] arthurl: tubbo sorry i'm not sure i'm following :)
[19:12:16] tubbo: arthurl: i'm not sure what your issue is. you can't install capistrano without a Gemfile?
[19:12:53] bronson: has joined #RubyOnRails
[19:13:24] arthurl: tubbo my issue is having to do with deploying an older rails app (that doesn't have a gemfile) using capistrano
[19:13:34] arthurl: i have cap installed on a deployment server that we use to push out deploys
[19:13:45] tubbo: arthurl: oh great
[19:13:49] tubbo: that's a lot easier
[19:14:00] tubbo: capistrano was indeed made during a time before bundler existed
[19:14:21] tubbo: arthurl: so you're doing a `cap deploy`. then what happens?
[19:15:06] gavit: why does it make an array of attributes: Parameters: {"utf8"=>"✓", "authenticity_token"=>"4EtoH15Y47mVikVJj58aNW0ew3FRxsd1PCwUacZqETsPvIvz8QhmqiBAgmsIhFqaaTAMo7dKUFRe9dh3CvmwRA==", "social_group"=>{"category"=>"Single", "name"=>"Test", "description"=>"", "socialgroup_memberships_attributes"=>{"0"=>{"start_date"=>"2015-01-01", "end_date"=>"2017-01-01", "person_id"=>["3", ""]}}}, "commit"=>"Create Social group", "locale"=>"en"}
[19:15:07] diegoaguilar: has joined #RubyOnRails
[19:15:12] gavit: I'll only ever get a 0 right?
[19:15:42] tubbo: that's just the way nested attributes are expressed by rails' form_for.
[19:16:06] deur-_: has joined #RubyOnRails
[19:16:24] gavit: oow, ok. I thought I had something wrong in my code.
[19:16:34] phredus: has joined #RubyOnRails
[19:16:35] durexlw: you need the person_id's, iterate over them, create new user from it, add it to the social group
[19:16:42] arthurl: tubbo this is what the output looks like when it fails
[19:16:43] arthurl: https://gist.githubusercontent.com/alyssenko/b823e818840ce381151e899851a7bd46/raw/16678b46b1a80df3334e881f958986e887da092e/gistfile1.txt
[19:16:48] durexlw: laterz all
[19:17:11] arthurl: basically complaining about gemfile.lock which makes sense because it doesn't exist in the codebase
[19:17:26] arthurl: so i think i need to use the project-specific capfile instead?
[19:17:30] phredus_: has joined #RubyOnRails
[19:17:37] arthurl: i see there is a capfile in the root directory of the project i'm trying to deploy
[19:17:48] tubbo: arthurl: why are you running that command at all if the project doesn't use bundler?
[19:17:58] blackmesa: has joined #RubyOnRails
[19:18:11] momomomomo: has joined #RubyOnRails
[19:18:17] arthurl: tubbo because our other projects that we deploy use bundler
[19:18:29] arthurl: i didn't realize this was an older rails app
[19:18:46] cnk: arthurl: so where did you get the capistrano deploy scropt for the older app?
[19:18:58] stannard: has joined #RubyOnRails
[19:19:01] finnnnnnnnnnn: has joined #RubyOnRails
[19:19:13] arthurl: cnk well the one i'm running now i wrote based on other cap scripts we have for other projects
[19:19:28] cnk: You may have ot make some adjustments
[19:19:31] arthurl: but now i see it's not going to work because of the bundler issue
[19:19:41] gavit: tubbo: so it's okay to access socialgroup_memberships_attributes["0"] to make my members?
[19:19:47] cnk: so there wasn't a deploy.rb in the old project?
[19:19:56] tubbo: gavit: you shouldn't need to. that can be mass-assigned into an other object.
[19:20:11] macsteps: has joined #RubyOnRails
[19:20:19] tubbo: gavit: so you can just do SocialGroup.create(params[:social_group]) if you want.
[19:20:20] arthurl: i see the older project i'm trying to deploy has the gems in a 'vendor/gems' folder in the codebase
[19:20:29] arthurl: cnk there is a deploy.rb in the older project
[19:20:55] tubbo: arthurl: you should be able to omit that bundler task entirely.
[19:21:00] giom: has joined #RubyOnRails
[19:21:09] cnk: So what happens if you go to that older porject's root and just type 'cap deploy:check'?
[19:21:12] tubbo: arthurl: please add your config/deploy.rb and Capfile to that gist.
[19:21:29] cnk: that should not change anything - but if it runs, we know something
[19:24:05] arthurl: tubbo https://gist.githubusercontent.com/alyssenko/b823e818840ce381151e899851a7bd46/raw/f787f55f079ad49ac73e7b6c9c90417fa33d6383/gistfile1.txt
[19:24:12] arthurl: added capfile and deploy.rb
[19:24:53] xalupeao: has joined #RubyOnRails
[19:25:22] tubbo: arthurl: you know you can add multiple files to the same gist right?
[19:25:37] arthurl: tubbo i do now :)
[19:25:42] cnk: OK so that looks like your deploy expects capistrano 2 - not 3
[19:26:01] tubbo: arthurl: are there any files in 'vendor/plugins/*/recipes/*.rb'?
[19:26:11] emachnic: has joined #RubyOnRails
[19:26:33] cnk: And see the stages stuff? this is going to try to deploy to staging - details of which should be in a subdirectory in a file named staging.rb
[19:26:38] subsonik: has joined #RubyOnRails
[19:27:36] arthurl: tubbo none of the plugins have a recipes folder
[19:27:56] xalupeao: i have a question with routes :C (resources=
[19:28:06] xalupeao: i need two urls
[19:28:11] xalupeao: i have this code https://gist.github.com/xalupeao/a1043084aa367e4e156b991f0c1414d7
[19:28:17] arthurl: cnk right i see that
[19:28:28] arthurl: so i guess i'm trying to understand what my approach should be
[19:28:43] cnk: So, do you have a staging site? or is that gone?
[19:28:50] cnk: I would practice on that if you can
[19:28:52] xalupeao: but i need /controller/select no /controller/:model_id/select
[19:29:02] cnk: just to get familiar with this cap's setup
[19:29:04] arthurl: that can go away- i'm only concerned with 'production'
[19:29:18] tubbo: arthurl: my recommendation is to upgrade to capistrano 3.0 if you can. you're just dealing with legacy BS problems that have already been solved.
[19:29:20] cnk: you like to test in production
[19:29:26] arthurl: but i can test by deploying to 'production' right now
[19:29:34] tubbo: great idea
[19:29:40] arthurl: the machine it's pointing to isn't a real production
[19:29:43] tubbo: no way for it to blow up in your face
[19:29:48] tubbo: nah i'm just kidding
[19:30:11] cnk: arthurl: so what do you need to accomplish?
[19:30:17] brianpWins: has joined #RubyOnRails
[19:30:18] noobsu: has joined #RubyOnRails
[19:30:34] arthurl: cnk i need to deploy this older rails app to a machine
[19:30:42] arthurl: that's all i'm trying to accomplish
[19:31:09] cnk: so which of the config files has the info for the machine you want to deploy to?
[19:31:53] cnk: you can make the default_stage point to that file
[19:32:06] cnk: and then you don't have ot pass a stage argument
[19:32:23] arthurl: in the codebase of this older rails app it looks like ../config/deploy/production.rb has that info
[19:32:33] cnk: I can never remember if it was cap deploy:something stage or cap stage deploy:something
[19:32:49] cnk: so set default_stage to production
[19:33:24] cnk: and check that 'cap --version' gives you somethiin in the 2.x range
[19:33:45] arthurl: Capistrano v2.9.0
[19:34:17] matthias_: has joined #RubyOnRails
[19:34:48] yellow5: has joined #RubyOnRails
[19:35:06] gavit: tubbo: https://gist.github.com/gavit/75b58433ed0d05889315a26fdf068d5e#file-console-log-L8 am I doing soemthing wrong?
[19:36:22] cnk: arthurl: the least destructive thing you can do to test is type: cap deploy:check
[19:36:38] k3rn31: has joined #RubyOnRails
[19:36:40] alfie_max15: has joined #RubyOnRails
[19:36:55] cnk: watch the output of that - that will tell you if you can connect to the prod box and if the directory structure is what your deploy script would have set up
[19:37:10] subsonik: has joined #RubyOnRails
[19:37:33] noobsu: has joined #RubyOnRails
[19:37:35] jenrzzz: has joined #RubyOnRails
[19:37:53] stannard: has joined #RubyOnRails
[19:38:13] arthurl: cnk i guess i'm also somewhat confused about idea that i have two projects, my deployer project is where we have all the different deploy scripts and then the actual project (older rails app) that i'm trying to deploy
[19:38:37] tubbo: gavit: that @test thing isn't necessary
[19:38:44] gavit: tubbo: bbl, gonna drive home
[19:38:51] tubbo: gavit: you should just be able to do @social_group = SocialGroup.create and get the attributes for free
[19:39:06] cnk: arthurl: the intent of capistrano was to let you sit at your dev machine and issue 'deploy this there' commands
[19:39:12] gavit: tubbo: I'm not exactly parsing the 'correct' params
[19:40:11] arthurl: so currently running cap deploy xxx from the machine designated to carry out deployments wouldn't work for me since none of this deploy logic for this older rails app is in the deployer project
[19:40:13] gavit: tubbo: http://imgur.com/FdQw91s
[19:40:36] arthurl: cnk right i understand that- so i guess i still need to write new scripts to sit inside the deploy project is what i'm saying
[19:40:38] gavit: but in the view I am selecting multiple members so I can make the 'membership' at once
[19:41:53] subsonik: has joined #RubyOnRails
[19:42:48] Coldblackice: has joined #RubyOnRails
[19:43:37] cnk: arthurl: only if the exising script doesn't work
[19:43:42] cnk: have you tried it?
[19:43:47] nettoweb: has joined #RubyOnRails
[19:43:52] Craigimus: has joined #RubyOnRails
[19:44:02] arthurl: cnk you mean the existing script that's in the codebase of the older rails app?
[19:44:09] bonswouar: has joined #RubyOnRails
[19:44:23] cnk: yes that is the one I would try to run to deploy it
[19:44:52] cnk: is the "deploy project" not just a different git clone of the project you want on the prod server?
[19:45:01] arthurl: right- but i'd need a local copy of that codebase on the machine designated to carry out deployments is what i'm saying
[19:45:07] arthurl: which isn't currently the case
[19:45:38] arthurl: cnk it's not- it's a project that only has deploy scripts- not actual code bases of the project's it's deploying
[19:45:59] arthurl: it basically tells our jenkins machine to connect to the target machine then once on target machine invoke git pull of the project we're deploying etc
[19:46:11] cnk: OK that's odd but <shrug> copy the scripts from the deployed prject to your deployment project
[19:46:33] Kallis: has joined #RubyOnRails
[19:47:36] gingray: has joined #RubyOnRails
[19:48:30] WebAhmed: has joined #RubyOnRails
[19:48:42] arthurl: cnk i see what' your'e saying- so basically copy over the deploy.rb from older project and try to invoke it
[19:49:22] WebAhmed: good afternoon guys. is anyone here familiar with react
[19:49:49] cnk: yes that's how I would approach it
[19:50:15] cnk: you may end up rewriting it if your Jenkins only has cap3 not cap2. But as a start, I would copy esiting and test
[19:50:16] arthurl: cnk cool thanks- let me see what i can do- i appreciate your help
[19:50:23] alfie_max15: arthurl, that's interesting, why would you have kept it as two separate repo's in the first place?
[19:50:29] cnk: No prob.
[19:50:33] arthurl: jenkins is on cap 2.9
[19:51:21] arthurl: alfie_max15 good question- this older repo was created before my time here and the deploy piece of it was never actually finished/integrated with our deployment process
[19:52:02] sameerynho: has joined #RubyOnRails
[19:52:06] pikos: has joined #RubyOnRails
[19:52:39] alfie_max15: WebAhmed, what specifically are you looking for in react? Post your question and maybe someone might take a look
[19:52:59] alfie_max15: arthurl, lol, been there :)
[19:53:10] arthurl: yeah... fun times
[19:53:46] pikos: hi everyone! I'm having a very hard time with a gem I'm using, filterrific (https://github.com/jhund/filterrific) - I'm trying to have 2 instances of filterrific on a site, but only the first one works, the second one gets ignored. Does anyone have experience with this gem?
[19:54:57] adre: has joined #RubyOnRails
[19:55:23] alfie_max15: piko_, nop, but seems interesting, might give it a try sometime soon :)
[19:55:41] WebAhmed: I picked up Rails API with a react/flux front-end to work on. The original developer used JSX transformer and I'm trying to find the cleanest way to remove the JSX headers from each file and start using webpack
[19:56:13] pikos: it's awesome for filtering a single table/model, very easy to set up and implement custom filters and ordering
[19:56:28] pikos: alfie_max15
[19:56:42] fatephd: has joined #RubyOnRails
[20:00:02] hello9: why cant I change a hash value in a controller? e.g hash = {a: 1, b:2}, and i write hash[:a] = 75, it doesn't work
[20:00:16] centrx: has joined #RubyOnRails
[20:00:34] pikos: or, if anyone knows a gem that offers similar functionalities (Filtering, Ordering, Pagination) where two different models/tables can be displayed at the same time, I'd be over the moon
[20:01:28] hello9: nvm i think i found my prob
[20:02:29] hello9: @piko are you on a deadline?
[20:02:58] mdw: has joined #RubyOnRails
[20:03:32] pikos: hello9, of course :D thesis project, first time with rails. loving it but oh boy do I have no clue sometimes
[20:03:55] alfie_max15: is it advisable to run rails server in development mode in port 80?
[20:04:32] hello9: piko_, what is your github maybe i will try and build somehing over the weekend
[20:04:49] hello9: although actuallly i havent used filterrific
[20:04:52] alfie_max15: so that you won't have to specify the port when entering the url in the browser
[20:05:05] jenrzzz: has joined #RubyOnRails
[20:05:54] hello9: sounds cool
[20:05:59] hello9: @alife_max15 haha
[20:06:05] hello9: im trying it now
[20:06:34] hello9: mine was in use
[20:06:44] pikos: hello9: https://github.com/upd89/controlcenter
[20:06:51] xalupeao: has joined #RubyOnRails
[20:07:49] alfie_max15: hello9, mine was in use??
[20:08:01] hello9: my port 80
[20:08:11] alfie_max15: yeah, mine too
[20:08:24] hello9: apprently chrome is using mine if im reading it correctly
[20:08:41] pikos: hello9: especially double filterrific form try can be found here: https://github.com/upd89/controlcenter/blob/master/app/views/systems/show.html.erb
[20:08:44] hello9: piko_, cool i was working on something like that recently so perhaps i can get something out this weekend but who knows
[20:08:53] alfie_max15: the thing is, i just got in a project where the base url has been hardcoded
[20:09:23] alfie_max15: and i don't think this is a right way to do
[20:09:32] pikos: hello9, if you figure out something, high-fives will be given and virgins sacrificed <3
[20:09:33] alfie_max15: so, i need to have a valid argument to propose a change for this
[20:15:03] bronson: has joined #RubyOnRails
[20:17:26] piko__: has joined #RubyOnRails
[20:17:29] jhack: has joined #RubyOnRails
[20:17:37] syndikate: has joined #RubyOnRails
[20:20:46] akshat: has joined #RubyOnRails
[20:20:57] macsteps: has joined #RubyOnRails
[20:21:59] emilkarl: has joined #RubyOnRails
[20:23:11] xalupeao: has joined #RubyOnRails
[20:26:49] ivanskie: has joined #RubyOnRails
[20:28:47] ivanskie: anyone here got experience working with rethinkDB in rails apps?
[20:29:37] ivanskie: i'm working on a simple app, trying to get nested resources working. it aint working :/ trying to figure out what would be the best way to explain.
[20:31:42] ivanskie: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[20:31:44] ivanskie: has joined #RubyOnRails
[20:32:28] Macaveli: has joined #RubyOnRails
[20:32:31] ivanskie: can u guys read my msg? channel says to register with nickserv. but i already did. just making sure.
[20:32:37] Oog: has joined #RubyOnRails
[20:32:40] alfie_max15: ivanskie, yes
[20:33:08] arup_r: has joined #RubyOnRails
[20:33:19] Oog: I have a model that can days of the week selected on it - eg Monday and Tuesday. or jsut WEdnesday etc - what is the best way to store this data? 7 booleans?
[20:33:21] arup_r: Hi, I am trying to implement Headless policies, but getting error. https://gist.github.com/aruprakshit/16f040ff2b697e85cdf8335f9c449ee8 ..
[20:33:38] arup_r: I did look https://github.com/elabs/pundit#headless-policies
[20:33:46] arup_r: but no idea why user is `nil`
[20:36:27] giom: has joined #RubyOnRails
[20:36:44] rafaelfranca: has joined #RubyOnRails
[20:37:40] startupality: has joined #RubyOnRails
[20:39:10] marr: has joined #RubyOnRails
[20:41:59] tbuehlmann: arup_r: current_admin is nil?
[20:42:13] arup_r: No, I am logged in
[20:43:09] tbuehlmann: have you double tripple checked that current_admin is present and not nil?
[20:44:16] arup_r: yes, I did tbuehlmann. look the image https://gist.github.com/aruprakshit/16f040ff2b697e85cdf8335f9c449ee8#gistcomment-1782059
[20:45:40] tbuehlmann: I see `policy(:dashboard).profile?` there. what's current_user? or have you defined a pundit_user method?
[20:46:06] Devalo: has joined #RubyOnRails
[20:47:04] arup_r: my helper is current_admin, and I think it passed automatically.. What is pundit_user method?
[20:47:07] diegoviola: has joined #RubyOnRails
[20:47:32] arup_r: current_admin is devise helper, because my devise table is Admin
[20:47:50] giom: has joined #RubyOnRails
[20:47:59] ur5us: has joined #RubyOnRails
[20:49:03] tbuehlmann: that should be the policy method, right? https://github.com/elabs/pundit/blob/58eda659d44a2e9d5e022fd23cc0f65bad7f7d82/lib/pundit.rb#L224
[20:49:16] tbuehlmann: it's using the pundit_user method, which defaults to current_user
[20:49:24] tbuehlmann: which might be nil
[20:49:43] voidDotClass: has joined #RubyOnRails
[20:49:58] alfie_max15: has left #RubyOnRails: ("Leaving")
[20:50:42] kgrz: pundit only passes current_user by default. So if your devise DB is a different model, you need to specify (override) the pundit_user method inside your policy
[20:50:52] acorncom_: has joined #RubyOnRails
[20:51:49] arup_r: yeah, got this link https://github.com/elabs/pundit#customize-pundit-user from tbuehlmann link. let me try. I didn't kno thid
[20:51:59] acorncom: has joined #RubyOnRails
[20:52:20] tbuehlmann: btw, did you show us code that isn't used? it differs from the gist to the image
[20:52:56] giom: has joined #RubyOnRails
[20:53:13] arup_r: now fixed.. I added it def pundit_user; current_admin ;end
[20:53:25] diego2: has joined #RubyOnRails
[20:53:29] diego2: has joined #RubyOnRails
[20:53:29] Darmani: The nil-class error usually means one of the associations within the db isn't setup correctly, right?
[20:53:33] arup_r: tbuehlmann: now, I show the code to you which was trubling..
[20:54:01] arup_r: anyway, thanks tbuehlmann and kgrz. It is fixed
[20:54:05] snowy: has joined #RubyOnRails
[20:55:31] tbuehlmann: Darmani: most of the time people are trying to call methods on an object, and if that object is nil for whatever reason, chances are you're getting a nomethoderror
[20:56:16] Darmani: undefined method error for nil-class.
[20:56:47] Darmani: tbuehlmann: same difference I suppose.
[20:57:16] Darmani: Is there a good article for understanding associations?
[20:57:31] Darmani: I have a basic understanding... But when it gets complicated I tend to get lost.
[20:58:19] clandry94: has joined #RubyOnRails
[20:58:28] tbuehlmann: sure: http://guides.rubyonrails.org/association_basics.html
[20:58:41] diegoaguilar: has joined #RubyOnRails
[21:00:40] cabinB: has joined #RubyOnRails
[21:00:52] acorncom: howdy, I’m relatively new to the Rails world and have a question re: testing a JSON-API endpoint
[21:01:23] diego2: has joined #RubyOnRails
[21:01:33] acorncom: I’m running the code shown in this gist: https://gist.github.com/acorncom/3fe869d369196c7ea5749616e4660185 and am getting errors when making a GET query. seems to be a route matching issue. any tips on how to work through it?
[21:02:32] tbuehlmann: acorncom: can you add your routes to the gist?
[21:03:05] stannard: has joined #RubyOnRails
[21:04:11] diego2: has joined #RubyOnRails
[21:04:34] acorncom: tbuehlmann, all the routes or just the ones that seem appliable?
[21:04:41] solars: has joined #RubyOnRails
[21:04:56] tbuehlmann: I assume there's a route missing, so just gist the whole thing
[21:06:19] sdwrage: has joined #RubyOnRails
[21:07:04] Synthead: is there such thing as .has_keys? in some form? like {a: 1, b: 2, c: 3}.has_keys?(:a, :b)
[21:08:51] acorncom: tbuehlmann: updated (and tweaked the test in the gist to fit in accurately with the route table)
[21:08:56] GodFather: has joined #RubyOnRails
[21:11:06] diego2: has joined #RubyOnRails
[21:11:35] holdmypocket: has joined #RubyOnRails
[21:12:01] srinidhi: has joined #RubyOnRails
[21:12:06] centrx: Synthead: http://stackoverflow.com/a/4743729
[21:13:09] s2013: has joined #RubyOnRails
[21:13:22] Synthead: centrx: yeah that's what I'm doing now except I'm looking for all the keys instead of any of them
[21:13:28] Synthead: I might write a helper method for this
[21:13:57] tbuehlmann: acorncom: I can't find a route matching the action name and params in the list
[21:14:00] s2013: i have this weird issue.. its saving a record properly.. including the time associated with it
[21:14:06] s2013: but later on when i query that record, the tiem is nil
[21:14:09] centrx: Synthead: Google [hash has all keys]
[21:14:14] s2013: what should i be looking for
[21:14:16] tbuehlmann: acorncom: which one are you trying to test?
[21:14:21] s2013: im scratching my head.. and it just started happening
[21:14:46] acorncom: tbuehlmann: I’ll separate the particular one out of the list that I think I should be working with ;-)
[21:14:52] Synthead: centrx: I know it can be done, and I know how to google things. I was asking you guys in case I missed a rails method or something
[21:15:00] smathy: s2013, !gist proof of what you're saying - the console session eg.
[21:15:00] helpa: s2013: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[21:17:35] centrx: Synthead: yeah I don’t think there is one in Ruby or Rails
[21:18:11] s2013: smathy https://gist.github.com/ss2k/dcec2b4c0caf2e2b849b69ed20e24b74
[21:18:13] Synthead: centrx: ok thanks :) I'll just write a helper method. no biggie
[21:18:19] acorncom: tbuehlmann: thanks for rubber-ducking with me. apparently I had my test in the wrong controller test
[21:19:00] acorncom: tbuehlmann: when working with related resources, I’m needing to write the test for that related controller, despite the url ;-)
[21:20:40] eljimmy: has joined #RubyOnRails
[21:20:43] holdmypocket: Is anyone running Windows 10 as their primary operating system while running Linux VMs to work on RoR apps? I'm trying to decide how necessary it is to boot into Linux or give up and get a Macbook Pro
[21:21:19] smathy: s2013, it's a different record, there's no venue_id or user_id in the insert.
[21:21:37] s2013: its the same record. venue_id and user_id is inserted later
[21:22:00] acorncom: holdmypocket: I’ve been using a Rails box from https://railsbox.io, it’s been working pretty well
[21:22:00] piko__: holdmypocket: why would you need to buy a mbp?
[21:22:04] s2013: SQL (0.3ms) UPDATE "events" SET "venue_id" = $1, "updated_at" = $2 WHERE "events"."id" = $3 [["venue_id", 74], ["updated_at", "2016-05-19 16:16:16.763189"], ["id", 33]]
[21:22:10] ur5us_: has joined #RubyOnRails
[21:22:17] noobsu: has joined #RubyOnRails
[21:22:18] s2013: same w/ user_id
[21:22:19] tbuehlmann: holdmypocket: I'm using windows 10 and an ubuntu vm when I'm on my desktop machine. using just ubuntu on my notebook when not home
[21:22:30] holdmypocket: piko__: I keep reading how terrible it is to work on RoR in Windows
[21:22:50] piko__: holdmypocket: linux runs on other machines than mbp ;)
[21:23:14] smathy: Riiight. So instead of the gist you made, show me a gist from start to finish demonstrating the issue. Don't leave anything out.
[21:23:27] jstransky: has joined #RubyOnRails
[21:23:51] s2013: thats all there is nothing else.. it saves the record. and responds back correctly but then if you try to go into the console or try to query that record later
[21:23:53] holdmypocket: piko__: The best laptop value I've found is a Sager/Clevo at xoticpc.com so I'm trying to decide if I should try to buy the latest one (mine is getting old) and dual boot Linux and hope to get it working, or if I can get away with just installing Windows 10 and setting up VirtualBox with Linux on it
[21:23:55] s2013: the start and end times are nil
[21:24:54] s2013: there is nothign in the log that mentions the start time and end tiem except when record is being created
[21:24:59] yfeldblum: has joined #RubyOnRails
[21:24:59] holdmypocket: tbuehlmann: just curious, on your desktop machine do you have access to the VM's virtual drive or do you ssh in and edit using vim or something?
[21:25:16] piko__: holdmypocket: I don't have much experience with RoR development on Windows, but on linux it's been great. if you're not comfortable switching to linux as the primary host, just use it in a vm. should work fine unless you have just 2gb of RAM or something
[21:25:30] centrx: After running migrations, does it always cycle through all the indexes in the database? (or this an sqlserveradapter only thing?)
[21:25:37] ur5us: has joined #RubyOnRails
[21:25:57] centrx: holdmypocket: virtualbox, for example, allows sharing folders between the guest and the host
[21:26:10] s2013: there is nothign in the callback, etc
[21:26:13] s2013: so confusing
[21:26:32] tbuehlmann: holdmypocket: I'm using virtualbox, so I startup the vm and work inside that
[21:26:39] holdmypocket: I guess my concern with Windows 10 and running a Linux VM on it for RoR development is the issue I ran into messing with node.js and long path names which Windows couldn't handle. I guess that isn't an issue with Rails though.
[21:27:19] tbuehlmann: windows support in rails has gotten better, but I wouldn't develop on windows yet
[21:27:20] holdmypocket: tbuehlmann: ahh, thanks
[21:27:21] Jasaka: has joined #RubyOnRails
[21:27:37] giom: has joined #RubyOnRails
[21:27:38] apotry: has joined #RubyOnRails
[21:28:20] acorncom: has left #RubyOnRails: ()
[21:28:59] tbuehlmann: off for now, good night!
[21:29:21] holdmypocket: have a good one
[21:33:10] s2013: # config.time_zone = 'Central Time (US & Canada)'
[21:33:10] s2013: # config.active_record.default_timezone = 'Central Time (US & Canada)' i think this is causing it
[21:33:28] et09: has joined #RubyOnRails
[21:33:31] noobsu_: has joined #RubyOnRails
[21:33:46] et09: mount ActionCable.server => '/cable'
[21:34:03] et09: i took that line out of my config/routes.rb - and yet i'm still getting successful websocket requests/upgrades from the browser
[21:34:10] et09: after restarting the server (in rails 5)
[21:34:15] et09: i have no idea why
[21:37:12] FCser: has joined #RubyOnRails
[21:41:22] JesseH: has joined #RubyOnRails
[21:41:31] smathy: s2013, usually, the explanation for problems that don't make sense are incorrect assumptions. In showing only what you think is relevant you're subjecting everyone else to the same assumptions that have created this confusion in the first place.
[21:41:43] rakm: has joined #RubyOnRails
[21:41:59] s2013: i pinpointed the isssue but i dont know why
[21:44:19] noobsu: has joined #RubyOnRails
[21:47:41] Devalo: has joined #RubyOnRails
[21:52:28] joelwallis: has joined #RubyOnRails
[21:52:33] stannard: has joined #RubyOnRails
[21:56:24] s2013: has joined #RubyOnRails
[21:58:45] akshat_: has joined #RubyOnRails
[22:19:29] ss_much: has joined #RubyOnRails
[22:20:35] Darmani: Hey guys! One of my tests for authorization is failing and I don't know why :[
[22:20:38] Darmani: https://github.com/mfifth/forum/blob/authorizations_for_topics/app/controllers/topics_controller.rb
[22:20:47] Darmani: Am I doing it wrong? o.o
[22:25:03] workmad3: Darmani: it would probably help if you said which test was failing...
[22:25:19] nickjj: has joined #RubyOnRails
[22:25:34] startupality: has joined #RubyOnRails
[22:25:46] Darmani: workmad3: Oh. My apologies. It's the editing topic's spec.
[22:26:44] workmad3: Darmani: there are no specs in that repo... gist the code, the spec and the failure output please rather than making us go look for it maybe? ;)
[22:27:11] Darmani: no specs? o.o
[22:27:36] workmad3: topic_controllers_spec.rb is empty
[22:28:29] Darmani: oh that's not where the test is. I can gist it anyway hang on.
[22:28:47] Darmani: https://gist.github.com/mfifth/09797909c8e209da03c26ff82e1aa70d
[22:28:47] giom: has joined #RubyOnRails
[22:29:45] Darmani: workmad3: The test itself is pretty straightforward. It's the validation (within the controller) where the actually restrictions are applied.
[22:29:53] manfrin: has joined #RubyOnRails
[22:30:40] xalupeao: has joined #RubyOnRails
[22:31:38] workmad3: Darmani: !gist-usage (specifically the edit gist option and the `add file` button to makes gists really understandable) :)
[22:31:38] helpa: Darmani: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[22:31:46] hahuang61: has joined #RubyOnRails
[22:32:02] workmad3: Darmani: also, the failing test output would be instrumental in helping identify the issue
[22:32:28] Darmani: workmad3: Lmao and here I thought I was prepared xD
[22:33:15] workmad3: Darmani: heh :) no probs... when you're first looking for help, just getting your info organised is frequently 90% of the task
[22:34:29] workmad3: Darmani: typically what you want is: the code, the test (if there is one that's relevant) and the failing output (error, bad HTML, failing test output, etc.)
[22:34:51] Darmani: https://gist.github.com/mfifth/09797909c8e209da03c26ff82e1aa70d
[22:34:55] Darmani: workmad3: Done! I think...
[22:36:10] workmad3: Darmani: yup... and now I can see straight away what the issue is
[22:36:23] workmad3: Darmani: your `before_action` tasks are run in the order they're declared...
[22:36:35] Darmani: workmad3: I didn't know that :O
[22:36:54] workmad3: Darmani: and now you do... and I bet you can see the issue now as well ;)
[22:37:34] workmad3: Darmani: the key bit was that the error was telling you that `@topic` was nil in your `verify_author` method
[22:37:49] workmad3: Darmani: so then it's looking for where that's set :)
[22:37:51] FCser: has joined #RubyOnRails
[22:38:12] workmad3: without the output, I didn't know which bit to look at though ;)
[22:38:23] Darmani: workmad3: so... What order should they go in exactly?
[22:38:32] workmad3: Darmani: the order you want them run in
[22:38:54] Darmani: I think... set_forum, set_topic, authenticate_user and then verify author?
[22:39:03] Darmani: workmad3: Does that sound right?
[22:39:19] axl__: has joined #RubyOnRails
[22:39:21] workmad3: Darmani: you could probably do authenticate_user! first, so you fail really fast if the user isn't signed in
[22:39:44] workmad3: (no point doing those database searches if you're just going to redirect to a sign-in page, right? :) )
[22:40:08] Darmani: workmad3: yeah I guess so.
[22:40:09] workmad3: Darmani: but verify_author depends on @topic being set, which means it has to be after set_topic... that's the only really hard constraint I can see
[22:41:00] Darmani: workmad3: hm
[22:41:07] Darmani: sorry I'm trying to think here.
[22:42:56] Darmani: workmad3: sweet! I got it(:
[22:43:04] Darmani: Thanks man you are awesome ^.^
[22:43:07] workmad3: Darmani: no probs
[22:43:40] Darmani: I have to go eat something before I fall over in my chair q.q
[22:48:00] Omen: has joined #RubyOnRails
[22:52:19] macsteps: has joined #RubyOnRails
[22:53:09] stannard: has joined #RubyOnRails
[22:53:10] dopie: has joined #RubyOnRails
[22:54:29] truenito: has joined #RubyOnRails
[22:54:46] dopie: hello all :)
[22:55:41] dopie: I have a question http://www.screencast.com/t/yk4gaC7c , in my update.js.haml I'm checking what params are being passed and then acting on them but their is going to be a lot of params, is it ok to leave it in that js file? or should I move it somewhere else
[22:57:26] blackmesa: has joined #RubyOnRails
[22:57:53] jstransky: has joined #RubyOnRails
[23:00:11] axl_: has joined #RubyOnRails
[23:00:26] dopie: has joined #RubyOnRails
[23:01:40] maxdoubt: has joined #RubyOnRails
[23:02:09] sameerynho: has joined #RubyOnRails
[23:06:26] Symbiosisz: has joined #RubyOnRails
[23:06:50] dalbusch1t: has joined #RubyOnRails
[23:12:56] insanedreamer: has joined #RubyOnRails
[23:14:55] momomomomo: has joined #RubyOnRails
[23:16:16] JesseH: has joined #RubyOnRails
[23:17:10] chouhoulis: has joined #RubyOnRails
[23:18:52] chouhoul_: has joined #RubyOnRails
[23:22:15] flashpoint9: has joined #RubyOnRails
[23:23:11] sdwrage: has joined #RubyOnRails
[23:23:35] _Tariq: has joined #RubyOnRails
[23:23:51] jstransky: has joined #RubyOnRails
[23:25:15] refinerysource: has joined #RubyOnRails
[23:30:22] giom: has joined #RubyOnRails
[23:32:15] distruggle: has joined #RubyOnRails
[23:35:34] wilsonc91: has joined #RubyOnRails
[23:37:04] tfitts: has joined #RubyOnRails
[23:37:12] quazimodo: has joined #RubyOnRails
[23:40:01] _Tariq: has joined #RubyOnRails
[23:46:16] aghalarp: has joined #RubyOnRails
[23:47:17] Nowaker: has joined #RubyOnRails
[23:48:07] dopie: Radar, I actually need your opinion
[23:48:59] dopie: I'm venturing into ajax for the first time, you are already accustomed to my noobness :)
[23:49:29] dopie: I have a question http://www.screencast.com/t/yk4gaC7c , in my update.js.haml I'm checking what params are being passed and then acting on them but their is going to be a lot of params, is it ok to leave it in that js file? or should I move it somewhere else
[23:49:32] dopie: 3 years of noobness :)
[23:50:13] dopie: each param is going to have something different happen
[23:51:30] baweaver: you're not on helpa's radar
[23:53:12] Nowaker: Howdy. I've got a weird problem with #update! method on the model. At some point in my script @model.update! key: val has no effect - it's around two minutes after performing the #find. No change performed on the database but also no exception. Here's a quick pseudocode: u = U.find 1; ... do various things for two minutes ... ; u.update! key: val; - and no change is performed
[23:53:15] dopie: Is there a better way or cleaner way you would suggest?
[23:53:46] Radar: dopie: My consulting rate is $200/hr
[23:53:57] Radar: I can send through my contract if you'd like?
[23:53:59] Radar: Which address should I send it to?
[23:54:08] dopie: I'm asking your opinion
[23:54:09] Nowaker: I'd except an exception or something. But just getting nothing. Any ideas why?
[23:54:38] Nowaker: However, if I do @model.reload before performing that #update!, the change goes through.
[23:55:09] Radar: dopie: And I don't want to give it freely.
[23:55:14] dopie: Youre that broke you need to tell people your rates on irc?
[23:55:16] Nowaker: So, the question really is, why could happen to @model object that it needs a reload? And why does #update! not throw an exception.
[23:55:30] dopie: Thanks for the help :)
[23:55:33] Radar: This is not a 15 minute "here's the answer" type dealio
[23:55:39] ur5us: has joined #RubyOnRails
[23:55:49] Radar: It's more a three hour "this code is bad but salvageable" session
[23:55:51] triptec_: has joined #RubyOnRails
[23:56:10] flashpoint9: has joined #RubyOnRails
[23:56:25] dopie: Whats bad about it?
[23:56:25] adre: has joined #RubyOnRails
[23:57:00] Radar: Ok, going on ignore since you aren't getting the hint.
[23:57:20] Radar: As simple as I can put it: I am busy. Do not ping me directly. Leave me alone.
[23:57:37] dopie: Cool thanks
[23:59:06] aghalarp: has joined #RubyOnRails