« Back to channel list

#RubyOnRails - 13 June 2016

« Back 1 day Forward 1 day »
[00:00:37] ecksit: has joined #RubyOnRails
[00:03:15] bonhoeffer: has joined #RubyOnRails
[00:11:14] jancel: has joined #RubyOnRails
[00:13:47] ur5us: has joined #RubyOnRails
[00:18:06] jenrzzz: has joined #RubyOnRails
[00:18:40] moeabdol1: has joined #RubyOnRails
[00:20:46] gr33nw00d: has joined #RubyOnRails
[00:21:23] gr33nw00d: hey guys, question from a noob: how can I update a model but use the pre-updated version in my view? the example is notifications - I want to mark them read after rendering the view
[00:24:32] gr33nw00d: nevermind figured it out
[00:24:34] gr33nw00d: after_action
[00:27:13] Hobogrammer: has joined #RubyOnRails
[00:27:18] jancel: has joined #RubyOnRails
[00:30:49] moeabdol1: has joined #RubyOnRails
[00:39:13] mitt3ns: has joined #RubyOnRails
[00:39:52] mitt3ns: has joined #RubyOnRails
[00:45:02] moeabdol1: has joined #RubyOnRails
[00:45:15] Darmani: Hey guys, in my RSpec test I want Capybara to select the first element with the string I provided.
[00:45:19] Darmani: How do I get it to do that?
[00:45:51] AmiMoench: has joined #RubyOnRails
[00:46:30] armyriad: has joined #RubyOnRails
[00:49:15] benlieb: has joined #RubyOnRails
[00:53:06] DoctorMonocular: has joined #RubyOnRails
[00:57:03] Markhor1991: has joined #RubyOnRails
[01:02:01] binaryplease1: has joined #RubyOnRails
[01:03:57] roamingdog: Darmani: likely this, i'm trying it out now... http://www.rubydoc.info/github/jnicklas/capybara/master/Capybara/Node/Finders:all
[01:05:40] Darmani: roamingdog: That looks a bit confusing.
[01:09:20] norc-2: has joined #RubyOnRails
[01:09:58] roamingdog: Darmani: do you know what kind of element contains the text?
[01:10:14] Darmani: yeah it's a link.
[01:10:29] Darmani: It's a link next to a username that says "Message me!"
[01:10:53] roamingdog: Darmani: this works for me: page.all('a', text: 'hello')
[01:11:18] Darmani: roamingdog: So... What does that do exactly?
[01:11:28] roamingdog: page.first('a', text: 'hello') for the first one only
[01:11:40] roamingdog: it finds the element you wanted. what are you trying to do?
[01:12:03] Darmani: Ahh gotcha.
[01:12:12] roamingdog: first anchor tag with text 'hello'
[01:12:16] Darmani: I just want it to click on the first link it finds.
[01:12:25] roamingdog: page.first('a', text: 'hello').click
[01:12:43] Darmani: roamingdog: got it. Thanks man.
[01:12:55] pawnbox: has joined #RubyOnRails
[01:15:29] rubyonrails045: has joined #RubyOnRails
[01:16:34] rubyonrails045: Hey guys, can anyone help me? I'm trying to use delegation ( I'm up for other ways of trying to solve this ) to be able to access a property on the joining table of a "has many through" relationship from one of the joining models.
[01:16:51] rubyonrails045: I have a quick gist if anyone is available to look at it
[01:18:25] flashpoint9: has joined #RubyOnRails
[01:21:34] ravster: has joined #RubyOnRails
[01:21:50] arBmind1: has joined #RubyOnRails
[01:23:45] Oliphaunte: has joined #RubyOnRails
[01:25:31] truenito: has joined #RubyOnRails
[01:25:49] roamingdog: rubyonrails045: just fyi, just put the link to the gist, no one will _ever_ say 'yes please, i'll have a gist please'
[01:27:02] ekinmur: has joined #RubyOnRails
[01:27:48] m_antis: has joined #RubyOnRails
[01:29:03] sevenseacat: has joined #RubyOnRails
[01:31:12] arBmind: has joined #RubyOnRails
[01:32:12] jancel: has joined #RubyOnRails
[01:36:43] groatyoats: has joined #RubyOnRails
[01:36:50] rafaelfranca: has joined #RubyOnRails
[01:37:57] Mia: has joined #RubyOnRails
[01:37:57] Mia: has joined #RubyOnRails
[01:42:05] jancel: has joined #RubyOnRails
[01:42:28] Darmani: I'm not sure why I'm getting this error message. Could someone take a look?
[01:42:28] Darmani: https://gist.github.com/mfifth/236fd66fc46e4c69851cb70a7d395b84
[01:44:51] sevenseacat: Darmani: seems that @messages is nil
[01:45:23] Darmani: sevenseacat: Lol
[01:45:53] nettoweb: has joined #RubyOnRails
[01:45:54] sevenseacat: not sure why thats funny but anyway... you render the index template from the create action, but the index template requires more instance variables to be set
[01:46:09] sevenseacat: that you are not setting in the create action
[01:46:34] Darmani: sevenseacat: more instance variables to be set...?
[01:46:47] sevenseacat: the index template iterates over @messages
[01:46:58] sevenseacat: which you are not setting in the create action, hence it is nil
[01:47:29] Darmani: sevenseacat: ah.
[01:47:32] Darmani: So what should I be rendering?
[01:47:45] sevenseacat: what do you want to render on message creation failure?
[01:48:12] Oliphaunte: has joined #RubyOnRails
[01:48:14] Darmani: The same index page with a flash message failure.
[01:49:15] sevenseacat: then perhaps redirect there instead of using render. or set the right variables so the page can render successfully. or look at submitting the form remotely so you don't re-render the whole pager
[01:49:23] sevenseacat: also, why do you have a new action then if it is not getting used?
[01:49:57] nattyPablo: has joined #RubyOnRails
[01:50:01] Darmani: sevenseacat: good question. I structured it that way at first but then I changed it.
[01:51:17] benlieb: has joined #RubyOnRails
[01:51:22] Darmani: sevenseacat: I just changed it to a redirect, I suppose it's simpler that way.
[01:51:30] Darmani: Thanks for the help
[01:52:34] enkristoffer: has joined #RubyOnRails
[01:57:21] crystal77: has joined #RubyOnRails
[01:58:01] flashpoint9: Is there something I can place in my rspec files that will output on the command line? for example if I wanted to see what the response was how can I render response on the command line?
[02:02:11] diegoaguilar: has joined #RubyOnRails
[02:02:16] roamingdog: flashpoint9: i use 'awesome_print' so in a spec i can do ap 'anything' and see it when tests run
[02:02:39] flashpoint9: roamingdog: ok ill check that out
[02:08:31] Axsuul: has joined #RubyOnRails
[02:08:40] GaryKing: has joined #RubyOnRails
[02:09:27] GaryKing: Hello, I created a before_validation to replace null values with non-null values, yet I still get errors that the record is invalid. Why is this validation taking place even when my before_validation runs?
[02:10:03] sevenseacat: GaryKing: got some code/error/etc. for us to see?
[02:10:34] flashpoint9: GaryKing: How have you sanity checked the null replacement code?
[02:11:14] GaryKing: Basically before_validation :ensure_not_null; def ensure_not_null; if self.response.nil? then self.response = ‘’; end
[02:12:46] GaryKing: I’m actually inheriting the validations from an abstract model. I’ve got other models inheriting from there with no problems.
[02:14:42] Oliphaunte: has joined #RubyOnRails
[02:14:45] GaryKing: I just checked self after the validation runs and it looks good too.
[02:17:14] GaryKing: Does serialize run before or after validations?
[02:18:05] roamingdog: GaryKing: it would be a sad state if it ran before
[02:18:26] GaryKing: Indeed so I’m not sure what’s going on...
[02:20:05] GaryKing: What’s the best way to step through the code to see what’s up? Any recommended gems?
[02:20:36] DoctorMonocular: has joined #RubyOnRails
[02:21:18] roamingdog: GaryKing: http://fleeblewidget.co.uk/2014/05/byebug-cheatsheet/
[02:21:25] GaryKing: Great thanks
[02:22:26] GaryKing: What’s the diff between byebug and pry? I usually use pry. byebug seems better yet less popular? is it just newer?
[02:24:02] pilne: has joined #RubyOnRails
[02:26:07] roamingdog: GaryKing: i just checked your code here, indeed it should work. i had to change the single quotes to 'regular' single quotes, but i assume that happened when you pasted
[02:26:26] GaryKing: my irc client replaced the quotes i guess
[02:34:42] nattyPablo: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[02:36:08] GaryKing: roamingdog: oh wait, validates :presence also checks for “”? if so then that’s the problem :p
[02:36:37] roamingdog: GaryKing: ja, unless blank: true or something
[02:37:11] GaryKing: i would have figured it out sooner, but for some reason this code works fine for my other 3 similar models, which all inherit from the same class…
[02:38:53] roamingdog: for the record, i meant allow_blank: true
[02:39:26] stardiviner: has joined #RubyOnRails
[02:39:48] Leepoff: has joined #RubyOnRails
[02:39:52] GaryKing: ah okay i’ll remember
[02:40:08] LeoDee: has joined #RubyOnRails
[02:42:38] jancel: has joined #RubyOnRails
[02:43:01] stardiviner: has joined #RubyOnRails
[02:44:14] GaryKing: okay so uh, major bug discovered i guess? turns out the other models that i thought had no problems, nope, they weren’t even bothering to insert the rows which i thought validation passed. so i guess i can fix that now.
[02:44:28] GaryKing: create! will probably come in handy now
[02:45:01] jenrzzz: has joined #RubyOnRails
[02:45:01] jenrzzz: has joined #RubyOnRails
[02:45:30] roamingdog: GaryKing: as will tests
[02:51:08] elton: has joined #RubyOnRails
[02:52:43] jancel: has joined #RubyOnRails
[02:54:49] GaryKing: yep for sure
[02:56:46] elton: has joined #RubyOnRails
[03:03:56] pawnbox: has joined #RubyOnRails
[03:11:24] chipotle: has joined #RubyOnRails
[03:16:29] braincrash: has joined #RubyOnRails
[03:18:34] djj: has joined #RubyOnRails
[03:20:51] k3rn31: has joined #RubyOnRails
[03:22:18] ravster: has joined #RubyOnRails
[03:25:53] pawnbox: has joined #RubyOnRails
[03:25:55] jenrzzz: has joined #RubyOnRails
[03:25:55] jenrzzz: has joined #RubyOnRails
[03:27:40] jancel: has joined #RubyOnRails
[03:29:38] roamingdog: has joined #RubyOnRails
[03:31:45] arBmind: has joined #RubyOnRails
[03:33:58] djj: /msg NickServ SETPASS dj_ cxsizrpbidim poop420
[03:34:46] jgt: has joined #RubyOnRails
[03:43:57] jenrzzz: has joined #RubyOnRails
[03:43:57] jenrzzz: has joined #RubyOnRails
[03:47:30] pawnbox: has joined #RubyOnRails
[03:47:56] Oliphaunte: has joined #RubyOnRails
[03:56:44] k3rn31: has joined #RubyOnRails
[03:58:13] i: has joined #RubyOnRails
[03:58:54] n1lo: has joined #RubyOnRails
[04:01:17] sypheren: has joined #RubyOnRails
[04:02:57] SteenJobs: has joined #RubyOnRails
[04:09:13] helpa: has joined #RubyOnRails
[04:10:49] jenrzzz: has joined #RubyOnRails
[04:12:41] yfeldblum: has joined #RubyOnRails
[04:23:14] dionysus69: has joined #RubyOnRails
[04:25:24] Wolland: has joined #RubyOnRails
[04:25:42] pawnbox: has joined #RubyOnRails
[04:26:13] CircleDot: has joined #RubyOnRails
[04:34:16] naftilos76: has joined #RubyOnRails
[04:47:46] jgt: has joined #RubyOnRails
[04:50:07] Coldblackice: has joined #RubyOnRails
[04:52:34] jenrzzz: has joined #RubyOnRails
[04:52:34] jenrzzz: has joined #RubyOnRails
[04:55:00] Leepoff: has joined #RubyOnRails
[05:00:29] dionysus69: has joined #RubyOnRails
[05:01:54] hahuang61: has joined #RubyOnRails
[05:04:34] SteenJobs: has joined #RubyOnRails
[05:11:25] kgrz: has joined #RubyOnRails
[05:16:24] jancel: has joined #RubyOnRails
[05:18:13] pawnbox: has joined #RubyOnRails
[05:23:13] ravster: has joined #RubyOnRails
[05:25:05] Contigi: has joined #RubyOnRails
[05:26:25] flashpoint9: has joined #RubyOnRails
[05:31:53] haraigoshi: has joined #RubyOnRails
[05:32:15] arBmind: has joined #RubyOnRails
[05:33:03] tildes: has joined #RubyOnRails
[05:33:13] Oliphaunte: has joined #RubyOnRails
[05:34:43] rvanlieshout: has joined #RubyOnRails
[05:38:18] rvanlieshout: has joined #RubyOnRails
[05:40:53] KevinSjoberg: has joined #RubyOnRails
[05:45:07] snoobydoo: has joined #RubyOnRails
[05:45:14] jayc0b0: has joined #RubyOnRails
[05:47:10] duncannz: has joined #RubyOnRails
[05:50:38] chipotle: has joined #RubyOnRails
[05:53:16] pawnbox: has joined #RubyOnRails
[05:54:47] chipotle: has joined #RubyOnRails
[05:55:30] jenrzzz: has joined #RubyOnRails
[05:55:30] jenrzzz: has joined #RubyOnRails
[05:55:51] maxz: has joined #RubyOnRails
[06:05:05] njero: has joined #RubyOnRails
[06:09:06] kgrz: has joined #RubyOnRails
[06:09:10] edwinvdgraaf: has joined #RubyOnRails
[06:12:11] KevinSjoberg: has joined #RubyOnRails
[06:15:58] KevinSjoberg: has joined #RubyOnRails
[06:17:53] jancel: has joined #RubyOnRails
[06:18:39] AimlessRAven: has joined #RubyOnRails
[06:19:55] AimlessRAven: hi all, i list my categories in my brand index view
[06:20:07] AimlessRAven: now i wanna find category name who i clicked
[06:20:15] AimlessRAven: my params[:q] produce => {"category_id_eq"=>"3", "brands_products_price_min_cents_gteq"=>"0", "brands_products_price_min_cents_lteq"=>"25000"}
[06:20:33] AimlessRAven: how to find category.name by this params[:q]
[06:22:44] chipotle: has joined #RubyOnRails
[06:24:24] scepticulous: has joined #RubyOnRails
[06:24:26] netzfisch: has joined #RubyOnRails
[06:26:12] elton: has joined #RubyOnRails
[06:27:52] solars: has joined #RubyOnRails
[06:29:28] Sheperson: has joined #RubyOnRails
[06:29:51] chipotle: has joined #RubyOnRails
[06:39:01] chipotle: has joined #RubyOnRails
[06:39:02] rbr: has joined #RubyOnRails
[06:42:38] dionysus69: has joined #RubyOnRails
[06:43:51] hahuang61: has joined #RubyOnRails
[06:44:06] deweysdecimal: has joined #RubyOnRails
[06:45:00] chipotle: has joined #RubyOnRails
[06:49:00] chipotle: has joined #RubyOnRails
[06:50:02] kgrz: has joined #RubyOnRails
[06:51:27] chipotle: has joined #RubyOnRails
[06:53:53] enkristoffer: has joined #RubyOnRails
[06:53:58] enkristoffer: has joined #RubyOnRails
[06:54:06] KevinSjoberg: has joined #RubyOnRails
[06:54:06] DoctorMonocular: has joined #RubyOnRails
[06:54:24] k3rn31: has joined #RubyOnRails
[06:55:59] KevinSjoberg: has joined #RubyOnRails
[07:01:28] chipotle: has joined #RubyOnRails
[07:04:21] alfiemax: has joined #RubyOnRails
[07:07:45] Guest17987: has joined #RubyOnRails
[07:08:00] Terens: has joined #RubyOnRails
[07:08:10] Terens: what is the difference between with options and
[07:08:19] Terens: with_options and just wrapping validations isnide an if block ?
[07:10:58] crova: has joined #RubyOnRails
[07:11:56] chipotle: has joined #RubyOnRails
[07:12:33] crova: greetings ! I'm having problemas on update action with parameters generated on the form (utf8, commit, authenticity_token). Anyone knows how to accept those parameters or ignore them?
[07:13:31] darutoko: has joined #RubyOnRails
[07:13:57] universa1: crova: code? error? stack trace? => gist
[07:14:13] tjbiddle: has joined #RubyOnRails
[07:14:39] pawnbox: has joined #RubyOnRails
[07:14:42] crova: sure, one second
[07:15:14] matthewd: Terens: The if block will be evaluated when the model is loaded.. that's unlikely to be what you want
[07:15:19] artto: has joined #RubyOnRails
[07:15:52] Terens: I thought that now. But in real case scenario would that ever backfire?
[07:16:07] helpa: Why don't you try it and find out for yourself?
[07:16:41] sevenseacat: given there is no data in the model when it is loaded, it will definitely not do what you want
[07:17:15] Terens: I use with_options always , but how can I proove that it is correct to others in team
[07:17:32] Terens: ok thanks that is a good point
[07:17:48] sevenseacat: easy - show it not working when you dont use with_options
[07:17:53] jenrzzz: has joined #RubyOnRails
[07:18:25] matthewd: Even easier: ask them to show you the alternative
[07:18:36] crova: universa1, sevenseacat https://gist.github.com/crova/29a620444a5c2280535afc5806893b9d there you go
[07:18:43] matthewd: Delegation As Education™
[07:18:44] Terens: they are telling me that they work fine
[07:18:53] universa1: crova: !gist-usage
[07:18:53] helpa: crova: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[07:18:57] aganov: has joined #RubyOnRails
[07:19:12] crova: thanks for the link
[07:19:14] matthewd: Terens: Telling you, or showing you?
[07:19:17] universa1: crova: https://gist.github.com/crova/29a620444a5c2280535afc5806893b9d#file-server-log-L5
[07:19:29] sevenseacat: crova: that update action is quite incomplete
[07:19:42] Terens: mostly telling but they wrote tests for these models and work ..
[07:19:52] crova: sevenseacat, how so?
[07:20:02] universa1: https://gist.github.com/crova/29a620444a5c2280535afc5806893b9d#file-controller-L3
[07:20:15] universa1: crova: simply gist the full file please.
[07:20:21] sevenseacat: a) its not syntactically valid without more lines of code and b) wheres the definition of single_shoot_params ?
[07:20:44] artto: has joined #RubyOnRails
[07:20:47] antgel: has joined #RubyOnRails
[07:20:54] crova: sevenseacat, you got whole control now, sorry
[07:21:03] DoubleMalt: has joined #RubyOnRails
[07:21:20] sevenseacat: ok, your single_shoot_params method is incorrect
[07:21:35] sevenseacat: compare what parameters you're permitting, with what parameters the controller is receiving
[07:23:13] ur5us: has joined #RubyOnRails
[07:23:30] sevenseacat: so many issues with this code, guh
[07:23:52] ravster: has joined #RubyOnRails
[07:24:13] crova: I don't see which one I'm missing, only only that is not getting permitted is "campaign", that I don't even know where is coming from (I suppose is from the form_for)
[07:24:33] sevenseacat: yes, campaign is the hash that holds *all of the data you're submitting in the form*
[07:24:37] crova: sevenseacat, sorry for the mess, I'm pretty new to this and don't have all the good practices yet
[07:24:47] sevenseacat: which is getting completely ignored
[07:25:00] sevenseacat: thats the data you want to save, not action and authenticity token and the utf8 tick
[07:25:06] crova: yes, indeed
[07:25:16] crova: but I have no clue on how to point to the content of that hash
[07:25:25] sevenseacat: http://guides.rubyonrails.org/getting_started.html#the-first-form
[07:25:46] sevenseacat: see section 5.6
[07:25:55] crova: thank you
[07:28:18] phredus: has joined #RubyOnRails
[07:35:25] artto: has joined #RubyOnRails
[07:36:56] crova: sevenseacat, I must be dumb, but I can't see how to fix my code...
[07:37:14] arBmind: has joined #RubyOnRails
[07:37:41] sevenseacat: all the data you want to save to the db is in params[:campaign] - therefore you require that parameter (params.require(:campaign)) and permit all of the attributes you want to be saved, just like in the example
[07:38:49] crova: so it's the params.require(:id) that has no place in it?!
[07:39:00] sevenseacat: and the line after that
[07:39:10] sevenseacat: remove them both
[07:39:51] crova: I'll give it a try, I appreciate
[07:42:37] crova: sevenseacat, got it. I thought the require was necessary to pick up the correct model, and not correct data to save into the model, many thanks
[07:42:51] crova: it works like it was supposed now
[07:45:30] r1v3r_: has joined #RubyOnRails
[07:49:05] vasilakisFiL: has joined #RubyOnRails
[07:49:35] kgrz: has joined #RubyOnRails
[07:49:54] roamingdog: has joined #RubyOnRails
[07:52:47] tjbiddle: has joined #RubyOnRails
[07:54:22] enkristoffer: has joined #RubyOnRails
[07:57:54] AntiSpamMeta: has joined #RubyOnRails
[07:58:28] ur5us: has joined #RubyOnRails
[07:58:58] jsrn: has joined #RubyOnRails
[07:59:03] mauro1254: has joined #RubyOnRails
[07:59:27] srinidhi: has joined #RubyOnRails
[08:00:20] helpa: We're not all guys here - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[08:01:32] andywww: has joined #RubyOnRails
[08:02:46] pawnbox: has joined #RubyOnRails
[08:07:40] artto: has joined #RubyOnRails
[08:08:03] snoobydoo: Hey everyone, quick question. Is it valid to have a db name wih a '-' eg: 'foo-bar_development' or 'foo-bar_test'?
[08:08:25] snoobydoo: I'm trying to setup my database.yml accordingly for two databases
[08:08:31] sevenseacat: likely depends on the dbms, but I'd avoid it
[08:09:27] snoobydoo: Um okay, so CamelCase it? I'm trying to understand what the convention is
[08:09:43] sevenseacat: use underscores
[08:10:05] sevenseacat: or alternatively, use a one-word name like foobar_development
[08:10:32] snoobydoo: Makes sense. Thanks!
[08:12:24] dannyguk: has joined #RubyOnRails
[08:14:42] mauro1254: Is it possible to share the session using activerecord session store between 2 apps, one with rails v 4.2.6 and the other with rails 5.0.0rc1?
[08:16:45] Ergo: has joined #RubyOnRails
[08:16:56] neanderslob: has joined #RubyOnRails
[08:17:30] mauro1254: I get the following error: ArgumentError (dump format error (user class))
[08:17:46] Z00t: has joined #RubyOnRails
[08:18:41] Axsuul: has joined #RubyOnRails
[08:18:52] DoctorMonocular: has joined #RubyOnRails
[08:21:08] ur5us: has joined #RubyOnRails
[08:22:52] yottanami: has joined #RubyOnRails
[08:23:56] srinidhi: has joined #RubyOnRails
[08:25:04] eladmeidar: has joined #RubyOnRails
[08:25:08] mauro1254: has joined #RubyOnRails
[08:26:14] mauro1254: has joined #RubyOnRails
[08:30:57] blackmesa: has joined #RubyOnRails
[08:32:56] matthewd: mauro1254: Apparently not, then :)
[08:34:06] mauro1254: apparently not
[08:35:02] matthewd: mauro1254: Maybe related: https://github.com/rails/rails/issues/24726
[08:36:03] adre: has joined #RubyOnRails
[08:37:46] mauro1254: matthewd: thx
[08:37:55] enkristoffer: has joined #RubyOnRails
[08:38:13] pydave6367: has joined #RubyOnRails
[08:40:39] srinidhi: has joined #RubyOnRails
[08:41:03] gingray: has joined #RubyOnRails
[08:43:11] jenrzzz: has joined #RubyOnRails
[08:43:11] jenrzzz: has joined #RubyOnRails
[08:45:46] matthewd: mauro1254: See also https://github.com/PipelineDeals/rails_4_session_flash_backport/pull/1
[08:46:14] matthewd: mauro1254: I'm sure I recall a recent discussion on this somewhere, but I can't find it :/
[08:46:34] Circuit8: has joined #RubyOnRails
[08:47:26] mauro1254: matthewd: this is for rails4 => rails3, right?
[08:48:30] pawnbox: has joined #RubyOnRails
[08:48:42] moeabdol: has joined #RubyOnRails
[08:49:13] workmaster2n: has joined #RubyOnRails
[08:49:27] matthewd: mauro1254: It looks like it, yes. But it might give you enough of a clue to work out what's happening in your versions?
[08:53:43] dannyguk: has joined #RubyOnRails
[08:53:48] pydave6367: has joined #RubyOnRails
[08:53:58] pydave6367: has joined #RubyOnRails
[08:54:26] matthewd: mauro1254: .. you're not storing something crazy in your session, are you?
[08:54:47] marr: has joined #RubyOnRails
[08:55:53] artto: has joined #RubyOnRails
[08:56:11] yottanami: I am trying to deploy my code but I got this error ``ActiveRecord::StatementInvalid: PG::InsufficientPrivilege: ERROR: permission denied for relation schema_migrations` I am sure about Grant all privileges to my database
[08:56:24] elton: has joined #RubyOnRails
[08:57:15] matthewd: mauro1254: Can you show me a marshal value it's choking on?
[08:58:08] mauro1254: How can I do that?
[08:59:26] matthewd: Firstly, reproduce it with as minimal of a session value as possible
[08:59:51] matthewd: .. then find the row(s) for that session key in the appropriate DB table
[09:00:43] rogue_koder: has joined #RubyOnRails
[09:03:02] mauro1254: matthewd: I'm using json serializer
[09:03:26] patatas: has joined #RubyOnRails
[09:03:37] mauro1254: both rails 4.2 app and rails 5.0 one use :json
[09:04:29] rvanlieshout: are you storing full objects in session?
[09:04:44] matthewd: .. that's a marshal error :/
[09:05:15] patatas: any suggestions for additional security of a model's attribute..say, "balance". I don't want just any other process updating it. or..should i make it readable only except for..idk.
[09:07:04] rvanlieshout: patatas: any other process = also somebody who has access to the rails console?
[09:07:18] matthewd: patatas: Not writing code that updates it is normally the best choice. You could redefine #balance= to raise, so someone intending to write to it has to do something unusual, if you really can't trust yourself... but that's not an Actual Barrier.
[09:08:21] pydave6367: has joined #RubyOnRails
[09:08:34] c355E3B: has joined #RubyOnRails
[09:09:36] lxsameer: has joined #RubyOnRails
[09:12:34] mauro1254: matthewd: is it normal to have \n characters? I'm trying to base64 decode and then load with multi json
[09:13:10] snowy: has joined #RubyOnRails
[09:14:10] matthewd: Probably ¯\_(ツ)_/¯
[09:14:35] workmad3: has joined #RubyOnRails
[09:15:46] tvw: has joined #RubyOnRails
[09:16:00] Terens: patatas ntomatas
[09:16:27] mauro1254: Strange ... Looking at https://github.com/rails/activerecord-session_store/blob/master/lib/active_record/session_store.rb and I should not base64 decode ...
[09:17:48] matthewd: mauro1254: If it looks like it's base64, it's a pretty safe bet it is... but what do you see when you decode that? JSON, or Marshal?
[09:17:56] Z00t: has joined #RubyOnRails
[09:18:17] matthewd: mauro1254: Also, which app wrote the session and which one is reading it, when you get the dump format error?
[09:20:33] snoobydoo: has joined #RubyOnRails
[09:20:43] drptbl: has joined #RubyOnRails
[09:21:07] mauro1254: rails 4.2 wrote it and I'm trying to read the value through the console of that app
[09:21:58] mauro1254: rails 4.2.6 write the session, rails 5.0.0rc1 get the dump format error when trying to read the session
[09:24:46] ravster: has joined #RubyOnRails
[09:24:52] snoobydoo: I'm trying to setup two dbs and have followed this answer: http://stackoverflow.com/a/17312606/1951032 However, when I run migrations the migrations associated with the second db fail with 'PG::ConnectionBad' and 'ActiveRecord::StatementInvalid'
[09:25:12] snoobydoo: Does anyone have experience setting up multiple dbs? Thoughts on whats going wrong?
[09:27:54] jhass: snoobydoo: gist the full error messages
[09:29:10] artto: has joined #RubyOnRails
[09:30:52] mauro1254: matthewd: sorry, it is marshal
[09:31:25] mauro1254: matthewd: I could try to use json as serializer
[09:31:51] snoobydoo: jhass: https://gist.github.com/arvindravi/c1131178e985fbca0cc0ab1a088bf5a5 - Just realised the migrations are being run and the tables are created - but it ends with rake aborted? Not sure whats happening
[09:32:40] matthewd: That does seem likely to have a better chance of working... though I'm curious what the class is, if you're not putting weird things in there
[09:33:22] Ergo: has joined #RubyOnRails
[09:33:29] jhass: snoobydoo: something raised (StandardError, ugh) and somehow that did take the connection with it, AR tries to rollback but can't because the connection went down
[09:33:37] mauro1254: matthewd: I could try :hybrid for soft transition
[09:33:56] mauro1254: matthewd: Look at https://github.com/rails/activerecord-session_store/blob/master/lib/active_record/session_store.rb for details
[09:34:36] jhass: snoobydoo: any more output with --trace?
[09:35:41] matthewd: mauro1254: That'll help you move to json, but doesn't help with 5.0 compatibility if you can't unmarshal
[09:35:45] rogue_koder: has joined #RubyOnRails
[09:35:47] snoobydoo: should I rollback and run it with --trace again?
[09:36:53] jhass: snoobydoo: tbh not sure rollback will even work, I'd drop create and migrate again with trace
[09:39:55] snoobydoo: jhass: https://gist.github.com/arvindravi/c1131178e985fbca0cc0ab1a088bf5a5 - Updated Gist with --trace
[09:40:47] r1v3r_: has joined #RubyOnRails
[09:41:09] jhass: not really helpful
[09:41:20] jhass: are you able to tail the logs of your postgresql?
[09:41:58] jhass: also check if log/development.log has any more info
[09:43:41] snoobydoo: Ugh! I don't have logging enabled on postgres (I'm using the OSX Postgres app)
[09:45:06] snoobydoo: development.log - https://gist.github.com/arvindravi/9dedfbcceab82394f41e6d83910628f9
[09:45:17] snoobydoo: Doesn't seem very helpful though
[09:46:48] snoobydoo: jhass: ^ The gist has a tail of log/development.log
[09:48:19] jhass: not sure what to do at this point, enable postgresql logging?
[09:48:53] enkristoffer: has joined #RubyOnRails
[09:48:55] snoobydoo: Yeah just did, I'm going to drop-create-migrate again
[09:49:56] mdw: has joined #RubyOnRails
[09:50:55] drptbl: has joined #RubyOnRails
[09:53:53] jancel: has joined #RubyOnRails
[09:55:32] patatas: rvanlieshout matthewd -- i was thinking more like... if it is a direct update...meaning it's not from a method i trust, i will not perform it.
[09:55:36] patatas: or maybe im just paranoid
[09:56:41] weckl: has joined #RubyOnRails
[09:57:29] Terens: I am facing an error
[09:57:31] Terens: require "#{Rails.root}/lib/bootstrap_form/helpers/bootstrap"
[09:57:36] Terens: I have this and i get
[09:57:55] Terens: cannot load such file
[09:58:11] sevenseacat: does that file exist? :)
[10:00:26] Terens: yes it does . Ok I managed to load it
[10:00:34] Terens: however class_eval doesnt do antyhing
[10:03:00] soroot: has joined #RubyOnRails
[10:03:19] snoobydoo: jhass: The query the log ends with is 'STATEMENT: INSERT INTO "schema_migrations" ("version") VALUES ($1)', everything else above it seems normal
[10:03:31] jhass: huh, weird
[10:04:13] jhass: maybe get pry-rescue and wrap 20160613061736 and the one after it into it
[10:04:14] Oliphaunte: has joined #RubyOnRails
[10:04:51] arBmind: has joined #RubyOnRails
[10:06:07] snoobydoo: Should I just ignore this since migrations are running like they should?
[10:06:20] snoobydoo: Rake gets aborted and the error is thrown after they're migrated
[10:07:30] snoobydoo: There's no schema_migrations table in the second db though
[10:09:17] GreatDanton: has joined #RubyOnRails
[10:13:01] fox_mulder_cp: has joined #RubyOnRails
[10:13:03] snoobydoo: Should I wrap the entire migration within Pry.rescue?
[10:13:40] snoobydoo: I'm new to Pry, sorry.
[10:14:06] patatas_: has joined #RubyOnRails
[10:14:20] Sylario: I have a deploy.rb not restarting the app despite a restart task, what is missing ? : https://gist.github.com/bsylvain/a30fcc410b496201421d800a2778621a
[10:16:15] blackmesa: has joined #RubyOnRails
[10:16:29] patatas: has left #RubyOnRails: ()
[10:16:50] workmaster2n: has joined #RubyOnRails
[10:17:02] PotatoChipz: has joined #RubyOnRails
[10:19:29] pawnbox: has joined #RubyOnRails
[10:19:57] bruce_lee: has joined #RubyOnRails
[10:19:57] bruce_lee: has joined #RubyOnRails
[10:26:36] Hyuk: has joined #RubyOnRails
[10:27:15] jenrzzz: has joined #RubyOnRails
[10:27:40] Rodya_: has joined #RubyOnRails
[10:34:49] jenrzzz: has joined #RubyOnRails
[10:36:59] jhass: snoobydoo: I guess so but if you say the migration goes through...
[10:37:33] jhass: the schema_migrations table of your primary DB is used from my understanding
[10:39:37] snoobydoo: jhass: Apparently this is something that's being worked on: https://github.com/rails/rails/issues/14176
[10:40:07] snoobydoo: Found a gem called secondbase from the thread, I'm confused as to how to move forward now
[10:45:32] Kedare: has joined #RubyOnRails
[10:49:27] rodfersou: has joined #RubyOnRails
[10:51:03] jhass: snoobydoo: secondbase looks pretty solid from a quick look
[10:52:33] jhass: until official support that is
[10:52:47] d0nn1e: has joined #RubyOnRails
[10:53:06] Terens: has joined #RubyOnRails
[10:53:22] Terens: Hello how some people can write 400 lines per day ?
[10:53:37] snoobydoo: jhass: Yeah I think I'm going to go ahead with it, hopefully things go well. Thanks!
[10:54:02] jhass: Terens: using their keyboard
[10:54:04] KevinSjoberg: has joined #RubyOnRails
[10:55:38] defsdoor: has joined #RubyOnRails
[10:58:33] jhass: snoobydoo: only thing that bugs me a bit is that they didn't do the extra step of supporting an arbitrary number of databases
[11:01:17] snoobydoo: True, I was wondering the same thing
[11:01:21] AzaToth: has joined #RubyOnRails
[11:03:25] nettoweb: has joined #RubyOnRails
[11:05:50] ferr1: has joined #RubyOnRails
[11:11:40] tvw: has joined #RubyOnRails
[11:12:30] ishamo: has joined #RubyOnRails
[11:14:03] Z00t: has joined #RubyOnRails
[11:15:29] soroot: has joined #RubyOnRails
[11:16:57] Rodya_: has joined #RubyOnRails
[11:18:47] artto: has joined #RubyOnRails
[11:19:28] Z00t: has joined #RubyOnRails
[11:19:42] mdw7: has joined #RubyOnRails
[11:19:45] srinidhi: has joined #RubyOnRails
[11:21:43] mdw: has joined #RubyOnRails
[11:24:11] Z00t: has joined #RubyOnRails
[11:25:22] artto: has joined #RubyOnRails
[11:25:44] ravster: has joined #RubyOnRails
[11:25:50] Coldblackice: has joined #RubyOnRails
[11:26:35] chappy: has left #RubyOnRails: ("Leaving")
[11:29:05] Z00t: has joined #RubyOnRails
[11:30:57] ksoze: has joined #RubyOnRails
[11:33:56] Terens: I have a f.collection_select(:product_id ......)
[11:34:06] Terens: however validation of presence is at product
[11:34:07] kgrz: has joined #RubyOnRails
[11:34:17] Terens: how can that select grab validation ?
[11:35:34] artto: has joined #RubyOnRails
[11:37:46] roelof: has joined #RubyOnRails
[11:38:58] roelof: Why do I see this error message rake-11.1.2/lib/rake/task_manager.rb:71:in `[]' on this code : https://gist.github.com/rwobben/2b8d0d9ce80d829fb246bf35799565ba
[11:40:14] jhass: roelof: that's just part of the trace, the error is above
[11:42:31] roelof: jhass : I think you mean this one: Don't know how to build task 'create_database2' (see --tasks)
[11:42:39] jhass: roelof: no
[11:42:44] roelof: I do rake create_database2
[11:43:08] jhass: your task isn't loaded by your Rakefile then
[11:43:27] gingray: has joined #RubyOnRails
[11:43:33] jhass: (neither explicitly nor implicitly by rails for you)
[11:44:37] roelof: hmm, wierd, yesterday the task did run
[11:45:22] roelof: how can I find out why the task in not loaded
[11:46:10] jhass: by going through the codepath that you expect to load it
[11:46:32] lxsameer: has joined #RubyOnRails
[11:46:32] lxsameer: has joined #RubyOnRails
[11:46:37] ldnunes: has joined #RubyOnRails
[11:47:53] andywww: has left #RubyOnRails: ()
[11:48:25] roelof: oke, I know this task can be found at /lib/task
[11:49:27] bruce_lee: has joined #RubyOnRails
[11:49:29] Rodya_: has joined #RubyOnRails
[11:50:21] edwinvdgraaf: has joined #RubyOnRails
[11:52:02] Oliphaunte: has joined #RubyOnRails
[11:52:39] roelof: hmm, I do not see it, the task is in /lib/tasks , ends on .rake
[11:52:53] roelof: and I do defined it with desc and task
[11:53:20] roelof: see : desc 'read_database2'
[11:53:31] roelof: task read_database2: :environment do
[11:54:44] jhass: maybe you changed your Rakefile to remove Rails' task loading mechanism
[11:54:49] agit0: has joined #RubyOnRails
[11:55:18] roelof: I did not touch that part as far as I know
[11:55:38] roelof: I can check this on the rake file in the root directory ?
[11:56:35] jhass: there shouldn't be another one anywhere else
[11:56:40] roelof: that one looks like this : require File.expand_path('../config/application', __FILE__)
[11:56:50] roelof: Rails.application.load_tasks
[11:57:45] rodferso1: has joined #RubyOnRails
[11:58:13] qejk: has joined #RubyOnRails
[11:58:24] srinidhi: has joined #RubyOnRails
[11:59:31] jhass: that should load tasks in the correct place
[11:59:52] jord-n: has joined #RubyOnRails
[12:00:15] blackmesa: has joined #RubyOnRails
[12:00:50] KevinSjoberg: has joined #RubyOnRails
[12:03:35] roelof: jhass: any ideas left to solve this ?
[12:03:59] Rodya_: has joined #RubyOnRails
[12:04:12] jhass: there's nothing to suggest from the information you provided
[12:04:35] roelof: maybe I put the code on github ?
[12:05:35] PotatoChipz: has left #RubyOnRails: ()
[12:07:41] mauro1254: matthewd: the issue I had has to do with marshal. I solved defining an initializer with the following instruction: ActiveRecord::SessionStore::Session.serializer = :hybrid
[12:09:01] qejk: has joined #RubyOnRails
[12:09:06] KevinSjoberg: has joined #RubyOnRails
[12:09:30] eljimmy: has joined #RubyOnRails
[12:10:20] roelof: jhass : I see something wierd. when I do rake read_database2. I see this one the first line ((in /home/ubuntu/workspace)
[12:10:56] roelof: is rake maybe looking in the root directory instead of the lib/tasks directory ?
[12:12:02] k3rn31: has joined #RubyOnRails
[12:14:45] srinidhi: has joined #RubyOnRails
[12:15:32] jhass: rake itself never looks into any directories
[12:15:40] jhass: Rails does
[12:16:35] shinnya: has joined #RubyOnRails
[12:18:40] roelof: very wierd case. I did not change anything , yesterday I worked fine , now it refuse to work
[12:19:27] roelof: maybe I will put it on github and fire up a linux distro and look if my development is messed up
[12:19:51] KevinSjoberg: has joined #RubyOnRails
[12:20:04] flashpoint9: has joined #RubyOnRails
[12:24:03] truenito: has joined #RubyOnRails
[12:25:06] ksoze: has joined #RubyOnRails
[12:25:51] AimlessRAven: has joined #RubyOnRails
[12:26:00] workmaster2n: has joined #RubyOnRails
[12:26:09] KevinSjoberg: has joined #RubyOnRails
[12:28:13] Oliphaunte: has joined #RubyOnRails
[12:28:24] roelof: jhass: still a very wierd problem. How can I task not work suddenly when nothing has changed
[12:28:45] jhass: simple: your assumption that nothing changed is wrong
[12:29:15] artto: has joined #RubyOnRails
[12:29:29] Z00t: has joined #RubyOnRails
[12:29:34] tknz: has joined #RubyOnRails
[12:29:55] roelof: I run the task yesterday evening and it worked fine. Then I goto sleep , fire up my computer and did the task again and it failed
[12:30:13] roelof: how can there be a change in a computer that is not on
[12:32:11] universa1: roelof: time.
[12:32:27] universa1: roelof: as the most obvious thing, that has changed between now and yesterday evening.
[12:32:44] roelof: :) a good one, universal
[12:32:56] roelof: but time does not change code
[12:33:13] jhass: it can change its behavior
[12:33:24] soroot: has joined #RubyOnRails
[12:33:32] jhass: another thing that changed is that all processes running on your computer were killed and restarted
[12:33:58] roelof: jhass: that is right
[12:34:31] Guest6988: has joined #RubyOnRails
[12:35:01] Z00t: has joined #RubyOnRails
[12:35:14] dannyguk: has joined #RubyOnRails
[12:35:33] KevinSjoberg: has joined #RubyOnRails
[12:36:22] diegoviola: has joined #RubyOnRails
[12:36:28] roelof: still a wierd issue. If I put all the code on github , can one of both take a look if you see something wierd
[12:36:37] sergey_makagon: has joined #RubyOnRails
[12:37:18] jenrzzz: has joined #RubyOnRails
[12:37:19] jgt: has joined #RubyOnRails
[12:39:32] Z00t: has joined #RubyOnRails
[12:39:50] BaNzounet: If I've a has_many relations let's say coupons, when I do user.coupons the request is going to be WHERE user_id = ?, but now I want to chain .coupons with another scope, is it possible to get the user_id in that scope too? -> coupons.valid (and valid has a subquery like .where('... (SELECT ... WHERE user_id = ?)), how can I get user_id there without passing it to my scope ?
[12:43:19] jmignault: has joined #RubyOnRails
[12:44:17] matthewd: BaNzounet: You need the user_id *inside* the scope? What does the scope look like? :/
[12:44:27] Holek_: has joined #RubyOnRails
[12:44:35] Z00t: has joined #RubyOnRails
[12:47:03] rvanlieshout: BaNzounet: user.coupons.valid
[12:47:55] Holek_: has left #RubyOnRails: ()
[12:49:25] BaNzounet: matthewd: https://gist.github.com/AlexGaspar/a944520915d6f15a76fa004d1294f56e
[12:50:21] BaNzounet: That what I want to achieve but currently I've to pass the user_id to .valid, e.g. user.coupons.valid(user.user_id)
[12:50:38] Z00t: has joined #RubyOnRails
[12:51:20] ramortegui: has joined #RubyOnRails
[12:51:49] Malgorath: has joined #RubyOnRails
[12:53:00] KevinSjoberg: has joined #RubyOnRails
[12:54:32] kali3: has joined #RubyOnRails
[12:55:19] Oliphaunte: has joined #RubyOnRails
[12:55:43] Z00t: has joined #RubyOnRails
[12:57:21] acovrig: has joined #RubyOnRails
[12:58:25] Malgorath: has joined #RubyOnRails
[12:58:30] mr-spoon: has joined #RubyOnRails
[12:59:58] norfumpit: has joined #RubyOnRails
[13:00:24] Z00t: has joined #RubyOnRails
[13:01:05] kali3: has left #RubyOnRails: ("Leaving")
[13:02:43] matthewd: BaNzounet: I think I'd suggest renaming that to e.g. valid_for_user, then: `has_many :coupons do; def valid; valid_for_user(proxy_association.owner); end; end`
[13:03:51] alfiemax: has joined #RubyOnRails
[13:04:33] blackmesa: has joined #RubyOnRails
[13:04:36] Z00t: has joined #RubyOnRails
[13:05:32] roamingdog: has joined #RubyOnRails
[13:06:47] neha-: has joined #RubyOnRails
[13:07:37] nettoweb: has joined #RubyOnRails
[13:07:53] jancel: has joined #RubyOnRails
[13:08:19] Z00t: has joined #RubyOnRails
[13:09:56] arup_r: has joined #RubyOnRails
[13:11:20] roamingdog: has joined #RubyOnRails
[13:13:15] Z00t: has joined #RubyOnRails
[13:13:30] incidence: has joined #RubyOnRails
[13:13:47] Gizmokid2005: has joined #RubyOnRails
[13:18:23] Oliphaunte: has joined #RubyOnRails
[13:18:38] mauro1254: matthewd: thx for the help ;) have a nice day
[13:19:18] ksoze: has joined #RubyOnRails
[13:20:13] diegoviola: I'm trying to design a very simple booking app, but I have no idea how to design the models, especially the part where a user can book for a room/whatever
[13:20:20] BaNzounet: matthewd: th
[13:20:27] diegoviola: can someone give me a light on that, please?
[13:22:24] Z00t: has joined #RubyOnRails
[13:22:37] rbr: has joined #RubyOnRails
[13:23:23] arup_r: diegoviola: I hope you have a project document for this task, you need to read that and break it into sensible modules.
[13:23:45] arup_r: otherwise any general idea might work or might not for you
[13:24:03] alfiemax: has joined #RubyOnRails
[13:26:21] ravster: has joined #RubyOnRails
[13:27:14] sergio_101: has joined #RubyOnRails
[13:27:55] elton: has joined #RubyOnRails
[13:30:05] timmyBsd: has joined #RubyOnRails
[13:30:38] arup_r: s/modules/models
[13:30:44] Z00t: has joined #RubyOnRails
[13:30:54] diegoviola: arup_r: yeah.. thanks
[13:32:20] KevinSjoberg: has joined #RubyOnRails
[13:33:11] quazimodo: has joined #RubyOnRails
[13:37:02] Z00t: has joined #RubyOnRails
[13:39:15] jenrzzz: has joined #RubyOnRails
[13:40:18] aegis3121: has joined #RubyOnRails
[13:42:28] Axsuul: has joined #RubyOnRails
[13:43:39] lxsameer: has joined #RubyOnRails
[13:44:21] ravster: has joined #RubyOnRails
[13:44:38] roamingdog: diegoviola: models: Booking, Room, User
[13:45:11] roamingdog: diegoviola: user has_many bookings, has_many rooms through: bookings etc etc
[13:47:37] dblessing: has joined #RubyOnRails
[13:48:32] roamingdog: has joined #RubyOnRails
[13:48:49] jancel: has joined #RubyOnRails
[13:49:41] n1lo: has joined #RubyOnRails
[13:54:20] maxz: has joined #RubyOnRails
[13:55:11] roamingdog: has joined #RubyOnRails
[13:58:08] Z00t: has joined #RubyOnRails
[13:59:22] sevenseacat: what arup_r said
[14:01:01] diegoviola: I'll give that a try, thanks
[14:02:56] rafaelfranca: has joined #RubyOnRails
[14:03:55] arup_r: has joined #RubyOnRails
[14:05:05] alfiemax: has joined #RubyOnRails
[14:05:21] Z00t: has joined #RubyOnRails
[14:05:47] acovrig: I have a rails API w/devise, and can login just fine from angularjs’s $http.post(), an android app, a Titanium app, and a ionic app; however in Titanium and ionic, when I login, logout, and try to login again, I get `Filter chain halted as :require_no_authentication rendered or redirected` any ideas why?
[14:06:26] mustmodify: has joined #RubyOnRails
[14:07:44] mustmodify: Has someone written a tool that will parse and chunk a large-ish logfile by week or month? So if I have a 1G log file because I neglected to set up log rotation, can I retroactively fix that without too much work? ;)
[14:08:24] rubyhatesme: has joined #RubyOnRails
[14:08:36] rubyhatesme: does anyone know where i can get information on mailchimp/mandrillapp?
[14:09:05] Akuma: has joined #RubyOnRails
[14:10:42] Z00t: has joined #RubyOnRails
[14:10:56] GreekFreak: has joined #RubyOnRails
[14:11:04] qejk: has joined #RubyOnRails
[14:11:41] jhack: has joined #RubyOnRails
[14:12:05] arup_r: GreekFreak: hello! :)
[14:12:20] jgt: has joined #RubyOnRails
[14:12:50] GreekFreak: I am using Rails 3.2.18 and have upgraded to MySQL 5.7. My rake db:migrate did not work so I added "class ActiveRecord::ConnectionAdapters::Mysql2Adapter
[14:12:50] GreekFreak: NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"
[14:12:50] GreekFreak: end" Now it won't start my server complaining that NATIVE_DATABASE_TYPES is an uninitialized constant. Any advice?
[14:13:15] SteenJobs: has joined #RubyOnRails
[14:13:17] arup_r: rubyhatesme: if you click the *more* link here http://mailchimp.com/, u will see plenty
[14:13:21] ksoze: has joined #RubyOnRails
[14:14:03] arup_r: where u saw NATIVE_DATABASE_TYPES constant, I mean where it is defined?
[14:14:06] rubyhatesme: i just need to know if using test mode disables the normal mode
[14:14:17] SteenJobs: anyone have luck using wrap() with nokogiri to wrap elements in an erb node?
[14:14:33] SteenJobs: trying to embed stuff inside of a link_to block
[14:14:50] GreekFreak: arup_r, I didn't define it. Online people recommend that "monkey patch". I assume it's defined in Ruby Core?
[14:15:10] arup_r: oh, no idea. I have to google it.. :)
[14:15:21] GreekFreak: arup_r, hold on
[14:15:28] clandry94: has joined #RubyOnRails
[14:15:39] arup_r: so ur current mysql gem is not compatible with upgrade mysql native?
[14:15:54] Z00t: has joined #RubyOnRails
[14:16:00] Markhor1991: has joined #RubyOnRails
[14:16:03] workmad3: GreekFreak: did you recompile mysql2 after upgrading MySQL?
[14:16:16] adavia: has joined #RubyOnRails
[14:16:18] arup_r: hm. good thinking.
[14:16:44] helpa: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[14:16:54] macsteps: has joined #RubyOnRails
[14:16:54] GreekFreak: arup_r, here's one example: http://stackoverflow.com/questions/33742967/primary-key-issue-with-creating-tables-in-rails-using-rake-dbmigrate-command-wi
[14:17:04] agent_white: has joined #RubyOnRails
[14:17:07] GreekFreak: arup_r, here's another: http://stackoverflow.com/questions/33755062/mysql-5-7-9-rails-3-2-mysql2-0-3-20
[14:17:08] arup_r: answer workmad3 first.. :)
[14:17:15] SteenJobs: figured it out, all good :D
[14:17:44] GreekFreak: matthewd, sorry didn't see it. Server wont' start with the following error: "`<class:Mysql2Adapter>': uninitialized constant ActiveRecord::ConnectionAdapters::Mysql2Adapter::NATIVE_DATABASE_TYPES (NameError)"
[14:18:11] matthewd: GreekFreak: That's what happened when you tried a random solution from the Internet. What was the original problem?
[14:18:34] GreekFreak: workmad3, yes I did. I have been working with mysql2 for a few days now after the update. Suddenly it started complaining about PRIMARY keys
[14:18:53] GreekFreak: ok hold on. Let me recreate it so that you can see the original error
[14:21:04] Z00t: has joined #RubyOnRails
[14:22:02] chipotle: has joined #RubyOnRails
[14:22:39] GreekFreak: arup_r, workmad3, matthewd, I took the setup back to what it was with the original error (before I added that monkey patch) and now it works without the original error. Sorry for wasting your time guys... If it happens again I'll drop a message again
[14:23:25] hardtail: has joined #RubyOnRails
[14:25:10] techsethi: has joined #RubyOnRails
[14:25:18] workmad3: GreekFreak: ah, I missed that you'd added a monkey-patch and it was that which failed
[14:25:19] mustmodify: [cross-posted from #ruby] So it looks like if I ask Ruby stdlib logger to rotate daily or weekly, if there's already a file there, it'll assume that file is from the previous day/week/month. Is there a way to have it check the file creation date?
[14:25:33] workmad3: GreekFreak: most likely, you grabbed a chunk of code intended for either an earlier or a later version of rails
[14:26:04] GreekFreak: workmad3, I'll keep that in mind for next time. Thanks
[14:26:53] frem_: has joined #RubyOnRails
[14:27:31] workmad3: GreekFreak: always a problem when you're working with an old and pretty unsupported version of rails
[14:28:35] GreekFreak: workmad3, I've noticed. But it's such a mamoth project that I need to dedicate time to upgrade it and test it properly. It feels like I'll have to rewrite the whole project
[14:31:16] fedruantine: has joined #RubyOnRails
[14:32:07] sk0r: has joined #RubyOnRails
[14:32:07] GreekFreak: workmad3, Ok it's back. Here is the error: Mysql2::Error: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead: CREATE TABLE `port_agents_da_item_categories` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `description` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB/home/theo/.rvm/gems/ruby-2.0.0-p195@admin_base/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:i
[14:33:38] k3rn31: has joined #RubyOnRails
[14:35:39] konsolebox: has joined #RubyOnRails
[14:36:38] workmad3: GreekFreak: right, so that appears to be because the primary key for mysql's adapter in 3.2 has a DEFAULT NULL value, which MySQL 5.7 isn't allowing
[14:36:48] workmad3: GreekFreak: https://github.com/rails/rails/blob/3-2-stable/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb#L114 <-- there's the exact line of code
[14:37:35] konsolebox: has joined #RubyOnRails
[14:37:55] jhass: why did it have that anyway oO
[14:38:04] workmad3: GreekFreak: you might be able to resolve it by doing `ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"` inside an initializer
[14:38:15] Ergo^: has joined #RubyOnRails
[14:38:43] workmad3: jhass: looking at the git blame, it seems to be a holdover from 2011 when the adapter was initially created, so probably just an oversight :)
[14:38:48] arup_r: hacking some good code is good like that? just asking
[14:39:11] workmad3: and mysql never complained by default...
[14:39:16] workmad3: (I hate mysql)
[14:39:52] GreekFreak: workmad3, ok the monkey patch I had was exactly what you suggest. I'll try it again by copy/pasting yours and then I'll restart the server and see if throws the same error as before
[14:40:20] rubyonrails668: has joined #RubyOnRails
[14:41:48] rubyhatesme: has left #RubyOnRails: ()
[14:41:52] workmad3: GreekFreak: no, yours was on the Mysql2Adapter not the AbstractMysqlAdapter, and was reopening the class to try and access the constant (which means you were dealing with potentially different constant lookup rules)
[14:43:17] rubyonrails668: I'm using this code here https://gist.github.com/rivacom/4159aad72367fe589933f30d6349d195 , I have two tables, one with player id / name and one with daily stats for each player. I'm trying to get top player based on the maximum sum of all players(choosing the top player) but I think i must be missing something. Can anyone take a peak?
[14:43:19] GreekFreak: workmad3, Oh! ok. So I created a file in my initializer and I just pasted your line in there as is (I didn't create a class - wasn't sure if I should). Now the migration works but when I try to start the server I get: `<top (required)>': uninitialized constant ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter (NameError)
[14:43:21] ekinmur: has joined #RubyOnRails
[14:43:23] guidocalvano: has joined #RubyOnRails
[14:43:59] workmad3: GreekFreak: hmm... ok, that sounds like the initializer is trying to load before ActiveRecord...
[14:44:29] elton: has joined #RubyOnRails
[14:44:40] workmad3: GreekFreak: try wrapping it in `ActiveSupport.on_load(:active_record) do ... end`
[14:47:06] GreekFreak: workmad3, ok while you were typing I tried the following: I named the file "abstract_mysql_adapter.rb", and I put the following in it: "class ActiveRecord::ConnectionAdapters::MysqlAdapter
[14:47:06] GreekFreak: NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"
[14:47:07] GreekFreak: end". I got the error when trying to start the server: /media/theo/0AB208293E62A107/Platform/code/admin_base/config/initializers/abstract_mysql_adapter.rb:2:in `<class:AbstractMysqlAdapter>': uninitialized constant ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::NATIVE_DATABASE_TYPES (NameError)
[14:47:37] mostlybadfly: has joined #RubyOnRails
[14:47:40] croberts: has joined #RubyOnRails
[14:47:42] GreekFreak: in some help someone said that this should appear after the "ActiveRecord.initialize!" or something
[14:48:13] workmad3: GreekFreak: that's the point of doing it in an `on_load`... it delays the block until after ActiveRecord has been loaded
[14:49:23] alfiemax: has joined #RubyOnRails
[14:49:26] workmad3: GreekFreak: so maybe rather than reporting on trying something different to the suggestion (and was in no substantial way different from the previous code), you could report on what happens with the suggested code
[14:50:16] Terens: Does premailer work with foundation email?
[14:51:01] GreekFreak: workmad3, I tried that. Same error. Sorry, I should've said so
[14:51:24] workmad3: GreekFreak: correct, you should have... it's really difficult to help if you don't provide accurate information
[14:51:24] GreekFreak: `<class:AbstractMysqlAdapter>': uninitialized constant ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::NATIVE_DATABASE_TYPES (NameError)
[14:51:36] yellow5: has joined #RubyOnRails
[14:52:35] GreekFreak: workmad3, sorry, I was trying to put the code in lib/patches and then require it in my environment.rb, as suggested here: https://github.com/rails/rails/pull/13247
[14:53:19] guidocalvano: I am a noob in ruby, and want to know how to do something that should be easy…
[14:53:26] SteenJobs: if you want to use a stylesheet_link_tag and avoid the asset pipeline, what directory would you put those assets in?
[14:53:52] guidocalvano: I want to ask via the command line what controller is behind a given url
[14:54:11] guidocalvano: there is some code that interprets the url
[14:55:12] workmad3: GreekFreak: right... that also isn't what I suggested
[14:55:18] workmad3: GreekFreak: I said put it in an initializer...
[14:55:34] workmad3: GreekFreak: because you need it to happen in the initialization process...
[14:55:51] guidocalvano: so what I want is some shell command ‘get_controller -u /my/path/after/the/host’
[14:56:38] Jasaka: has joined #RubyOnRails
[14:57:01] guidocalvano: that returns the controller and action
[15:00:26] GreekFreak: workmad3, I had mentioned I tried that and it didn't work. However I now noticed I had a typo. So I did the following, as per your suggestion and it works: I named the file 'abstract_mysql_adapter.rb' and in it I have the following: ActiveSupport.on_load(:active_record) do
[15:00:26] GreekFreak: ActiveRecord::ConnectionAdapters::NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"
[15:00:26] GreekFreak: . It Works!!!
[15:00:51] GreekFreak: server starts but now my rake db:migrate won't work
[15:01:15] GreekFreak: workmad3, rake aborted!
[15:01:15] GreekFreak: NameError: uninitialized constant ActiveRecord::ConnectionAdapters::NATIVE_DATABASE_TYPES
[15:01:16] rafaelfranca: has joined #RubyOnRails
[15:01:37] rafaelfranca: has joined #RubyOnRails
[15:01:39] cschneid: has joined #RubyOnRails
[15:01:53] ksoze: has joined #RubyOnRails
[15:01:55] jancel: has joined #RubyOnRails
[15:01:56] d1rewolf: hi all. Using rails_admin, is there a way to change what fields are used when searching for an association on an object's Edit page? I've added a "def label" but it doesn't appear to use this for search
[15:02:38] prithaj: has joined #RubyOnRails
[15:03:28] workmad3: GreekFreak: ... that's because you've once again screwed up the line
[15:03:39] GreekFreak: workmad3, Ok so I did a mix and it works for both migrations and starting the server.
[15:03:58] Oliphaunte: has joined #RubyOnRails
[15:04:04] GreekFreak: workmad3, In the file I now have: ActiveSupport.on_load(:active_record) do
[15:04:05] GreekFreak: class ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter
[15:04:05] GreekFreak: NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"
[15:04:18] workmad3: GreekFreak: also, please stop pasting code into the channel
[15:05:18] aegis3121: has joined #RubyOnRails
[15:05:20] GreekFreak: workmad3, ok. I thought since it's short it's ok. Could you show me how I screwed up the line?
[15:05:35] workmad3: GreekFreak: you skipped out an entire class
[15:06:14] workmad3: GreekFreak: `ActiveRecord::ConnectionAdapters::NATIVE_DATABASE_TYPES` was what you typed and showed... but it should be `ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::NATIVE_DATABASE_TYPES`
[15:06:37] workmad3: GreekFreak: which you then somehow managed to restore when claiming that a modification worked...
[15:07:07] chouhoulis: has joined #RubyOnRails
[15:07:44] workmad3: GreekFreak: the end result is that you're managing to claim that equivalent code in slightly different forms works in one case and doesn't in another... but taking a long time doing so, and giving garbled info on what exactly you're trying in the interim...
[15:07:53] workmad3: GreekFreak: which makes it very very difficult to help you out...
[15:08:26] roamingdog: has joined #RubyOnRails
[15:08:41] GreekFreak: workmad3, I recopied and pasted your code as I assumed I mistyped it. I pasted the final thing here: https://gist.github.com/tscholiadis/9c0c6751a3aef87fc07d4147300bc266 Could you check that it's ok?
[15:09:06] workmad3: GreekFreak: afaict, that looks about right
[15:09:24] GreekFreak: workmad3, it works. Thank you for your help and patience!
[15:11:32] rubyonrails668: I'm using this code here https://gist.github.com/rivacom/4159aad72367fe589933f30d6349d195 , I have two tables, one with player id / name and one with daily stats for each player. I'm trying to get top player based on the maximum sum of all players(choosing the top player) but I think i must be missing something. Can anyone take a peek?
[15:12:57] roamingdog: rubyonrails668: i peeked earlier, what do you get when you run that code?
[15:13:07] workmad3: GreekFreak: no probs... just next time, double-check what you're doing against suggestions before saying "It doesn't work" and trying random alternatives
[15:13:38] rubyonrails668: roamingdog, nothing just shows a blank on the page
[15:14:01] GreekFreak: workmad3, will do
[15:14:01] roamingdog: rubyonrails668: your controller is call 'infodataController' and that works?
[15:14:44] roamingdog: rubyonrails668: and what does 'User.id do' mean?
[15:16:06] roamingdog: since 'infodataController' starts with a lowercase letter, i'd expect an error
[15:17:22] rubyonrails668: Looping through all the player(forgot to change it back to player model) but it's suppose to loop through each player, and add all the games played up
[15:18:10] roamingdog: rubyonrails668: can you update the gist with actual code
[15:19:30] rubyonrails668: https://gist.github.com/rivacom/4c834835141411cb621825118bb73fb8
[15:20:11] roamingdog: that's some strange looking code i'm afraid
[15:20:42] roamingdog: rubyonrails668: suggest you try things in console to see what output you're getting
[15:22:24] roamingdog: rubyonrails668: in console type Player.id and hit enter for a start
[15:22:41] tubbo: set private on
[15:22:49] tubbo: haha wrong window :D
[15:23:09] roamingdog: tubbo: we'll respect your privacy nonetheless
[15:23:13] pwnd_nsfw: has joined #RubyOnRails
[15:23:32] tubbo: nah it's just a bitlbee config to open new messages in query windows
[15:23:44] rubyonrails668: roamingdog: well if i replace ID with a id from the table it works fine.
[15:23:59] rubyonrails668: is <%= @gamesplayed %> the correct syntax to output the value?
[15:24:31] roamingdog: rubyonrails668: that parts fine
[15:24:45] roamingdog: rubyonrails668: is this for one player?
[15:26:31] chipotle: has joined #RubyOnRails
[15:26:55] rubyonrails668: There are multiple players
[15:27:05] rubyonrails668: but i'm just trying it with 1 for now
[15:27:20] roamingdog: rubyonrails668: what did you get, in console, for Player.id?
[15:27:25] agit0: has joined #RubyOnRails
[15:27:29] chopin: has joined #RubyOnRails
[15:27:57] rubyonrails668: it errored and said use ids
[15:28:05] rubyonrails668: so i tried Player.ids and it worked
[15:28:35] rubyonrails668: so i remove the do loop, and just tried @gamesplayed = Dailystat.where(:id => 1 ).sum(:gamesplayed).to_i and it outputs in console but not for the html page
[15:28:47] Ergo: has joined #RubyOnRails
[15:30:02] roamingdog: rubyonrails668: Player.ids gives you an array of ids, Player.id is meaningless. update gist with what you've got now? if works in console, should work in the app
[15:30:49] rubyonrails668: https://gist.github.com/rivacom/e8776e9a1dadf11b365807d3e034cfbe
[15:31:02] chouhoulis: has joined #RubyOnRails
[15:31:35] roamingdog: rubyonrails668: that looks fine, what's it doing? blank page still? maybe something wrong with your view
[15:32:00] rubyonrails668: well the page loads, just not that value
[15:32:15] rubyonrails668: should be 244 but it shows blank on the page where that value should be
[15:32:49] safetypin: has joined #RubyOnRails
[15:32:57] roamingdog: rubyonrails668: i dunno, if me, i'd check the page source
[15:33:04] iamvery_: has joined #RubyOnRails
[15:33:27] leira: has joined #RubyOnRails
[15:34:34] roamingdog: .sum(:gamesplayed) returns an integer btw, no need for .to_i there
[15:35:34] rubyonrails668: Is there a easy way to return the top maximum sum of all players?
[15:36:28] rubyonrails668: Just the top 1 player out of all players
[15:39:14] hobodave: has joined #RubyOnRails
[15:39:59] Criten: has joined #RubyOnRails
[15:40:07] Criten: Hey guys! long time no see.
[15:40:39] Criten: I'm trying to call .render on a generated controller (ApplicationController.new.render) and it works great, but i dont seem to have access to the path helpers
[15:40:43] Criten: any way to inject those?
[15:40:46] jenrzzz: has joined #RubyOnRails
[15:40:46] jenrzzz: has joined #RubyOnRails
[15:41:55] d1rewolf: has joined #RubyOnRails
[15:42:06] Markhor1991: has joined #RubyOnRails
[15:43:05] dionysus69: has joined #RubyOnRails
[15:43:39] arup_r: from where you are calling that?
[15:43:40] SteenJobs: is it possible to precompile assets by passing a directory name? it’s not working for me when passing navbar/*
[15:43:56] diegoaguilar: has joined #RubyOnRails
[15:44:34] matthewd: SteenJobs: No. Why do you think you want to?
[15:45:05] elton: has joined #RubyOnRails
[15:45:32] SteenJobs: matthewd: because there are naming conflicts between stylesheets i received from the designer (each view has its own stylesheet, but they repeat the same id and class names, but defined differently), and need to load them on a per view basis
[15:45:42] SteenJobs: which means they can’t be part of the asset pipeline
[15:45:48] Axsuul: has joined #RubyOnRails
[15:46:54] matthewd: I'm not sure how that follows
[15:46:55] SteenJobs: matthewd: open to other appraoches (hence the “why do you ‘think’” haha)
[15:47:48] matthewd: The asset pipeline is perfectly capable of generating multiple stylesheets
[15:48:32] jhass: SteenJobs: other approach would be to do a layout for each
[15:48:37] jhass: see nested layouts
[15:48:54] SteenJobs: matthewd: if it’s in the asset pipeline, won’t the styles be applied to every view?
[15:49:03] SteenJobs: jhass: thanks b. will check it out now.
[15:49:04] jhass: or if it's really just a single view per stylesheet just content_for :head in it
[15:49:16] agit0: has joined #RubyOnRails
[15:49:18] pawnbox: has joined #RubyOnRails
[15:49:22] SteenJobs: jhass: really each view has 5 corresponding stylesheets
[15:49:30] tjbiddle: has joined #RubyOnRails
[15:49:32] matthewd: SteenJobs: No
[15:49:36] SteenJobs: but they all have the same naming which is why i need to apply them to views independently
[15:49:48] SteenJobs: matthewd: then i was mistaken - how can i have the assets in the pipeline and apply them selectively then?
[15:49:50] jhass: yeah just content_for :head then
[15:49:59] Criten: arup_r: i'm calling it via my own library
[15:50:18] jhass: I mean you could probably do some crazy stuff like reading the current route in your layout and guessing the right namespace from it
[15:50:26] jhass: but sometimes explicitness beats smartness
[15:50:34] arup_r: Criten: U need to include them http://stackoverflow.com/a/5456103/2767755
[15:50:39] Criten: arup_r: https://gist.github.com/ZackMattor/bdf201a290e4c0396d2b74ea0a4ed718
[15:50:45] matthewd: SteenJobs: You put the stylesheets in app/stylesheets/, add each to config.assets.precompile, then reference them individually from your views (presumably just as you are now)
[15:51:34] pawnbox: has joined #RubyOnRails
[15:51:41] SteenJobs: matthewd: haha that’s what i did!
[15:51:47] disgrntld: has joined #RubyOnRails
[15:52:16] SteenJobs: matthewd: so the original q was instead of listing each stylesheet, i was hoping i could list the directory
[15:52:30] SteenJobs: although if i end up adding a bunch of precompiled assets, that really woujld slow rendering, right?
[15:52:58] jhass: the proper solution would be to kick your designers ass :P
[15:53:02] matthewd: SteenJobs: Oh... "passing" == "adding to precompile array"?!
[15:53:13] SteenJobs: sorry about that
[15:53:16] SteenJobs: what’d you think i meant?
[15:53:21] jhass: and have them use a class on body and namespace everything within
[15:53:29] SteenJobs: jhass: if only my designer wasn’t one of the founders and maybe knew a single thing about css...
[15:53:42] Criten: arup_r: hmm.. alright getting closer. I swore i tried that before... i'm getting some error with default_url_options not being defined...
[15:53:48] Criten: I know you need to set the :host option manually.
[15:53:59] jhass: SteenJobs: well they hired you for the complex stuff... no? :P
[15:54:03] SteenJobs: jhass: i’ve already written scripts to replace all <img> and <a> tags with corresponding erb
[15:54:05] Z00t: has joined #RubyOnRails
[15:54:38] SteenJobs: do you think adding all these assets to precompile array will slow things down because of multiple files rather than one?
[15:54:48] snoobydoo: has joined #RubyOnRails
[15:54:51] matthewd: I read it as passing on the command line (to the rake task), to build a subset of assets somehow
[15:55:27] SteenJobs: matthewd: hahaha yea not that
[15:55:30] matthewd: Compiling more files will probably be slower than compiling fewer... but maybe not by enough to warrant finding an alternative solution
[15:55:32] jhass: SteenJobs: it causes more client requests for sure
[15:55:40] jhass: not per page but per user session
[15:55:45] manfrin: has joined #RubyOnRails
[15:56:02] matthewd: You can add a regular expression to the array, if you want to match multiple files without naming them individually
[15:56:03] tjbiddle_: has joined #RubyOnRails
[15:56:14] KevinSjoberg: has joined #RubyOnRails
[15:56:14] SteenJobs: matthewd: couldn’t have asked for a better answer - since my question isn’t in a vacuum, it’s relevance is based on the cost/benefit of finding an alternative
[15:56:29] SteenJobs: matthewd: aright. i guess not a big deal to just type in a few extra filenames
[15:56:33] jhass: matthewd: well, glob pattern not regexp actually iirc?
[15:57:20] jhass: SteenJobs: what you probably should do is to at least have one "meta" file per view for your 5 style sheets that either @import's or //= require's the others
[15:57:34] jhass: to at least limit the amount of requests somewhat
[15:58:03] jhass: and also your boilerplate in the views, since you then just have to include that meta thing
[15:58:04] SteenJobs: jhass: ah that’s a good point, yea there should be a single manifest for each and this way i can get it down to 1 asset/page instead of 5
[15:58:28] jhass: you'll also have only the manifest to add to the precompile list then
[15:58:42] pawnbox: has joined #RubyOnRails
[15:58:54] jhass: and probably can do something like app/assets/stylesheets/*/main.scss
[15:59:00] lxsameer: has joined #RubyOnRails
[15:59:22] rogue_koder: has joined #RubyOnRails
[15:59:49] kitsuneyo: has joined #RubyOnRails
[16:00:09] kitsuneyo: do you guys use validates_associated?
[16:00:44] kitsuneyo: why do you have to specify it separately?
[16:00:52] SteenJobs: jhass: where would the manifest file need to be placed?
[16:01:04] jhass: alongside the five
[16:01:22] jhass: and then you can even just have it do require_tree . I guess
[16:01:40] hobodave_: has joined #RubyOnRails
[16:02:12] Tref: has joined #RubyOnRails
[16:05:06] hobodave: has joined #RubyOnRails
[16:05:24] SteenJobs: jhass: right, and add the manifest to precompile. perf. thanks as always.
[16:07:31] roelof: has joined #RubyOnRails
[16:08:34] roelof: hello, I have to read some 4.7 k responses from a external source. I do it now sequential but every time around 50% it looks like there are hiccups
[16:08:58] roelof: so I get error messages that are not right. How can I deal with this problem ?
[16:09:23] jhass: that depends on your actual problem
[16:10:31] roelof: the actual problem is that sometimes data is not found which should be there and is there , jhass
[16:10:36] agit0: has joined #RubyOnRails
[16:10:58] roelof: like this error message : NoMethodError: undefined method `find' for nil:NilClass
[16:11:18] roelof: which should come from this one: url = "https://www.rijksmuseum.nl/api/nl/collection/NUMBER/tiles?key=14OGzuak&format=json".gsub("NUMBER", number)
[16:12:29] jhass: then you should check whether it's there before calling .find on it
[16:15:33] kitsuneyo: has joined #RubyOnRails
[16:16:16] Z00t: has joined #RubyOnRails
[16:16:51] roelof: on the first 2000 this works well, jhasss
[16:16:55] creature: has joined #RubyOnRails
[16:16:55] creature: has joined #RubyOnRails
[16:17:39] roelof: and when I call the request from my own browser I see everything I need
[16:18:59] roelof: maybe the use of a loop takes care of this problem : I use all_numbers.flatten.map do |number|
[16:19:19] roelof: where all_numbers is a array of numbers I need for the request
[16:19:23] tubbo: roelof: you can also use .compact to get rid of anything that's `nil`.
[16:19:39] pilne: has joined #RubyOnRails
[16:20:01] roelof: tubbo: I can, but I know that nill schould not happen.
[16:20:56] roelof: and when I run it again., the same happen on another item of the array
[16:21:30] tubbo: roelof: well if i were you, the first thing i'd do is get a second set of eyes on my code to make sure i didn't mess anything up.
[16:21:39] tubbo: roelof: if that all checks out, maybe the API is rate-limiting you somehow.
[16:21:55] tubbo: but definitely assume it's your fault first :)
[16:22:15] chipotle: has joined #RubyOnRails
[16:24:01] davidw: has joined #RubyOnRails
[16:24:12] d1rewolf: hi all. Using rails_admin, is there a way to change what fields are used when searching for an association on an object's Edit page? I've added a "def label" but it doesn't appear to use this for search
[16:24:26] Xentil: has joined #RubyOnRails
[16:25:19] tildes: has joined #RubyOnRails
[16:25:38] jancel: has joined #RubyOnRails
[16:25:54] tweeeaks: has joined #RubyOnRails
[16:26:16] jancel: has joined #RubyOnRails
[16:27:12] roelof: tubbo: I cannot find anything about that. but this is my code to read the data : https://gist.github.com/rwobben/d1126d85f33799c016f1a6d3d2b2e1c3
[16:27:20] arBmind: has joined #RubyOnRails
[16:28:02] roelof: tubbo: could it maybe a memory problem. I have 512 Mb avaiable
[16:28:31] tubbo: roelof: not likely.
[16:28:38] fedruantine: has joined #RubyOnRails
[16:28:58] tubbo: roelof: is it possible that item["objectNumber"] could be nil at any point?
[16:29:21] tubbo: you might want to be sure by changing that line to say `numbers = all_paintings.map { |item| item["objectNumber"] }.compact`, that way `numbers` won't ever have any nil values in it.
[16:29:53] roelof: normally not, I ask in the first part all numbers of all the paintings
[16:29:55] tubbo: roelof: also, you ever consider using string interpolation? :) url = "https://www.rijksmuseum.nl/api/nl/collection/#{number}?key=14OGzuak&format=json"
[16:30:33] tubbo: from what i can see, that's the only place nil could've made it into the all_numbers array.
[16:30:53] roelof: tubbo: I tried , but I could not make that work with #{number}
[16:30:59] jancel: has joined #RubyOnRails
[16:31:20] tubbo: roelof: make sure you use double-quoted strings when you interpolate.
[16:31:55] roelof: and I print that number and everytime it fails on another number. this time it is "SK-A-2061"
[16:33:04] roelof: oke, so something like : url = "https://www.rijksmuseum.nl/api/nl/collection/#{number}/tiles?key=14OGzuak&format=json" ?
[16:33:20] tubbo: roelof: you're also somewhat on a tangent right now
[16:33:28] tubbo: roelof: roelof | like this error message : NoMethodError: undefined method `find' for nil:NilClass
[16:33:39] tubbo: roelof: that happens on ln 35 (https://gist.github.com/rwobben/d1126d85f33799c016f1a6d3d2b2e1c3#file-read_database-rb-L35)
[16:33:43] roelof: tangent ?
[16:33:54] moeabdol: has joined #RubyOnRails
[16:34:03] roelof: yes, so far , right
[16:34:28] tubbo: roelof: so what guarantee do you have that data2 isn't just an empty hash?
[16:34:36] roelof: and 35 depends on line 23 - 24
[16:35:28] roamingdog: d1rewolf: don't use rails_admin anymore, but this looks like what you want https://github.com/sferik/rails_admin/wiki/Associations-scoping
[16:35:43] roelof: no guarentee, the api sends a json repons which I alter in a hash on 40 - 42
[16:35:59] Leepoff: has joined #RubyOnRails
[16:36:06] tubbo: roelof: i think you better ensure that data2["levels"] isn't nil before trying to run a .find over it.
[16:36:17] roelof: so I have to check somehow if the respons back is not empty
[16:36:29] roelof: if so, then I have to ask again, right ?
[16:36:32] Z00t: has joined #RubyOnRails
[16:37:15] roelof: because every painting has a json response which is not empty , I checked that manually
[16:37:32] tubbo: roelof: i don't know how the API you're talking to works. but you might want to consult its documentation, if there is any, to determine whether any rate-limiting is supposed to occur. then you might want to throttle your own requests.
[16:37:50] tubbo: roelof: but normally, asking for the same thing in the same way twice doesn't net you different results.
[16:37:59] tubbo: (unless, of course, you're being rate-limited)
[16:38:00] mustmodify: has left #RubyOnRails: ()
[16:38:34] manfrin: has joined #RubyOnRails
[16:38:36] roelof: oke, I wil ask the maintainer of the api or the head-developer for help
[16:38:44] roelof: tubbo: thanks for the help
[16:46:20] meoblast001: has joined #RubyOnRails
[16:47:28] greghoggard: has joined #RubyOnRails
[16:47:48] dcluna: has joined #RubyOnRails
[16:49:49] chipotle: has joined #RubyOnRails
[16:50:36] greghoggard: I recently got a theme from wrapbootstrap and moved all the necessary css and js and image files to the appropriate places in the app/assets folder. The theme is working, but the only thing that isnt showing up are the images. how am i supposed to reference them in my rails 4 app?
[16:50:48] macsteps: has joined #RubyOnRails
[16:51:32] greghoggard: <img src="img/payment/americanexpress.gif" alt="" /> is an example of the html code i'm given with the theme
[16:51:59] [Butch]: has joined #RubyOnRails
[16:52:11] chipotle: has joined #RubyOnRails
[16:53:28] roelof: greg : see http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-image_tag
[16:56:38] greghoggard: i added <% image_tag("paypal.gif") %> and it still does not display
[16:56:48] roamingdog: greghoggard: need an =
[16:57:07] whathappens: has joined #RubyOnRails
[16:57:18] greghoggard: oh wow thank you
[16:57:35] lightt: has joined #RubyOnRails
[16:57:37] jancel: has joined #RubyOnRails
[16:58:33] Cache_Money: has joined #RubyOnRails
[16:59:54] cnk: has joined #RubyOnRails
[17:00:26] roamingdog: is there a more concise way to do this? ( rubyonrails668 you may be interested in this ) https://gist.github.com/chrislerum/3337e8f84a3251785565555197330be2
[17:00:27] marr: has joined #RubyOnRails
[17:01:19] chipotle: has joined #RubyOnRails
[17:03:14] dblessing: has joined #RubyOnRails
[17:03:32] tbuehlmann: you retrieve all players there, and then you query the database for each player's avg score, that's a lot of queries for a lot of players
[17:04:03] tbuehlmann: I'd try joining games, grouping by player and aggregate the games score
[17:04:34] mdw: has joined #RubyOnRails
[17:05:16] aegis3121: has joined #RubyOnRails
[17:07:09] flashpoint9: has joined #RubyOnRails
[17:07:27] polishdub: has joined #RubyOnRails
[17:07:42] lxsameer: has joined #RubyOnRails
[17:07:42] lxsameer: has joined #RubyOnRails
[17:09:49] Markhor1991: has joined #RubyOnRails
[17:10:17] Markhor1991: oh i wasnt connected. well good afternoon all
[17:10:56] chopin_: has joined #RubyOnRails
[17:11:10] neha-: has joined #RubyOnRails
[17:12:25] roamingdog: tbuehlmann: thanks, yep that gets rid of N+1 for me - i'm interested in (probably) using .map to create the hash instead of the way i'm iterating over players.
[17:13:02] tbuehlmann: you also don't want to use map, since that would also lead to getting all players
[17:14:49] tbuehlmann: do you know what I mean?
[17:14:50] dblessing: has joined #RubyOnRails
[17:15:23] fryguy: has joined #RubyOnRails
[17:15:26] tbuehlmann: .all will retrieve all players, that might be a lot. you can tell the database to do the hard work. the database is good with such things
[17:17:59] arup_r: has joined #RubyOnRails
[17:18:19] roamingdog: tbuehlmann: yes i understand that much. still making one query for each player, figuring out the aggregation part.
[17:19:03] tbuehlmann: start with something like `joins(:games).group(:id)`
[17:19:12] roelof: another question : Does someone knows a good linux distro that still uses the "old" grub. Grub2 still wants to boot my windows and linux and I want to use the Windows bootloader to boot both
[17:21:13] roamingdog: i had this: joins(:games).group(:player) .group(:player) same effect as .group(:id) i guess?
[17:21:52] tbuehlmann: do you have a column player?
[17:22:21] roamingdog: no, games has player_id
[17:22:44] roamingdog: good point, wonder why no error
[17:23:36] constantinexvi: has joined #RubyOnRails
[17:23:56] tbuehlmann: what does the generated SQL look like?
[17:24:07] ravster: has joined #RubyOnRails
[17:25:12] Dimik: has joined #RubyOnRails
[17:25:31] roamingdog: whether us .group(:id) or .group(:player) or .group(:player_id), sql looks same: SELECT AVG("games"."score") FROM "games" WHERE "games"."player_id" = ? [["player_id", 1]]
[17:25:57] tbuehlmann: I don't see a join in there
[17:26:50] diegoviola: has joined #RubyOnRails
[17:29:07] roamingdog: me neither. yet joins is in the line: (updated) https://gist.github.com/chrislerum/3337e8f84a3251785565555197330be2
[17:29:44] tbuehlmann: let go of this #each :)
[17:30:06] roamingdog: copied wrong line from log, there is a join: SELECT "players".* FROM "players" INNER JOIN "games" ON "games"."player_id" = "players"."id" GROUP BY "players"."id"
[17:30:24] tbuehlmann: that looks good so far
[17:30:47] tbuehlmann: you now want to add a new column to the result set, the average score
[17:31:35] roamingdog: sorry, let go of 'each'? if remove, errors since iterating
[17:31:36] tbuehlmann: that's done by adding a select call in which you use that AVG() function
[17:31:49] tbuehlmann: you don't want to iterate over users
[17:32:12] tbuehlmann: you want a result set of all users plus the avg score
[17:32:28] tbuehlmann: then order that by the avg score and take the first/last one
[17:32:44] tbuehlmann: and by order and taking I mean in the database, not in ruby
[17:33:16] manfrin: has joined #RubyOnRails
[17:34:11] tbuehlmann: so you want to select the average games score to the query
[17:34:18] tbuehlmann: .select() will do
[17:35:24] roamingdog: Player.joins(:games).group(:id).select(score: average(:score)) i sense a learning moment approaching for me...
[17:35:38] roamingdog: that doesn't work btw, now sure of the syntax
[17:36:32] tbuehlmann: try something like .select('*, AVG(games.score) AS average_score')
[17:37:02] tildes: has joined #RubyOnRails
[17:37:10] theery: has joined #RubyOnRails
[17:38:40] chouhoul_: has joined #RubyOnRails
[17:38:45] agit0: has joined #RubyOnRails
[17:40:00] chouhoul_: has joined #RubyOnRails
[17:40:22] romistrub: has joined #RubyOnRails
[17:40:25] Oliphaunte: has joined #RubyOnRails
[17:40:38] romistrub: With activerecord, shouldn't the database and table creation be a one-time thing, whereas CRUD operations occur separately on an as-needed basis?
[17:41:03] roamingdog: tbuehlmann: getting awesome, just one sql query now https://gist.github.com/chrislerum/3337e8f84a3251785565555197330be2
[17:41:07] tbuehlmann: romistrub: sure
[17:41:45] tbuehlmann: roamingdog: great. what if you call .average_score on any of those players?
[17:41:57] romistrub: tbuehlmann: then why are all of the examples I've seen online doing it in a way that makes them seem inseparable. I'm way too confused
[17:42:06] roamingdog: it works. now to get the player with the highest average...
[17:42:15] adre: has joined #RubyOnRails
[17:42:16] tbuehlmann: romistrub: not sure what you mean. what exactly have you read?
[17:42:34] romistrub: http://makandracards.com/makandra/32401-activerecord-how-to-use-activerecord-standalone-within-a-ruby-script
[17:42:55] jenrzzz: has joined #RubyOnRails
[17:42:55] jenrzzz: has joined #RubyOnRails
[17:43:29] romistrub: uses create_table, but don't I only want to do that once? not every time the script is run?
[17:44:01] truenito: has joined #RubyOnRails
[17:44:26] tbuehlmann: romistrub: AR needs to know about the schema, so having a definition somewhere is needed
[17:44:33] tbuehlmann: in rails that'd be in db/schema.rb
[17:44:52] tbuehlmann: the actual process of creating a table is ran only once, typically in a migration
[17:44:57] romistrub: tbuehlmann: so it's only telling rails about the schema, not creating a table?
[17:45:43] romistrub: tbuehlmann: then how do I create the table with an appropriate schema in the first place? :P
[17:45:54] elton: has joined #RubyOnRails
[17:45:56] tbuehlmann: you'd create a migration and run it
[17:46:25] romistrub: hmmm, weird terminology
[17:46:38] tbuehlmann: a migration is a class in rails
[17:46:42] Markhor1991: thats what im facing, context, vernacular, terminology..
[17:47:12] tbuehlmann: when you run `rake db:migrate` all migrations are executed that haven't been executed so far
[17:47:26] tbuehlmann: so when you run `rake db:migrate` the next time, nothing happens
[17:47:27] romistrub: tbuehlmann: okay I gotcha
[17:47:56] romistrub: so in other words, I could do it using the mysql> prompt if I wanted to
[17:48:49] Oliphaunte: has joined #RubyOnRails
[17:50:24] replay: has joined #RubyOnRails
[17:50:43] roelof: how can I update rake. So I can test if my problems are not related to a old rake ?
[17:50:54] edwinvdgraaf: has joined #RubyOnRails
[17:51:34] Markhor1991: you mean to run all rakes again?
[17:52:50] flashpoint9: has joined #RubyOnRails
[17:53:09] roamingdog: tbuehlmann: so awesome, final ruby does it perfectly: joins(:games).group(:id).select('players.*, AVG(games.score) AS average_score').order('average_score desc').first.name
[17:53:15] roamingdog: tbuehlmann: thanks very much
[17:53:19] roelof: no, to update the rake function/gem to a newer version ?
[17:53:59] roelof: I use now 11.2.2
[17:54:08] Markhor1991: "gem update rake" should suffice.
[17:54:17] haraigoshi: has joined #RubyOnRails
[17:54:34] tbuehlmann: romistrub: mhhh, I'd say nope. the schema has to be uptodate so AR can define the right methods. so, you could add stuff in MySQL directly, but the schema has to reflect it
[17:54:41] tbuehlmann: roamingdog: great!
[17:55:08] roelof: wierd, then I see nothing to update
[17:56:01] Markhor1991: do "gem update" to update gem itself, then "gem update gemNAme" to update individual gems.
[17:56:02] tildes: has joined #RubyOnRails
[17:57:17] roelof: same output; I have then propably the newest version
[17:58:19] djinni`: has joined #RubyOnRails
[17:59:06] Markhor1991: i think freshly installed gem is most recent, if you did it all recentl, but ok. that's due diligence
[17:59:16] roelof: Can this work. I have some 4.7K responses. At this moment after 50% the rake task fails. Can I somehow take let's say 500 items.
[17:59:22] flopsec: has joined #RubyOnRails
[17:59:55] roelof: Then ask the external source for these data. then wait for let's say 10 minutes and take the next 500.
[18:00:42] Markhor1991: delay or queue requests, you mean?
[18:00:50] kitsuneyo: has joined #RubyOnRails
[18:01:14] flashpoint9: has joined #RubyOnRails
[18:01:14] roelof: I think delay, I have not tried queue request yet.
[18:01:23] Talltree: i have a question about ransack, i set it up with remote enabled and a index.js file that rerenders a table. but the url doesnt update that way.
[18:01:43] zeknox: has joined #RubyOnRails
[18:01:46] blackmesa: has joined #RubyOnRails
[18:01:59] Talltree: how would i update the url after the xhr response gets rendered?
[18:02:16] roelof: I make now a loop throught all the 4.7K numbers with each
[18:03:05] roelof: and that costs me at this moment some 45 minutes to finisch
[18:03:47] Malgorath: Is there a simple way to output a variable in a controller? Just want to see its value(s)
[18:03:49] dustinm`: has joined #RubyOnRails
[18:03:54] leira: has joined #RubyOnRails
[18:04:28] zeknox: what are folks using to encrypt the source code for apps that are to be shared?
[18:04:39] choke: has joined #RubyOnRails
[18:04:47] agit0: has joined #RubyOnRails
[18:05:01] tbuehlmann: zeknox: you don't want to hear "by not doing it", right? :)
[18:05:16] Malgorath: zeknox, that would kind of be against the whole idea of opensource
[18:05:30] arup_r: has joined #RubyOnRails
[18:05:34] tbuehlmann: I assume shared doesn't mean OSS here
[18:05:40] zeknox: so no one has wanted to protect their intellectual property with a rails app?
[18:05:48] jancel: has joined #RubyOnRails
[18:06:10] banister: has joined #RubyOnRails
[18:06:15] k3rn31: has joined #RubyOnRails
[18:06:52] Malgorath: zeknox, again, 'protecting' in opensource is like saying military intelligence
[18:07:04] dannyguk: has joined #RubyOnRails
[18:07:23] Malgorath: and nvm I remember logger on my question
[18:07:53] roelof: is this code (https://gist.github.com/rwobben/24d0dfd1350f7b2184f5ec3d7085d8c5) easily be converted to use a queue or threads then
[18:08:15] roelof: and if so, can anyone help me to rewrite my code ?
[18:14:59] DoctorMonocular: has joined #RubyOnRails
[18:15:58] whathappens: has joined #RubyOnRails
[18:16:39] tvw: has joined #RubyOnRails
[18:16:41] whathapp_: has joined #RubyOnRails
[18:18:17] whathapp_: has joined #RubyOnRails
[18:21:32] zel: has joined #RubyOnRails
[18:23:11] KevinSjoberg: has joined #RubyOnRails
[18:25:35] crova: has joined #RubyOnRails
[18:27:11] choke: has joined #RubyOnRails
[18:28:33] tildes: zeknox: with jruby you can convert the ruby files to java bytecode. while technically it isn't encryption, it might be good enough for your case
[18:29:05] roelof: nobody who can help me ?
[18:29:07] d5sx43: has joined #RubyOnRails
[18:29:22] stevenx: has joined #RubyOnRails
[18:30:34] tildes: roelof: not sure why or how you want to use queue / threads for your rake task
[18:31:23] macsteps: has joined #RubyOnRails
[18:32:34] moeabdol: has joined #RubyOnRails
[18:33:47] zeknox: tildes: that sounds like something i'd be interested in, just install jruby and compile the rails app to bytecode?
[18:33:50] tubbo: roelof: did you determine that you're not being rate-limited?
[18:35:31] tildes: zeknox: not sure how it works in practice unfortunately. but we have done it in my company, and I could ask my colleagues how it is done - in case you don't find some answers before that
[18:35:57] tubbo: zeknox: i've never needed to encrypt the source code because i keep my source code in private repositories.
[18:36:01] zeknox: tildes: any info would be much appreciated, never done the jruby side of things
[18:36:04] tubbo: so no one can access it but me
[18:36:08] roelof: I cannot find anything on the api page : http://rijksmuseum.github.io/
[18:36:19] zeknox: tubbo: i also use private repos, but have a business need at times to run on clients hardware
[18:36:20] tubbo: zeknox: literally any high schooler can decompile java bytecode fwiw
[18:36:24] whathappens: has joined #RubyOnRails
[18:36:35] tubbo: zeknox: there's no such thing as security when the user has physical access.
[18:36:56] tubbo: roelof: did you read https://www.rijksmuseum.nl/en/api/terms-and-conditions-of-use?
[18:37:01] zeknox: tubbo: understood, that is why i have legal documents as well but giving away IP via open source is not the answer as well
[18:37:03] whathapp_: has joined #RubyOnRails
[18:37:23] d5sx43: has joined #RubyOnRails
[18:37:24] Scriptonaut: has joined #RubyOnRails
[18:37:28] Cache_Money: has joined #RubyOnRails
[18:37:49] roelof: tubbo: yes, there is only mentioned of fair use policy
[18:38:03] chouhoulis: has joined #RubyOnRails
[18:38:06] roelof: which mentioned this : •Respect the Rijksmuseum’s server capacity (in the case of Live API).
[18:38:14] tubbo: zeknox: why not just encrypt the whole drive? :)
[18:38:22] staticfox: has joined #RubyOnRails
[18:38:36] zeknox: tubbo: im exploring those options as well
[18:38:42] tubbo: roelof: so maybe you're not doing that? 4700 requests is a lot.
[18:39:00] bool_: has joined #RubyOnRails
[18:39:04] tubbo: roelof: you could group those requests in batches of 500 or so, and then wait a second or two before making the next batch if you are being throttled.
[18:39:10] Scriptonaut: hey guys. I've been moving from redis to elasticsearch lately. I setup a new dev machine yesterday, and I'm trying to run the rake task to index my elastic search database. However when I run it, it tells me there is no server running on port 9200. I thought bundle install would take care of the server for me? There seems to be no server running. So, I decided to install elastic search from debian
[18:39:15] roelof: oke, but the assigment is talking about showing all the paintings
[18:39:16] Scriptonaut: sources (apt-get). Still, no server running. I even run: "elasticsearch" in the terminal, and it still is telling me there isn't a server. What am I doing wrong here?
[18:39:18] tubbo: zeknox: i'd say that's a much better approach.
[18:39:28] Cache_Money: Is this the correct way to drop a table in Rails 4? http://stackoverflow.com/a/7779954/899904
[18:39:41] tubbo: roelof: yeah, but it doesn't mention that the task has to be done in a given amount of time, right? :P like does it matter how long the rake task runs?
[18:39:49] zeknox: tubbo: yeah but that will require the client has a hypervisor and i provide a VM, if they install an os on a physical box I have no support then
[18:39:53] tubbo: Cache_Money: yes
[18:40:02] Cache_Money: tubbo: okay, thanks!
[18:40:17] tubbo: zeknox: possibly. sidenote, can you encrypt docker images? :)
[18:40:35] roelof: tubbo: oke that also what I tought. so I have to take 500 numbers out of the api. so that will be 50 pages
[18:40:52] alfiemax: has joined #RubyOnRails
[18:40:55] tubbo: roelof: i mean, last i checked that wasn't even your problem
[18:40:57] roelof: I think I can do that, How can I make the wait period.
[18:40:57] zeknox: tubbo: yes, thats adding a bit of complexity into the whole scheme
[18:41:15] tubbo: your problem was that data2['whateverYouWantedFromTheAPI'] was nil and you still haven't actually verified that such data exists.
[18:41:34] roelof: I do not know if it's my problem or the enviroment or the api
[18:41:37] tubbo: zeknox: more complex than encrypting your source code? ;)
[18:41:54] tubbo: roelof: well i know a great way to rule that first one out...ensure that you aren't calling .find on nil...
[18:42:05] zeknox: tubbo: I tried the trial version of rubyencoder and I already have a poc working within minutes
[18:42:20] tubbo: well fuck me
[18:42:26] tubbo: zeknox: i didn't even know rubyencoder was a thing
[18:42:29] roelof: I did check that and sometimes the api returns nil which is not right when I manually check the response with that number on a browser
[18:42:44] zeknox: tubbo: yeah but now my tests dont run once encoded lol
[18:42:56] fedruantine: has joined #RubyOnRails
[18:43:06] tubbo: "compiling Ruby source code into a bytecode format" is probably why
[18:43:23] tubbo: but do you really need to run tests in places where this app is running the encrypted version of the code?
[18:43:30] roelof: so something is not right with the response or the way my code handles things , tubbo
[18:43:55] zeknox: tubbo: no, I probably dont need to run tests, thats the only issue ive run into thus far, other than views are not encypted as well nor coffeescript or non .rb files
[18:43:57] tubbo: roelof: that 2nd one. the API may or may not have data2['levels'], like what if it comes back like { "levels": null} ?
[18:44:00] jenrzzz: has joined #RubyOnRails
[18:44:33] tubbo: zeknox: now THAT is something that you're not gonna be able to control. those files are actually served onto every single client who uses your stuff. you can obfuscate/minify, but you can't really compile it down to a bytecode that requires reverse engineering...
[18:44:40] roelof: right, but what I said, if I check it manually I see the output that I was expecting
[18:45:09] zeknox: tubbo: yup, still entertaining which route to go
[18:45:11] tubbo: zeknox: you could always pull a ASP Classic and only allow Firefox/Chrome to view your app :)
[18:45:15] tubbo: and then you could use WebAssembly.
[18:45:25] yellow5: has joined #RubyOnRails
[18:45:49] zave: has joined #RubyOnRails
[18:46:35] tubbo: roelof: then i would assume you are being rate limited
[18:47:15] yfeldblum: has joined #RubyOnRails
[18:47:16] roelof: oke, then the question is how to I make the wait period.
[18:47:48] chouhoulis: has joined #RubyOnRails
[18:48:12] roelof: then I could test the scenario what you said. take some , wait a few seconds/minutes and take some more , till the end is reached
[18:49:01] roelof: tubbo: oke, I can use sleep, right ?
[18:49:37] lxsameer: has joined #RubyOnRails
[18:49:54] tubbo: roelof: sure
[18:50:18] roelof: then I will test that idea. Hopefully that works fine
[18:50:46] roelof: tubbo: thanks again for the help
[18:51:35] fox_mulder_cp: hi. i want convert ascii to bin, but get error 'NameError: uninitialized constant ASCII' after stra.tr!(ASCII, BIN)
[18:51:59] fox_mulder_cp: when read sudoku part in Flanegan's book
[18:53:29] fox_mulder_cp: my eyes fails for me or i'm really see discussion about asp.net...
[18:58:44] ecnalyr: has joined #RubyOnRails
[18:58:48] _underscore_: has joined #RubyOnRails
[18:59:04] flashpoint9: has joined #RubyOnRails
[18:59:16] tubbo: fox_mulder_cp: you might be looking for http://ruby-doc.org/core-2.2.2/Encoding.html
[18:59:24] ksoze: has joined #RubyOnRails
[19:00:38] jancel: has joined #RubyOnRails
[19:00:42] _underscore_: Anyone know why when I add something f.file_field it causes the submit button not to submit in firefox and a "This site can’t be reached" error in chrome. (Rails 4.2.6)
[19:01:10] _underscore_: (I can't use paperclip)
[19:01:20] fox_mulder_cp: _underscore_: hm. what says debugging console of chrome?
[19:01:35] fox_mulder_cp: tubbo: thanks.
[19:01:49] DoctorMonocular: has joined #RubyOnRails
[19:02:29] nickenchuggets: has joined #RubyOnRails
[19:02:56] dblessing: has joined #RubyOnRails
[19:03:24] Markhor1991: has joined #RubyOnRails
[19:04:11] _underscore_: fox_mulder_cp: it says.. POST http://localhost:3000/documents net::ERR_ACCESS_DENIED
[19:04:39] fox_mulder_cp: _underscore_: ook. what your firewall says about 3000 port?
[19:05:00] fox_mulder_cp: sudo iptables -vnL | grep 3000
[19:05:23] _underscore_: fox_mulder_cp Chain INPUT (policy ACCEPT)
[19:05:31] _underscore_: all my chains are empty
[19:05:48] fox_mulder_cp: _underscore_: hmhm. sudo lsof -Pni | grep 3000
[19:05:54] tubbo: sounds like you're getting a 401 error
[19:05:57] Coldblackice: has joined #RubyOnRails
[19:06:18] context: are you getting anything in the rails server log
[19:06:26] fox_mulder_cp: may be rails server stopped
[19:06:28] _underscore_: Nothing hits rails server log.
[19:06:28] kitsuneyo: has joined #RubyOnRails
[19:06:46] context: any sort of antivirus running?
[19:06:48] fox_mulder_cp: _underscore_: ps aux | grep ruby?
[19:06:59] context: he'd get connection refused if not running
[19:07:01] fox_mulder_cp: context: linux? haha :)
[19:07:08] context: yeah... figured id ask anywhere
[19:07:15] _underscore_: And here is where it get really strange. I have another part of my web server accepting files. But it is accepting nested files. It works.
[19:07:42] rafaelfranca: has joined #RubyOnRails
[19:07:42] rafaelfranca: has joined #RubyOnRails
[19:07:44] dannyguk: has joined #RubyOnRails
[19:07:44] fox_mulder_cp: _underscore_: seems strange. what rails server running in console says, not a logs?
[19:07:52] context: if it is getting requests you have someting going on in your server
[19:07:56] tubbo: _underscore_: i bet it's permissions :)
[19:07:56] _underscore_: fox_mulder_cp: ruby bin/rails c and bin/rails s (and the grep command)
[19:07:57] borodin: has joined #RubyOnRails
[19:08:06] JesseH2: has joined #RubyOnRails
[19:08:07] fox_mulder_cp: when u press post btn press
[19:08:49] _underscore_: The request doesn't make it to rails s (at least not to the console log)
[19:08:51] fox_mulder_cp: curl -XPOST http://localhost:3000
[19:09:18] context: do GET then POST
[19:09:33] _underscore_: I get an HTML reply
[19:09:37] fox_mulder_cp: _underscore_: ok add into input chain iptables -I INPUT -dport 3000 -j ACCEPT
[19:09:41] context: does GET in chrome work ?
[19:09:46] _underscore_: <H1>Length Required</H1>
[19:09:47] _underscore_: WEBrick::HTTPStatus::LengthRequired
[19:10:04] context: restart chrome for the giggles
[19:10:13] fox_mulder_cp: _underscore_: oh, try to use puma
[19:10:31] tubbo: lol no one is gonna tell _underscore_ to check permissions on the folder he's uploading to?
[19:10:33] Axsuul: has joined #RubyOnRails
[19:10:35] tubbo: like, you know, the most obvious answer?
[19:10:55] context: tubbo: id still think you'd get SOMETHING in the log
[19:11:12] context: like... exception thrown: PermissionDeniedDummy
[19:11:17] _underscore_: tubbo: oh god. I can't belive it.
[19:11:18] context: tubbo: but yeah, good point
[19:11:26] tubbo: context: there's life after the rails log
[19:11:28] diegoviola: has joined #RubyOnRails
[19:11:31] tubbo: like nginx's access.log and error.log
[19:11:35] fox_mulder_cp: tubbo: hm. but really strange case..
[19:11:36] tubbo: also syslog
[19:11:40] sonofdirt: has joined #RubyOnRails
[19:11:44] _underscore_: god damn 4 hours and the file in /tmp/ I was testing with was root.root rw------
[19:11:47] context: not if its rails s running webrick
[19:11:55] tubbo: fox_mulder_cp: nah it's pretty common actually.
[19:11:56] fox_mulder_cp: syslog can't be write eccess denied for directory
[19:12:25] tubbo: fox_mulder_cp: no one was looking at syslog, or nginx's logs.
[19:12:52] tubbo: could still be proxied to nginx.
[19:12:56] context: tubbo: he said this was rails s
[19:12:57] _underscore_: I would have hoped firefix/chrome would have given an error saying they can't read the file.. but what do I know.
[19:13:00] fox_mulder_cp: tubbo: u think, that it the great idea see as syslog/nginx log when app server is directly failed?
[19:13:22] context: _underscore_: the browser doesnt know/care. thats the servers job
[19:13:31] tubbo: _underscore_: i certainly wouldn't want any browser knowing about my file system :)
[19:13:45] fox_mulder_cp: i think, that right checking and fail - its is a webrick bug
[19:14:34] tubbo: fox_mulder_cp: well, the first thing i do when an error occurs and i don't see it in my rails log is assume that the error logging appears elsewhere. so yeah, keep going up the stack to nginx.
[19:14:40] context: webrick should use a tempfile name for the upload (you would think) and not end up clashing with an already existing file
[19:14:40] _underscore_: syslog (btw) doesn't log a userspace app trying to access a file it doesn't own.
[19:14:48] tubbo: that's the easiest thing that i can imagine
[19:15:25] fox_mulder_cp: tubbo: it's u, but i writes files into aap dir, not a system hierarchy
[19:15:38] snowy: has joined #RubyOnRails
[19:15:48] context: fox_mulder_cp: the web server will write to a temp file, most likely in /tmp
[19:16:00] context: out of your hands.
[19:16:33] fox_mulder_cp: context: nginx? before pass this file to apstream app server?
[19:16:34] elton: has joined #RubyOnRails
[19:16:57] context: your app gets a Tempfile (wrapped by ActiveSupport::Something..)
[19:17:02] fox_mulder_cp: why /tmp is locke for root rights only
[19:17:13] context: /tmp is sticky
[19:17:14] tubbo: well, nginx _should_ be running as root. that's why it can run on :80
[19:17:18] context: or... should be
[19:17:19] joelwallis: has joined #RubyOnRails
[19:17:49] fox_mulder_cp: drwxrwxrwt 48 root root 4153344 чер 13 22:17 .
[19:17:49] fox_mulder_cp: drwxr-xr-x 23 root root 4096 кві 28 2015 ..
[19:18:02] fox_mulder_cp: it's a /tmp '.'
[19:18:43] fox_mulder_cp: context: but _underscore_ says about locked file, not dir
[19:18:54] jenrzzz: has joined #RubyOnRails
[19:18:54] jenrzzz: has joined #RubyOnRails
[19:19:05] _underscore_: tubbo, fox_mulder_cp: Thanks a ton. I still can't believe it was a stupid permission issue.
[19:19:23] context: well chrome did say permission denied ;)
[19:19:29] alfiemax: has joined #RubyOnRails
[19:19:45] context: im more confused by if you were really hitting rails directly, you didnt get anything from webrick in log :-/
[19:19:50] fox_mulder_cp: context: chrome can't knows evetything about server-side file systems and rights
[19:19:57] context: yeah i know that
[19:20:12] _underscore_: Yeah, I just picked a file in tmp to test with. The adb.log file was nice and small. But I forgot I do adb android updates as root. Firefox/Chrome could see the file in tmp because tmp is drwxrwxrwt
[19:20:25] fox_mulder_cp: and as for me u must add checking for properly written file
[19:20:33] _underscore_: But firefox/chrome couldn't open the file to send because the adb.log file was rw------ root
[19:20:37] context: oh... you were trying to upload a file you didnt have access to, haha
[19:20:49] context: thats coo l
[19:20:58] _underscore_: Yeah, pretty funny. And it only took me 3-4 hours to figure it out.
[19:21:11] context: so yeah. server never was seeing anything
[19:21:11] _underscore_: I hate computers
[19:21:27] JakFrist: has joined #RubyOnRails
[19:21:44] fox_mulder_cp: when file can't be accessible for writing webrick must fails
[19:21:53] _underscore_: Yeah, but I'm still pretty pissed that chrome/firefox don't tell you they can't read the file. When I try to open a file in vi it tells me I cant... seems like all apps should.
[19:22:16] _underscore_: I guess they don't know they can't read it until I submit the form.
[19:22:54] fox_mulder_cp: _underscore_: with your case i drop bookmarked place in ruby book where paused for help u %)
[19:23:36] neha-: has joined #RubyOnRails
[19:23:42] DoctorMonocular: ok here's a naming question -- I have a class that represents a Matrix, and this matrix can do one special thing. That thing is that given a value, the matrix can tell you what values from the matrix the given value falls between, along however many dimensions it has. What is a good name for this class?
[19:23:59] sypheren: has joined #RubyOnRails
[19:24:47] fox_mulder_cp: DoctorMonocular: Matrix has u, young podavane :)
[19:24:55] cnk: DoctorMonocular: Is there a specialized mathematical term for that kind of matrix? If so, call your class that
[19:25:18] cnk: (its been FOREVER since I took linear algebra and names are the first thing to fade)
[19:25:20] dblessing: has joined #RubyOnRails
[19:25:22] DoctorMonocular: cnk, no, I don't believe so, math wouldn't have any need to name that
[19:25:23] Markhor1991: is this using derivatives?
[19:25:57] DoctorMonocular: Markhor1991: no, I'm not sure how it would even do that, but in any case, it doesn't
[19:26:34] cnk: does this give you boundries of some sort?
[19:26:45] cnk: I am sure there is a term for the sort of thing you are doing
[19:28:25] DoctorMonocular: cnk: yeah it gives you boundaries. In fact the novel methods for this class are .bounding_indices_for and .bounding_values_for
[19:28:41] Markhor1991: MatrixIndexer class?
[19:29:08] cnk: What problem domain does this matrix represent?
[19:29:33] cnk: if it finds price boundaries, I would call it PriceBoundary or similar
[19:30:01] cnk: Unless the matrix is general, I would probably name it for the purpose rather than the math
[19:30:51] cnk: but if this is to be a reusable library class, then BoundaryMatrix?
[19:31:42] sadaf2605: has joined #RubyOnRails
[19:31:52] jgt: has joined #RubyOnRails
[19:32:21] DoctorMonocular: well, it happens to be the case that I'm using it in lieu of a more complex polynomial function that can tell me the overall "goodness" of things. For example I have a matrix of known goodness values for a bed given the quality of the bed and the importance (ie. degree of VIP status) of the person who has been assigned to the bed. It's a 3x3 matrix, so I can put in arbitrary values between 0 and 1 on
[19:32:21] DoctorMonocular: both of the dimensions and get back the known anchor values (eg. 1 important and 1 bed quality = 1 goodness, 1 important and 0 bed quality = 0 goodness). I'm using this class for cases like that, but not ONLY for that specific case
[19:32:40] DoctorMonocular: BoundaryMatrix could work
[19:32:47] DoctorMonocular: BoundaryAwareMatrix
[19:33:05] moeabdol: has joined #RubyOnRails
[19:33:12] dblessing: has joined #RubyOnRails
[19:33:34] tbuehlmann: matrix.. beds.. what about Mattress?
[19:33:49] tbuehlmann: gnihihi, I'm on fire
[19:34:02] ksoze: has joined #RubyOnRails
[19:34:47] Z00t: has joined #RubyOnRails
[19:35:36] arBmind: has joined #RubyOnRails
[19:35:37] fox_mulder_cp: tbuehlmann: matrix already has u, young podavane :)
[19:35:58] Scriptonaut: has left #RubyOnRails: ()
[19:36:29] ekinmur: has joined #RubyOnRails
[19:37:02] fox_mulder_cp: internet matrix, water matrix, air matrix...
[19:39:22] dblessing: has joined #RubyOnRails
[19:41:49] arup_r1: has joined #RubyOnRails
[19:42:24] dblessing: has joined #RubyOnRails
[19:43:02] jenrzzz: has joined #RubyOnRails
[19:43:02] jenrzzz: has joined #RubyOnRails
[19:43:05] k3rn31: has joined #RubyOnRails
[19:43:40] fox_mulder_cp: hhe. a[1,2] vs a[1][2]
[19:47:35] dblessing: has joined #RubyOnRails
[19:48:25] haraigoshi: has joined #RubyOnRails
[19:48:36] whathappens: has joined #RubyOnRails
[19:48:52] Leepoff: has joined #RubyOnRails
[19:49:30] Markhor1991: has joined #RubyOnRails
[19:51:15] safetypin: has joined #RubyOnRails
[19:52:07] dblessing: has joined #RubyOnRails
[19:52:34] tubbo: anyone here use rspec_api_documentation?
[19:54:20] avaca: has joined #RubyOnRails
[19:55:01] jstransky: has joined #RubyOnRails
[19:58:45] jancel: has joined #RubyOnRails
[19:59:15] FooMunki: has joined #RubyOnRails
[20:00:09] FooMunki: has joined #RubyOnRails
[20:02:46] emilkarl: has joined #RubyOnRails
[20:02:50] safetypin: has joined #RubyOnRails
[20:06:35] diegoviola: is there a better way to do this? https://gist.github.com/diegoviola/b22f61e39c809b93023d403b87ce0ade
[20:06:50] diegoviola: rather than calling #build_user and #build_room for a nested form
[20:06:58] choke: has joined #RubyOnRails
[20:07:29] nettoweb: has joined #RubyOnRails
[20:07:55] tubbo: yeah you shouldn't need to do that at all, diegoviola.
[20:08:42] sonofdirt: has joined #RubyOnRails
[20:08:53] albertvaka_: has joined #RubyOnRails
[20:09:47] dannyguk: has joined #RubyOnRails
[20:10:01] norc-2: diegoviola, http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html
[20:10:03] diegoviola: removing them out worked fine
[20:10:14] roamingdog: has joined #RubyOnRails
[20:14:21] emilkarl: has joined #RubyOnRails
[20:15:56] safetypin: has joined #RubyOnRails
[20:16:27] qejk: has joined #RubyOnRails
[20:19:48] whathappens: has joined #RubyOnRails
[20:22:38] jancel: has joined #RubyOnRails
[20:22:44] Talltree: http://resn.co.nz/
[20:25:04] jhass: it's always interesting how webdevs are proud of no being able to do the windows < vista solitaire winning effect
[20:25:21] Ergo: has joined #RubyOnRails
[20:25:41] ekinmur: has joined #RubyOnRails
[20:26:15] Talltree: jhass wasnt it xp too?
[20:26:37] jhass: I think vista lost it, hence < vista
[20:27:17] Criten: jhass: what
[20:29:09] Markhor1991: oh the cards cascading down on victory? yeah.
[20:29:09] duncannz: has joined #RubyOnRails
[20:29:50] Markhor1991: i thought vista had it but it was really really fast, done n a second. previous ones took several seconds, or a while. probably due to processing speed
[20:29:57] emilkarl: has joined #RubyOnRails
[20:32:18] dblessing: has joined #RubyOnRails
[20:36:39] Markhor1991: ok i've been trying to understand the routing in rails, i am kinda new and all. so, i can leave it as "site.com/controller/view", but i could also make it just "site.com/view" if i wanted? exposing no controller names?
[20:37:37] tubbo: Markhor1991: you can do whatever you want, but rails does establish some conventions to make writing your routes more convenient, like `resources`.
[20:37:55] AmiMoench: has joined #RubyOnRails
[20:38:21] Talltree: you could still call path: nil on the resources line to have it at "site.com/view" right?
[20:39:06] Markhor1991: the resources comes out as the prior one. my other thing was understanding controllers, but controllers..seem to be the "interact with input and models" part. i think i got it. yes, resources does make my life easier on default stuff.
[20:40:14] Rodya_: has joined #RubyOnRails
[20:40:59] safetypin: has joined #RubyOnRails
[20:41:04] Ergo^: has joined #RubyOnRails
[20:46:15] safetypin: has joined #RubyOnRails
[20:48:16] workmad3: has joined #RubyOnRails
[20:48:24] JakFrist: has joined #RubyOnRails
[20:52:05] jhack: has joined #RubyOnRails
[20:52:05] codeurge: has joined #RubyOnRails
[20:55:58] emilkarl: has joined #RubyOnRails
[20:57:11] moeabdol: has joined #RubyOnRails
[20:57:53] Leepoff: has joined #RubyOnRails
[20:58:00] srinidhi: has joined #RubyOnRails
[20:58:36] macsteps: has joined #RubyOnRails
[21:00:10] dblessing: has joined #RubyOnRails
[21:02:21] jancel: has joined #RubyOnRails
[21:02:29] AmiMoench: has joined #RubyOnRails
[21:09:19] dblessing: has joined #RubyOnRails
[21:10:34] dannyguk: has joined #RubyOnRails
[21:11:50] dblessing: has joined #RubyOnRails
[21:11:58] gusrub: has joined #RubyOnRails
[21:13:43] lxsameer: has joined #RubyOnRails
[21:13:51] roamingdog: has joined #RubyOnRails
[21:13:55] pawnbox: has joined #RubyOnRails
[21:14:05] JesseH2: has joined #RubyOnRails
[21:15:05] allcentury: has joined #RubyOnRails
[21:17:21] elton: has joined #RubyOnRails
[21:20:25] dblessing: has joined #RubyOnRails
[21:20:38] purrist: has joined #RubyOnRails
[21:21:57] whathapp_: has joined #RubyOnRails
[21:23:45] sk0r: has joined #RubyOnRails
[21:24:54] aldodelgado: has joined #RubyOnRails
[21:25:48] aldodelgado: Question? I'm getting undefind method from Rails.env.development? after upgrading. Has this been deprecated?
[21:26:13] aldodelgado: Should I use Rails.env == "development" instead?
[21:27:07] dblessing: has joined #RubyOnRails
[21:27:33] choke: has joined #RubyOnRails
[21:30:00] ur5us: has joined #RubyOnRails
[21:32:26] Leepoff: has joined #RubyOnRails
[21:32:40] jgt: has joined #RubyOnRails
[21:33:26] leira: has joined #RubyOnRails
[21:33:30] yfeldblum: has joined #RubyOnRails
[21:33:34] fox_mulder_cp: aldodelgado: export RAILS_ENV=development; rails c|rails s etc
[21:33:38] manfrin_: has joined #RubyOnRails
[21:34:30] dblessing: has joined #RubyOnRails
[21:38:36] dblessing: has joined #RubyOnRails
[21:40:04] norc: has joined #RubyOnRails
[21:40:06] safetypin: has joined #RubyOnRails
[21:41:51] aldodelgado: fox_mulder_cp: thanks
[21:43:20] asahi: has joined #RubyOnRails
[21:43:32] Axilla: 8 years of rails and never once did i realize that Model.column_names existed >< *face palm*
[21:45:19] Axilla: Talltree: did you click and hold and push it all the way up? Pretty sure i just smoked some deemsters
[21:45:27] Axilla: and entered a new portal
[21:45:28] onethirtyfive: has joined #RubyOnRails
[21:45:30] ksoze: has joined #RubyOnRails
[21:46:39] choke: anyone know if it's possible ( or wise ) to change the fog directory from within a carrierwave uploader?
[21:46:52] asahi: is there a way to return an activerecord relation, and do finds and creates in memory without making a round trip to the db each time, and then create all the new records at once?
[21:46:57] fox_mulder_cp: axilla: when i start develop my first rails guides blog app for some weeks i play with irb and classes/instances methods.
[21:47:21] fox_mulder_cp: asahi: caching...
[21:48:26] asahi: fox_mulder_cp: do you know where I can find a resource on that?
[21:48:57] havenwood: onethirtyfive: hi!
[21:49:27] onethirtyfive: Tricky to word, but if I extend an AR association with a module, can the methods in that module directly refer to the source object? (let's say I'm extending "blogs" with custom methods, but need to refer to "user")
[21:50:39] pawnbox: has joined #RubyOnRails
[21:51:06] onethirtyfive: I'd rather not have to pass in the user_id as an arg to my custom extension method, because I feel like it should be obtainable from the CollectionProxy.
[21:52:52] dblessing: has joined #RubyOnRails
[21:52:58] superlou: has joined #RubyOnRails
[21:53:08] sk0r: has joined #RubyOnRails
[21:55:06] _underscore_: has joined #RubyOnRails
[21:55:22] onethirtyfive: Surely there is an AR guru here quietly contemplating my question in his/her mountaintop cave. ;)
[21:55:32] jgt: has joined #RubyOnRails
[21:55:49] dblessing: has joined #RubyOnRails
[21:55:53] clandry94: has joined #RubyOnRails
[21:55:59] eserror_: has joined #RubyOnRails
[21:56:40] chouhoul_: has joined #RubyOnRails
[21:58:18] nettoweb: has joined #RubyOnRails
[22:00:39] onethirtyfive: Nevermind, I just realized if I have my method on the association it's already scoped to the user. Haha one of those days...
[22:01:32] sk0r: has joined #RubyOnRails
[22:01:57] Markhor1991: has joined #RubyOnRails
[22:03:31] fox_mulder_cp: asahi: i can't know your qa, english is not my native (
[22:03:38] Sashimi: has joined #RubyOnRails
[22:04:02] dblessing: has joined #RubyOnRails
[22:04:07] clandry94: has joined #RubyOnRails
[22:05:37] havenwood: Sashimi: hi
[22:06:14] StevenXL: has joined #RubyOnRails
[22:07:00] rafaelfranca: has joined #RubyOnRails
[22:07:15] edwinvdgraaf: has joined #RubyOnRails
[22:08:32] Markhor1991: has joined #RubyOnRails
[22:08:33] asahi: fox_mulder_cp: no worries. I was looking for a guide of some sort, but I think I've figured out a way to work in memory by mapping the AR relations and then using activerecord-import
[22:08:51] whathappens: has joined #RubyOnRails
[22:10:33] Jasaka|NA: has joined #RubyOnRails
[22:11:15] dannyguk: has joined #RubyOnRails
[22:11:37] gingray: has joined #RubyOnRails
[22:12:34] pydave6367: has joined #RubyOnRails
[22:13:39] ksoze: has joined #RubyOnRails
[22:13:40] Markhor1991: has joined #RubyOnRails
[22:14:03] Darmani: has joined #RubyOnRails
[22:16:30] sonofdirt: has joined #RubyOnRails
[22:21:51] dannyguk: has joined #RubyOnRails
[22:23:43] Darmani: Hi guys, quick question.
[22:23:50] jancel: has joined #RubyOnRails
[22:24:16] Darmani: I'm want to convert a users input into an id. For example a user types in an email (into my form) and then I convert it into an id.
[22:24:18] Darmani: https://gist.github.com/mfifth/5f3b8edf3510380ce9995ba0a64d2da4
[22:24:24] Darmani: How would I go about doing that? o.o
[22:24:46] flashpoint9: has joined #RubyOnRails
[22:25:00] choke: has joined #RubyOnRails
[22:25:02] norc: Darmani, what do you mean by "converting it into an id"
[22:25:35] Darmani: norc: So... Like I would retrieve the id by calling id on the instance of the user they provided.
[22:25:44] Darmani: And that would create a new "conversation" between the two of them.
[22:26:27] Radar: GOOD MORNING
[22:26:59] Darmani: Radar: Woah long time no see dude
[22:27:09] Radar: It's been at most 4 days.
[22:27:16] norc: Darmani, so do that!
[22:27:38] Darmani: norc: I don't know how to do that though :[
[22:27:38] Radar: Darmani: No need to supply a hidden field here: https://gist.github.com/mfifth/5f3b8edf3510380ce9995ba0a64d2da4#file-index-html-erb-L3
[22:27:42] norc: Darmani, you already have it...
[22:27:46] Radar: Darmani: Just assume sender_id is current_user.id in the controller
[22:27:49] norc: Darmani, recipient_id ?
[22:28:15] Darmani: Radar: I don't know how to do that either lol..
[22:28:21] Radar: Darmani: As for the recipient field, you can find the user by their email address in the controller. recipient = User.find_by(email: params[:recipient])
[22:29:23] Darmani: Radar: I need to wrap my head around what you just said.
[22:29:26] Darmani: Give me a second. lol
[22:33:44] Axsuul: has joined #RubyOnRails
[22:34:01] enkristoffer: has joined #RubyOnRails
[22:34:16] eljimmy: has joined #RubyOnRails
[22:35:18] Darmani: Radar: Ah. That's smarter than what I did... I didn't think about putting that in the controller o.o
[22:38:02] Darmani: Radar: Okay I have the recipient saved as an integer in my db. So it looks for a recipient_id. That's why I wanted to convert the input.
[22:38:05] Radar: Darmani: I mean you could make it fancy so that it does an AJAX lookup based on the user's email address and then assigns an id to a hidden field... but that might be above your skill levle for now.
[22:38:17] jenrzzz: has joined #RubyOnRails
[22:38:17] jenrzzz: has joined #RubyOnRails
[22:39:28] Darmani: Radar: That sounds complicated.
[22:40:07] Radar: Yup, it is.
[22:41:25] Darmani: Radar: Meh I'm just gonna read the simple_form docs. There has to be a way to do this.
[22:41:50] Radar: Darmani: I would recommend sending it through as a regular field, using text_field_tag :recipient
[22:41:54] lupine: famous last words
[22:41:57] Radar: Then doing the lookup in the controller, as I recommended before.
[22:42:13] dblessing: has joined #RubyOnRails
[22:42:29] Darmani: Radar: Ah so leave simple_form out of it? Hm, okay.
[22:42:35] Darmani: I'll show you what I come up with ^^
[22:43:02] quazimodo: has joined #RubyOnRails
[22:43:16] rafaelfranca: has joined #RubyOnRails
[22:44:00] pawnbox: has joined #RubyOnRails
[22:44:24] blackmesa: has joined #RubyOnRails
[22:54:28] blackmesa: has joined #RubyOnRails
[22:55:35] chopin: has joined #RubyOnRails
[22:58:41] superlou: has joined #RubyOnRails
[23:00:07] eserror: has joined #RubyOnRails
[23:00:28] tildes: has joined #RubyOnRails
[23:04:16] lightt: has joined #RubyOnRails
[23:04:35] B1n4r10: has joined #RubyOnRails
[23:07:11] __royal: has joined #RubyOnRails
[23:08:07] Darmani: Radar: https://gist.github.com/mfifth/5f3b8edf3510380ce9995ba0a64d2da4
[23:08:16] Darmani: I keep getting this error. Don't know why.
[23:08:33] __royal: is there a way to save inner html to a variable and pass it along with params?
[23:09:55] jgt1: has joined #RubyOnRails
[23:10:50] Radar: __royal: Do you have an example of what you're trying to do?
[23:11:09] __royal: well im using quilljs to make a text editor
[23:11:21] __royal: and quill build a series of dom elements on the page
[23:11:52] __royal: those dom elements being stylized text
[23:12:06] __royal: and im trying to find a way to save the contents
[23:13:01] jenrzzz: has joined #RubyOnRails
[23:15:11] ravster: has joined #RubyOnRails
[23:18:09] elton: has joined #RubyOnRails
[23:19:59] Radar: __royal: my guess is that it provides some kind of JS API to retrieve the elements, so then you could get those elements and pass them as a parameter back to Rails by using jQuery
[23:22:37] dannyguk: has joined #RubyOnRails
[23:24:02] choke: has joined #RubyOnRails
[23:24:30] __royal: Radar: yes you're right, thanks!
[23:25:43] tildes_: has joined #RubyOnRails
[23:25:55] Sashimi: has joined #RubyOnRails
[23:30:22] Darmani: Radar: I'm really not sure what I'm missing.
[23:30:43] Radar: Darmani: Conversation model please
[23:31:02] Radar: Darmani: Error looks like a validation error
[23:31:13] Darmani: Radar: https://gist.github.com/mfifth/5f3b8edf3510380ce9995ba0a64d2da4
[23:31:22] Darmani: Radar: yeah I'm just not sure why it says that.
[23:32:35] yfeldblum: has joined #RubyOnRails
[23:32:50] dnewkerk: has joined #RubyOnRails
[23:33:44] Sashimi: has joined #RubyOnRails
[23:34:05] DanByc: has joined #RubyOnRails
[23:34:12] DanByc: Hello all
[23:34:15] twilling: has joined #RubyOnRails
[23:34:45] rizenine: has joined #RubyOnRails
[23:35:00] dalbusch1t: has joined #RubyOnRails
[23:35:20] Radar: Darmani: https://gist.github.com/mfifth/5f3b8edf3510380ce9995ba0a64d2da4#file-conversation-rb-L7 this is why
[23:35:40] Radar: Darmani: Check the params you're passing in here: https://gist.github.com/mfifth/5f3b8edf3510380ce9995ba0a64d2da4#file-conversations_controller-rb-L11
[23:36:11] DanByc: Hello Radar. Thanks again for sending me that tutorial. I'm on Ch. 10 right now, with a strange problem regarding Pundit
[23:37:00] DanByc: Where do I begin to solve a failed Rspec test stating that on clicking "States", Pundit::PolicyScopingNotPerformedError:
[23:37:14] Darmani: Radar: I don't see what you are seeing Radar... That scope is to make sure I don't have a conversation with myself, and that "between" scope it to make sure there isn't already an existing convo between two users.
[23:37:33] Radar: Darmani: What is the value of params[:sender_id]? What is the value of params[:recipient_id]?
[23:38:23] Darmani: Radar: The value? Those should be two different user id's..
[23:38:27] Darmani: In theory anyway...
[23:38:33] Radar: Darmani: I don't care about theory.
[23:38:36] Radar: I care about practical.
[23:38:55] Darmani: Okay well those are two different users Radar.
[23:39:10] Radar: ACTION grabs Darmani by the shoulders; shakes vigorously
[23:39:42] Markhor1991: has joined #RubyOnRails
[23:39:57] Darmani: Radar:Okay they aren't?? They are the same??
[23:40:27] Sashimi: has joined #RubyOnRails
[23:40:46] Radar: [09:37:33] <Radar> Darmani: What is the value of params[:sender_id]? What is the value of params[:recipient_id]?
[23:41:26] Darmani: Radar: How do you highlight stuff in Gist? The way you do?
[23:41:30] Radar: Darmani: Click on the line number.
[23:41:50] Darmani: Radar: https://gist.github.com/mfifth/5f3b8edf3510380ce9995ba0a64d2da4#file-conversation-rb-L2
[23:42:08] Radar: Darmani: the value! the bloody value.
[23:42:18] Darmani: Radar: I don't know D:
[23:42:19] Darmani: ACTION cries
[23:42:20] Radar: Check the logs. It'll be in the logs.
[23:42:32] Radar: put a binding.pry above the Conversation.between and pull the values out of that somehow
[23:42:54] tildes: has joined #RubyOnRails
[23:43:17] renegadeandy: has joined #RubyOnRails
[23:43:46] DanByc: Radar: I have a quick question regarding chapter 10 of Rails 4 in Action if you have the time
[23:43:59] Radar: DanByc: Yes I do :)
[23:44:29] DanByc: Sweet thanks. I've been stuck on this for a while, hard reset and copied and pasted all the code. No luck:
[23:45:09] DanByc: I'm getting this error after generating the State controller: Failure/Error: click_link "States"
[23:45:10] DanByc: Pundit::PolicyScopingNotPerformedError:
[23:45:10] DanByc: Pundit::PolicyScopingNotPerformedError
[23:45:23] Radar: DanByc: Do you have the code on GitHub somewhere so I can clone it down to my machine and take alook?
[23:46:40] moeabdol: has joined #RubyOnRails
[23:46:42] DanByc: Yes I have it on my account: https://github.com/DanByczynski18/ticketee
[23:47:01] Radar: Thanks. Should I just check out to the master branch?
[23:47:24] DanByc: Yeah I just saved it to the master
[23:47:37] DanByc: Probably not githubbing correctly lol
[23:49:37] Radar: Taking a look. One moment.
[23:49:54] DanByc: Awesome I really appreciate it. Google was a total bust for this one
[23:50:53] dblessing: has joined #RubyOnRails
[23:54:11] Radar: I can reproduce the issue, but I am not sure what causes it. Going to take a deeper look.
[23:57:12] DanByc: Yeah I went back a couple chapters and found nothing. Maybe new version compatibility issues?
[23:58:04] lightt: has joined #RubyOnRails
[23:58:06] dblessing: has joined #RubyOnRails
[23:59:35] ekinmur: has joined #RubyOnRails