« Back to channel list

#RubyOnRails - 22 April 2016

« Back 1 day Forward 1 day »
[00:00:46] zave: has joined #RubyOnRails
[00:00:57] wldcordeiro: has joined #RubyOnRails
[00:04:10] n008f4g_: has joined #RubyOnRails
[00:04:27] rahult_: has joined #RubyOnRails
[00:04:35] ZerGabriel: has joined #RubyOnRails
[00:06:05] bronson: has joined #RubyOnRails
[00:10:48] smathy: I like it tubbo, only what you need.
[00:12:10] tubbo: i made the /orders.xml index with haml though
[00:12:13] tubbo: (we already use haml)
[00:13:47] aloneintheworld: has joined #RubyOnRails
[00:16:08] bruno-: has joined #RubyOnRails
[00:16:21] SteenJobs: has joined #RubyOnRails
[00:21:10] twilling: has joined #RubyOnRails
[00:21:34] bronson: has joined #RubyOnRails
[00:30:21] chouhoul_: has joined #RubyOnRails
[00:34:50] neanderslob: has joined #RubyOnRails
[00:35:52] duncannz: has joined #RubyOnRails
[00:35:53] bruno-: has joined #RubyOnRails
[00:36:20] chipotle: has joined #RubyOnRails
[00:37:33] grassass: has joined #RubyOnRails
[00:39:13] pawnbox: has joined #RubyOnRails
[00:40:50] duncannz: has joined #RubyOnRails
[00:46:20] duncannz: I am using simple_calendar for rails but have written my own styled Previous month and Next month buttons, therefore I want to remove those that simple_calendar automatically puts in, but can't find how to do this.
[00:49:57] JonasOSDever: has joined #RubyOnRails
[00:50:07] RegulationD: has joined #RubyOnRails
[00:50:34] ur5us: has joined #RubyOnRails
[00:53:04] neha-: maybe subclass it
[00:53:31] neanderslob: has joined #RubyOnRails
[00:54:14] SeanLazer: has joined #RubyOnRails
[00:55:21] aegis3121: has joined #RubyOnRails
[00:55:35] one_zero: has joined #RubyOnRails
[01:00:29] bruno-: has joined #RubyOnRails
[01:03:15] sudoubuntu: has joined #RubyOnRails
[01:05:50] uri___: has joined #RubyOnRails
[01:08:07] srinidhi: has joined #RubyOnRails
[01:11:13] sevenseacat: has joined #RubyOnRails
[01:14:32] maxdoubt: has joined #RubyOnRails
[01:14:53] pawnbox: has joined #RubyOnRails
[01:16:09] AmiMoench: has joined #RubyOnRails
[01:17:19] Guest_: has joined #RubyOnRails
[01:17:20] petor: has joined #RubyOnRails
[01:20:41] diegoaguilar: has joined #RubyOnRails
[01:29:24] Pazician: has joined #RubyOnRails
[01:30:03] roamingdog: has joined #RubyOnRails
[01:31:17] akshat: has joined #RubyOnRails
[01:32:17] noobsu: has joined #RubyOnRails
[01:34:09] RahulT: has joined #RubyOnRails
[01:35:35] wd40s: has joined #RubyOnRails
[01:37:25] JonasOSDever: has joined #RubyOnRails
[01:38:27] bradleyprice: has joined #RubyOnRails
[01:41:29] Ropeney: has joined #RubyOnRails
[01:43:15] chouhoulis: has joined #RubyOnRails
[01:44:04] maxdoubt: has joined #RubyOnRails
[01:44:12] yfeldblum: has joined #RubyOnRails
[01:45:14] Cohedrin: has joined #RubyOnRails
[01:50:44] bruno-: has joined #RubyOnRails
[01:51:02] pawnbox: has joined #RubyOnRails
[01:51:48] maxdoubt: has joined #RubyOnRails
[01:55:31] chagel: has joined #RubyOnRails
[01:55:59] rahult_: has joined #RubyOnRails
[01:57:13] akshat: has joined #RubyOnRails
[01:59:19] bronson: has joined #RubyOnRails
[02:01:01] bruno-: has joined #RubyOnRails
[02:03:41] bradleyprice: has joined #RubyOnRails
[02:10:47] flashpoint9: has joined #RubyOnRails
[02:12:57] chipotle: has joined #RubyOnRails
[02:15:44] bruno-: has joined #RubyOnRails
[02:20:54] akshat_: has joined #RubyOnRails
[02:23:07] beilabs: has joined #RubyOnRails
[02:26:04] chipotle: has joined #RubyOnRails
[02:31:04] joshkovach: has joined #RubyOnRails
[02:31:10] neha-: has joined #RubyOnRails
[02:31:12] SteenJobs: has joined #RubyOnRails
[02:34:00] neha-: has joined #RubyOnRails
[02:36:02] shibly: has joined #RubyOnRails
[02:36:19] shibly: has left #RubyOnRails: ("Leaving")
[02:39:37] maxdoubt: has joined #RubyOnRails
[02:40:32] braincrash: has joined #RubyOnRails
[02:43:48] SteenJobs: has joined #RubyOnRails
[02:45:13] maxdoubt: has joined #RubyOnRails
[02:46:34] pawnbox: has joined #RubyOnRails
[02:47:12] FooMunki: has joined #RubyOnRails
[02:48:56] egray: has joined #RubyOnRails
[02:50:25] petor: has joined #RubyOnRails
[02:52:19] fedexo: has joined #RubyOnRails
[02:55:13] maxdoubt: has joined #RubyOnRails
[02:57:23] syndikate: has joined #RubyOnRails
[03:00:31] SeanLazer: has joined #RubyOnRails
[03:00:40] bronson: has joined #RubyOnRails
[03:05:09] Rodya_: has joined #RubyOnRails
[03:06:00] bruno-: has joined #RubyOnRails
[03:07:03] theblang: has joined #RubyOnRails
[03:13:08] ebbflowgo: has joined #RubyOnRails
[03:13:09] pyemkey: has joined #RubyOnRails
[03:15:23] yfeldblum: has joined #RubyOnRails
[03:16:18] syndikate: has joined #RubyOnRails
[03:16:42] bruno-: has joined #RubyOnRails
[03:16:47] braincrash: has joined #RubyOnRails
[03:17:40] roamingdog: has joined #RubyOnRails
[03:18:03] stardiviner: has joined #RubyOnRails
[03:20:29] Radar: GOOD AFTERNOON
[03:20:58] hckiang: has joined #RubyOnRails
[03:21:39] Spami: has joined #RubyOnRails
[03:21:54] hckiang: has joined #RubyOnRails
[03:22:20] pawnbox: has joined #RubyOnRails
[03:22:21] SteenJobs: how’s the weather over there these days?
[03:22:36] SteenJobs: it’s finally been sunny in NYC
[03:23:42] mattp_: has joined #RubyOnRails
[03:24:19] sevenseacat: morning Radar
[03:24:38] SteenJobs: evening here
[03:25:01] SteenJobs: do you know if there’s any way to scale an entire frontend without having to resize every single element
[03:25:15] SteenJobs: designer said everything needs to be 20% smaller
[03:25:55] Radar: * { font-size: 80% }
[03:26:06] Radar: Also: fire your designer
[03:26:09] hckiang: !important
[03:26:17] hckiang: fire your designer +1
[03:26:20] sevenseacat: +1 to fire designer
[03:26:28] sevenseacat: if you do that, it will not be what you expect
[03:26:41] hckiang: it will fuck up things in mobile
[03:26:57] sevenseacat: it'll fuck things up everywhere
[03:29:08] roamingdog: has joined #RubyOnRails
[03:30:04] t_p: has joined #RubyOnRails
[03:31:07] Pazician: has joined #RubyOnRails
[03:31:22] bruno-: has joined #RubyOnRails
[03:34:29] markelite: has joined #RubyOnRails
[03:34:50] hckiang: has left #RubyOnRails: ("ERC (IRC client for Emacs 24.5.1)")
[03:34:55] TheShaun: has joined #RubyOnRails
[03:34:56] SteenJobs: he’s one of the founders!
[03:35:20] SteenJobs: and anyway, i didn’t use em values…i used percentages mostly, so would font-size still work in theory?
[03:37:48] suffice: has joined #RubyOnRails
[03:40:29] sevenseacat: give it a go.
[03:41:42] jobewan: has joined #RubyOnRails
[03:45:31] pyemkey: Morning. Let's imagine you have search page with many filters and user would like to save his favorite one to reuse them later. Is it right approach save link into database with specific params? I also look for right name for this kind of resource. SavedSearch is good one?
[03:47:42] t_p: has joined #RubyOnRails
[03:47:51] gambl0re: hi sevenseacat
[03:48:45] jscheel: has joined #RubyOnRails
[03:49:14] roamingdog: pyemkey: deja vu - did none of the suggestions from earlier work for you? if not, what issues are you having?
[03:49:52] jscheel: hi all! Is there any way for a model to know when one of it’s associations has saved? So, blog has_many posts, callback for blog when post is persisted?
[03:51:16] roamingdog: jscheel: just googled 'rails notify parent when child is saved' and got this as first response:
[03:51:21] roamingdog: after_save do
[03:51:21] roamingdog: conversation.update_attribute(:updated_at, Time.now)
[03:51:58] jscheel: roamingdog: oh, interesting, so it’s touching the parent
[03:52:09] roamingdog: that's a bit old, but the ease with which it was found suggests you haven't really tried looking yet. sorry i'm in a foul mood. still trying to be helpful :)
[03:52:27] roamingdog: in that example, i assume Conversation is the parent, yes
[03:52:43] jscheel: roamingdog: no sorry, was a dumb question, brain is mush today
[03:53:17] roamingdog: oh look, it's beer o'clock! i should be right as rain again shortly
[03:54:02] tfitts: jscheel: I think parent.touch would also work
[03:54:23] roamingdog: jscheel: what do you want to accomplish though?
[03:54:30] roamingdog: just set updated_at?
[03:58:15] jscheel: roamingdog: hehe, it’s a rabbit hole :) parent has after_add callback on association that creates some other models in a different association. I need them to save if the child from the first association is built, then saved
[03:58:27] tfitts: that'll trigger all the callbacks too
[03:58:38] jscheel: problem is that the after_add association callback only cares about something getting added in memory
[03:58:42] pawnbox: has joined #RubyOnRails
[03:58:43] jscheel: it doesn’t care about persistence
[03:59:12] jscheel: apparently there was some debate about this several years ago, but it didn’t come to anything
[03:59:53] roamingdog: not familiar with 'after_add'...
[04:00:08] jscheel: roamingdog: it’s an association callback
[04:00:32] fox_mulder_cp: has joined #RubyOnRails
[04:02:17] jscheel: hmm, I don’t think touch actually fires callbacks
[04:04:27] jscheel: oh, a subset of callbacks
[04:04:45] lessless: has joined #RubyOnRails
[04:05:48] roamingdog: jscheel: can i see the url you're looking at, if there is one?
[04:06:01] jscheel: for the touch callbacks?
[04:06:10] roamingdog: ja, mentioning a subset etc?
[04:06:12] jscheel: http://apidock.com/rails/ActiveRecord/Persistence/touch
[04:06:33] jscheel: “after_touch, after_commit and after_rollback callbacks are executed”
[04:08:16] roamingdog: yes i see, will any of those be a problem though?
[04:10:16] jstransky: has joined #RubyOnRails
[04:11:40] Cohedrin_: has joined #RubyOnRails
[04:12:12] jscheel: roamingdog: no, I got it working with after_touch, I think
[04:12:16] jscheel: running specs now
[04:13:44] Yeomra: has joined #RubyOnRails
[04:14:00] tubbo: has joined #RubyOnRails
[04:17:45] zacts: has joined #RubyOnRails
[04:18:12] nickenchuggets: has joined #RubyOnRails
[04:18:12] nickenchuggets: has joined #RubyOnRails
[04:19:27] context: wow. well... activeadmin is awesome! and so is ruby.
[04:19:43] tfitts: context: you're joking, right?
[04:20:04] context: i dont know who to blame, i think ruby
[04:20:46] Hodge: has joined #RubyOnRails
[04:21:15] context: log instance.inspect ; if false { instance = something_else } ; log instance.inspect
[04:21:24] context: what do i get? my-instance, followed by nil.
[04:21:33] context: the code literally says "if false"
[04:21:42] context: WHY in gods effing hell, is instance turning into nil.
[04:23:06] context: the block doesnt even get executed. i have a log message in it that doesnt doanything
[04:23:19] context: BUT if i comment the block, both instance.inspect happily show the instance.
[04:24:07] context: tfitts: so no... im not joking
[04:27:07] context: https://ghostbin.com/paste/p9hmy
[04:27:26] baweaver: has joined #RubyOnRails
[04:27:38] pawnbox: has joined #RubyOnRails
[04:27:48] tfitts: context: try pry
[04:29:06] tfitts: instead of all that logger stuff you can step into your code and check things out
[04:29:10] Spami: has joined #RubyOnRails
[04:29:18] context: yeah, just as expected, binding.pry never triggers inside the block, cause it says if flase
[04:30:29] pawnbox: has joined #RubyOnRails
[04:30:39] tfitts: why would you even have to check. of course if false isn't going to execute the block
[04:31:13] context: thanks sherlock...
[04:31:22] context: why would the same exact print statement on top and bottom differ then
[04:31:27] Ropeney: context, i'm wondering how you'r doing an if without an end
[04:31:33] chagel: has joined #RubyOnRails
[04:32:15] Ropeney: if false {}
[04:32:35] sevenseacat: oh right, i was looking at the actual code in the ghostbin
[04:32:58] Ropeney: i stopped reading down after it got to complaining
[04:33:03] Ropeney: missed that part
[04:33:22] context: the if {} was just for irc. pseudo, ghostbin was for actual code
[04:34:28] context: i know the block doesnt execute, that gives zero explanation as to why the blocks mere existence causes crap to disappear
[04:35:28] Ropeney: you sure your not pasting "irrelevant" info?
[04:37:39] context: which part looks irrelevant
[04:38:02] Ropeney: is there some code your leaving out because you feel its not irrelevant
[04:38:08] context: its the only Rails.logger.info that currently exists in the code and only part being copy/pasta'd from my server console
[04:38:24] dopie: has joined #RubyOnRails
[04:38:33] Ropeney: its not relevant*
[04:38:46] jstransky: has joined #RubyOnRails
[04:39:12] context: removing ALL other code from this file still gives me nil. but does not crash seeing as it stops trying to use resource
[04:39:42] context: the only other 'relevant' info would be that this is an active admin related file which i kind of noted above
[04:40:02] context: so i think its related to this Arbre::Context crap but ... the if block still does not get executed.
[04:40:04] havenwood: There's not other relevant context, context?
[04:40:08] context: and its still ruby code
[04:40:20] havenwood: Mmm, context two levels deep...
[04:41:00] havenwood: First time I saw arb I swore it was an erb typo. I continue to do so.
[04:41:36] baweaver: Arbre is french for tree
[04:42:06] baweaver: you'd think with a name like that they'd log things better
[04:42:24] havenwood: Les arbres sont belles mais grumes pas tellement.
[04:42:37] context: baweaver: pun intended right ;)
[04:43:16] baweaver: I would never stoop to such low brow humour as a pun
[04:43:24] havenwood: ACTION eyes Google translate suspiciously, these are not the logs you're looking for
[04:44:04] context: meh. apologize for the blowing up. ill move the logic outside of the arb 'view'.
[04:44:08] context: still confuses the crap out of me
[04:44:59] havenwood: Pass it through a few langs and it makes more sense: Trees are beautiful, but not like logs.
[04:45:19] tvon: has joined #RubyOnRails
[04:45:36] baweaver: Wood you believe no one's going to call me on that earlier statement?
[04:45:52] baweaver: Perhaps I'm barking up the wrong tree.
[04:45:55] tfitts: I thought it was good
[04:45:58] tfitts: wow, they keep going
[04:46:02] baweaver: I'm a sap for a good pun
[04:46:21] baweaver: there's no way I can leaf it at just one.
[04:46:31] baweaver: Gotta branch out a bit into the domain
[04:47:49] baweaver: havenwood: I'll always root for a good pun.
[04:48:03] ornerymoose: has joined #RubyOnRails
[04:48:03] havenwood: baweaver: wooden you know it
[04:48:19] baweaver: Axeually I woodn't
[04:49:02] baweaver: Shoulda saw that coming.
[04:51:23] havenwood: i saw logs and it was nice gnawing them
[04:51:58] RegulationD: has joined #RubyOnRails
[04:52:03] baweaver: Going to go out on a limb here and say we should probably end our pun here.
[04:53:19] pyemkey: has joined #RubyOnRails
[04:55:08] chagel: has joined #RubyOnRails
[04:56:40] AmiMoench: has left #RubyOnRails: ()
[04:59:54] duncannz: has joined #RubyOnRails
[05:01:19] tildes: has joined #RubyOnRails
[05:02:50] Megamos: has joined #RubyOnRails
[05:12:59] jenrzzz: has joined #RubyOnRails
[05:15:18] noobsu: has joined #RubyOnRails
[05:18:56] ale: has joined #RubyOnRails
[05:19:49] apeiros: has joined #RubyOnRails
[05:20:08] t_p: has joined #RubyOnRails
[05:22:07] shibly: has joined #RubyOnRails
[05:22:12] t_p: has joined #RubyOnRails
[05:22:32] shibly: has left #RubyOnRails: ()
[05:23:15] flashpoint9: has joined #RubyOnRails
[05:23:34] Devalo: has joined #RubyOnRails
[05:25:36] fox_mulder_cp: has joined #RubyOnRails
[05:28:02] dionysus69: has joined #RubyOnRails
[05:29:16] nix1947: has joined #RubyOnRails
[05:29:50] jenrzzz: has joined #RubyOnRails
[05:29:51] jenrzzz: has joined #RubyOnRails
[05:31:59] DZj091231kld: has joined #RubyOnRails
[05:32:03] Pazician: has joined #RubyOnRails
[05:36:51] netzfisch: has joined #RubyOnRails
[05:37:41] stardiviner: has joined #RubyOnRails
[05:43:52] Cohedrin: has joined #RubyOnRails
[05:45:09] chagel: has joined #RubyOnRails
[05:48:17] DailySnow: has joined #RubyOnRails
[05:49:26] DailySnow: has left #RubyOnRails: ()
[05:53:09] yfeldblum: has joined #RubyOnRails
[05:54:23] jenrzzz: has joined #RubyOnRails
[05:54:23] jenrzzz: has joined #RubyOnRails
[05:59:12] navneet_: has joined #RubyOnRails
[05:59:34] RahulT: has joined #RubyOnRails
[05:59:46] navneet_: has joined #RubyOnRails
[06:00:28] navneet__: has joined #RubyOnRails
[06:01:29] bronson: has joined #RubyOnRails
[06:01:51] beilabs: has joined #RubyOnRails
[06:05:44] roamingdog: has joined #RubyOnRails
[06:08:56] violarium: has joined #RubyOnRails
[06:09:22] suffice: has joined #RubyOnRails
[06:10:38] TheShaun: has joined #RubyOnRails
[06:12:49] DanKnox: has joined #RubyOnRails
[06:16:13] pLaToOn: has joined #RubyOnRails
[06:16:19] thejamespinto: hey guys, I have a concern that does redirections based on data found in the user model... but I don't want that to be a concern, I wanted it to be a class by itself, what category does this class fall into? It seems like a Presenter/Decorator, but my thing is with Model+Controller
[06:16:27] thejamespinto: any suggestions?
[06:16:41] sevenseacat: hey everyone*
[06:16:47] markelite: has joined #RubyOnRails
[06:17:08] thejamespinto: I keep forgetting using guys is colloquial :(
[06:17:13] thejamespinto: Hey everyone :)
[06:17:38] null__: has joined #RubyOnRails
[06:18:12] TheMoonMaster: has joined #RubyOnRails
[06:18:44] armyriad: has joined #RubyOnRails
[06:19:58] sp1rs: has joined #RubyOnRails
[06:20:41] gambl0re: hi sevenseacat
[06:20:44] gambl0re: hows things?
[06:21:04] kareeoleez: has joined #RubyOnRails
[06:21:21] kareeoleez: guys what is a suggested dir path to put the entire rails application on a production machine ?
[06:21:30] gambl0re: ACTION slaps sevenseacat around a bit with a large trout
[06:21:50] kareeoleez: I usually deploy them in /home/username/app but I am not sure this is right
[06:23:35] null__: has joined #RubyOnRails
[06:23:56] agit0: has joined #RubyOnRails
[06:24:43] aganov: has joined #RubyOnRails
[06:25:21] null__: has joined #RubyOnRails
[06:27:44] pawnbox_: has joined #RubyOnRails
[06:28:43] thejamespinto: kareeoleez: everyone* (I'm sorry but your sexist language offends one of our members)
[06:28:47] tildes: kareeoleez: out of curiosity I googled something for you: http://stackoverflow.com/questions/166370/what-deployment-directories-do-you-use-for-rails-applications-deploying-to-a-de
[06:29:07] tildes: kareeolez: imo the username part is off, for sure
[06:29:19] tildes: I personally like the /var/rails/appname suggestion
[06:29:29] Ropeney: i prefer /srv/
[06:29:46] tildes: we do something different at our company, but still, definitely not inside anybody's username dir :)
[06:29:55] tildes: Ropeney: why is that?
[06:30:09] Pazician: has joined #RubyOnRails
[06:30:14] sevenseacat: thejamespinto: it's not sexist, its exclusionary. and I'm not offended, its a suggestion.
[06:30:51] null__: has joined #RubyOnRails
[06:30:51] kareeoleez: thejamespinto: no sexist language. I was specific haha
[06:31:19] tildes: kareeoleez: I for one don't like to be called a guy, but thought it was an interesting question in any case
[06:31:20] thejamespinto: sevenseacat: please, it-is is not a possessive, you are offending my perfectly grammatical eyes.
[06:31:24] sp1rs: has joined #RubyOnRails
[06:31:30] Ropeney: tildes, no real reason just what I have done.
[06:31:40] tildes: Ropeney: ok, a matter of taste then :)
[06:31:44] Ropeney: srv seems more "correct" naming haha
[06:31:53] sevenseacat: thejamespinto: i suggest being a little less ridiculous.
[06:32:22] thejamespinto: hey guys, sevenseacat wants us all to stop being silly
[06:32:24] kareeoleez: tildes: If this is an application that will be deployed in several machines and the system is bootstrapped with a standard user, it should be fine
[06:32:30] ChanServ: +q *!*@177.159.138.3
[06:32:46] roamingdog: has joined #RubyOnRails
[06:32:49] sevenseacat: 15min timeout.
[06:33:18] kareeoleez: tildes: I believe I ssh'ed to cloud66's connected droplet in DO and saw them save everything in /var/something
[06:33:29] tildes: kareeoleez: not saying it wouldn't work. so to be specific, I just haven't seen that kind of arrangement
[06:34:00] Ropeney: I think Redhat and debian default to /var/www/ ?
[06:34:08] kareeoleez: tildes: without a reason I followed nginx /var/www folder in the beginning
[06:34:13] antgel: has joined #RubyOnRails
[06:34:22] Pazician_: has joined #RubyOnRails
[06:34:23] kareeoleez: but this is too PHP-ish
[06:34:37] sevenseacat: what does PHP have to do with a folder on a server?
[06:34:44] kareeoleez: I don't see PHP sites as applications but as templates
[06:34:56] kareeoleez: mostly about how templates are served
[06:35:02] Ropeney: "php is hosted in a directory, must not do"
[06:35:13] kareeoleez: you know what I mean
[06:35:17] Ropeney: no i don't
[06:35:19] sevenseacat: Ropeney: I prefer to put my apps in a quantum cloud.
[06:35:33] sevenseacat: so very Ruby-ish.
[06:35:33] kareeoleez: each language or framework has its own philosophy
[06:36:05] sevenseacat: kareeoleez: I also don't see what's "PHP-ish" about using nginx's default app folder
[06:36:19] Ropeney: they don't reinvent the wheel though
[06:36:25] Ropeney: that may be a lie
[06:36:31] sevenseacat: oh Rails usually does
[06:36:52] kareeoleez: it's not a big deal the whole question I did
[06:37:02] kareeoleez: just asking IF there is "right" and "wrong"
[06:37:08] Ropeney: it's not, but discussion is fun :D
[06:37:35] roamingdog: oh, Ropeney, thanks for pointing me the other night to setting up warden helpers for running rspec suite. it took some time, but my test suite is a beautiful thing now.
[06:37:48] sevenseacat: whats right is what works. whats wrong is what doesnt
[06:37:58] Palsson: has joined #RubyOnRails
[06:38:00] roamingdog: sevenseacat: ah, but that's pragmatic
[06:38:02] kareeoleez: also has to do with permissions (default)
[06:38:14] sevenseacat: when asking simple questions like 'what server folder do I put apps in'
[06:38:22] kareeoleez: I don't want to mess around with custom folders in /etc or /var/bin
[06:39:02] kareeoleez: sevenseacat: nice quote, I hope you don't mind If I steal it
[06:39:24] sevenseacat: not at all. i probably stole it from somewhere else, and it just popped into my head.
[06:39:26] Ropeney: roamingdog, np :D
[06:40:24] kareeoleez: Zuckemberg stole an idea from others and look what it became
[06:40:34] kareeoleez: the implementation is what matters
[06:40:44] roamingdog: kareeoleez: yes
[06:41:04] kareeoleez: so the one who puts the idea into practice
[06:41:17] kareeoleez: shit, this got too philosophical
[06:41:25] kareeoleez: isn't there a #philosophy to talk
[06:41:45] kareeoleez: sorry guys and ladies (got it right this time)
[06:42:06] roamingdog: (i think 'guys' includes all humans) (ducks)
[06:42:22] sevenseacat: most guys do think that.
[06:42:38] roamingdog: why must we differentiate?
[06:42:50] solars: has joined #RubyOnRails
[06:42:59] roamingdog: is there another term that includes all? i don't want to go around saying 'humans' all the time
[06:43:14] sevenseacat: 'everyone'? 'all'? 'folks'? 'group'?
[06:43:53] roamingdog: but, surely you see that, in modern vernacular, guys has come to mean 'everybody'?
[06:43:54] sevenseacat: roamingdog: replace a male word ('guys') with a female word ('girls') in your vocabulary and see how odd it sounds
[06:44:15] ur5us: has joined #RubyOnRails
[06:44:26] roamingdog: i have two daughers, both 13. they're fine with being called guys, because that's their current language
[06:44:48] kareeoleez: I feel offended by "humans"
[06:44:52] roamingdog: girls is specific. boys is specific. i don't see that 'guys' is
[06:44:57] gambl0re: hi sevenseacat
[06:45:01] sevenseacat: I used to be fine with it too, when I was too concerned about fitting in a male-dominated world
[06:45:10] gambl0re: in case you dont know, sevenseacat is a she, i think
[06:45:19] sevenseacat: now, I'm quite happy to tell you that I am not one of the guys, thank you
[06:45:32] kareeoleez: I know noone cares but I believe in equality too
[06:45:41] roamingdog: well, is there really any issue saying 'guys' to mean everyone then?
[06:45:48] kareeoleez: just trying to get a bit publicity in this room
[06:45:52] roamingdog: kareeoleez: i care
[06:46:07] sevenseacat: roamingdog: because you're deciding a male word should represent males and females
[06:46:30] sevenseacat: and females are saying no
[06:46:32] roamingdog: sevenseacat: people then; i'll try to say 'people'
[06:46:45] roamingdog: i really don't want to make trouble or offend, just asking
[06:46:49] Ropeney: can we move on now?
[06:46:58] kareeoleez: I insist on being offended by called "human"
[06:47:18] roamingdog: kareeoleez: i see your point, but i insist on calling you a human
[06:47:21] sevenseacat: someone always has to go to that level.
[06:47:25] roamingdog: unless you can prove otherwise
[06:47:48] kareeoleez: we are not all humans
[06:48:01] kareeoleez: some of us are gods
[06:48:10] roamingdog: i bow down then
[06:48:22] TheMoonMaster: has joined #RubyOnRails
[06:48:35] roamingdog: ok, yes, that was jejune
[06:48:38] kareeoleez: I am trying to increase the level of my interpersonal skills
[06:48:49] sevenseacat: you're failing miserably
[06:48:58] kareeoleez: by hoping to make sevenseacat laugh
[06:49:09] sevenseacat: trolling is the opposite of what you should be doing
[06:49:46] roamingdog: i wish i had a rails question, but everything's moving along swimmingly here
[06:50:30] GorillaApe: has joined #RubyOnRails
[06:51:09] GorillaApe: I play with stuffed monkeys
[06:51:24] GorillaApe: with embedded ruby compiler
[06:51:26] roamingdog: now THAT'S what i come here for
[06:51:54] tildes: I actually have a ruby question if anyone's in the mood
[06:52:16] Chagel_: has joined #RubyOnRails
[06:52:18] ChanServ: -q *!*@177.159.138.3
[06:52:34] sevenseacat: sorry, that was a bit longer than 15 minutes, I lost track of time.
[06:52:39] thejamespinto: I haz a mouth again
[06:52:43] hello9: has joined #RubyOnRails
[06:53:02] kareeoleez: sevenseacat: I am starting to believe you're a bot
[06:53:16] sevenseacat: believe whatever you like
[06:53:55] Ropeney: kareeoleez your beeing stupid, correct yourself :)
[06:53:55] hello9: Hey all, I'm trying to render a string as a textfile download. I did this before in Rails 2 with :render => text, and it would generate the file. in Rails 4 i tried that, and also send_data and the logs say it's rendered, but no file is downloaded
[06:54:04] kareeoleez: I guess the reply to the question "where do you live?" should be "in /var/www"
[06:54:44] null__: has joined #RubyOnRails
[06:54:54] kareeoleez: Ropeney: not at all, I have endless respect for sevenseacat
[06:55:26] Ropeney: you may do, but right now... your coming across as quite the tool. Lets stop :D
[06:56:31] quazimodo: has joined #RubyOnRails
[06:56:48] jstransky: has joined #RubyOnRails
[06:56:53] gambl0re: come on guys...lets stop arguing. sevenseacat is my friend
[06:57:18] thejamespinto: gambl0re: come on everyone*
[06:57:28] kareeoleez: the best so far !!!
[06:57:54] roamingdog: when can we talk about vaping?
[06:58:05] hello9: Hey all, I'm trying to render a string as a textfile download. I did this before in Rails 2 with :render => text, and it would generate the file. in Rails 4 i tried that, and also send_data and the logs say it's rendered, but no file is downloaded
[06:58:29] hello9: tl;dr how to do :render => text in rails 4
[06:58:58] roamingdog: tl dr is right, coz i read it the first time
[07:01:18] Ropeney: hello9, plain: ?
[07:02:06] sameerynho: has joined #RubyOnRails
[07:02:28] thejamespinto: hello9: food for thought, is there a specific http status or mime type you should be passing?
[07:03:06] Ropeney: just `render plain: "I am some text"`
[07:03:27] alfie_max15: has joined #RubyOnRails
[07:03:34] thejamespinto: saying render text: "" will render http status 200 and mime type for plain text. but you said you wanted a download
[07:04:19] hello9: thejamespinto, im currently passing content-type, content-disposition, and transfer-encoding
[07:04:27] hello9: i dindt change the headers from the old version
[07:04:30] ZerGabriel: has joined #RubyOnRails
[07:05:07] alfie_max15: in my controller i'm trying to perform a query like this :
[07:05:10] alfie_max15: locations = @business.locations.includes(:reviews).where('report_id NOT IN (?) OR count(locations.review) > 0', [nil, ''])
[07:05:17] tpp8: has joined #RubyOnRails
[07:05:35] renegadeandy: has joined #RubyOnRails
[07:05:36] alfie_max15: which obviously results in an error `PG::UndefinedColumn: ERROR: column locations.reviews does not exist`
[07:05:37] kareeoleez: thejamespinto: ^^
[07:05:54] Ropeney: thats obvious is it?
[07:06:07] alfie_max15: could anyone please take a look at the query and help me with what i might be doing wrong
[07:06:25] Ropeney: how is that obvious, when we don't know what columns your locations model has
[07:06:39] mark_66: has joined #RubyOnRails
[07:06:54] tpp8: has joined #RubyOnRails
[07:07:17] thejamespinto: hello9: I just checked some client work, but we've changed it to redirect to the file format.pdf { redirect_to @order.pdf_path }
[07:07:19] alfie_max15: location model has_many reviews and only column relevant here is report_id
[07:07:41] Ropeney: alfie_max15 !gist
[07:08:03] alfie_max15: i'm trying to query all locations which has a report_id and as well as has atleast one review
[07:08:41] Ropeney: join instead of includes
[07:09:30] SteenJobs: has joined #RubyOnRails
[07:09:45] alfie_max15: if i join, then i get only locations which has reviews, but it's an OR condition that i'm looking for
[07:10:10] Ropeney: "has a report_id and as well as has atleast one review"
[07:10:11] alfie_max15: might have more than one reviews or has report_id
[07:10:23] alfie_max15: sorry about that, my bad
[07:10:35] neanderslob: has joined #RubyOnRails
[07:11:21] tildes: alfie_max15: I think you could simplify it, by dropping the count, and instead asking for report_id is not null and review_id is not null
[07:11:29] tildes: if I understood what you want at all
[07:11:30] quazimodo: 7 hours of googling later and i'm a bit desperate
[07:11:42] hello9: Ropeney, https://gist.github.com/anonymous/ddcbf7bc01f7ed339cf04ad2627fd51e
[07:12:03] Ropeney: where's the rest of it
[07:12:08] artto: has joined #RubyOnRails
[07:12:18] alfie_max15: tildes, review_id is not null? the relation is Location has_many reviews, so location model doesn't have review_id
[07:12:26] quazimodo: has anyone expercienced PG::UnableToSend: SSL SYSCALL error: EOF detected with rpush (rails 4.2.0, ruby 2.3.0, rpush 2.7.0, pg 0.18.4)
[07:12:49] hello9: @data is just a big ol string
[07:13:30] roamingdog: quazimodo: i've never seen anything that effed up
[07:14:05] roamingdog: but wait, i have a hunch, get it?
[07:14:26] aiguu__: has joined #RubyOnRails
[07:14:29] tildes: alfie_max15: in plain sql, is this what you want then: select * from locations l, reviews r where l.id = r.location_id and l.report_id is not null
[07:15:30] alfie_max15: tildes, yes, except for its OR instead of AND
[07:15:50] TheMoonMaster: has joined #RubyOnRails
[07:16:06] Ropeney: hello9, i think you should use send_data @data, type: 'text/txt', filename: 'data.txt' and return
[07:16:30] tagaulap_: has joined #RubyOnRails
[07:17:01] jstransky: has joined #RubyOnRails
[07:17:01] tagaulap: has joined #RubyOnRails
[07:17:26] tildes: alfie_max15: does it work as it should, if you execute that sql over ActiveRecord.connection.execute?
[07:17:43] alfie_max15: let me try, one sec please
[07:18:46] conta: has joined #RubyOnRails
[07:18:58] quazimodo: roamingdog: and now i wanna die
[07:19:20] quazimodo: this problem has eaten so much of my time, is unreproducable as hell too
[07:19:38] hello9: Ropeney, it logs ' Rendered text template (0.0ms)
[07:19:38] hello9: Sent data data.txt (2.1ms)' but no download ;/
[07:20:04] Ropeney: did anything come in browser?
[07:20:12] Ropeney: !gist it all
[07:20:32] jstransky: has joined #RubyOnRails
[07:21:24] hello9: i changed it to 'send_data "ehhinooooooooooo", type: 'text/txt', filename: 'data.txt' and return' just for an example, and still nothing
[07:21:51] Ropeney: quazimodo, https://github.com/rails/rails/issues/20411 did you see this?
[07:22:21] quazimodo: Ropeney: one of the ones that I've inspected
[07:22:30] Ropeney: hello9, above that put `puts "*" * 100` and make sure something happens
[07:23:02] thejamespinto: alfie_max15: do you know how to use counter cache columns in Rails?
[07:23:19] quazimodo: Ropeney: i think i can try the db config changes
[07:23:24] sp1rs: has joined #RubyOnRails
[07:23:29] Ropeney: quazimodo goodluck :D
[07:23:34] Ropeney: how are you connecting to your db?
[07:23:52] quazimodo: but its unlikely, the network admin at the company we're doing it for is one of those arrogant dragon types
[07:24:02] navneet_: has joined #RubyOnRails
[07:24:10] hello9: Ropeney, yeah its loading.. maybe send_data just doesnt work for me or somethin
[07:25:06] quazimodo: Ropeney: nothing unusual, tcp over netword with username & pass
[07:25:26] alfie_max15: thejamespinto, yes
[07:25:27] Ropeney: so no ssh tunnel in the cloud or vpn etc ?
[07:25:38] Ropeney: hello9, idk :(
[07:25:56] thejamespinto: alfie_max15: that could improve your query speed instead of calling that count() on SQL
[07:26:23] quazimodo: Ropeney: no
[07:26:28] quazimodo: we suggested ssh tunnel
[07:26:56] alfie_max15: thejamespinto, you are suggesting that i use that instead. nice why didn't i think of that
[07:27:08] Ropeney: quazimodo, I don't feel its an in app error more a systems error
[07:27:23] pyemkey: has joined #RubyOnRails
[07:27:53] Macaveli: has joined #RubyOnRails
[07:27:58] quazimodo: https://gist.github.com/siassaj/2d4e23dbb89bd03fc3488aa84ed69f9c
[07:28:01] quazimodo: thats the setup
[07:28:12] hello9: Ropeney, if you put `send_data "datadata", type: 'text/txt', filename: 'data.txt' and return` in a controller method it generates a file?
[07:31:11] jstransky: has joined #RubyOnRails
[07:31:14] quazimodo: Ropeney: yeah we think so too but the people at the place are saying no, the devs are idiotss
[07:31:29] Ropeney: hello9, yes it is
[07:31:34] hello9: hahaha crazy
[07:31:38] quazimodo: no mention of this stuff in the rails production.log, only in rpush.log
[07:31:44] alfie_max15: has joined #RubyOnRails
[07:31:47] quazimodo: yet rpush uses activerecord::base connection pool
[07:31:49] Ropeney: quazimodo, sounds typical
[07:32:07] arBmind: has joined #RubyOnRails
[07:32:08] quazimodo: so ... how can rpush be trying to use crusty connections with closed tcp sockets and rials isnt?
[07:32:19] hello9: Ropeney, is the method youre using defined as a post?
[07:32:20] Ropeney: so hello9 gist your whole controller or im moving on
[07:32:30] hello9: that is the controller
[07:32:38] hello9: im doing bare bones now till i get something working
[07:32:39] Ropeney: you sent me a headers.merge!
[07:32:42] Ropeney: thats not a controller
[07:32:45] alfie_max15: has left #RubyOnRails: ()
[07:32:46] hello9: yeah i got rid of everything
[07:32:53] hello9: sandboxing till i figure out what to di
[07:33:01] Ropeney: send whole controller
[07:33:03] Ropeney: or im moving on
[07:33:06] hello9: okay, 1 sec
[07:33:08] artto: has joined #RubyOnRails
[07:34:47] hello9: Ropeney, nvm it is working
[07:35:07] hello9: i am now trying to reimplement in the original controller, if i get stuck etc. i will be sure to gist.
[07:38:35] marr: has joined #RubyOnRails
[07:39:31] sevenseacat: has joined #RubyOnRails
[07:39:54] quazimodo: i really want to cry :*(
[07:40:07] snowy: has joined #RubyOnRails
[07:40:13] universa1: quazimodo: then do it.
[07:43:40] mikecmpbll: has joined #RubyOnRails
[07:45:31] FLeiXiuS: has joined #RubyOnRails
[07:45:52] FLeiXiuS: Do before_save callbacks happen when there is no UPDATE, due to no changes
[07:45:57] navneet_: has joined #RubyOnRails
[07:46:10] universa1: FLeiXiuS: !try
[07:46:10] helpa: FLeiXiuS: Why don't you try it and find out for yourself?
[07:46:12] navneet_: has joined #RubyOnRails
[07:46:45] FLeiXiuS: I would assume yes, but they're not firing for me.
[07:46:50] quazimodo: quazimodo: !try
[07:46:50] FLeiXiuS: So thats why I asked the question.
[07:47:07] FLeiXiuS: quazimodo, you're not the one.
[07:47:19] quazimodo: but i wanted to try :(
[07:49:05] bruno-: has joined #RubyOnRails
[07:52:35] jsrn: has joined #RubyOnRails
[07:53:32] yfeldblum: has joined #RubyOnRails
[07:54:42] pawnbox: has joined #RubyOnRails
[07:55:03] universa1: FLeiXiuS: if you think it is something in your app, just create a dummy app and try it there.
[07:55:12] universa1: FLeiXiuS: you might be interested in the before_validation callback
[07:57:17] fourcolors: has joined #RubyOnRails
[08:01:13] benlieb: has joined #RubyOnRails
[08:01:46] DoubleMalt: has joined #RubyOnRails
[08:02:10] qejk: has joined #RubyOnRails
[08:03:11] fourcolors: has left #RubyOnRails: ("Good Bye")
[08:03:15] bronson: has joined #RubyOnRails
[08:03:49] mikecmpbll: has joined #RubyOnRails
[08:04:40] Ergo: has joined #RubyOnRails
[08:04:53] finnnnnnnnnnn: has joined #RubyOnRails
[08:08:29] baweaver: has joined #RubyOnRails
[08:09:30] drptbl: has joined #RubyOnRails
[08:09:35] null__: has joined #RubyOnRails
[08:09:59] AzaToth: has joined #RubyOnRails
[08:15:29] darutoko: has joined #RubyOnRails
[08:17:10] rafaelfranca: has joined #RubyOnRails
[08:21:04] wd40s: has joined #RubyOnRails
[08:24:24] noobsu: has joined #RubyOnRails
[08:26:47] hckiang: has joined #RubyOnRails
[08:38:12] beauby: has joined #RubyOnRails
[08:40:10] skislak: has joined #RubyOnRails
[08:42:14] finnnnnnnnnnn: has joined #RubyOnRails
[08:43:01] t_p: has joined #RubyOnRails
[08:43:03] pawnbox: has joined #RubyOnRails
[08:53:23] RegulationD: has joined #RubyOnRails
[08:54:33] suffice: has joined #RubyOnRails
[08:57:37] moep: has joined #RubyOnRails
[08:58:48] pawnbox: has joined #RubyOnRails
[08:59:07] finnnnnnnnnnn_: has joined #RubyOnRails
[09:06:06] benlieb: has joined #RubyOnRails
[09:06:42] bruno-: has joined #RubyOnRails
[09:06:58] sp1rs: has joined #RubyOnRails
[09:09:59] Pazician: has joined #RubyOnRails
[09:10:57] workmad3: has joined #RubyOnRails
[09:11:51] nix1947_: has joined #RubyOnRails
[09:12:45] quazimodo: has joined #RubyOnRails
[09:16:40] mikenovikov: has joined #RubyOnRails
[09:16:58] ql6wlld: has joined #RubyOnRails
[09:17:18] Weavel: has joined #RubyOnRails
[09:18:51] rafaelfranca: has joined #RubyOnRails
[09:18:52] TheShaun: has joined #RubyOnRails
[09:19:32] ferr: has joined #RubyOnRails
[09:21:35] ddv: has joined #RubyOnRails
[09:22:10] blackmesa: has joined #RubyOnRails
[09:24:16] suffice: has joined #RubyOnRails
[09:25:05] doublemalt_: has joined #RubyOnRails
[09:25:17] markelite: has joined #RubyOnRails
[09:29:05] ayonkhan: has joined #RubyOnRails
[09:30:48] artto: has joined #RubyOnRails
[09:31:42] beilabs: has joined #RubyOnRails
[09:33:34] darkxploit: has joined #RubyOnRails
[09:35:31] quazimodo: has joined #RubyOnRails
[09:36:28] blackhuey: has joined #RubyOnRails
[09:38:35] wd40s: has joined #RubyOnRails
[09:45:39] qejk: has joined #RubyOnRails
[09:48:55] noobsu: has joined #RubyOnRails
[09:51:18] DaniG2k: has joined #RubyOnRails
[09:52:03] DaniG2k: I'm looking to refactor this controller https://gist.github.com/DaniG2k/01392a0fb248745b5365cd7773f37e2a
[09:52:42] DaniG2k: I'm wondering if there's a way I can call the `flash.now.alert = t('.failure'); render :index; return;` code all from another method
[09:52:52] mentero: has joined #RubyOnRails
[09:53:17] DaniG2k: I've noticed that if I do this, however, I will return from the method (obviously) and not actually call return after calling render
[09:53:23] sevenseacat: are they all validations, all authorization checks, or both?
[09:53:55] universa1: DaniG2k: whoa... looks like you're rendering index in all cases except one anyways.
[09:54:00] navneet: has joined #RubyOnRails
[09:54:08] DaniG2k: they are all validations
[09:54:31] universa1: https://gist.github.com/DaniG2k/01392a0fb248745b5365cd7773f37e2a#file-website_controller-rb-L11 -- o0 ;)
[09:55:01] sevenseacat: then I think they should be on the models they're validating
[09:55:13] universa1: https://gist.github.com/DaniG2k/01392a0fb248745b5365cd7773f37e2a#file-website_controller-rb-L64-L76
[09:55:16] sevenseacat: also, +1 to o.O
[09:55:25] universa1: also this... stub the method in some test setup file.
[09:55:38] sevenseacat: putting test code in your app is a huuuuuuuuuuuge o.O
[09:55:42] universa1: replace the classes with mock ones...
[09:55:53] sevenseacat: I didn't even see that on first skim
[09:56:45] DaniG2k: universa1: I'm sorry I don't understand your second link...are you saying that method should be moved to the model?
[09:56:52] DaniG2k: retrieve_token?
[09:57:15] universa1: DaniG2k: it should simply be Omise::Token.retrieve(token)
[09:57:21] universa1: no check for Rails.env.test? ...
[09:58:23] universa1: and you should do something like (pseudo - code!) before :suite; Omisse::Token.stub(:retrieve).and_return(OpenStruct.new ...); end
[09:58:29] universa1: in your test setup
[09:59:30] navneet_: has joined #RubyOnRails
[09:59:37] DaniG2k: I'll tackle the refactoring of #donate first
[09:59:56] universa1: also your check for Rails.env.test in your donate method should not be there.
[10:00:13] DaniG2k: yeah good point
[10:00:39] universa1: and then what sevenseacat said. validations should be in the model.
[10:00:44] finnnnnnnnnnn: has joined #RubyOnRails
[10:03:14] solars: hi _everybody_
[10:04:46] bronson: has joined #RubyOnRails
[10:05:26] TheMoonMaster: has joined #RubyOnRails
[10:06:56] arBmind: has joined #RubyOnRails
[10:07:38] bruno-: has joined #RubyOnRails
[10:08:22] Guest_: has joined #RubyOnRails
[10:10:47] baweaver: has joined #RubyOnRails
[10:13:01] kailido: has joined #RubyOnRails
[10:13:22] kailido: how can I run an action after user update?
[10:14:02] universa1: kailido: whatever.save; run_my_action ?!
[10:14:53] kailido: im uploading a file, and running an action after but its not recognizing the file
[10:15:02] kailido: and if I refresh it recognize
[10:15:02] universa1: kailido: !code
[10:15:02] helpa: kailido: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[10:16:02] kailido: https://gist.github.com/luisamaro0/e7af2b0c7ad9b45626e0962199439794
[10:16:34] kailido: Errno::EISDIR at /users/3 Is a directory @ rb_sysopen - ./public/
[10:16:49] universa1: kailido: gist the full classes along with the full error trace!
[10:18:12] kailido: https://gist.github.com/luisamaro0/e7af2b0c7ad9b45626e0962199439794
[10:18:45] Pazician: has joined #RubyOnRails
[10:21:20] Pazician_: has joined #RubyOnRails
[10:21:28] universa1: kailido: tbh, i'd move a lot of that code from the controller to the model... but anyways: check what Dir[current_user.personal...to_s] returns! it includes directories.
[10:21:39] universa1: guessing from your error message!
[10:22:25] kailido: the problem is that its not recognizing the uploaded file
[10:22:30] universa1: kailido: no!
[10:22:31] kailido: only if I refresh
[10:22:46] universa1: error: https://gist.github.com/luisamaro0/e7af2b0c7ad9b45626e0962199439794#file-error-rb-L1
[10:22:47] kailido: if I refresh it copies without erros
[10:22:54] universa1: causing line: https://gist.github.com/luisamaro0/e7af2b0c7ad9b45626e0962199439794#file-error-rb-L9
[10:23:13] universa1: parent line: https://gist.github.com/luisamaro0/e7af2b0c7ad9b45626e0962199439794#file-error-rb-L10
[10:24:06] universa1: kailido: so your Dir[...] passes ./public to https://gist.github.com/luisamaro0/e7af2b0c7ad9b45626e0962199439794#file-user-rb-L95 as filename
[10:24:24] n008f4g_: has joined #RubyOnRails
[10:24:47] DaniG2k_: has joined #RubyOnRails
[10:24:49] kailido: but if I refresh it passes the full path with the file
[10:25:52] universa1: ok. which doesn't call your copy_file anymore...
[10:26:10] universa1: kailido: extract the copy_file and bat_file into a lib class, which you can more easily test.
[10:26:29] universa1: kailido: and fix the bugs in your code...
[10:26:36] universa1: gtg, lunch is calling.
[10:26:40] kailido: if I call copy file outside update it works well
[10:26:49] universa1: if you say so.
[10:27:03] TheMoonMaster: has joined #RubyOnRails
[10:28:49] kailido: but I just want to run copy_file after the user uploads a file
[10:32:29] violarium: has joined #RubyOnRails
[10:34:56] Detch: has joined #RubyOnRails
[10:36:26] moei: has left #RubyOnRails: ("Leaving...")
[10:36:50] blackmesa: has joined #RubyOnRails
[10:40:53] srinidhi: has joined #RubyOnRails
[10:42:29] AimlessRAven: has joined #RubyOnRails
[10:42:58] AimlessRAven: https://gist.github.com/anonymous/03296f6a546a9b1778a903cc76900c28
[10:43:13] AimlessRAven: here i want to add in my 2 inputs border: 1px solid red; when my form-controll have class has-error
[10:43:16] AimlessRAven: how to do that
[10:43:22] mikeiniowa: has joined #RubyOnRails
[10:44:44] tvw: has joined #RubyOnRails
[10:46:41] jhass: using CSS?
[10:47:08] jhass: .has-error input { border: 1px solid red; }
[10:47:23] beilabs: has joined #RubyOnRails
[10:48:26] sp1rs: has joined #RubyOnRails
[10:48:45] AimlessRAven: jhass: ill try
[10:48:47] dezull: has joined #RubyOnRails
[10:50:51] lessless: has joined #RubyOnRails
[10:57:46] ur5us: has joined #RubyOnRails
[10:59:17] ishamo: has joined #RubyOnRails
[11:08:32] bruno-: has joined #RubyOnRails
[11:10:55] Ropeney: has joined #RubyOnRails
[11:14:48] chagel: has joined #RubyOnRails
[11:16:26] w0rd-driven: has joined #RubyOnRails
[11:20:31] wd40s: has joined #RubyOnRails
[11:21:45] Ropeney: has joined #RubyOnRails
[11:22:07] marcules: has joined #RubyOnRails
[11:22:13] ldnunes: has joined #RubyOnRails
[11:23:23] marcules: has joined #RubyOnRails
[11:26:03] rrawlins: has joined #RubyOnRails
[11:31:57] w0rd-driven: has joined #RubyOnRails
[11:35:59] JonasOSDever: has joined #RubyOnRails
[11:37:50] GodFather: has joined #RubyOnRails
[11:38:24] syndikate: has joined #RubyOnRails
[11:39:55] JonasOSDever: has joined #RubyOnRails
[11:41:05] Quintasan_: has joined #RubyOnRails
[11:42:40] rodfersou: has joined #RubyOnRails
[11:43:24] stardiviner: has joined #RubyOnRails
[11:45:00] leeky: has joined #RubyOnRails
[11:45:02] dangrahn: has joined #RubyOnRails
[11:45:56] JonasOSDever: has joined #RubyOnRails
[11:47:10] rafaelfranca: has joined #RubyOnRails
[11:48:31] JonasOSDever: has joined #RubyOnRails
[11:49:24] wd40s: has joined #RubyOnRails
[11:49:53] moeabdol: has joined #RubyOnRails
[11:50:05] p1k: has joined #RubyOnRails
[11:50:28] Weavel: has joined #RubyOnRails
[11:53:13] null__: has joined #RubyOnRails
[11:53:40] Ergo^: has joined #RubyOnRails
[11:54:53] violarium: has joined #RubyOnRails
[11:55:30] ornerymoose: has joined #RubyOnRails
[11:58:35] dezull: has joined #RubyOnRails
[12:01:12] artto: has joined #RubyOnRails
[12:01:35] King_Rex: has joined #RubyOnRails
[12:06:52] trinaldi: has joined #RubyOnRails
[12:10:16] pawnbox_: has joined #RubyOnRails
[12:11:36] baweaver: has joined #RubyOnRails
[12:12:44] jhn: has joined #RubyOnRails
[12:16:32] Weavel: has joined #RubyOnRails
[12:18:51] itsmeduncan: has joined #RubyOnRails
[12:19:16] navneet: has joined #RubyOnRails
[12:20:38] rrawlins: has joined #RubyOnRails
[12:21:13] flashpoint9: has joined #RubyOnRails
[12:22:00] renegadeandy: has joined #RubyOnRails
[12:22:28] flashpoint9: has joined #RubyOnRails
[12:22:40] blackmesa: has joined #RubyOnRails
[12:22:53] navneet_: has joined #RubyOnRails
[12:24:04] dgncn: has joined #RubyOnRails
[12:24:08] tildes: has joined #RubyOnRails
[12:24:40] snowy: has joined #RubyOnRails
[12:26:46] beauby: has joined #RubyOnRails
[12:27:21] finnnnnnnnnnn_: has joined #RubyOnRails
[12:28:40] ornerymoose: has joined #RubyOnRails
[12:29:09] Jasaka: has joined #RubyOnRails
[12:31:39] tildes: SalaryPayment needs to be able to return related SalesLedgerPayments, and for that I wrote this method: http://pastie.org/private/0tw0daxkrellio48hvdma#6 I think it looks uncool, but it works. Would you leave it as it is? Is there something I could do about it?
[12:32:07] tildes: If there is something wrong with it, I would really appreciate the info
[12:32:40] srinidhi: has joined #RubyOnRails
[12:35:48] Quintasan_: has joined #RubyOnRails
[12:35:58] jhass: tildes: SalesLedgerPayment.where(id: ids) for starters
[12:36:33] tildes: jhass: yes, makes sense :)
[12:37:07] ramortegui: has joined #RubyOnRails
[12:37:23] jhass: this looks a bit complex on first glance, but if the schema is properly mapped out to AR models, it should be possible to express it without arel even
[12:37:54] sp1rs: has joined #RubyOnRails
[12:37:56] tildes: jhass: the schema is complex itself. all models are AR
[12:38:07] tildes: what is arel?
[12:40:06] jhass: the underlying query abstraction DSL activerecord uses
[12:40:56] jhass: okay, next up, in the inner select, salary_payments sp is unused, throw it out, it just adds confusion
[12:41:44] tildes: jhass: true. I made one clean up already, forgot to clean that one. maybe short break is needed
[12:42:15] tildes: (it was used, also unnecessarily :( )
[12:49:24] tildes: jhass: thanks for taking a look and for the comments
[12:50:17] antgel: has joined #RubyOnRails
[12:50:42] jhass: I feel like it can be expressed with pure AR, but I'd need the model associations (a bit hard to fully reconstruct from that query alone) and a console to play with
[12:52:11] Ropeney: has joined #RubyOnRails
[12:52:40] jhass: btw personally I prefer writing out the full table names instead of aliases, it makes the query longer perhaps but keeping track of all the aliases is more mindwork for me
[12:53:26] jhass: others might argue that it hides the actual joins happening under the verbose names though
[12:53:47] SeanLazer: has joined #RubyOnRails
[12:54:35] Scient: too tired to actually think about that query but it seems that the schema is too complex is you have to do crap like that :P
[12:54:55] RegulationD: has joined #RubyOnRails
[12:55:38] joshkovach: has joined #RubyOnRails
[12:56:32] jhass: so.id = si.ascendant_id is backwards, no? you select sales_invoices by the found sales_orders, right?
[12:56:49] tildes: jhass: I totally understand the challenge of reconstructing the models from the query alone. it was a bit of a challenge to construct the query although I have the models, direct db access and a console :)
[12:57:50] tildes: jhass: backwards in the sense that it would probably read better ordered differently?
[12:58:13] tildes: jhass: now that you say it, I can see it too, and agree fully
[13:06:17] enkristoffer: has joined #RubyOnRails
[13:07:30] nettoweb: has joined #RubyOnRails
[13:07:44] Megamos: has joined #RubyOnRails
[13:09:39] bruno-: has joined #RubyOnRails
[13:10:42] hello9: has joined #RubyOnRails
[13:11:37] P4Titan: has joined #RubyOnRails
[13:14:28] jhass: somewhere into the direction of SalesLedgerPayment.joins(sales_ledger_invoice: {sales_invoice: {ascendant: {provisions: {salary_payment_items: :salary_payment}}}) ?
[13:14:32] jhass: very rough guess
[13:14:55] jhass: eh, it ate half of it, SalesLedgerPayment.joins(sales_ledger_invoice: {sales_invoice: {ascendant: {provisions: {salary_payment_items: :salary_payment}}}) .where("sales_invoice.ascendant_type" => "SalesOrder", "salary_payment.id" => id).distinct
[13:15:24] aegis3121: has joined #RubyOnRails
[13:17:28] sp1rs: has joined #RubyOnRails
[13:20:16] artto: has joined #RubyOnRails
[13:21:39] enkristoffer: has joined #RubyOnRails
[13:23:23] crameth: has joined #RubyOnRails
[13:23:39] dionysus69: has joined #RubyOnRails
[13:28:23] trinaldi: has joined #RubyOnRails
[13:28:32] tildes: jhass: it is more readable for sure
[13:30:35] sudoubuntu: has joined #RubyOnRails
[13:31:28] godzillaenlacasa: has joined #RubyOnRails
[13:33:50] artto: has joined #RubyOnRails
[13:34:43] yellow5: has joined #RubyOnRails
[13:35:57] macsteps: has joined #RubyOnRails
[13:39:07] t_p: has joined #RubyOnRails
[13:49:32] bruno-: has joined #RubyOnRails
[13:54:20] arBmind: has joined #RubyOnRails
[13:57:34] jscheel: has joined #RubyOnRails
[13:58:25] agent_white: has joined #RubyOnRails
[13:59:50] pawnbox: has joined #RubyOnRails
[14:00:03] akshat: has joined #RubyOnRails
[14:00:36] godzillaenlacasa: is it possible to do an includes and a conditional statement to create an object array?
[14:00:54] godzillaenlacasa: for instance, this works right now: `@network_hosts = @location.network_hosts.includes(network_host_tests: { results: :issue })`
[14:01:01] bruce_lee: has joined #RubyOnRails
[14:01:23] godzillaenlacasa: but I also need to exclude network_hosts that `ignore_flag => true`
[14:02:40] pawnbox: has joined #RubyOnRails
[14:04:03] macsteps: has joined #RubyOnRails
[14:09:26] rafaelfranca: has joined #RubyOnRails
[14:12:23] baweaver: has joined #RubyOnRails
[14:12:51] artto: has joined #RubyOnRails
[14:13:10] roamingdog: has joined #RubyOnRails
[14:14:57] akshat_: has joined #RubyOnRails
[14:15:11] maxdoubt: has joined #RubyOnRails
[14:19:42] mr-spoon: has joined #RubyOnRails
[14:21:34] dever: has joined #RubyOnRails
[14:21:50] dever: Hey all, quick question (I hope), I'm writing an internal gem, which must have a sidekiq worker... how can I get this to work nicely with a rails app it will be included in?
[14:21:53] dever: Should I just require the developer to include my queue as part of their config?
[14:22:30] pyemkey: has joined #RubyOnRails
[14:22:41] smathy: has joined #RubyOnRails
[14:22:54] akshat: has joined #RubyOnRails
[14:23:18] tubbo: dever: _pretty_ sure sidekiq, by default, will just pick from all queues...and to define a queue all you need to do is enqueue a job in that queue.
[14:24:18] dever: aye, does it not just use the queues defined in a procfile?
[14:25:07] tubbo: dever: well if you define them there, yeah
[14:25:10] tbuehlmann: I think it just pulls jobs from the default queue per default
[14:25:18] akshat: has joined #RubyOnRails
[14:25:22] tubbo: so i think adding it to 'default' would be the easiest thing to do
[14:25:38] dever: aye, all of our projects use a procfile, most will be using this gem going forward
[14:25:41] tubbo: frankly, if you're writing a gem i would expect that queue to be configurable for a bunch of reasons.
[14:26:08] sp1rs: has joined #RubyOnRails
[14:26:10] tubbo: setting it in your class to the value of config.your_gem.queue_name might be better. but i'm not sure what your use case is.
[14:26:29] dever: tubbo: aye, of course, but i just want to set it up so it doesn't have to be specified in the procfile (if possible)
[14:26:32] syzygy_: has joined #RubyOnRails
[14:27:27] tubbo: right, so that queue name configuration should start out as :default if you want that (99% sure)
[14:27:42] jvanbaarsen: has joined #RubyOnRails
[14:28:07] dever: tubbo: aye, have that, yeah, i suppose that's the best way for it.
[14:28:22] tbuehlmann: I like that, too
[14:28:22] dever: have a default queue if you just want to 'plug and play'
[14:28:39] dever: if not, specify in procfile, and gem configuration
[14:29:09] dever: tubbo: tbuehlmann: cheers.
[14:29:35] tvon: has joined #RubyOnRails
[14:29:58] rafaelfranca: has joined #RubyOnRails
[14:31:41] Ropeney: has joined #RubyOnRails
[14:32:03] rbr: has joined #RubyOnRails
[14:32:37] Quintasan: has joined #RubyOnRails
[14:33:57] danman: has joined #RubyOnRails
[14:34:01] matthias_: has joined #RubyOnRails
[14:36:53] artto: has joined #RubyOnRails
[14:37:50] newjersey: has joined #RubyOnRails
[14:40:16] diegoviola: has joined #RubyOnRails
[14:41:54] DylanJ: Does anyone know how to access the current database name inside of a rails migration? I'm using postgres. I need to run a SQL query written by hand which has the database name.
[14:46:35] epochwolf: DylanJ: http://stackoverflow.com/questions/399396/can-you-get-db-username-pw-database-name-in-rails
[14:47:05] diegoaguilar: has joined #RubyOnRails
[14:47:52] ornerymoose: has joined #RubyOnRails
[14:48:32] epochwolf: if people would google their question before asking... I would be so happy.
[14:48:42] GodFather: has joined #RubyOnRails
[14:48:52] adavia: has joined #RubyOnRails
[14:51:14] blackmesa: has joined #RubyOnRails
[14:52:39] Ergo: has joined #RubyOnRails
[14:54:38] Devalo: has joined #RubyOnRails
[14:54:48] stardiviner: has joined #RubyOnRails
[14:55:43] chipotle: has joined #RubyOnRails
[14:57:34] siaW: has joined #RubyOnRails
[14:58:39] tvw: has joined #RubyOnRails
[15:07:13] i: has joined #RubyOnRails
[15:08:28] arBmind: has joined #RubyOnRails
[15:09:03] dopie: has joined #RubyOnRails
[15:09:19] agit0: has joined #RubyOnRails
[15:09:29] akshat_: has joined #RubyOnRails
[15:09:42] bronson: has joined #RubyOnRails
[15:10:20] sp1rs: has joined #RubyOnRails
[15:14:09] chouhoulis: has joined #RubyOnRails
[15:16:04] artto: has joined #RubyOnRails
[15:16:25] chouhoul_: has joined #RubyOnRails
[15:17:13] ToTenMilan: has joined #RubyOnRails
[15:18:05] macsteps: has joined #RubyOnRails
[15:18:27] chridal_: has left #RubyOnRails: ("WeeChat 1.5-dev")
[15:18:42] chridal: has joined #RubyOnRails
[15:18:46] chridal: has left #RubyOnRails: ("WeeChat 1.5-dev")
[15:19:08] chridal: has joined #RubyOnRails
[15:20:22] Ergo: has joined #RubyOnRails
[15:20:23] bruno-: has joined #RubyOnRails
[15:20:26] DylanJ: epochwolf: if people didn't make assumptions about what other people do i would be so happy
[15:20:37] DylanJ: why even have an irc channel? i mean everything is already on stackoverflow
[15:20:52] smathy: DylanJ, no it's not.
[15:21:21] newjersey: has joined #RubyOnRails
[15:21:22] smathy: DylanJ, and some problems need to be talked through interactively. Most though can be written up on SO or in the guides or docs.
[15:22:53] smathy: ...but you know DylanJ, I don't want to embarrass you here but, if you actually just googled "access the current database name inside of a rails migration" then the first result is the one epochwolf posted.
[15:22:55] aegis3121: has joined #RubyOnRails
[15:23:10] newjersey: has joined #RubyOnRails
[15:23:35] Ropeney: has joined #RubyOnRails
[15:23:36] matthias_: has joined #RubyOnRails
[15:28:34] artto: has joined #RubyOnRails
[15:31:53] siaW: in my app i want to set cookies that will track when a user was last seen, then on the user’s next visit, show him new users since he last visited. but i’m not sure how to query the DB from the controller to show him the latest users since he last visited. any advice?
[15:33:14] smathy: siaw, !querying
[15:33:14] helpa: siaw: http://guides.rubyonrails.org/active_record_querying.html - ActiveRecord Querying Guide by Ryan Bigg
[15:35:22] chouhoulis: has joined #RubyOnRails
[15:36:42] polishdub: has joined #RubyOnRails
[15:37:15] Ropeney: siaw, i'd make a scope that takes a date?
[15:37:42] siaW: ropeney: how about a helper method?
[15:38:20] Ropeney: siaw, your returning a set of users though. So i'd have a scope on User that returns since a date period
[15:39:02] Ropeney: shouldn't be controller logic doing that
[15:39:45] siaW: the reason i wanted to do that in the controller is cause then i can pass the date from the cookie as an argument
[15:39:59] Ropeney: you can pass the date from the cookie to a scope
[15:40:15] kailido: how can i call an action after redirect_to :back ?
[15:40:27] Ropeney: User.since(session[:last_seen])
[15:40:39] siaW: i didn’t know that :D
[15:40:45] Ropeney: can u try rephrase kailido?
[15:40:46] siaW: now i know thanks
[15:40:56] Ropeney: since := your scope
[15:41:39] Ropeney: kailido, if you need to call an action after redirect_to :back, why not redirect to that action?
[15:42:46] dionysus69: has joined #RubyOnRails
[15:43:08] kailido: i need tot be on the same page and call an action after refreshing the papge
[15:43:30] Ropeney: you do call an action when you refresh the page, the action you redirected to
[15:43:35] OTORelic: has joined #RubyOnRails
[15:43:41] artto: has joined #RubyOnRails
[15:44:58] lxsameer: has joined #RubyOnRails
[15:45:08] marcdel: has joined #RubyOnRails
[15:46:09] szulak: has joined #RubyOnRails
[15:46:13] GodFather: has joined #RubyOnRails
[15:47:19] kailido: its still doing before refreshing the page
[15:47:34] Ropeney: not enough context sorry, I can't work out what your trying to do
[15:48:16] Jasaka: has joined #RubyOnRails
[15:48:41] kailido: https://gist.github.com/luisamaro0/e7af2b0c7ad9b45626e0962199439794
[15:49:03] kailido: im updating the user, with an uploaded file
[15:49:26] kailido: after updating im calling copy_file to copy the uploaded file to other dir
[15:49:50] kailido: but it is not recognizing the file, it gives me an error, but if I refresh it recognizes
[15:51:07] artto: has joined #RubyOnRails
[15:51:18] rafaelfranca: has joined #RubyOnRails
[15:51:28] context: "an error"
[15:51:55] kailido: Errno::EISDIR - Is a directory @ rb_sysopen
[15:52:47] Ropeney: did you delete a heap of things, or do you really format this badly?
[15:53:51] kailido: i just put the actions used
[15:54:10] baweaver: has joined #RubyOnRails
[15:55:15] Ropeney: yeah I still have no idea what your doing
[15:56:02] kailido: after updating, I call copy_file
[15:56:05] smathy: kailido, first things first: "i need tot be on the same page and call an action after refreshing the papge" <-- this makes no sense, redirect_to sends an HTTP response back to the browser that instructs the browser to request a new URL, there's nothing else you can do after that that will impact the browser.
[15:56:18] Ropeney: you don't call copy_file after updating
[15:56:29] RegulationD: has joined #RubyOnRails
[15:57:04] Ropeney: changed what?
[15:57:15] kailido: https://gist.github.com/luisamaro0/e7af2b0c7ad9b45626e0962199439794
[15:57:33] Ropeney: it never gets there
[15:58:48] bronson: has joined #RubyOnRails
[15:58:52] bradleyprice: has joined #RubyOnRails
[15:59:14] kailido: smathy: some other solution to my problem ?
[15:59:17] rrawlins: has joined #RubyOnRails
[15:59:27] smathy: kailido, !xy - I still don't know your actual problem
[15:59:27] helpa: kailido: It seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[16:00:05] shibly: has joined #RubyOnRails
[16:00:08] smathy: kailido, your code makes no sense.
[16:00:13] Ropeney: move copy_file after the if
[16:00:15] Pupeno: has joined #RubyOnRails
[16:00:15] Pupeno: has joined #RubyOnRails
[16:00:18] Ropeney: if @user.update(..)
[16:00:24] kailido: I did that already
[16:00:27] pawnbox: has joined #RubyOnRails
[16:00:38] Ropeney: im moving on
[16:00:50] shibly: Is #ror and #rubyonrails the same channel? Is there any channel for rails development(rails source code maintainance)
[16:00:53] Ropeney: i can't help you sorry kailido
[16:01:45] Pupeno: How do I load my FactoryGirls factory in a non-test file (rake task)?
[16:01:55] kailido: im saying i've tried that and you don't try to help anymore why
[16:02:10] smathy: shibly, yes, when people say #ror they're just using shorthand for this channel.
[16:02:49] VeryBewitching: has joined #RubyOnRails
[16:03:15] shinnya: has joined #RubyOnRails
[16:03:16] VeryBewitching: Only once smathy, just for you :P
[16:03:26] shibly: Is there any channel for rails development(rails source code maintainance) ?
[16:03:35] tubbo: shibly: !dry last warning.
[16:03:35] helpa: shibly: Don't repeat yourself. Asking the same question repeatedly will not give you more answers.
[16:04:05] shibly: tubbo: Sorry
[16:04:05] tubbo: shibly: there's no open discussion chat for the core team, it's a private Campfire only open to the members of the core team.
[16:04:34] Ropeney: kailido, answers like "i tried that" without what happened and the result after we suggested leaves us in the dark and unable to help. We aren't at your computer, we can't see your results.
[16:04:54] shibly: has left #RubyOnRails: ()
[16:05:17] bradleyprice: has joined #RubyOnRails
[16:05:38] kailido: sorry, what part it doesnt make sense?
[16:05:49] Ropeney: the "i tried that" part
[16:05:56] pawnbox: has joined #RubyOnRails
[16:06:07] kailido: I was talking about the code now, what doenst made sense
[16:06:17] Mia: has joined #RubyOnRails
[16:06:17] Mia: has joined #RubyOnRails
[16:06:32] Spami: has joined #RubyOnRails
[16:06:47] rbr: has joined #RubyOnRails
[16:07:34] ayonkhan: has joined #RubyOnRails
[16:09:04] allcentury: has joined #RubyOnRails
[16:09:14] allcentury: hi all - how I can view which ruby standard libraries rails has loaded for me?
[16:10:03] smathy: allcentury, why would you care?
[16:10:31] allcentury: smathy: I'm finding that I have to require some and not other standard libaries and it's a guessing game
[16:10:56] smathy: allcentury, you should always require a stdlib if you're going to use it.
[16:11:27] brent__: has joined #RubyOnRails
[16:12:05] tubbo: allcentury: yeah it's no big deal if something gets required twice, because require will check whether it's already loaded
[16:14:44] artto: has joined #RubyOnRails
[16:15:25] davidw: has joined #RubyOnRails
[16:18:46] djbkd: has joined #RubyOnRails
[16:19:09] AnoHito_: has joined #RubyOnRails
[16:19:26] maxdoubt: has joined #RubyOnRails
[16:19:44] monoprotic: has joined #RubyOnRails
[16:19:44] monoprotic: has joined #RubyOnRails
[16:20:54] zave: has joined #RubyOnRails
[16:20:59] PedramT: has joined #RubyOnRails
[16:24:17] DragonPunch: has joined #RubyOnRails
[16:25:19] marduk: has joined #RubyOnRails
[16:25:47] Axy: has joined #RubyOnRails
[16:25:51] M-shine: has joined #RubyOnRails
[16:26:49] treehug88: has joined #RubyOnRails
[16:26:57] daveomcd: I'm wanting to make a page where I have a checkbox for a single boolean attribute for every user (i only have ~20 users). I want to set it up so i can enable and disable this attribute by checking the box. How can i go about this? Would I have a different form element for each user?
[16:27:41] PedramT: has joined #RubyOnRails
[16:27:49] siaW: has joined #RubyOnRails
[16:27:52] Ropeney: do you want to enable per user or all users at once?
[16:28:21] daveomcd: enable per user, so basically i could go there an check the box for users i want to enable for the "feature" or disable them
[16:28:26] smathy: daveomcd, yes, each checkbox will be a different form element.
[16:28:26] siaW: any idea why i’m getting “syntax error, unexpected '}', expecting keyword_end” on scope :last_visited, ->(cookies[:last_visited]) { where("created_at > ?", cookies[:last_visited]) }
[16:28:36] Ropeney: then element for each
[16:28:46] daveomcd: ok cool thanks!
[16:28:52] Ropeney: siaw, ruby version?
[16:28:52] daveomcd: you too smathy !
[16:30:35] Ropeney: and siaw, i dont think your cookies[:last_visited] will work there
[16:30:37] smathy: siaw, stunned that's the error you're getting, I'd have expected: unexpected '[', expecting ')'
[16:30:45] mikecmpbll: has joined #RubyOnRails
[16:30:56] smathy: daveomcd, np.
[16:31:22] Cohedrin: has joined #RubyOnRails
[16:31:31] rrawlins: has joined #RubyOnRails
[16:31:31] siaW: ropeney my cookies won’t work there? why not. you said i could do it in a scope.
[16:31:38] siaW: like refer to it from a scope
[16:31:42] siaW: as an argument
[16:31:45] Ropeney: no, i said you could pass it to the scope
[16:32:04] siaW: but then i could use it in view right?
[16:32:10] Ropeney: so you go User.last_visited(cookies[:last_visited])
[16:32:27] Ropeney: and have cookies[:last_visited] just be last_visited
[16:32:32] Ropeney: in your model
[16:32:53] Ropeney: but don't call the variable the same name as your scope
[16:34:17] siaW: something like
[16:34:18] siaW: scope :new_users, ->(last_seen) { where("created_at > ?", last_seen]) }
[16:34:30] siaW: in my model
[16:34:45] Ropeney: without the ]
[16:35:36] Cohedrin_: has joined #RubyOnRails
[16:36:49] IrishGringo: has joined #RubyOnRails
[16:40:19] GodFather: has joined #RubyOnRails
[16:41:29] moeabdol: has joined #RubyOnRails
[16:42:40] rrawlins: has joined #RubyOnRails
[16:44:43] Rodya_: has joined #RubyOnRails
[16:48:12] arBmind1: has joined #RubyOnRails
[16:52:23] moeabdol: has joined #RubyOnRails
[16:52:59] meoblast001: has joined #RubyOnRails
[16:54:18] PedramT: has joined #RubyOnRails
[16:54:22] Cache_Money: has joined #RubyOnRails
[16:54:59] siaW: where in my rails app can i set cookies to store the value of say Time.now when user hit my index?
[16:55:03] bronson: has joined #RubyOnRails
[16:55:40] Ropeney: the controller?
[16:56:19] Ropeney: siaw, http://api.rubyonrails.org/classes/ActionDispatch/Cookies.html
[16:56:36] dopie: has joined #RubyOnRails
[16:56:38] siaW: yes i guess controller but it gets tricky
[16:56:50] IrishGringo: has joined #RubyOnRails
[16:57:01] siaW: cause i have this
[16:57:02] siaW: https://gist.github.com/siaw23/f6cd686dacf49d3db68f27fff5d3c8ae
[16:57:15] siaW: i’m setting the cookie when a user hits my app
[16:57:21] siaW: but what if he his the new action
[16:57:29] siaW: and comes back to the index again
[16:57:31] Ropeney: do it in a before_action ?
[16:57:46] siaW: you mean before_filter
[16:57:58] rrawlins: has joined #RubyOnRails
[16:58:14] siaW: so it means another method and not in the index :D
[17:04:14] PedramT: has joined #RubyOnRails
[17:04:44] sleungcy: has joined #RubyOnRails
[17:06:10] Silox|: has joined #RubyOnRails
[17:06:14] daveomcd: I have this code in the head of my application.html.erb -- https://gist.github.com/daveomcd/b86f793fd3703370f39450d10f2d022b -- I'm wanting to load the javascript only if the attribute is set to true. It works but whenever I turn the attribute to false for someone it still loads it until i hit refresh button in my browser. Is this because of turbolinks?
[17:06:46] patrick_star_2: has joined #RubyOnRails
[17:07:06] Ropeney: so you change page and it stays on?
[17:07:38] daveomcd: ropeney, yea, or the reverse depending on if you have just enabled or disabled the column for that user
[17:07:53] pawnbox: has joined #RubyOnRails
[17:07:55] daveomcd: i didn't know if the head of my page is being cached or something
[17:07:56] Ropeney: sounds like turbolinks then
[17:08:21] daveomcd: any way to have turbolinks ignore those lines of code or something?
[17:08:29] Ropeney: no idea, never used it
[17:08:37] aegis3121: has joined #RubyOnRails
[17:09:39] pawnbox: has joined #RubyOnRails
[17:11:00] zave: has joined #RubyOnRails
[17:11:15] naftilos76: has joined #RubyOnRails
[17:11:46] ericmeds_: has joined #RubyOnRails
[17:12:16] ornerymoose: has joined #RubyOnRails
[17:13:21] monoprotic: has joined #RubyOnRails
[17:13:21] monoprotic: has joined #RubyOnRails
[17:13:32] noah256: has joined #RubyOnRails
[17:13:46] tvon[laptop]: has joined #RubyOnRails
[17:13:47] P4Titan: has joined #RubyOnRails
[17:14:58] akshat: has joined #RubyOnRails
[17:15:15] agent_white: has joined #RubyOnRails
[17:15:50] arBmind: has joined #RubyOnRails
[17:15:55] Devalo: has joined #RubyOnRails
[17:16:17] DoubleMalt: has joined #RubyOnRails
[17:16:20] _djbkd: has joined #RubyOnRails
[17:16:30] smathy: daveomcd, can you not see the other JS lines that Rails generated in your layout?
[17:19:07] Junaos: has joined #RubyOnRails
[17:20:34] Cohedrin: has joined #RubyOnRails
[17:20:51] Fridtjof: has joined #RubyOnRails
[17:21:27] hobodave: has joined #RubyOnRails
[17:21:51] Gkj8899: has joined #RubyOnRails
[17:21:56] marienz: has joined #RubyOnRails
[17:22:18] rrawlins: has joined #RubyOnRails
[17:22:29] hobodave: good morning
[17:23:40] JesseH: has joined #RubyOnRails
[17:23:46] tubbo: hello dave
[17:24:33] benlieb: has joined #RubyOnRails
[17:25:07] n008f4g_: has joined #RubyOnRails
[17:25:12] sp1rs: has joined #RubyOnRails
[17:26:09] hobodave: Has anyone seen this ConcurrencyError when using ActiveSupport::Cache::MemoryStore in Rails 4.1? I'm not sure what to do about it: https://gist.github.com/hobodave/f1587f15406ac1ca5430599213e587b1
[17:26:15] itsmeduncan: has joined #RubyOnRails
[17:26:29] baweaver: has joined #RubyOnRails
[17:26:37] hobodave: The line that throws that exception is: @value = Marshal.load(Marshal.dump(@value))
[17:26:49] OTORelic: has joined #RubyOnRails
[17:27:10] hobodave: It appears to me that the MemoryStore is intended to be thread-safe, it uses Mutexes to synchronize access to the data store
[17:28:21] siaW: how do i find the minute of creation from this?
[17:28:21] cmckee: has joined #RubyOnRails
[17:28:22] siaW: scope :new_users, ->(last_seen) { where("created_at > ?", last_seen) }
[17:28:29] siaW: scope :new_users, ->(last_seen) { where("created_at.min > ?", last_seen) }
[17:28:34] siaW: because in the console
[17:28:43] siaW: User.created_at.min responds
[17:29:00] siaW: scope :new_users, ->(last_seen) { where("created_at.min > ?", last_seen)
[17:29:07] hobodave: siaw created_at.min is Ruby, that's why
[17:29:09] hobodave: created_at.min > ? is SQL
[17:29:17] jhass: you're passing a SQL fragment to where, that's not ruby code
[17:29:25] jhass: what's last_seen?
[17:29:45] siaW: last_seen is Time.now.min
[17:30:09] jhass: what sense does that make at all
[17:30:26] jhass: you want all users that registered after the current minute of the hour?
[17:31:01] siaW: yes, i’m testing
[17:31:04] siaW: just a test
[17:31:18] cmckee: What is the <%- -%> Rails context mean? Its similar to <%= %>. Couldnt pull up anything with a google search
[17:31:22] jhass: so say one registered 2016-01-01 00:20, one 2016-01-01 00:30, one 2016-02-01 00:40 and we have 2016-04-01 00:25
[17:31:23] fox_mulder_cp: siaw: .. i read this as time to owin... ...
[17:31:34] jhass: you want the second and third but the first?
[17:31:51] siaW: i’m setting cookies that will show User A how many new people visited after User A’s last visted
[17:32:00] Ropeney: siaw, you'll want EXTRACT(MINUTE FROM TIMESTAMP created_at) EXTRACT(MINUTE FROM TIMESTAMP ?)
[17:32:10] cmckee: has left #RubyOnRails: ()
[17:32:14] jhass: ropeney: no they don't, see above, it's quite nonsensical to do that
[17:32:18] PedramT: has joined #RubyOnRails
[17:32:23] diegoaguilar: has joined #RubyOnRails
[17:32:23] siaW: yes that’s what i’m trying to do
[17:32:26] cmckee: has joined #RubyOnRails
[17:32:40] jhass: siaw: please try to follow what I'm stating above
[17:32:45] Ropeney: thats how you get minute of a timestamp
[17:33:02] jhass: it'll work in your current testing because all your test users are fairly new but fuck up tomorrow
[17:33:04] tubbo: hobodave: i have not. that is a shame though :D
[17:33:19] daveomcd: smathy, the line in the <head> tag is removed; however the effects still work- it's like the file is still loaded
[17:33:21] arup_r: has joined #RubyOnRails
[17:33:23] Ropeney: jhass, pretty sure he said he is just testing with it
[17:33:23] tubbo: hobodave: is ConcurrencyError a jruby error?
[17:33:50] tvon: has joined #RubyOnRails
[17:33:50] siaW: yes i’m just testing to si if it works with the current few minutes
[17:33:58] siaW: the parameters i can change after i see it working
[17:34:13] cmckee: has left #RubyOnRails: ()
[17:34:41] siaW: this is what i have https://gist.github.com/siaw23/f6cd686dacf49d3db68f27fff5d3c8ae
[17:34:49] arup_r: I am trying to remove a partial from body and add to <head> using deface. I am able to remove, but not able to add there.. what am I missing? https://gist.github.com/aruprakshit/ca2ce3c413f968dc572d1bfc493ff1af
[17:34:56] jhass: siaw: I strongly suggest you use the same types of values as you plan to use later
[17:35:09] jhass: siaw: and I strongly suggest to use absolute timestamps
[17:35:24] siaW: jhass: ok. but cookie values are set to string
[17:35:47] siaW: and i know i can compare string using >
[17:35:50] jhass: timestamps have standard serializations to and from string
[17:35:53] siaW: but i don’t know if it’s good practice
[17:36:03] Ropeney: wow you've complicated all this siaw
[17:36:13] siaW: i’m a noob
[17:36:21] Ropeney: use timestamp, save as a string and then you have it all working
[17:36:28] Ropeney: why try make whats so simple, so hard
[17:36:34] siaW: yeah right
[17:36:35] jhass: Time#iso8601 and Time.iso8601 for instance
[17:36:44] Ropeney: and use DateTime not time
[17:36:56] jhass: ACTION never got DateTime
[17:37:09] jhass: Time represents a fixed point in time
[17:37:25] jhass: not the time of day
[17:37:35] RegulationD: has joined #RubyOnRails
[17:37:44] daveomcd: smathy, if i press the browser reload button though it takes care of the issue- id just rather not have to rely on someone having to do that
[17:40:11] mdw: has joined #RubyOnRails
[17:41:00] mdw: has joined #RubyOnRails
[17:42:47] smathy: daveomcd, not what I asked, can you not see the javascript_include_tag lines that Rails generated for you in your layout?
[17:43:22] smathy: daveomcd, if you can't I'd advise making a new dummy app with the same version of Rails you're using, then taking a look in the layout, then copy what Rails generated.
[17:44:25] daveomcd: ahh let me look thanks
[17:44:45] daveomcd: I see them they're in there
[17:45:00] smathy: daveomcd, you'll see that they have a special attribute for the turbolinks tracking.
[17:45:04] daveomcd: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>; <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>; <%= csrf_meta_tags %>
[17:49:16] replay: has joined #RubyOnRails
[17:52:57] rafaelfranca: has joined #RubyOnRails
[17:53:08] [Butch]: has joined #RubyOnRails
[17:57:50] baweaver: has joined #RubyOnRails
[17:58:09] arup_r: has joined #RubyOnRails
[18:01:55] smathy: jhass, DateTime's only purpose is for pre-gregorian calendar representations.
[18:02:46] yellow5: has joined #RubyOnRails
[18:02:46] siaW: rails has this to set cookies
[18:02:47] siaW: cookies[:login] = { :value => "XJ-122", :expires => 1.hour.from_now }
[18:02:50] jhass: because fixing Time to handle that had made too much sense I guess
[18:02:57] siaW: is there a #expired? method to check if cookie expired?
[18:03:06] siaW: if not, then how do i check if cookie exipred?
[18:03:20] jhass: siaw: a client sending you an expired cookie would be in violation of the HTTP spec
[18:03:55] smathy: jhass, yeah, maybe it was during a time when they were still tossing up messing with core classes.
[18:03:57] tubbo: jhass: because Time also represents date :P
[18:04:41] tubbo: i feel like Date / DateTime are useless, why not use one class to represent all timestamps?
[18:04:55] siaW: jhass: so after expiration of cookie, is the value reset to “” or deleted or what?
[18:05:09] agit0: has joined #RubyOnRails
[18:05:18] macsteps: has joined #RubyOnRails
[18:05:19] jhass: I'd hope it's unset/not there (nil depending on how you ask I guess)
[18:05:41] siaW: unset sound more logical
[18:06:33] petor: has joined #RubyOnRails
[18:06:38] tubbo: jhass: i use DateTime in rails because it's actually ActiveSupport::DateTime, and so you don't have to do Time.zone.now
[18:06:47] tubbo: DateTime.now has zone incorporated
[18:07:12] jhass: well, that's all just symptoms of Time getting one more thing not right
[18:07:17] hobodave: tubbo yes, it's a JRuby error
[18:07:35] hobodave: I think it may have something to do with caching an ActiveRecord model directly
[18:07:50] hobodave: gonna try caching its #attributes instead and building the model outside of the cache fetch
[18:08:37] hobodave: the error happened 6 times in 3 days (6 million requests)
[18:09:37] arup_r: nvm, ignore my question
[18:10:05] tubbo: hobodave: hah that's not so bad :D
[18:10:14] tubbo: million to one shot doc, million to one...
[18:10:21] smathy: tubbo, funny, I yearn for a "time without date" far more often than I use the "date without time" class.
[18:10:38] hobodave: haha, I guess not, I just don't like unexpected exceptions :)
[18:10:58] Dimik: has joined #RubyOnRails
[18:13:06] antgel: has joined #RubyOnRails
[18:13:24] smathy: ...so just expect them, and be happy that your server handles them nicely and sends a 500.
[18:13:35] tubbo: hobodave: might be some crazy GC whatever
[18:13:53] tubbo: also jruby is constantly being worked on, maybe it's been updated and this bug has been fixed?
[18:14:04] tubbo: https://twitter.com/headius/status/723559292985450496
[18:14:53] flashpoint9: has joined #RubyOnRails
[18:15:10] smathy: ...on each exception, just grab a newer jruby.
[18:15:38] flashpoint9: has joined #RubyOnRails
[18:15:58] tubbo: s/jruby/rbx
[18:20:23] aegis3121: has joined #RubyOnRails
[18:20:49] blackmesa: has joined #RubyOnRails
[18:25:33] DragonPunch: has joined #RubyOnRails
[18:26:53] mikecmpbll: has joined #RubyOnRails
[18:27:43] flashpoint9: has joined #RubyOnRails
[18:28:57] renegadeandy: has joined #RubyOnRails
[18:29:34] yfeldblum: has joined #RubyOnRails
[18:30:36] darkxploit: has joined #RubyOnRails
[18:30:56] snowy: has joined #RubyOnRails
[18:30:57] smoitra: has joined #RubyOnRails
[18:31:46] moeabdol: has joined #RubyOnRails
[18:32:10] navneet: has joined #RubyOnRails
[18:33:12] listrophy: has left #RubyOnRails: ()
[18:33:50] darkxploit: has joined #RubyOnRails
[18:34:14] navneet_: has joined #RubyOnRails
[18:37:14] Yeomra: has joined #RubyOnRails
[18:37:18] mdw: has joined #RubyOnRails
[18:37:59] diegoaguilar: has joined #RubyOnRails
[18:38:03] darkxploit: has joined #RubyOnRails
[18:39:33] diego1: has joined #RubyOnRails
[18:41:35] apotry: has joined #RubyOnRails
[18:47:16] hoodow: has joined #RubyOnRails
[18:49:10] thejamespinto: has joined #RubyOnRails
[18:49:29] Cohedrin_: has joined #RubyOnRails
[18:51:44] antgel: has joined #RubyOnRails
[18:53:47] jhill_: has joined #RubyOnRails
[18:54:31] PedramT: has joined #RubyOnRails
[18:55:04] baweaver: has joined #RubyOnRails
[18:56:10] CornishPasty: has joined #RubyOnRails
[18:56:27] jinette: has joined #RubyOnRails
[18:58:29] jhack: has joined #RubyOnRails
[18:59:34] darkxploit: has joined #RubyOnRails
[18:59:55] artto: has joined #RubyOnRails
[19:01:10] mentero: has joined #RubyOnRails
[19:01:48] hayden_: has joined #RubyOnRails
[19:01:56] chouhoulis: has joined #RubyOnRails
[19:03:25] DukeDave: has joined #RubyOnRails
[19:04:17] iwada: has joined #RubyOnRails
[19:04:55] WhereIsMySpoon: has joined #RubyOnRails
[19:05:55] siaW: has joined #RubyOnRails
[19:09:51] Devalo: has joined #RubyOnRails
[19:11:34] tvon: has joined #RubyOnRails
[19:15:57] baweaver: has joined #RubyOnRails
[19:19:03] ondrejsynacek: has joined #RubyOnRails
[19:19:07] crankharder: has joined #RubyOnRails
[19:19:17] _djbkd: has joined #RubyOnRails
[19:19:48] PedramT: has joined #RubyOnRails
[19:20:42] r0x0rZ: has joined #RubyOnRails
[19:20:56] r0x0rZ: i dragged out fonts from /assets/fonts directory and then put them back. now my app can't load the fonts. i tried rebooting server and running rake:assets:precompile ... nothing works. also i didn't change anything else in my code.
[19:21:17] akshat_: has joined #RubyOnRails
[19:22:09] moeabdol: has joined #RubyOnRails
[19:25:17] chouhoulis: has joined #RubyOnRails
[19:25:18] arup_r: has joined #RubyOnRails
[19:25:57] mikecmpbll: has joined #RubyOnRails
[19:31:35] Cohedrin: has joined #RubyOnRails
[19:32:23] jenrzzz: has joined #RubyOnRails
[19:32:24] jenrzzz: has joined #RubyOnRails
[19:33:11] yfeldblum: has joined #RubyOnRails
[19:34:57] Coldblackice_: has joined #RubyOnRails
[19:35:56] bradleyprice: has joined #RubyOnRails
[19:38:01] gmas: has joined #RubyOnRails
[19:38:19] rrawlins: has joined #RubyOnRails
[19:40:19] King_Rex: has joined #RubyOnRails
[19:40:45] bradleyp_: has joined #RubyOnRails
[19:41:17] dh5: has joined #RubyOnRails
[19:41:19] Rodya_: has joined #RubyOnRails
[19:42:37] dh5: I'm trying to include the style class in the following form item, but no matter in which position I insert 'class: name', it doesn't work
[19:42:39] dh5: <%= text_field_tag :search, params[:search], placeholder: "Search Cars" %>
[19:44:41] dh5: according to the documentation, it should be: <%= text_field_tag :search, params[:search], class: 'form-control', placeholder: "Search Cars" %>, but that does not work
[19:44:44] arup_r: <%= text_field_tag :search, params[:search], placeholder: "Search Cars", class: 'form-input' %> should work dh5
[19:45:08] dh5: thanks arup, let me try that
[19:45:08] arup_r: ok.. what is the rendered html. for this part. can you show?
[19:45:13] smathy: dh5, !gist the HTML from your browser that's generated by that.
[19:45:13] helpa: dh5: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[19:45:24] arup_r: dh5: your last code should work though
[19:45:36] dh5: <input type="text" name="search" id="search" placeholder="Search Cars">
[19:45:47] dh5: that's the HTML that is rendering
[19:46:15] tubbo: dh5: try restarting the server and viewing that page again
[19:46:52] r0x0rZ: has joined #RubyOnRails
[19:46:53] smathy: dh5, maybe a caching issue, or maybe the wrong view, change the placeholder to something else - does it change?
[19:47:48] dh5: restarted the server, no luck. It's actually a static page.
[19:48:19] arup_r: now follow smathy suggeston last to first
[19:49:03] tubbo: dh5: are you sure you're on the right template/partial? :) also, i'm assuming you're doing this in development...
[19:49:10] dh5: alright, brb
[19:49:24] dh5: Yes, i'm doing it in dev
[19:49:36] tubbo: alright just making sure
[19:49:47] dh5: and yeah, it really just is the static index.html page
[19:51:22] arup_r: no .erb at the end?
[19:51:28] smathy: dh5, what do you mean it's a static page?
[19:51:40] smathy: dh5, ERB no worky in .html files.
[19:51:59] dh5: yes, it does have erb at the end
[19:52:13] dh5: https://gist.github.com/anonymous/a785e428cb665a2526606b1bb433db32
[19:52:16] dh5: thats the form snippet
[19:52:19] smathy: dh5, so..... by static you meant dynamic, got it.
[19:52:46] smathy: dh5, ok, and add the HTML from your browser that that generated.
[19:53:34] jenrzzz: has joined #RubyOnRails
[19:53:35] jenrzzz: has joined #RubyOnRails
[19:54:12] dh5: https://gist.github.com/anonymous/e806b14d71783b850bc9a85c7d90203b
[19:54:16] Rodya_: has joined #RubyOnRails
[19:54:23] rafaelfranca: has joined #RubyOnRails
[19:54:48] smathy: dh5, right, so see, the placeholder isn't the new one, you're looking at the wrong template.
[19:57:08] Thouren: has joined #RubyOnRails
[19:58:39] dh5: I know for a fact I'm not looking at the wrong template, I was literally just working on it and all other changes were reflecting
[19:59:02] dh5: I'm gonna restart the entire instance
[20:00:13] smathy: Now it's an instance.
[20:00:27] blackmesa: has joined #RubyOnRails
[20:01:35] tubbo: dh5: also, `ls` the views dir you're in
[20:02:11] _djbkd: has joined #RubyOnRails
[20:02:14] tubbo: a while back, i accidentally left a .orig model class in my app/models dir. took me a *while* to figure out why changes to app/models/whatever.rb weren't getting reflected
[20:02:29] jtong: has joined #RubyOnRails
[20:02:32] tubbo: because rails loaded app/models/whatever.rb, and then it loaded app/models/whatever.rb.orig, which basically reopened the class and undid all my changes.
[20:02:42] tubbo: i'm not sure if this still happens, but that shit was annoying
[20:03:02] tubbo: so if you have app/views/application/index.html and app/views/application/index.html.erb...which template gets loaded?
[20:03:21] flashpoint9: has joined #RubyOnRails
[20:04:47] dh5: restarting the whole instance seems to have done it
[20:04:50] hobodave_: has joined #RubyOnRails
[20:05:00] dh5: oh well
[20:05:01] tubbo: dh5: instance == aws instance?
[20:05:04] dh5: Thanks for the help!
[20:05:07] tubbo: dh5: oh the server
[20:05:09] dh5: Yes, aws
[20:05:45] tubbo: dh5: i wouldn't run in 'development' anywhere other than your local workstation...it's not designed to be requested like that.
[20:06:06] tubbo: dh5: instead, i would copy my production environment and call it 'staging', then run my dev server on AWS with that environment.
[20:07:12] dh5: Thanks tubbo, I'll do that.
[20:08:33] pawnbox: has joined #RubyOnRails
[20:09:17] istrasci: has joined #RubyOnRails
[20:10:04] istrasci: Is it possible to make a Rails engine where the namespace is different than the actual engine name?
[20:10:29] tubbo: istrasci: !try
[20:10:29] helpa: istrasci: Why don't you try it and find out for yourself?
[20:10:35] tubbo: ACTION is genuinely curious
[20:10:53] matthias_: has joined #RubyOnRails
[20:11:27] jstransky: has joined #RubyOnRails
[20:11:33] istrasci: Well I did, and I can't get it to work. I make an engine called SomeApi, but I just want the namespace to be Some::. But if I do that, the rails console doesn't recognize Some:: as a namespace.
[20:11:57] istrasci: Wondering if I'm doing something wrong, or if it's just not possible.
[20:12:25] optimus55: has joined #RubyOnRails
[20:13:54] srinidhi: has joined #RubyOnRails
[20:14:17] arup_r: istrasci: do you need `engine_name` method http://api.rubyonrails.org/classes/Rails/Engine.html
[20:14:41] arup_r: I'm confused so trying to help with a question..
[20:14:45] dionysus69: has joined #RubyOnRails
[20:15:19] tubbo: istrasci: so you want it to look like Some::Api, Some::Engine, etc.
[20:15:24] tubbo: but you want the engine name to be 'some_api'
[20:15:33] tubbo: s/it/your class names
[20:16:03] akshat: has joined #RubyOnRails
[20:16:32] istrasci: I want to do `rails plugin new some_api —mountable`, but then have all the models, etc. as Some::Model1, Some::Model2, ...
[20:16:50] istrasci: tubbo: Not sure if that answers your question.
[20:17:37] tubbo: istrasci: how about changing `isolate_namespace Some::Api` to `isolate_namespace Some`?
[20:17:50] istrasci: Yeah, I tried that too.
[20:18:22] tubbo: i always thought that every file in app/**/* was loaded, even in engines
[20:19:36] tubbo: istrasci: what happens when you do this
[20:19:38] tubbo: istrasci: !dw
[20:19:38] helpa: istrasci: 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.
[20:20:19] istrasci: Let me make a gist.
[20:20:49] akshat_: has joined #RubyOnRails
[20:21:24] istrasci: helpa: My computer exploded. How can I configure my rails engine so that my computer doesn't explode? I guess that's my core question.
[20:21:41] tubbo: use phoenix
[20:23:28] rrawlins: has joined #RubyOnRails
[20:23:57] SteenJobs: has joined #RubyOnRails
[20:24:34] macsteps: has joined #RubyOnRails
[20:26:18] PedramT: has joined #RubyOnRails
[20:27:58] istrasci: https://gist.github.com/istrasci/4b380cd8cf1dd7ac663fd86597f8115a
[20:30:14] istrasci: So I try to make the models in the Banner:: namespace, even though the whole engine is called RubyBannerApi. But it's not recognizing Banner::.
[20:30:24] LastWhisper____: has joined #RubyOnRails
[20:30:53] moei: has joined #RubyOnRails
[20:30:55] LastWhisper____: has joined #RubyOnRails
[20:31:03] jenrzzz: has joined #RubyOnRails
[20:32:43] tubbo: well, i'm not sure how you'd do that.
[20:32:58] LastWhisper____: has joined #RubyOnRails
[20:33:55] bradleyprice: has joined #RubyOnRails
[20:35:09] rrawlins: has joined #RubyOnRails
[20:36:57] Regulati_: has joined #RubyOnRails
[20:41:54] marr: has joined #RubyOnRails
[20:47:22] [Butch]: has joined #RubyOnRails
[20:48:55] newjersey: has joined #RubyOnRails
[20:49:23] newjersey: has joined #RubyOnRails
[20:49:48] dionysus69: has joined #RubyOnRails
[20:51:53] diegoaguilar: has joined #RubyOnRails
[20:52:20] ur5us: has joined #RubyOnRails
[20:52:35] diegoaguilar: has joined #RubyOnRails
[20:53:02] slash_nick: istrasci: let me guess... you would've called this thing "banner", but that's taken?
[20:53:35] daguilaraguilar: has joined #RubyOnRails
[20:54:00] istrasci: slash_nick: That, and I wanted the name to be more descriptive.
[20:54:05] slash_nick: maybe you'd have a better time just generating an engine called "Banner", then changing the gemspec file to name the gem "ruby_banner_api"... so folks `gem install ruby_banner_api`, but they mount Banner.
[20:54:26] istrasci: slash_nick: Yes, that is what I'm trying now.
[20:54:40] yfeldblum: has joined #RubyOnRails
[20:54:40] istrasci: I'm wondering if that's the only way.
[20:55:05] slash_nick: the file structure leads me to believe you generated "ruby_banner_api"
[20:59:19] dionysus69: has joined #RubyOnRails
[20:59:50] macsteps: has joined #RubyOnRails
[21:02:13] context: it doesnt find banner probably cause its located in lib/ruby_banner_api/spriden.rb
[21:02:42] context: or.. wherever thats NOT a dir named banner
[21:03:29] blackmesa: has joined #RubyOnRails
[21:05:35] PedramT: has joined #RubyOnRails
[21:06:28] istrasci: Well, even if I renamed that directory, it still wouldn't find it.
[21:07:39] Rodya_: has joined #RubyOnRails
[21:08:07] Spami: has joined #RubyOnRails
[21:09:48] jenrzzz: has joined #RubyOnRails
[21:11:18] FooMunki: has joined #RubyOnRails
[21:11:29] Devalo: has joined #RubyOnRails
[21:13:15] SteenJobs: has joined #RubyOnRails
[21:15:12] istrasci: *even when I renamed that directory
[21:17:05] Spami: has joined #RubyOnRails
[21:27:37] petor: has joined #RubyOnRails
[21:27:56] blackmesa: has joined #RubyOnRails
[21:28:03] Palsson: has joined #RubyOnRails
[21:29:37] jottr: has joined #RubyOnRails
[21:30:49] Jasaka: has joined #RubyOnRails
[21:31:06] IrishGringo: has joined #RubyOnRails
[21:32:01] petor: has joined #RubyOnRails
[21:32:30] macsteps: has joined #RubyOnRails
[21:37:32] optimus55: has joined #RubyOnRails
[21:37:33] mbd2: has joined #RubyOnRails
[21:41:04] jenrzzz: has joined #RubyOnRails
[21:41:04] jenrzzz: has joined #RubyOnRails
[21:49:10] pawnbox: has joined #RubyOnRails
[21:51:07] aegis3121: has joined #RubyOnRails
[21:51:14] sh5: has joined #RubyOnRails
[21:54:01] sh5: Quick question guys, I migrated prod and dev from sqlite to postgres and my search functions stopped working entirely. Trying to get to the bottom of it, but don't know where I'm failing.
[21:54:03] sh5: https://gist.github.com/deltahawk5/3246c0806af8f0abb947356164954e17
[21:54:37] sh5: This gist is for a dropdown menu that collects all manufacturers, returns them to the dropdown menu, and searches a car list for cars which have said manufacturer
[21:55:04] sh5: when the search posts, it just returns all vehicles regardless of manufacturers, as you can see
[21:55:22] universa1: sh5: !gist-usage
[21:55:22] helpa: sh5: How to use Gist properly: https://github.com/radar/guides/blob/master/using-gist.markdown
[21:55:26] universa1: controller code?
[21:55:47] rafaelfranca: has joined #RubyOnRails
[21:56:57] sh5: for cars, manufacturers, or both?
[21:57:23] universa1: for your not working search form
[21:57:33] GodFather: has joined #RubyOnRails
[21:58:05] hnanon: has joined #RubyOnRails
[21:58:24] sh5: here are the controllers: https://gist.github.com/deltahawk5/d54945baa17728695e3b8500f3b89d65
[21:58:24] hnanon: What can I use to scrape an iframe?
[21:58:30] hnanon: Nokogiri?
[21:58:33] dopie: has joined #RubyOnRails
[21:58:45] universa1: hnanon: sounds plausible.
[21:59:17] Rodya__: has joined #RubyOnRails
[22:03:05] dh5: has joined #RubyOnRails
[22:03:18] dh5: Sorry, my client timedout, i don't know if anyone mentioned their thoughts
[22:03:47] Contigi: has joined #RubyOnRails
[22:04:09] dh5: I'm really scratching my head how changing databases affected the meaning of the code
[22:04:26] universa1: dh5: ok. model code?
[22:04:32] istrasci: has left #RubyOnRails: ()
[22:04:57] universa1: search method specifically... please add everything to one gist... keeps it easier for others to find you
[22:05:52] dh5: Updated this gift
[22:05:53] dh5: https://gist.github.com/deltahawk5/d54945baa17728695e3b8500f3b89d65
[22:07:07] universa1: dh5: hmm, just guessing here, but postgres might be sensitive about lower and upper case column names
[22:07:18] universa1: https://gist.github.com/deltahawk5/d54945baa17728695e3b8500f3b89d65#file-car-rb-L7
[22:07:35] universa1: dh5: where("cars.name LIKE (?)", "%
[22:08:45] ornerymoose: has joined #RubyOnRails
[22:09:43] itsmeduncan: has joined #RubyOnRails
[22:13:28] bronson: has joined #RubyOnRails
[22:19:44] creature: has joined #RubyOnRails
[22:19:44] creature: has joined #RubyOnRails
[22:20:38] Trynemjoel: has joined #RubyOnRails
[22:26:44] Jasaka: has joined #RubyOnRails
[22:26:49] dh5: has joined #RubyOnRails
[22:27:23] jonr22: has joined #RubyOnRails
[22:30:28] pawnbox: has joined #RubyOnRails
[22:30:52] brianpWins: has joined #RubyOnRails
[22:31:43] ebbflowgo: has left #RubyOnRails: ()
[22:32:03] robbyoconnor: has joined #RubyOnRails
[22:40:26] SteenJobs: has joined #RubyOnRails
[22:41:10] MEATCHICKEN: has joined #RubyOnRails
[22:41:17] MEATCHICKEN: I have a route that is being hit twice upon navigating to it
[22:41:25] MEATCHICKEN: shows up twice in the logs
[22:41:29] MEATCHICKEN: what could be wrong?
[22:42:29] arBmind: has joined #RubyOnRails
[22:46:24] theblang: has joined #RubyOnRails
[22:47:24] baweaver: has joined #RubyOnRails
[22:51:29] Pupeno: has joined #RubyOnRails
[22:51:29] Pupeno: has joined #RubyOnRails
[22:52:25] Rodya_: has joined #RubyOnRails
[22:52:30] diegoaguilar: has joined #RubyOnRails
[22:53:09] jonr22: has joined #RubyOnRails
[22:55:03] bradleyprice: has joined #RubyOnRails
[22:55:47] jonr2219: has joined #RubyOnRails
[22:56:41] neha-: has left #RubyOnRails: ("Textual IRC Client: http://www.textualapp.com/")
[22:57:29] jottr: has joined #RubyOnRails
[22:57:46] akshat: has joined #RubyOnRails
[22:57:47] lemur: has joined #RubyOnRails
[22:58:01] bradleyprice: has joined #RubyOnRails
[22:58:12] jhack: has joined #RubyOnRails
[23:00:23] srinidhi: has joined #RubyOnRails
[23:03:53] dh5: has joined #RubyOnRails
[23:05:18] bronson: has joined #RubyOnRails
[23:05:26] dh5: Hey guys, so I still haven't been able to resolve the issue i mentioned earlier :\
[23:05:51] dh5: I migrated from sqlite to postgres and none of my searches/queries work: here is gist with controllers and models: https://gist.github.com/deltahawk5/d54945baa17728695e3b8500f3b89d65
[23:08:50] dh5: I'm confident its actually related to the code, but i can't figure out what it is
[23:09:10] dh5: here is the URL returned, and the parameters don't look correct
[23:09:23] dh5: cars?manufacturer%5Bmanufacturer_name%5D=Porsche&commit=Search
[23:10:25] dh5: which comes from this chunk of code: <%= select :manufacturer, "manufacturer_name" , Manufacturer.all.collect {|u| [u.name]}, {prompt: 'Select Manufacturer'}%>
[23:14:09] Devalo: has joined #RubyOnRails
[23:16:29] smathy: dh5, what doesn't look right to you about the params?
[23:18:30] dh5: nothing according to the rails api
[23:19:06] smathy: dh5, so your controller is expecting a parameter called "search" and your form isn't making one of those.
[23:19:35] smathy: dh5, just to get one thing out of your head, this has nothing at all to do with sqlite/postgres
[23:19:52] dh5: Right, I'm aware of that.
[23:20:23] smathy: dh5, ok, because just a few lines up you said "I migrated from sqlite to postgres and none of my searches/queries work"
[23:20:29] ur5us: has joined #RubyOnRails
[23:20:49] jstransky: has joined #RubyOnRails
[23:20:56] dh5: Right, because everything worked on sqlite3, I don't understand how switching to postgres would affect the functionality
[23:21:22] smathy: dh5, right, and what I'm telling you is that this code wouldn't work on postgres either.
[23:21:45] DragonPunch: has joined #RubyOnRails
[23:22:04] smathy: dh5, you're submitting a form which has no `params[:search]` and so your controller is setting @cars to Car.order("manufacturer_id asc").all
[23:22:15] dh5: I'm on postgres now and it doesn't work. It worked when I was on SQLITE3.
[23:22:29] dh5: That's what I meant to say
[23:22:43] dh5: but yes, something is wrong with the code.
[23:22:46] ur5us_: has joined #RubyOnRails
[23:22:47] smathy: dh5, and I'm telling you that your change of DB was irrelevant to this problem.
[23:22:55] dh5: Yes, I know that.
[23:22:57] smathy: ...so just don't spend any time thinking about or focusing on that.
[23:23:00] Trynemjoel: has joined #RubyOnRails
[23:23:05] smathy: ...ok, so don't bother mentioning it at all.
[23:23:26] dh5: I can't figure out what's wrong with the parameters on the select statement.
[23:24:22] baweaver: has joined #RubyOnRails
[23:25:38] bradleyprice: has joined #RubyOnRails
[23:26:15] tvon: has joined #RubyOnRails
[23:28:58] smathy: dh5, not sure what you mean there, did you not understand my comment earlier where I said: "your controller is expecting a parameter called "search" and your form isn't making one of those" ?
[23:29:14] smathy: ...or "you're submitting a form which has no `params[:search]` and so your controller is setting @cars to Car.order("manufacturer_id asc").all" ?
[23:30:08] ur5us: has joined #RubyOnRails
[23:31:26] dh5: I'm still learning, and I get what you're saying, but the solution to fix the code is flying over my head :(
[23:31:50] smathy: dh5, so, express the problem to me in your own words.
[23:32:55] dh5: It's a select dropdown menu. The dropdown menu contains a list of all car manufacturers. The user selects a manufacturer from the list, and hits search. The application returns all cars which are manufactured by that company.
[23:33:44] qejk: has joined #RubyOnRails
[23:34:50] dh5: That's the practical concept. I'm still very new to RoR and I've just been following the API.
[23:35:00] dh5: API documentation*
[23:36:01] ur5us: has joined #RubyOnRails
[23:37:18] smathy: dh5, I think you misread, I asked you to express the *problem* to me in your words.
[23:37:59] dh5: The problem is that I can't figure out how to get the application to pass the correct query parameters
[23:39:36] dh5: I get what you're saying about the controller expecting a search parameter
[23:39:52] dh5: I don't know how to make that change in the form
[23:40:43] smathy: dh5, ok, so you're decided that it's the form side of this problem that you want to change?
[23:40:55] triangles2: has joined #RubyOnRails
[23:41:14] smathy: ...because the naming in the form is only one side of the real problem you have.
[23:43:00] SteenJobs: has joined #RubyOnRails
[23:44:27] Maletor: has joined #RubyOnRails
[23:44:30] ebbflowgo: has joined #RubyOnRails
[23:46:21] dh5: I don't know, honestly
[23:46:45] dh5: I've run back and forth through this so many times I don't know where I stand anymore
[23:47:00] smathy: dh5, so just listen to what I'm saying....
[23:47:30] smathy: dh5, the problem is that your controller is expecting `search` but the form you're creating has `manufacturer[manufacturer]`
[23:48:49] RegulationD: has joined #RubyOnRails
[23:49:34] FooMunki: has joined #RubyOnRails
[23:49:46] dh5: Yes, I understand that.
[23:50:06] Devalo: has joined #RubyOnRails
[23:50:42] smathy: dh5, so why are you focused only on how to change the field name in the form?
[23:52:46] wd40s: has joined #RubyOnRails
[23:53:04] dh5: I have no idea what to change in the controller
[23:54:16] pawnbox: has joined #RubyOnRails
[23:54:26] Devalo: has joined #RubyOnRails
[23:54:45] sneakerhax: has joined #RubyOnRails
[23:55:04] Rodya_: has joined #RubyOnRails
[23:55:31] smathy: dh5, if you had to guess, what do you think it would be?
[23:56:40] Rodya_: has joined #RubyOnRails
[23:57:17] rafaelfranca: has joined #RubyOnRails
[23:59:38] dh5: params[:search]