« Back to channel list

#RubyOnRails - 28 March 2016

« Back 1 day Forward 1 day »
[00:01:33] Inside: has joined #RubyOnRails
[00:01:56] arBmind: has joined #RubyOnRails
[00:02:49] jaequery: has joined #RubyOnRails
[00:06:23] enitiz: has joined #RubyOnRails
[00:08:47] rails157: has joined #RubyOnRails
[00:08:54] rails157: has left #RubyOnRails: ()
[00:09:22] _Tariq: has joined #RubyOnRails
[00:11:26] Rubie: has joined #RubyOnRails
[00:12:04] user__: has joined #RubyOnRails
[00:14:29] MarkTR: has joined #RubyOnRails
[00:21:04] eyeamaye: has joined #RubyOnRails
[00:25:58] htmldrum: has joined #RubyOnRails
[00:26:00] htmldrum_: has joined #RubyOnRails
[00:33:17] cd-rum: has joined #RubyOnRails
[00:39:03] GodFather: has joined #RubyOnRails
[00:39:54] chouhoulis: has joined #RubyOnRails
[00:43:58] chouhoulis: has joined #RubyOnRails
[00:45:16] sandstrom: has joined #RubyOnRails
[00:46:04] stannard: has joined #RubyOnRails
[00:47:53] FooMunki: has joined #RubyOnRails
[00:48:24] hahuang61: has joined #RubyOnRails
[00:53:55] pawnbox: has joined #RubyOnRails
[00:58:00] DragonPunch: has joined #RubyOnRails
[00:58:10] blackhuey: has joined #RubyOnRails
[01:01:48] delgiudices: has joined #RubyOnRails
[01:03:49] northfurr: has joined #RubyOnRails
[01:04:20] bronson: has joined #RubyOnRails
[01:04:50] siaW: i need some help here: http://stackoverflow.com/questions/36144793/devise-omniauth-twitter-twitter-gem-updating-attributes
[01:04:52] _Tariq: has joined #RubyOnRails
[01:06:40] moei: has joined #RubyOnRails
[01:10:00] diegoaguilar: has joined #RubyOnRails
[01:10:41] DragonPunch: has joined #RubyOnRails
[01:10:46] siaW: 100pts bounty :D :D
[01:11:52] blackmesa: has joined #RubyOnRails
[01:15:50] Trynemjoel: has joined #RubyOnRails
[01:20:29] idefine: has joined #RubyOnRails
[01:21:36] uglybandersnatch: has joined #RubyOnRails
[01:22:41] Rubie: has joined #RubyOnRails
[01:24:02] pawnbox: has joined #RubyOnRails
[01:28:34] moei: has joined #RubyOnRails
[01:35:41] xcesariox: has joined #RubyOnRails
[01:37:34] idefine: has joined #RubyOnRails
[01:39:05] Trynemjoel: has joined #RubyOnRails
[01:39:39] UndergroundRails: has joined #RubyOnRails
[01:40:03] triangles: has joined #RubyOnRails
[01:41:21] sudoubuntu: has joined #RubyOnRails
[01:43:16] jaequery: has joined #RubyOnRails
[01:47:58] Trynemjoel: has joined #RubyOnRails
[01:50:45] djbkd: has joined #RubyOnRails
[01:50:51] northfurr: has joined #RubyOnRails
[01:55:56] Trynemjoel: has joined #RubyOnRails
[01:56:14] _Tariq: has joined #RubyOnRails
[01:57:28] ur5us: has joined #RubyOnRails
[01:59:07] ur5us: has joined #RubyOnRails
[01:59:44] ur5us: has joined #RubyOnRails
[02:01:48] jaequery: has joined #RubyOnRails
[02:02:32] northfurr: has joined #RubyOnRails
[02:02:45] Rubie: has joined #RubyOnRails
[02:06:38] yatish27: has joined #RubyOnRails
[02:06:43] idefine_: has joined #RubyOnRails
[02:07:23] Trynemjoel: has joined #RubyOnRails
[02:09:00] northfurr: has joined #RubyOnRails
[02:09:45] TinkerTyper: has joined #RubyOnRails
[02:13:35] pawnbox: has joined #RubyOnRails
[02:14:56] blackmesa: has joined #RubyOnRails
[02:16:07] owenjones: has joined #RubyOnRails
[02:16:43] silentpost: has joined #RubyOnRails
[02:17:36] yatish27: has joined #RubyOnRails
[02:18:08] stannard: has joined #RubyOnRails
[02:20:36] georgedrummond: has joined #RubyOnRails
[02:21:56] htmldrum: has joined #RubyOnRails
[02:21:57] htmldrum_: has joined #RubyOnRails
[02:22:57] atrius: has joined #RubyOnRails
[02:25:36] bratchley: has joined #RubyOnRails
[02:31:46] GnuYawk: has joined #RubyOnRails
[02:31:48] hahuang61: has joined #RubyOnRails
[02:34:26] merida: has joined #RubyOnRails
[02:37:53] greengriminal: has joined #RubyOnRails
[02:40:00] idefine: has joined #RubyOnRails
[02:40:48] davee_: has joined #RubyOnRails
[02:41:05] IrishGringo: has joined #RubyOnRails
[02:42:26] idefine_: has joined #RubyOnRails
[02:43:33] pawnbox: has joined #RubyOnRails
[02:44:01] northfurr: has joined #RubyOnRails
[02:44:41] sudoubuntu: has joined #RubyOnRails
[02:47:26] idefine: has joined #RubyOnRails
[02:47:27] crdpink2: has joined #RubyOnRails
[02:50:11] Cohedrin: has joined #RubyOnRails
[02:51:46] duderonomy: has joined #RubyOnRails
[02:55:44] rubyonrailed: has joined #RubyOnRails
[02:57:04] GnuYawk: has joined #RubyOnRails
[03:01:14] yatish27: has joined #RubyOnRails
[03:04:27] Dopagod: has joined #RubyOnRails
[03:05:09] _Tariq: has joined #RubyOnRails
[03:06:15] delgiudices: has joined #RubyOnRails
[03:06:29] bronson: has joined #RubyOnRails
[03:11:39] Guest31: has joined #RubyOnRails
[03:12:51] braincrash: has joined #RubyOnRails
[03:13:21] pawnbox: has joined #RubyOnRails
[03:17:53] blackmesa: has joined #RubyOnRails
[03:18:32] Rubie: has joined #RubyOnRails
[03:19:33] barajasfab: has joined #RubyOnRails
[03:23:19] Tempesta_: has joined #RubyOnRails
[03:24:18] greengriminal: has joined #RubyOnRails
[03:26:43] chagel: has joined #RubyOnRails
[03:27:36] chouhoul_: has joined #RubyOnRails
[03:27:38] jaequery: has joined #RubyOnRails
[03:28:26] idefine: has joined #RubyOnRails
[03:33:58] lyoshajapan: has joined #RubyOnRails
[03:36:19] jaequery: has joined #RubyOnRails
[03:40:25] fn2187: has joined #RubyOnRails
[03:43:17] Tempesta_: has left #RubyOnRails: ()
[03:43:29] Tempesta: has joined #RubyOnRails
[03:45:02] diegoaguilar: has joined #RubyOnRails
[03:47:55] pawnbox: has joined #RubyOnRails
[03:55:24] rubyonrailed: has joined #RubyOnRails
[03:56:00] _Tariq: has joined #RubyOnRails
[03:56:07] TheGreatGudsby: has joined #RubyOnRails
[03:57:05] jaequery: has joined #RubyOnRails
[04:00:32] northfurr: has joined #RubyOnRails
[04:02:28] lyoshajapan: has joined #RubyOnRails
[04:06:25] User458764: has joined #RubyOnRails
[04:07:05] tildes: has joined #RubyOnRails
[04:09:26] rubyonrailed: has joined #RubyOnRails
[04:10:42] gabr13l: has left #RubyOnRails: ()
[04:11:46] htmldrum: has joined #RubyOnRails
[04:11:50] htmldrum_: has joined #RubyOnRails
[04:20:53] blackmesa: has joined #RubyOnRails
[04:20:55] sevenseacat: has joined #RubyOnRails
[04:23:18] Tempesta_: has joined #RubyOnRails
[04:23:55] cabargas: has joined #RubyOnRails
[04:24:26] nocontrol: has joined #RubyOnRails
[04:24:36] lyoshajapan: has joined #RubyOnRails
[04:25:34] nocontrol: is there any way to get last(100) items by activerecord with a step of 200 ? I can't find any documentation for a "step"
[04:27:29] sevenseacat: what do you mean by 'step'?
[04:28:21] merida: has joined #RubyOnRails
[04:29:32] Rubie: has joined #RubyOnRails
[04:36:45] krz: has joined #RubyOnRails
[04:37:53] lyoshajapan: has joined #RubyOnRails
[04:41:31] crameth: has joined #RubyOnRails
[04:42:57] nocontrol: sevenseacat: get the 200th row
[04:43:13] nocontrol: sevenseacat: then the 400th row, then the 600th row
[04:43:19] uglybandersnatch: has joined #RubyOnRails
[04:43:21] nocontrol: sevenseacat: the last 100 of them
[04:43:41] sevenseacat: mmm... that isn't possible afaik, and would be quite intensive if it was
[04:44:03] nocontrol: sevenseacat: an alternative ?
[04:44:31] sevenseacat: might depend on why you want to do it
[04:45:00] nocontrol: sevenseacat: how do I get the 200th row data beginning from the last one ?
[04:45:12] apeiros: if the db in question supports rownum or something similar, you might be able to construct a query. no idea how to do it with AR, though.
[04:45:13] nocontrol: I could iterate this way
[04:45:56] lyoshajapan: has joined #RubyOnRails
[04:46:23] nocontrol: ....otherwise I must get 10k rows and then process them easily but I believe it's a total waste
[04:47:47] sevenseacat: again, we might be able to offer non-AR approaches, if we understood what you were trying to do and why
[04:48:30] nocontrol: I'll try to experiment more
[04:48:33] apotry: has joined #RubyOnRails
[04:48:35] sevenseacat: suit yourself
[04:51:16] moei: has joined #RubyOnRails
[04:53:45] arup_r: has joined #RubyOnRails
[05:05:23] scepticulous: has joined #RubyOnRails
[05:07:55] lyoshajapan: has joined #RubyOnRails
[05:08:42] bronson: has joined #RubyOnRails
[05:09:14] moei: has joined #RubyOnRails
[05:09:49] moei: has joined #RubyOnRails
[05:10:18] Tempesta_: has left #RubyOnRails: ()
[05:10:47] Tempesta: has joined #RubyOnRails
[05:12:05] Palsson: has joined #RubyOnRails
[05:13:05] Gooer: has joined #RubyOnRails
[05:21:40] yatish27: has joined #RubyOnRails
[05:23:30] Tempesta_: has joined #RubyOnRails
[05:24:17] blackmesa: has joined #RubyOnRails
[05:26:58] pawnbox: has joined #RubyOnRails
[05:28:32] arup_r: has joined #RubyOnRails
[05:31:44] lyoshajapan: has joined #RubyOnRails
[05:32:56] Dimik: has joined #RubyOnRails
[05:33:04] sadaf2606: has joined #RubyOnRails
[05:34:00] lyoshaja_: has joined #RubyOnRails
[05:37:11] owenjones: has joined #RubyOnRails
[05:39:17] chagel: has joined #RubyOnRails
[05:39:36] gingray: has joined #RubyOnRails
[05:41:00] fedexo: has joined #RubyOnRails
[05:42:40] sypheren: has joined #RubyOnRails
[05:44:28] yfeldblum: has joined #RubyOnRails
[05:54:42] patrick-sartent: has joined #RubyOnRails
[06:00:25] DoctorMonocular: has joined #RubyOnRails
[06:02:36] Chagel_: has joined #RubyOnRails
[06:04:19] hahuang61: has joined #RubyOnRails
[06:05:33] fexilal: has joined #RubyOnRails
[06:09:51] agit0: has joined #RubyOnRails
[06:10:44] User458764: has joined #RubyOnRails
[06:15:39] yfeldblum: has joined #RubyOnRails
[06:20:44] Tempesta: has joined #RubyOnRails
[06:24:04] Radar: GOOD EVENING.
[06:24:28] chipotle: has joined #RubyOnRails
[06:25:49] htmldrum: has joined #RubyOnRails
[06:25:50] htmldrum_: has joined #RubyOnRails
[06:27:07] blackmesa: has joined #RubyOnRails
[06:29:32] aganov: has joined #RubyOnRails
[06:31:25] draig: has joined #RubyOnRails
[06:35:18] agit0: has joined #RubyOnRails
[06:36:17] The_Phoenix: has joined #RubyOnRails
[06:37:30] Dopagod: has joined #RubyOnRails
[06:37:58] owenjones: has joined #RubyOnRails
[06:38:03] GnuYawk: has joined #RubyOnRails
[06:41:52] liquid-silence: has joined #RubyOnRails
[06:41:52] liquid-silence: has joined #RubyOnRails
[06:45:20] hahuang61: has joined #RubyOnRails
[06:56:26] baweaver: has joined #RubyOnRails
[07:06:42] Regulati_: has joined #RubyOnRails
[07:07:06] jalnt: has joined #RubyOnRails
[07:08:41] njero: has joined #RubyOnRails
[07:09:06] Guest89115: has joined #RubyOnRails
[07:10:37] bronson: has joined #RubyOnRails
[07:19:26] blindsight: has joined #RubyOnRails
[07:19:49] htmldrum: has joined #RubyOnRails
[07:19:49] htmldrum_: has joined #RubyOnRails
[07:21:55] arup_r: has joined #RubyOnRails
[07:22:22] srinidhi: has joined #RubyOnRails
[07:24:31] valetudo: has joined #RubyOnRails
[07:25:45] chouhoulis: has joined #RubyOnRails
[07:29:52] blackmesa: has joined #RubyOnRails
[07:31:19] ur5us: has joined #RubyOnRails
[07:41:03] Lingo: has joined #RubyOnRails
[07:41:59] chipotle: has joined #RubyOnRails
[07:45:55] htmldrum: has joined #RubyOnRails
[07:46:00] htmldrum_: has joined #RubyOnRails
[07:46:05] patrick_star: has joined #RubyOnRails
[07:46:13] merida: has joined #RubyOnRails
[07:50:46] dionysus69: has joined #RubyOnRails
[07:51:26] mark3: has joined #RubyOnRails
[07:52:19] phredus: has joined #RubyOnRails
[08:00:28] roshanavand: has joined #RubyOnRails
[08:08:48] i4: has joined #RubyOnRails
[08:09:01] yatish27: has joined #RubyOnRails
[08:12:09] htmldrum: has joined #RubyOnRails
[08:12:10] htmldrum_: has joined #RubyOnRails
[08:14:24] darutoko: has joined #RubyOnRails
[08:18:06] wethu: has joined #RubyOnRails
[08:22:17] rrichardsr3: has joined #RubyOnRails
[08:24:15] weckl: has joined #RubyOnRails
[08:26:32] chouhoulis: has joined #RubyOnRails
[08:26:48] tildes: has joined #RubyOnRails
[08:34:03] tribals: has joined #RubyOnRails
[08:37:01] blackmesa: has joined #RubyOnRails
[08:38:18] pawnbox: has joined #RubyOnRails
[08:41:44] hightower3: has joined #RubyOnRails
[08:42:13] tribals: i've a big question about associations. Let's start. First, it is necessary to specify corresponding `belongs_to` on related model? What it actually does? I assume it defines a set of methods, but actual association defined in db schema, right? so, if rails see such field in table, does it create any methods if there is no corresponding `belongs_to`? Second, i think associations between models is valuable thing for testing. Do you write tests for ass
[08:42:13] tribals: ociations? If do, how you do that?
[08:42:28] JohnBat26: has joined #RubyOnRails
[08:43:21] sevenseacat: the association methods for a belongs_to only get created when you call belongs_to, yes
[08:43:35] sevenseacat: rails will not infer associations - you must define them both in your schema and in your models
[08:44:02] sevenseacat: i sometimes write very basic tests for them using something like shoulda-matchers, if the gem is already in the project
[08:44:29] sevenseacat: does that cover all of it?
[08:46:21] blackmesa: has joined #RubyOnRails
[08:49:05] dgncn: has joined #RubyOnRails
[08:51:51] pawnbox: has joined #RubyOnRails
[08:52:02] doublemalt__: has joined #RubyOnRails
[08:54:30] chagel: has joined #RubyOnRails
[08:56:59] tribals: sevenseacat: yes, thanks. i thin now i've a better understanding how thing actually goes
[08:57:53] many: has joined #RubyOnRails
[08:58:30] Guest91417: has joined #RubyOnRails
[08:59:53] differentreality: has joined #RubyOnRails
[09:00:25] dionysus69: has joined #RubyOnRails
[09:03:32] Chagel_: has joined #RubyOnRails
[09:03:48] jhass: has joined #RubyOnRails
[09:04:08] mdw: has joined #RubyOnRails
[09:10:49] chipotle: has joined #RubyOnRails
[09:11:23] uglybandersnatch: has joined #RubyOnRails
[09:13:00] bronson: has joined #RubyOnRails
[09:15:35] blackmesa: has joined #RubyOnRails
[09:22:17] eyeamaye: has joined #RubyOnRails
[09:23:36] quazimodo: has joined #RubyOnRails
[09:24:04] siaW: has joined #RubyOnRails
[09:25:11] chipotle: has joined #RubyOnRails
[09:27:13] qhp: has joined #RubyOnRails
[09:27:16] chouhoulis: has joined #RubyOnRails
[09:27:27] niksrc: has joined #RubyOnRails
[09:28:23] baweaver: has joined #RubyOnRails
[09:28:58] johnflux: has joined #RubyOnRails
[09:32:15] Cervajz: has joined #RubyOnRails
[09:36:36] johnflux: has joined #RubyOnRails
[09:36:39] tildes: with a very eventful news week regarding npm, would be nice to know, what makes bundler and rubygems different?
[09:40:29] srinidhi: has joined #RubyOnRails
[09:42:33] fexilal: tildes : One would be ... the culture
[09:44:59] arup_r: has joined #RubyOnRails
[09:45:40] tildes: fexilal: I hope it's not the most important difference, because if it is, just change the people, and get the same results :)
[09:46:32] merida: has joined #RubyOnRails
[09:46:55] sevenseacat: well, our gem registry is not a proprietary company
[09:48:33] User458764: has joined #RubyOnRails
[09:48:42] sevenseacat: that being said, yanking of gems and breaking all of the things is still possible
[09:49:22] sevenseacat: but we have a more robust stdlib so those one-liner gems that everyone includes 5000 copies of, simply don't exist
[09:49:55] tildes: sevenseacat so if someone pulls out their gems, existing installations would keep working, but bundle install on a fresh installation couldn't fetch them?
[09:50:20] sevenseacat: unless you had vendored the gems
[09:50:25] matthewd: (but that's true of npm, too)
[09:50:29] tildes: I think a smaller number and less tangled web of packages is already a really good thing
[09:50:40] tildes: what is vendored gem?
[09:51:28] sevenseacat: installing gems to a vendor directory in your app so they can all be bundled with the app code
[09:51:31] fexilal: npm looks good in theory, but i guess what happened was analogous to this : http://www.denofgeek.com/games/24531/the-1983-videogame-crash-what-went-wrong-and-could-it-happen-again
[09:51:59] sevenseacat: `bundle package` appears to be the simplest way to do it
[09:52:22] tildes: how many people actually set their gems to a specific version? i was trying to search for keeping gemfiles secure, equivalent of shrinkwrap, and what not, and wasn't able to find very good resources on this topic
[09:53:01] tildes: (maybe I got bad search words, or maybe it's so self-evident nobody writes about it :) )
[09:53:07] sevenseacat: shrinkwrap, in my experience, is a clusterfuck
[09:53:10] fexilal: people dumped trivial packages that depend several other packages in a quest for github stars.
[09:53:25] sevenseacat: it depends on the gem, how strictly i pin it in a Gemfile
[09:53:55] tildes: good to know about bundle package
[09:54:07] sevenseacat: 'nice to have' gems i dont bother pinning at all, 'kinda important' gems get pinned down to minor versions, 'critical' gems to whatever the third number is called
[09:54:13] sevenseacat: micro, i think
[09:54:23] waseem_: sevenseacat: Tiny.
[09:54:38] tildes: sevenseacat: for any application you intend for production that is?
[09:54:53] sevenseacat: no, any app i build really
[09:55:05] waseem_: sevenseacat: semver.org calls it MAJOR.MINOR.PATCH
[09:56:11] sevenseacat: and when i say 'pin to a minor version' i mean like '~> 1.2.0'
[09:56:27] sevenseacat: to allow for tiny/micro/patch fixes
[09:57:36] yatish27: has joined #RubyOnRails
[09:57:41] siaW: good morning everyone. i’m trying to use sidekiq for the first time. so in looking at the documention. i did something like this. in my app>workers>poster.rb i have something like this: https://gist.github.com/siaw23/18215962e18067464936
[09:57:50] siaW: am i thinking right here?
[09:58:37] siaW: i expect the logger to be showing the message i’m posting to it
[09:59:32] sevenseacat: is that even valid syntax?
[10:00:01] siaW: i have no idea. i was reading this https://github.com/mperham/sidekiq/wiki/Getting-Started
[10:00:16] sevenseacat: i meant more your loop call
[10:01:22] sevenseacat: also - try calling it and see if it works
[10:02:46] yfeldblum: has joined #RubyOnRails
[10:05:54] siaW: ok i modified my method to look like this: https://gist.github.com/siaw23/18215962e18067464936
[10:06:13] arup_r1: has joined #RubyOnRails
[10:08:07] siaW: looks like have to do more than than
[10:09:13] sandstrom: has joined #RubyOnRails
[10:09:27] DragonPunch: has joined #RubyOnRails
[10:12:42] hamster88: has joined #RubyOnRails
[10:13:09] hamster88: Greetings everyone
[10:13:34] hamster88: I have a few questions regarding deployment of a RoR application
[10:14:25] hamster88: 1. I have deployed applications using heroku.. and tbh works real good. But the heroku based applicaation seems slow.
[10:14:37] hamster88: May be its just me or I am missing one thing or another.
[10:15:38] hamster88: 2. If i want to deploy my app on aws, along with sendgrid... what would i need in that case? I can't find a guide that could provide any pre-requisites.
[10:15:45] sevenseacat: individual dynos arent very high powered
[10:15:58] cd-rum: has joined #RubyOnRails
[10:16:09] hamster88: sevenseacat, so what can be done in that case
[10:16:13] sevenseacat: you want performance from heroku, be prepared to pay through the nose
[10:16:43] hamster88: so like we would have to go with business plan of heroku if i am getting your correct
[10:18:02] hamster88: is there any other good hosting you would suggest sevenseacat ?
[10:18:14] siaW: sevenseacat: it’s working :)
[10:18:20] cd-rum_: has joined #RubyOnRails
[10:18:43] sevenseacat: hamster88: yeah you would want their professional dynos if youre planning on running a business
[10:18:49] sevenseacat: siaw: good stuff.
[10:19:13] sevenseacat: hamster88: i'm not in the business of deployment, but I know my company hosts apps on AWS.
[10:20:10] thorgi: has joined #RubyOnRails
[10:20:51] hamster88: sevenseacat, AWS is good heard good things about it but the only thing is i can't found a list of pre-requisites that sendgrid would require on aws server. like if it needs postfix or any mail server configured on the server
[10:21:33] sevenseacat: isnt sendgrid a service? so you just point your apps at it?
[10:21:40] sevenseacat: no need to install anything?
[10:22:09] sevenseacat: documentation seems to suggest so
[10:22:29] hamster88: that shall work out of box then i assume
[10:22:44] fexilal: hamster88 : the aws analogue to heroku is elasitc beanstalk
[10:22:52] fexilal: slastic beanstalk
[10:23:03] fexilal: the fuck... elastic beanstalk*
[10:23:05] hamster88: elastic beanstalk < here corrected for you :D
[10:23:11] sevenseacat: check the docs to see how to configure it, that will answer your question.
[10:23:49] hamster88: sevenseacat, the docs says you only need to add the gem to the app and config vars secrets and yada yada yada.. and you are good to go
[10:23:54] hamster88: seems legit
[10:23:58] sevenseacat: then there you go
[10:24:17] hamster88: ok one more thing though..
[10:24:30] hamster88: shall i use nginx with puma or unicorn
[10:24:40] hamster88: Just curious about performance actually :D
[10:25:03] hamster88: I will do a research on this :D
[10:25:27] matthewd: Use whatever you're using on heroku; don't introduce extra variables needlessly
[10:25:44] sevenseacat: matthewd: you know heroku uses webrick by default, right? :D
[10:25:45] hamster88: fexilal, does beanstalk needs a lotz of configuration n setup ?
[10:25:47] Spami: has joined #RubyOnRails
[10:26:02] hamster88: the mighty webrick :D
[10:26:36] fexilal: it's the most automagical option to deploy on aws.
[10:26:38] matthewd: If you're using webrick, step 1 to improve performance might not be setting up AWS ;)
[10:26:44] sevenseacat: you may get more performance out of heroku if you switch from webrick to puma etc.
[10:26:58] sevenseacat: though you may have already done that, we dont know
[10:27:30] matthewd: I *think* Heroku complains, somewhere, if you're using webrick
[10:27:55] sevenseacat: if they do, it would likely be in very small writing during a deploy
[10:28:59] matthewd: Yeah.. lucky everyone reads warnings like that
[10:29:01] hamster88: I saw somewhere that you can add the puma and nginx on heroku but that would be an additional cost
[10:29:32] chouhoulis: has joined #RubyOnRails
[10:30:10] sevenseacat: i dont think so
[10:30:28] hamster88: they are available as add on lemme find it :D
[10:31:14] hamster88: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#adding-puma-to-your-application
[10:31:38] sevenseacat: no addons mentioned there
[10:33:11] arup_r: has joined #RubyOnRails
[10:36:03] fexilal: hamster88 : also, in many PaaS discussions you'll see something 'heroku is much more expensive but think of all the manhours you'll save so that you can focus on your business!' - AWS documentation is REALLY good and investing a little time learning how to deploy on AWS will pay for itself several times over.
[10:36:36] hamster88: i think i saw it somewhere
[10:36:45] hamster88: also fexilal i will check it
[10:37:14] sevenseacat: i'm glad you think you saw it, but you just linked to the official docs that don't mention it
[10:37:36] hamster88: that's why i used "think" cos i wasn't sure lol :P
[10:37:46] sevenseacat: lololololo or something
[10:38:32] hamster88: EC2 is what i wanna give a try to
[10:40:51] dvinciguerra: has joined #RubyOnRails
[10:45:34] fexilal: hamster88 : the services on AWS in order of increasing levels of sysadmining you have to do to deploy your app are: Elastic Beanstalk, Cloudformation/Opsworks(Chef), EC2/ECS/EBS/S3/RDS/R53/...
[10:45:58] iuuso_: has joined #RubyOnRails
[10:46:26] hamster88: hmm so Elastic Beanstalk i will use
[10:46:29] flashpoint9: has joined #RubyOnRails
[10:47:00] hamster88: fexilal, Can you point me to a guide or something that relates to deploying rails app on beanstalk
[10:47:38] uglybandersnatch: has joined #RubyOnRails
[10:48:39] fexilal: hamster88 : here's a good one (Opsworks) - https://www.youtube.com/watch?v=OQoYTeGJYf4 and there's this: https://www.youtube.com/watch?v=WNLIsqjkvu8
[10:50:12] johnflux: has joined #RubyOnRails
[10:52:57] siaW: i understand current_user by devise is accessible in controllers, views and helpers. what if i wanted to access current_user in another class i created. how can i do that in this class? should i make my class inherit from ApplicationController in order to get access to current_user? https://gist.github.com/siaw23/d8984c16379bb881b19a
[10:54:17] sevenseacat: workers don't operate in the context of a controller, you have to pass the user to the worker.
[10:54:41] sevenseacat: well, the user ID anyway, and then load the user in the job.
[10:56:07] siaW: sevenseacat i don’t understand
[10:56:25] siaW: “pass the user to the worker”
[10:56:48] sevenseacat: when you queue up the job, with its arguments, make the current user one of the arguments
[10:58:24] siaW: i get that part. but if i make current_user and argument, how can i make the job FIND the current user? i’m thinking first i have to make the worker class “see/recognize” current_user first
[10:58:48] siaW: cause now when i start sidekiq, i get “undefined local variable or method `current_user' for HardWorker:Class”
[10:59:20] sevenseacat: your job will have a user ID as an argument. then you can just call User.find
[10:59:29] sevenseacat: there is no concept of a "current user" in a job
[11:00:03] siaW: i’ll try again
[11:04:37] siaW: sevenseacat: does this make sense? https://gist.github.com/siaw23/d8984c16379bb881b19a
[11:04:46] siaW: please forget about anytying below
[11:05:31] quazimodo: has joined #RubyOnRails
[11:06:03] kiloreux: has joined #RubyOnRails
[11:06:45] sevenseacat: again, there is no such thing as a 'current user'.
[11:07:05] sevenseacat: the only thing state your worker knows about are the arguments you pass to the perform method.
[11:09:15] Silex: has joined #RubyOnRails
[11:09:52] siaW: sevenseacat: i’m stuck. a user is logged in. i want the job to work on him. how do i tell the job that it should be working on the current user?
[11:09:55] rodfersou: has joined #RubyOnRails
[11:10:16] sevenseacat: you pass the user ID to the job. then the job looks up the user, and does whatever you need it to do
[11:10:38] sevenseacat: so when you call the job, pass current_user.id as one of the arguments
[11:13:34] AimlessRAven: has joined #RubyOnRails
[11:13:47] AzaToth: has joined #RubyOnRails
[11:13:48] AimlessRAven: how to insert image_tag here %li{"data-thumb" => "assets/images/shop/top1-1-90x114.jpg"}
[11:13:49] dionysus69: has joined #RubyOnRails
[11:14:44] bronson: has joined #RubyOnRails
[11:15:03] matthias_: has joined #RubyOnRails
[11:16:00] tribals: has joined #RubyOnRails
[11:18:51] ldnunes: has joined #RubyOnRails
[11:18:55] siaW: sevenseacat: am i close? https://gist.github.com/siaw23/d8984c16379bb881b19a
[11:19:35] GodFather: has joined #RubyOnRails
[11:23:49] AimlessRAven: how to insert image_tag here %li{"data-thumb" => "assets/images/shop/top1-1-90x114.jpg"}
[11:28:56] trinaldi: has joined #RubyOnRails
[11:29:27] baweaver: has joined #RubyOnRails
[11:32:15] sevenseacat: siaw: if you are confused by what I'm saying, please ask for clarifications on the confusing parts instead of just making things up
[11:33:20] sevenseacat: also, trying your code will be a much easier and quicker way to see if it works
[11:33:26] sevenseacat: than asking someone on the internet
[11:33:49] siaW: sevenseacat: i’m sorry. i’m as confused as a freshman on the first day of college
[11:33:55] siaW: i tried what i did
[11:34:17] siaW: and sidekiq tells me “WARN: NoMethodError: undefined method `accounts' for "#<User:0x007fd0d0f18cd8>":String”
[11:34:39] siaW: but in my console current_user.accounts work fine
[11:35:14] sevenseacat: because current_user in your console is not the same thing as current_user in your job
[11:35:19] siaW: which made me think i’m close, just needed to figure out why #accounts on a User instance is not being recognized by sidekiq
[11:35:28] siaW: wwwwooooow
[11:35:32] sevenseacat: you do not have a user instance in sidekiq - you have a string
[11:35:40] siaW: now i’m even more confused
[11:36:24] srinidhi: has joined #RubyOnRails
[11:36:31] siaW: i’m seeing it now
[11:36:32] sevenseacat: "#<User:0x007fd0d0f18cd8>":String” is a string, not a user
[11:36:35] mdw: has joined #RubyOnRails
[11:37:24] mdw: has joined #RubyOnRails
[11:37:38] sevenseacat: because sidekiq serializes the arguments you pass to a job, you should always pass simple primitives like an integer ID, not a full object
[11:39:03] tbuehlmann: siaw: what rails version do you use?
[11:39:24] siaW: tbuehlmann:
[11:39:53] chouhoulis: has joined #RubyOnRails
[11:40:03] tbuehlmann: do you use active job with sidekiq as adapter or plain sidekiq without active job?
[11:40:22] tbuehlmann: just saw the gist, you use plain sidekiq. nevermind then
[11:40:30] johnflux: has joined #RubyOnRails
[11:40:30] siaW: errmm. i’m just usind sidekiq. with redis on local machine. that’s all
[11:42:41] AimlessRAven: how to insert image_tag here %li{"data-thumb" => "assets/images/shop/top1-1-90x114.jpg"}
[11:48:44] netzfisch: has joined #RubyOnRails
[11:48:56] rodferso1: has joined #RubyOnRails
[11:50:29] arup_r: has joined #RubyOnRails
[11:51:02] zworks: has joined #RubyOnRails
[11:51:28] zworks: any one else thinks ruby is not good when it comes to memory management ?
[11:52:28] tbuehlmann: what does that mean?
[11:53:16] zworks: I think it does not do GC properly
[11:53:35] zworks: apps are easily tend to grow in memory, compared to languages like python
[11:53:37] sevenseacat: define 'properly'
[11:53:50] sevenseacat: there's been a lot of work done on the GC in Ruby
[11:54:27] zworks: then why it's not releasing the memory to the OS after a finish of a function call ?
[11:55:14] sevenseacat: if thats happening its probably more a question for the ruby core team
[11:55:15] tbuehlmann: zworks: running the GC after every method call would result in a pretty big performance loss
[11:55:58] tbuehlmann: it also depends on the ruby version you're using. it's rather new that ruby returns memory, don't know the exact version number though
[11:56:09] solars: has joined #RubyOnRails
[11:56:49] zworks: For example, please check this stackoverflow post
[11:56:51] zworks: http://stackoverflow.com/questions/28826621/how-to-force-ruby-release-memory-to-os
[11:58:29] zworks: btw, using the GC.stat hash, which filed i should look at to get the memory used by ruby?
[11:58:51] rodfersou: has joined #RubyOnRails
[11:58:58] tbuehlmann: 2.3 uses the generational GC, so GC runs don't always clear up everything. it's a trade off between performance and memory
[12:01:57] zworks: most memory allocations because of the references with the '=' operator, right ?
[12:02:09] AimlessRAven: how to add image_tag here %li{"data-thumb" => "assets/images/shop/top1-1-90x114.jpg"}
[12:02:58] tbuehlmann: that's just a reference, calling Object.new without an assignment will allocate memory as well
[12:03:25] zworks: make sense
[12:03:53] zworks: so i think the loaded libraries/gems also constitute for the growth of the memory
[12:04:14] DragonPunch: has joined #RubyOnRails
[12:06:32] merida: has joined #RubyOnRails
[12:07:13] zworks: i also thought of using redis for storing objects , and manually empty the value at the end
[12:09:21] arup_r: AimlessRaven: %li{ data: { thumb: image_tag('shop/top1-1-90x114.jpg') }
[12:11:58] IrishGringo: has joined #RubyOnRails
[12:12:40] workmad3: has joined #RubyOnRails
[12:14:54] braincra-: has joined #RubyOnRails
[12:15:08] blackmesa: has joined #RubyOnRails
[12:16:54] Silex: has joined #RubyOnRails
[12:17:21] chouhoulis: has joined #RubyOnRails
[12:19:09] sandstrom: has joined #RubyOnRails
[12:22:02] siaW: sevenseacat: i believe this is what you meant
[12:22:02] siaW: https://gist.github.com/siaw23/d8984c16379bb881b19a
[12:22:13] siaW: lines 6, 7 and 8
[12:22:16] Balzrael: has joined #RubyOnRails
[12:22:18] siaW: and then line 21
[12:22:44] sevenseacat: siaw: now you're following :) 7 is a bit nasty, but it will work
[12:22:55] siaW: the method looks crazy i know. i’m just testing stuff. currently working
[12:24:43] siaW: buuuut one more thing
[12:24:46] chouhoulis: has joined #RubyOnRails
[12:25:14] Silex: has joined #RubyOnRails
[12:25:21] siaW: i realised that even though i’m telling the method to sleep for 30 seconds. it doesn’t actually sleep. it makes tweets at random times. why’s that?
[12:26:22] blackmesa: has joined #RubyOnRails
[12:26:37] _Tariq: has joined #RubyOnRails
[12:26:44] sevenseacat: it is sleeping for 30 seconds
[12:26:48] sevenseacat: but after it posts all the tweets
[12:27:00] zworks: any suggestions for a good ruby http library ?
[12:27:09] drbayer: has joined #RubyOnRails
[12:27:16] DragonPunch: has joined #RubyOnRails
[12:27:53] siaW: sevenseacat: ok will fix that
[12:27:58] siaW: but even with what you said
[12:28:02] siaW: that it’s sleeping
[12:28:05] zworks: I have used, rest-client, httpclient and net/http , but when i open multiple 'https' links in threads, the script crashes as 'segmentation fault'
[12:28:13] sevenseacat: zworks: !debug
[12:28:13] helpa: zworks: You have not provided enough information to debug your problem. Please provide this information: https://gist.github.com/radar/5384431
[12:28:17] siaW: look here please: https://gyazo.com/a44a543808d8483a1160571d32cef6cb
[12:28:32] sevenseacat: i dont click random unknown links, sorry.
[12:28:37] _Tariq: has joined #RubyOnRails
[12:28:49] siaW: ah ok. it’s an image :D
[12:28:53] siaW: but i understand
[12:29:20] AntiSpamMeta: has joined #RubyOnRails
[12:29:20] siaW: if it’s sleeping for 30 seconds
[12:29:34] siaW: and posting all tweets
[12:29:44] siaW: why do i have like 2seconds interval between tweets?
[12:29:53] siaW: shouldn’t it post all AT ONCE?
[12:29:57] sevenseacat: because it takes 2 seconds for twitter's API to respond?
[12:30:07] siaW: actually no
[12:30:16] siaW: cause some intervals are like 1 second
[12:30:17] sevenseacat: i have nfi what $twitter is so
[12:30:27] sevenseacat: assuming its an API object
[12:31:06] IrishGringo: has joined #RubyOnRails
[12:31:08] context: technically all those dont post at once
[12:31:16] context: since its single threaded they do in fact get posted one at a time
[12:31:42] zworks: https://gist.github.com/haswow/5bb9ebc593b2161b9fc1
[12:31:44] tbuehlmann: without knowing what $twitter is, you can't know that
[12:31:54] siaW: i’ll show what $twitter is :D
[12:31:55] context: what is the purpose of `while true` in there... to post the same damn tweets over an over ?
[12:32:07] sevenseacat: context: with a 30 second gap between blocks :D
[12:32:22] context: sevenseacat: makes TOTAL sense now!
[12:32:28] zworks: sevenseacat: that's the code
[12:32:31] tbuehlmann: also, cruby having the gil doesn't mean it can't do things concurrently
[12:32:48] sevenseacat: zworks: there's no segmentation fault there
[12:33:29] context: thirdly.. sidekiq workers that just... NEVER end... thats even more awesome
[12:33:33] tildes: has joined #RubyOnRails
[12:33:38] _Tariq: has joined #RubyOnRails
[12:33:40] zworks: sevenseacat: segmetation fault is a runtime error i get randomly
[12:33:41] sevenseacat: context: every 30 seconds, until the end of time.
[12:34:36] sevenseacat: zworks: i know what a segfault is, but there's absolutely no evidence of having one in that blob of poorly-formatted code
[12:35:04] zworks: https://gist.github.com/haswow/6bf5d82f999dd7a2c705
[12:35:13] zworks: that's how the error looks
[12:35:16] siaW: lady and gentlemen, this is $twitter https://gist.github.com/siaw23/1fcdaa24eb31da186e9c
[12:35:31] siaW: a global instance variable
[12:35:52] Papierkorb: siaw: I think you'll want to change your Twitter client secret right now ..
[12:35:52] sevenseacat: zworks: so whats grocer? thats where the error is coming rom
[12:36:05] siaW: it has an #update method that will just post to twitter
[12:36:14] siaW: Papierkorb: no i don’t have to. it’s fake
[12:36:30] siaW: i’m less stupid that i exhibit :p
[12:37:04] zworks: the error is triggered at openssl/buffering.rb:61
[12:37:39] zworks: I assume it may be because of multiple threads using OpenSSl
[12:37:44] siaW: sevenseacat: i’d argue with you and my “while true” and the sleep method honestly
[12:37:46] sevenseacat: which is being called brokenly by grocer, it seems
[12:38:06] sevenseacat: siaw: err, you want to defend your code?
[12:38:18] sevenseacat: this will be good
[12:38:25] siaW: the “while true” and sleep part
[12:39:20] pawnbox: has joined #RubyOnRails
[12:39:33] akshat: has joined #RubyOnRails
[12:39:50] Balzrael: does anyone here have experience with JRuby on Rails. I am interested in what you are using to manage Java dependencies and for building the war file
[12:39:52] siaW: sevenseacat: https://gist.github.com/siaw23/d8984c16379bb881b19a
[12:39:56] siaW: can you see it?
[12:40:06] sevenseacat: your code? yes
[12:40:15] siaW: i move the sleep into the “while” scope
[12:40:15] siaW: https://gist.github.com/siaw23/d8984c16379bb881b19a
[12:40:23] siaW: for me, there’s nothing bad about it
[12:40:38] sevenseacat: nothing bad about posting the same set of posts over and over again at 30 second intervals?
[12:41:05] siaW: not that part
[12:41:10] sevenseacat: you just said
[12:41:32] sevenseacat: even then, it's a waste of time having a worker sitting there sleeping in a job for 30 seconds
[12:41:45] sevenseacat: when it could be doing other jobs instead
[12:42:10] siaW: now i get your point clearer
[12:43:10] siaW: leaving the time wasting part of the job aside
[12:43:28] siaW: if you look at my while loop
[12:43:34] siaW: for each post
[12:43:47] siaW: sleep for 30seconds
[12:43:53] siaW: next post
[12:43:57] siaW: sleep 30seconds
[12:44:08] siaW: that makes sense right?
[12:44:24] sevenseacat: if thats what you want it to do, then yes
[12:45:05] siaW: and the problem was that after starting sidekiq. the interval between the posts were like 1 and 2 seconds
[12:45:13] siaW: unless i didn’t save something
[12:45:23] sevenseacat: zworks: https://github.com/grocer/grocer/issues/87
[12:46:30] sevenseacat: [20:29:57] sevenseacat: because it takes 2 seconds for twitter's API to respond?
[12:47:27] siaW: it’s working now
[12:47:43] siaW: i mean my time interval set is working
[12:48:45] _Tariq: has joined #RubyOnRails
[12:49:36] TheGreatGudsby: has joined #RubyOnRails
[12:50:16] siaW: sevenseacat: thank you veeery much 8)
[12:51:43] siaW: but you mentioned something about wasting the job’s time for 30 seconds
[12:51:58] Balzrael: does anyone here have experience with JRuby on Rails. I am interested in what you are using to manage Java dependencies and for building the war file
[12:52:11] siaW: how can i prevent that. if i really want to make posts after 30 seconds each?
[12:54:00] sevenseacat: have one job post a tweet, then enqueue another job to post the next tweet
[12:54:35] flashpoint9: has joined #RubyOnRails
[12:54:54] GodFather: has joined #RubyOnRails
[12:55:34] _Tariq: has joined #RubyOnRails
[12:56:09] nickenchuggets: has joined #RubyOnRails
[12:57:07] kiloreux: has joined #RubyOnRails
[12:57:55] merida: has joined #RubyOnRails
[12:59:05] pawnbox: has joined #RubyOnRails
[13:01:22] context: balzrael: use java tools to handle hava depedencies
[13:02:22] Balzrael: so maven would be the way to go :(
[13:02:59] aegis3121: has joined #RubyOnRails
[13:03:54] DragonPunch: has joined #RubyOnRails
[13:04:14] phredus: has joined #RubyOnRails
[13:05:47] mdw7: has joined #RubyOnRails
[13:06:26] DragonPunch: has joined #RubyOnRails
[13:07:03] blackmesa: has joined #RubyOnRails
[13:13:38] Papierkorb: Balzrael: iirc there was a integration for maven with bundler in JRuby, or something similar
[13:14:18] Papierkorb: Balzrael: https://github.com/mguymon/lock_jar
[13:16:19] AlexJakeGreen: has joined #RubyOnRails
[13:17:42] krz: has joined #RubyOnRails
[13:18:04] CodaBrink: has joined #RubyOnRails
[13:18:41] Balzrael: Papierkorb: actually JRuby comes now with jar-dependencies gem bundled in, and it is quite great for managing Java dependencies, but for building the app I need to use Warbler and it also needs JBundler to be present and initalized even if for the dependency management it is really not required
[13:18:51] mrgreenfur: has joined #RubyOnRails
[13:19:02] Balzrael: I was curious if there is a better way of building the war file
[13:19:12] mrchris: has joined #RubyOnRails
[13:20:06] valetudo: has joined #RubyOnRails
[13:21:33] chocoelho: has joined #RubyOnRails
[13:26:22] nmyr: has joined #RubyOnRails
[13:30:10] baweaver: has joined #RubyOnRails
[13:30:39] MiKey`: has joined #RubyOnRails
[13:30:41] MiKey`: has left #RubyOnRails: ()
[13:30:43] tildes: I'm fetching xml data from a web service, and parsing it with nokogiri. I would want to get to the point, where I can actually set accept headers correctly, so that I can be sure the format is in xml, and api version as expected. however, I don't get very far, as Net::HTTP::Get.new throws errors like so http://pastie.org/private/hsaatzxlm35m4hcghgwuqa
[13:30:47] sudoubuntu: has joined #RubyOnRails
[13:31:31] Rubie: has joined #RubyOnRails
[13:32:28] stannard: has joined #RubyOnRails
[13:32:32] tildes: would really appreciate some help
[13:32:45] mrchris: has joined #RubyOnRails
[13:33:07] epochwolf: tildes: Why are you using Net::HTTP::Get?
[13:33:26] tildes: epochwolf, it's what I found on the interwebs. totally open to other options as well
[13:33:40] epochwolf: tildes: How about reading the documentation: http://ruby-doc.org/stdlib-2.1.2/libdoc/net/http/rdoc/Net/HTTP.html
[13:34:00] tildes: epochwolf not a bad idea, I will.
[13:34:15] epochwolf: Net::HTTP::Get is in an internal class. You're passing the wrong parameters into it. (Don
[13:34:31] epochwolf: I don't know what the right ones are because it's an undocumentated internal class.
[13:35:02] tildes: I got it from here https://github.com/augustl/net-http-cheat-sheet/blob/master/headers.rb
[13:35:36] epochwolf: That's from 2012.
[13:35:38] tildes: epochwolf, but yes, I haven't got real excuses for not reading the documentation, so I will
[13:36:11] tjohnson: has joined #RubyOnRails
[13:36:15] tildes: epochwolf ... yes ... sometimes it's hard to tell which information is still valid. many things, at least the public interfaces of classes, still are, even from 2012
[13:36:39] qejk: has joined #RubyOnRails
[13:36:41] epochwolf: Also, it looks like you're supposed to pass uri into Net::HTTP::Get.new
[13:36:57] epochwolf: If you're going to use a cheatsheet, do try to follow what it's doing.
[13:37:05] tildes: I think I tried that too, but with a different error
[13:37:20] tildes: ACTION looking at the docs
[13:39:32] epochwolf: tildes: it looks like the docs have something similar to the cheat sheet. You might want to try again and if you get an error, tell me that error.
[13:39:42] GodFather: has joined #RubyOnRails
[13:41:13] hxegon: has joined #RubyOnRails
[13:41:48] mcr-credil: has joined #RubyOnRails
[13:42:22] siaW: hello, it’s me, i’ve been trying to fix this but can’t
[13:42:24] siaW: https://gist.github.com/siaw23/e07b18c8152a9ef8509b
[13:42:26] chrisml: has joined #RubyOnRails
[13:42:40] siaW: why can’t i do a migration? any idea?
[13:43:00] tildes: epochwolf I'll need to think about this for a second, it's the first time I'm trying to get even this 'deep' with net/http.
[13:43:23] siaW: i have things i have in the same gist, below
[13:44:13] epochwolf: siaw: you have a column named "name" and no column named "account_name"
[13:44:49] siaW: how’s that? my schema has “account_name”
[13:45:19] epochwolf: siaw: gist schema.rb and the failing migration.
[13:45:36] nickenchuggets: has joined #RubyOnRails
[13:46:19] epochwolf: Obviously the database doesn't have a field named accounts.account_name.
[13:46:33] sevenseacat: account_name != name
[13:46:54] epochwolf: sevenseacat: orly?
[13:46:55] mrgreenfur_: has joined #RubyOnRails
[13:47:47] siaW: here https://gist.github.com/siaw23/e07b18c8152a9ef8509b
[13:48:18] defsdoor: has joined #RubyOnRails
[13:49:06] epochwolf: siaw: well, you definitely have a problem.
[13:49:20] siaW: but with what?
[13:49:35] epochwolf: You'll need to manually fix that from the database console.
[13:50:41] epochwolf: Did you edit a migration after deploying it?
[13:50:58] epochwolf: Yeah, you dun fucked up.
[13:51:05] sevenseacat: your form is posting account_name. why?
[13:51:11] epochwolf: You'll have to repair that by hand.
[13:51:26] sevenseacat: oh, because your schema says it has that, but your migration doesnt
[13:52:22] mcr-credil: has joined #RubyOnRails
[13:53:08] siaW: i’m dead
[13:54:01] epochwolf: siaw: sql isn't that hard.
[13:54:08] dionysus69: has joined #RubyOnRails
[13:54:14] siaW: it’s not about sql
[13:54:20] yellow5: has joined #RubyOnRails
[13:54:33] epochwolf: I'd take a backup of your database before doing anything.
[13:54:34] siaW: not sure where to start. i think i need to edit my migration files
[13:54:57] epochwolf: Do not use migrations to try to repair this.
[13:55:02] siaW: don’t worry about the db. it’s a toy app for learning :D
[13:55:13] epochwolf: Then nuke the DB.
[13:55:20] flashpoint9: has joined #RubyOnRails
[13:55:25] epochwolf: Fix the migrations and rerun.
[13:55:29] hdoOOOG: has joined #RubyOnRails
[13:55:48] epochwolf: And never edit migrations after they have been run against a remote database.
[13:56:01] epochwolf: You can edit then in development if you know what you are doing.
[13:56:14] siaW: yes, the plan is edit in dev
[13:56:20] epochwolf: For any edits, you need to roll them back.
[13:56:23] siaW: and commit to heroku
[13:56:40] epochwolf: Do not edit after they have been run on heroku.
[13:56:55] sevenseacat: once you have pushed a migration anywhere, consider it locked. do not edit it again. ever.
[13:56:58] epochwolf: Migrations are scripts.
[13:57:09] mdel: has joined #RubyOnRails
[13:57:43] siaW: ok. so since my migration is “locked” on heroku, my guess here now is to genter psql on heroku, and rename column names
[13:57:44] tildes: can't get my net http request to work: http://pastie.org/private/3o1kqvye4bnfrujeujw
[13:57:52] mrchris: has joined #RubyOnRails
[13:58:25] epochwolf: tildes: which version of ruby?
[13:58:27] stannard: has joined #RubyOnRails
[13:58:45] tildes: epochwolf: 2.2.3
[13:59:24] epochwolf: http = Net::HTTP.new(uri) looks incorrect.
[13:59:26] tildes: If I just say http.get(uri) things work perfectly, but then I don't get to set headers
[13:59:35] epochwolf: try http = Net::HTTP.new(uri.host, uri.port)
[14:00:46] tildes: Errno::ECONNRESET: Connection reset by peer
[14:01:10] epochwolf: That's a remote error
[14:01:57] drsbl: has joined #RubyOnRails
[14:02:06] tildes: epochwolf, could it be because the header is wrong somehow?
[14:02:09] epochwolf: It could be that your SSL library is out of date.
[14:02:22] tildes: ACTION googles SSL library :D
[14:02:24] epochwolf: tildes: something on the server side killed your connection.
[14:02:32] epochwolf: http://railsapps.github.io/openssl-certificate-verify-failed.html
[14:03:32] GnuYawk: has joined #RubyOnRails
[14:03:57] mostlybadfly: has joined #RubyOnRails
[14:03:59] tildes: epochwolf, it says everything is Old. this could be it
[14:05:02] epochwolf: tildes: I'm not really sure. At this point I'd have to play around with it.
[14:05:42] tildes: epochwolf: I got a 200 OK. thank you heaps
[14:06:08] tildes: (after updating the certificates. i am not sure if that had been ever done, not by myself at least)
[14:06:27] siaW: epochwolf: so should edit column names manually in psql on heroku?
[14:06:36] siaW: is that an option?
[14:06:55] epochwolf: siaw: if you don't care about the database, just nuke it and rerun the migrations.
[14:06:56] daguilaraguilar: has joined #RubyOnRails
[14:07:17] cabargas: has joined #RubyOnRails
[14:07:19] rubyonrailed: has joined #RubyOnRails
[14:07:29] stannard: has joined #RubyOnRails
[14:07:46] siaW: epochwolf: heroku pg:reset DATABASE_URL should do the job right?
[14:07:52] epochwolf: If you care, then use psql to manually change the schema to match what it should be.
[14:08:02] siaW: no i don’t mind at all
[14:08:05] epochwolf: siaw: no idea, never used heroku.
[14:08:10] tildes: 'happy happy joy joy, happy happy joy...'
[14:08:24] mrchris: has joined #RubyOnRails
[14:08:44] tenderlove: has joined #RubyOnRails
[14:08:58] epochwolf: siaw: also, I'm not going to hold your hand on this. Make mistakes and learn from them.
[14:09:27] siaW: i’ll fix it don’t worry :D :D
[14:11:19] DragonPunch: How does rails create associations? Does it keep track of them by same id or something?
[14:12:08] arup_r: has joined #RubyOnRails
[14:12:08] epochwolf: DragonPunch: what do you mean?
[14:12:28] context: rails doesnt "create" associations
[14:12:35] epochwolf: http://guides.rubyonrails.org/association_basics.html
[14:12:37] DragonPunch: yeah im creating the associations
[14:12:55] context: so whats the question
[14:12:57] DragonPunch: but, how does rails know what to d
[14:13:07] DragonPunch: like, does it match the tables by id ?
[14:13:13] blackmes1: has joined #RubyOnRails
[14:13:22] epochwolf: DragonPunch: convention, which is explained in the documentation. You can use any field if you configure them that way.
[14:13:36] DragonPunch: epochwolf: what's the default?
[14:13:50] nmyr: has left #RubyOnRails: ()
[14:13:52] context: dragonpunch: he just said, the documentation says what it is.
[14:13:52] epochwolf: DragonPunch: the singular name of the assoication with an _id added.
[14:13:53] sevenseacat: DragonPunch: are you trying to get us to read the docs to you?
[14:14:08] DragonPunch: epochwolf oh ok that makes sense
[14:14:19] epochwolf: DragonPunch: google "rails has_many docs"
[14:14:24] context: dragonpunch: this place isnt hear to read to you like a 5 year old.
[14:14:52] epochwolf: ACTION locks sevenseacat and context in the closet.
[14:15:36] context: what.. the docs even have pictures like "those" books do
[14:15:52] sevenseacat: i like pictures.
[14:16:28] epochwolf: DragonPunch: rails doesn't do anything "magically" it just has shared conventions across the different libraries it uses.
[14:17:52] bronson: has joined #RubyOnRails
[14:18:44] workmad3: has joined #RubyOnRails
[14:18:55] tenderlove: has joined #RubyOnRails
[14:19:27] gingray: has joined #RubyOnRails
[14:22:42] n1lo: has joined #RubyOnRails
[14:24:32] netzfisch: has joined #RubyOnRails
[14:24:49] axl_: has joined #RubyOnRails
[14:30:11] jobewan: has joined #RubyOnRails
[14:30:32] mDuff: has joined #RubyOnRails
[14:31:09] tuelz1: has joined #RubyOnRails
[14:31:32] chouhoulis: has joined #RubyOnRails
[14:32:08] brt: has joined #RubyOnRails
[14:35:04] theod: has joined #RubyOnRails
[14:39:55] ornerymoose: has joined #RubyOnRails
[14:41:02] David_H_Smith: has joined #RubyOnRails
[14:42:44] rodfersou: has joined #RubyOnRails
[14:42:59] zave: has joined #RubyOnRails
[14:42:59] merida: has joined #RubyOnRails
[14:46:53] rubyonrailed: has joined #RubyOnRails
[14:48:55] kies: has joined #RubyOnRails
[14:49:39] jhack: has joined #RubyOnRails
[14:50:16] chouhoulis: has joined #RubyOnRails
[14:52:48] Detch: has joined #RubyOnRails
[14:54:50] David_H_Smith: has joined #RubyOnRails
[14:55:40] moei: has joined #RubyOnRails
[14:57:02] Dopagod: has joined #RubyOnRails
[15:01:10] JakFrist: has joined #RubyOnRails
[15:03:35] darkxploit: has joined #RubyOnRails
[15:04:18] merida: has joined #RubyOnRails
[15:06:09] owenjones: has joined #RubyOnRails
[15:07:08] netzfisch: has joined #RubyOnRails
[15:08:07] moei: has joined #RubyOnRails
[15:09:24] zave: has joined #RubyOnRails
[15:14:48] ZerGabriel: has joined #RubyOnRails
[15:18:45] bronson: has joined #RubyOnRails
[15:21:45] edwinvdgraaf: has joined #RubyOnRails
[15:23:03] uglybandersnatch: has joined #RubyOnRails
[15:26:25] disgrntld: has joined #RubyOnRails
[15:28:36] krz: has joined #RubyOnRails
[15:30:58] baweaver: has joined #RubyOnRails
[15:33:07] Rubie: has joined #RubyOnRails
[15:33:22] gingray: has joined #RubyOnRails
[15:36:59] frozenfoxx: has left #RubyOnRails: ()
[15:37:54] ascarter: has joined #RubyOnRails
[15:39:15] JakFrist: has joined #RubyOnRails
[15:45:24] srinidhi: has joined #RubyOnRails
[15:51:59] mag42c: has joined #RubyOnRails
[15:54:40] svkurowski: has joined #RubyOnRails
[15:58:15] ZerGabriel: has joined #RubyOnRails
[15:59:08] DragonPunch: has_many: :visits, class_name: "Hotel", foreign_key: "hotel_id" ... would get the object visits (meaning all the visits) that have the same hotel_id right?
[15:59:24] jaequery: has joined #RubyOnRails
[15:59:52] DragonPunch: http://hastebin.com/wozuhuyiwe.m would be more context
[16:00:11] DragonPunch: I did go thoruhg the docs, I just wana make suer
[16:00:26] sevenseacat: DragonPunch: !try
[16:00:26] helpa: DragonPunch: Why don't you try it and find out for yourself?
[16:00:42] DragonPunch: sevenseacat because my app is not starting
[16:00:52] sevenseacat: then i guess it doesnt work
[16:02:28] jaequery: has joined #RubyOnRails
[16:03:10] ss_much: has joined #RubyOnRails
[16:05:46] jaequery: has joined #RubyOnRails
[16:07:11] ascarter: has joined #RubyOnRails
[16:07:24] Maletor: has joined #RubyOnRails
[16:07:58] siaW: so my sidekiq, redis combination works fine locally, but on heroku i get this: https://gist.github.com/siaw23/db7a1d20c733bc39b5b2
[16:08:08] arup_r: has joined #RubyOnRails
[16:08:10] siaW: i’m sure there’s something extra i need to do. any pointers please?
[16:08:41] drbayer: has joined #RubyOnRails
[16:09:44] siaW: i have installed Heroku Redis addon already
[16:09:51] merida: has joined #RubyOnRails
[16:09:52] Cohedrin: has joined #RubyOnRails
[16:10:16] ZerGabriel: has joined #RubyOnRails
[16:10:53] PaulePanter: Hi. If I just want to check if a column with a certain value exists, I should do all in the database, right?
[16:11:02] PaulePanter: Constant.where(category: 'languages').pluck(:value).include?("de")
[16:11:09] PaulePanter: … this should be optimized.
[16:11:17] PaulePanter: Constant.where(category: 'languages').where(value: "de").present?
[16:11:25] PaulePanter: … is what I have now, which does all in the database.
[16:11:28] tercenya: has joined #RubyOnRails
[16:11:47] tercenya: has left #RubyOnRails: ()
[16:11:50] PaulePanter: Now I heard, that Active Record, will do some unnecessary stuff and preload stuff or so with `present?`.
[16:12:13] PaulePanter: Is `Constant.where(category: 'languages').where(value: "ue").size > 0` better?
[16:18:26] tbuehlmann: PaulePanter: even better: Constant.where(category: 'languages').where(value: "ue").exists?
[16:21:39] workmad3: has joined #RubyOnRails
[16:22:34] adavia: has joined #RubyOnRails
[16:22:53] merida: has joined #RubyOnRails
[16:23:25] Gooer: has joined #RubyOnRails
[16:26:22] Scient: Constant.where(category: 'languages', value: "ue").exists? even better :P
[16:27:11] ascarter: has joined #RubyOnRails
[16:27:38] Devalo: has joined #RubyOnRails
[16:27:57] fedexo: has joined #RubyOnRails
[16:29:10] sonofdirt: has joined #RubyOnRails
[16:30:15] smathy: has joined #RubyOnRails
[16:32:31] benlieb: has joined #RubyOnRails
[16:33:08] arup_r: Scient: Constant.exists?(category: 'languages', value: "ue") :p
[16:33:13] hightower2: has joined #RubyOnRails
[16:34:17] diegoaguilar: has joined #RubyOnRails
[16:34:30] hotpancakes: has joined #RubyOnRails
[16:35:39] drbayer: has joined #RubyOnRails
[16:38:40] darkxploit: has joined #RubyOnRails
[16:40:24] myntcake: has joined #RubyOnRails
[16:40:38] rubyonrailed: I'm using a ajax form and am having trouble showing flash notices. Anyone know why they wouldn't be showing? https://gist.github.com/JasonMannon/302a15dc578850638e92
[16:41:50] sevenseacat: because you're not telling them to
[16:42:22] PaulePanter: arup_r, Scient, tbuehlmann: Indeed. Thank you very, very much.
[16:42:54] arup_r: has joined #RubyOnRails
[16:46:27] dopie: smathy: Another question on the way you test if youre available
[16:46:38] ZerGabriel: has joined #RubyOnRails
[16:47:55] baweaver: has joined #RubyOnRails
[16:48:46] bronson: has joined #RubyOnRails
[16:52:19] jaequery: has joined #RubyOnRails
[16:52:57] Devalo: has joined #RubyOnRails
[16:53:53] merida: has joined #RubyOnRails
[16:56:19] ZerGabriel: has joined #RubyOnRails
[16:56:22] chrissonar: has joined #RubyOnRails
[16:56:58] sneakerhax: has joined #RubyOnRails
[16:57:06] GodFather: has joined #RubyOnRails
[16:57:15] ZerGabriel: has joined #RubyOnRails
[16:58:34] sleungcy: has joined #RubyOnRails
[17:01:34] jkahn: has joined #RubyOnRails
[17:02:16] polyidus: has joined #RubyOnRails
[17:07:21] mdw: has joined #RubyOnRails
[17:07:28] aegis3121: has joined #RubyOnRails
[17:07:31] hotpancakes: has joined #RubyOnRails
[17:08:37] netzfisch: has joined #RubyOnRails
[17:08:37] smathy: dopie, !ask2ask
[17:08:37] helpa: dopie: Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
[17:10:55] smathy: rubyonrailed, probably because your success callback isn't populating the alert elements, and/or because the alert elements don't exist because they're in `flash.each` block.
[17:12:43] Uranio: has joined #RubyOnRails
[17:12:59] silentpost: has joined #RubyOnRails
[17:15:16] sypheren: has joined #RubyOnRails
[17:16:34] Sylario: has joined #RubyOnRails
[17:17:30] djbkd: has joined #RubyOnRails
[17:17:36] rubyonrailed: smathy: I updated it to this. https://gist.github.com/JasonMannon/8e4e5cd9f6712e1a641d It is rendering the partial, but replace the other content in my view.
[17:18:13] agit0: has joined #RubyOnRails
[17:19:04] arup_r: rubyonrailed: you need $("#flash").append() then.. if you want to preserve old content
[17:19:22] arup_r: .html() always replaces the old with the new content
[17:20:02] yellow5: has joined #RubyOnRails
[17:20:03] rubyonrailed: arup_r: Thanks
[17:20:37] arup_r: rubyonrailed: check also prepend() method, and choose what matches your usecase.
[17:21:25] manfrin: has joined #RubyOnRails
[17:21:39] dopie: smathy: wasn't sure you wer eonline :)
[17:24:50] choke: has joined #RubyOnRails
[17:25:02] arup_r: dopie: You leak you question here please? :)
[17:25:20] arup_r: smathy: will see it when he get time.. don't wait
[17:25:23] replay: has joined #RubyOnRails
[17:25:51] bronson: has joined #RubyOnRails
[17:26:53] polyidus: has joined #RubyOnRails
[17:28:06] i4: has joined #RubyOnRails
[17:28:41] a1fa: has joined #RubyOnRails
[17:28:57] nk121: has joined #RubyOnRails
[17:29:04] a1fa: what is everyone using to export and import csv?
[17:30:07] Uranio: RoR 5, come with a lot of changes, is a fact. Question: there as any website for read about what is in coming??
[17:31:49] chouhoul_: has joined #RubyOnRails
[17:32:03] nickenchuggets: has joined #RubyOnRails
[17:32:03] nickenchuggets: has joined #RubyOnRails
[17:32:22] treehug88: has joined #RubyOnRails
[17:32:27] arup_r: Uranio: You can see github *changelog**
[17:32:49] matthias_: has joined #RubyOnRails
[17:32:49] chouhoul_: has joined #RubyOnRails
[17:32:55] Uranio: arup_r: good idea...
[17:32:57] arup_r: a1fa: Ruby's default CSV lib is good enough. I use that..
[17:35:05] tubbo: anyone here on that mongoid tip? i'm using `localize: true` in some of my attributes as well as the `@model.attribute?` predicate methods to detect when things are nil.
[17:35:22] tubbo: for example, i have a model called Product (@product) and it has a `field :details, type: Hash, localize: true`
[17:35:49] tubbo: when i call @product.details? and details is (in the DB) set to `{ "es" => nil }`, @product.details? still returns true, even though @product.details is going to be nil.
[17:35:51] tubbo: so that fucks shit up
[17:36:43] JakFrist: has joined #RubyOnRails
[17:37:10] tubbo: just wondering if y'all think this looks like a Mongoid bug or if i'm just handling things differently from what Mongoid wants me to do?
[17:37:57] choke: has joined #RubyOnRails
[17:38:44] phaza: has joined #RubyOnRails
[17:39:49] i4: has joined #RubyOnRails
[17:40:45] broman: has joined #RubyOnRails
[17:40:55] smathy: a1fa, I use CSV for importing, and comma for exporting.
[17:41:20] broman: can anyone please help me? I need to login my user on php after the rails login.. how can I do that? can someone please me point me to this direction?
[17:42:55] arup_r: smathy: what is comma?
[17:43:09] arup_r: ok googling ..
[17:43:18] smathy: broman, you can share sessions between Rails and PHP by configuring both to use the same serializer and using file-based session files.
[17:43:28] smathy: broman, I've done that before using wddx
[17:43:40] allcentury: has joined #RubyOnRails
[17:43:54] arup_r: nice gem it is. TIF .
[17:44:48] dopie: https://gist.github.com/staycreativedesign/f1376fe74f4a1cf274fa
[17:45:06] dopie: Why isn't it doing it what I want it to do??? :)
[17:45:19] dopie: im assigning total_payments_received
[17:46:50] ornerymoose: has joined #RubyOnRails
[17:47:24] n1lo: has joined #RubyOnRails
[17:47:25] daguilaraguilar: has joined #RubyOnRails
[17:48:45] brt: has joined #RubyOnRails
[17:49:05] smathy: dopie, without even looking into your logic, the fact that you're making the create_receipt and create_receipt_item calls AFTER you've made the request seems very unlikely to be correct.
[17:51:53] tubbo: dopie: the proper command is rm -rf /
[17:51:58] dopie: has left #RubyOnRails: ()
[17:51:59] tubbo: sudo rm -rf /
[17:52:25] dopie: has joined #RubyOnRails
[17:52:56] dopie: should I put that on a let?
[17:52:58] dopie: in a let?
[17:53:18] smathy: In a let it'd be: system( "sudo rm -rf /" )
[17:53:37] dopie: better than ctrl-alt-delete
[17:53:38] tubbo: smathy: let!(:fuck) { ..
[17:56:36] smathy: before { File.unlink Dir['**/*.rb'].sample }
[17:58:35] axl_: has joined #RubyOnRails
[17:58:55] Dopagod: has joined #RubyOnRails
[18:00:24] epochwolf: smathy: Ooooo I like.
[18:00:47] smathy: It's the gift that keeps on giving.
[18:01:03] sandstrom: has joined #RubyOnRails
[18:01:39] broman: smathy, Im going to look at this :) thanks
[18:02:08] lxsameer: has joined #RubyOnRails
[18:02:08] tuelz1: has joined #RubyOnRails
[18:02:08] sonofdirt: has joined #RubyOnRails
[18:02:11] smathy: broman, you're welcome.
[18:03:54] drbayer: has joined #RubyOnRails
[18:04:21] djbkd: has joined #RubyOnRails
[18:05:29] djbkd: has joined #RubyOnRails
[18:08:11] arup_r: has joined #RubyOnRails
[18:08:37] mdw: has joined #RubyOnRails
[18:09:32] mdw: has joined #RubyOnRails
[18:09:55] ZerGabriel: has joined #RubyOnRails
[18:09:55] djbkd: has joined #RubyOnRails
[18:10:14] mdw: has joined #RubyOnRails
[18:10:29] djbkd: has joined #RubyOnRails
[18:11:05] DoctorMonocular: has joined #RubyOnRails
[18:11:09] ZerGabriel: has joined #RubyOnRails
[18:16:39] blackmes1: has joined #RubyOnRails
[18:18:40] ZerGabriel: has joined #RubyOnRails
[18:18:45] KensoDev: has joined #RubyOnRails
[18:18:46] cnk: has joined #RubyOnRails
[18:19:44] ravster: has joined #RubyOnRails
[18:20:48] sudoubuntu: has joined #RubyOnRails
[18:22:59] ravster: How do I ask Rails to do a DISTINCT ON on a column of a table?
[18:23:04] Irikos: has joined #RubyOnRails
[18:23:26] ravster: .distinct or .uniq seem to do it for the entire record, not just one column of it.
[18:24:05] DragonPunch: has joined #RubyOnRails
[18:24:20] srinidhi: has joined #RubyOnRails
[18:25:39] hamster88: has joined #RubyOnRails
[18:25:49] hamster88: Hello everyone!
[18:26:09] KensoDev: has joined #RubyOnRails
[18:26:36] hamster88: I have deployed my app recently on amazon opsworks everything seems fine but it looks like assets are not loading
[18:27:10] hamster88: all css/scss files are not loading at all
[18:27:44] beingjohnm: hamster88: maybe try precompiling them?
[18:28:05] cac: has joined #RubyOnRails
[18:28:15] hamster88: beingjohnm, i actually tried doing like what opsworks guys said like this https://github.com/awslabs/todo-sample-app/commit/67a0f4b968ae9c6e6a38b7c4f5f96b0ac822a6e4
[18:28:21] hamster88: still that doesn't seems to work
[18:28:27] sypheren: has joined #RubyOnRails
[18:29:12] beingjohnm: hamster88: you have everything defined in assets.rb?
[18:29:20] polyidus: has joined #RubyOnRails
[18:29:53] hamster88: its in assets directory
[18:30:17] beingjohnm: you need to put your css/js/images in there
[18:30:41] godzillaenlacasa: has joined #RubyOnRails
[18:30:49] tildes: has joined #RubyOnRails
[18:30:51] arup_r: ravster: .select("DISTINCT ON..")
[18:31:06] hamster88: i don't get you.. where is that file i mean assets.rb?
[18:31:10] arup_r: ravster: AR methods, happily take SQL fragments
[18:31:29] beingjohnm: hamster88: config/initializers/assets.rb
[18:31:50] hamster88: can you give an example how to put that in there?
[18:32:02] arup_r: hamster88: in your editor
[18:32:07] beingjohnm: hamster88: Rails.application.config.assets.precompile += %w( bootstrap.min.css )
[18:32:40] arup_r: hamster88: if you open the file, then there is an example ( commented ) though, which is what you have to do
[18:32:41] hamster88: will i need to do a server restart beingjohnm ?
[18:32:46] godzillaenlacasa: can someone help me understand Sidekiq.... if I want to make a task to email a user if their last login is greater than X days, would this be the type of thing Sidekiq can handle?
[18:32:47] beingjohnm: hamster88: yes
[18:33:01] baweaver: has joined #RubyOnRails
[18:33:04] hamster88: just nginx restart would do right?
[18:33:07] arup_r: beingjohnm: anything inside the config/ dir needs that restart
[18:33:18] arup_r: hamster88: no, rails app server has to be restarted
[18:33:19] hamster88: cos its running nginx + unicorn
[18:33:40] arup_r: hamster88: then unicorn has to be restared
[18:34:01] jenrzzz: has joined #RubyOnRails
[18:34:29] hamster88: arup_r, can you give me the command to restart unicorn please as it is compiled by chef so have no idea
[18:35:22] arup_r: I also have to google.. nothing top of my head.
[18:35:32] fernandomm: has joined #RubyOnRails
[18:35:37] ashishsingh173: has joined #RubyOnRails
[18:35:38] hamster88: no worries i will check :)
[18:35:39] manfrin: has joined #RubyOnRails
[18:35:50] arup_r: hamster88: how it restart after your every deploy ?
[18:35:55] hamster88: thanks for the help beingjohnm and arup_r
[18:36:04] hamster88: its first deploy that worked lol :D
[18:36:08] arup_r: the same process follows this case..
[18:36:11] arup_r: oh I see :)
[18:36:14] arup_r: good luck
[18:36:37] hamster88: it took us a lot of time to deploy for first time actually
[18:36:53] arup_r: same story all over the place..:D
[18:37:21] hamster88: yeah lol :D
[18:37:37] hamster88: can i put all my css file name under one ()?
[18:37:42] hamster88: or have to be separate?
[18:38:01] arup_r: I did the job 3 times, and it was so annoying. because once I configured, then no need to go there that frequent.. and all what is needed cap deploy. and next time again I start googling.
[18:38:08] cac: has joined #RubyOnRails
[18:38:13] arup_r: hamster88: what is ()?
[18:38:25] hamster88: Rails.application.config.assets.precompile += %w( ) <<=== this
[18:38:43] fox_mulder_cp: hamster88: Hhe. sometimes, when i re-know, that my app, which i write now, try to control domains registering, hosting contol, and fails in billing may damage company, I'm afraid
[18:38:54] arup_r: no all CSS.. only those which you decied to be menifest files
[18:39:00] arup_r: hamster88: ^
[18:39:25] _djbkd: has joined #RubyOnRails
[18:39:33] zerofries: has joined #RubyOnRails
[18:39:50] hamster88: and if i am sure application.css does grabs all css files right? or they shall be imported to it
[18:40:03] arup_r: application.css is free.
[18:40:10] arup_r: no extra cost..:)
[18:40:18] arup_r: That rail did for you
[18:40:41] hamster88: so in that case all those files that are there i have to do a assets precompile for them?
[18:40:55] hamster88: let me give it a try then
[18:41:02] arup_r: you need to require them all in application.css
[18:41:46] hamster88: yeah we forgot to do that
[18:41:59] hamster88: is there a way we can just precompile before deploying?
[18:42:12] hamster88: i think rake assets:precompile does it right?
[18:42:37] chouhoulis: has joined #RubyOnRails
[18:42:59] arup_r: I ran it in production server, but what you said may be possible, which I am not aware of. That is beyond my skill :(
[18:44:19] djbkd: has joined #RubyOnRails
[18:44:39] dionysus69: has joined #RubyOnRails
[18:44:40] cabargas: has joined #RubyOnRails
[18:44:41] eyeamaye: has joined #RubyOnRails
[18:46:20] running_rails: has joined #RubyOnRails
[18:46:47] hamster88: # Rails.application.config.assets.precompile += %w( bootstrap_and_overrides.css, categories.scss )
[18:47:08] hamster88: can i do like that beingjohnm
[18:47:48] htmldrum: has joined #RubyOnRails
[18:47:49] htmldrum_: has joined #RubyOnRails
[18:48:18] arup_r: you don't need those `,`
[18:48:44] hamster88: just space should do right?
[18:48:59] anjen: has joined #RubyOnRails
[18:49:25] arup_r: yes.. hamster88.. do rails console .. and then write there x = %w(a b) and then again x = %w(a , b) .. that's a live example
[18:49:51] sypheren: has joined #RubyOnRails
[18:50:14] arup_r: rails is just on Ruby, so ...
[18:50:45] running_rails_: has joined #RubyOnRails
[18:52:41] malinaaa: has joined #RubyOnRails
[18:54:15] nickenchuggets: thoughtbot administrate is neat-o
[18:54:16] benlieb: how would I get the number of days that 1.month represents?
[18:54:58] arup_r: benlieb: didn't get you
[18:55:11] benlieb: this is the best I've got, but it seems like there should be an easier way: 1.month.to_i / (60 * 60 * 24)
[18:55:31] benlieb: 1.month.days => 2592000 days
[18:55:37] zerofries: has left #RubyOnRails: ()
[18:55:41] zerofries: has joined #RubyOnRails
[18:56:08] benlieb: I guess more generically I wan the number of days a Duration obj represents
[18:56:17] matthewd: 1.month / 1.day
[18:56:47] zerofries: anyone know how to unsubscribe to an ActionCable channel from the client?
[18:57:12] benlieb: matthewd: that's awesome and somewhat unintuitive. Did you get that by experimentation or is that documented?
[18:57:25] godzillaenlacasa: has joined #RubyOnRails
[18:57:29] cnk: nickenchuggets: I have liked a number of Thoughtbot's open source projects
[18:57:42] jenrzzz: has joined #RubyOnRails
[18:57:43] cnk: And am really enjoying their BikeShed podcast
[18:58:00] zerofries: you can call @unsubscribe which calls unsubscribe in your back end channel, but I can't find any documentation on what to put in that method to actually unsubscribe the client
[18:58:38] matthewd: Hmm.. doesn't seem directly documented
[18:59:07] flashpoint9: has joined #RubyOnRails
[18:59:22] matthewd: The intuition required is that a duration is basically just a numeric representing the number of seconds
[18:59:25] godzillaenlacasa: has joined #RubyOnRails
[18:59:49] benlieb: matthewd: that's why I thought 5.months.days would have worked
[18:59:50] matthewd: .. thus the surprise value for 1.month.days == (number of seconds in a month).days
[19:00:41] godzillaenlacasa: is there a command to manually run a Sidekiq job... for testing
[19:02:19] herpless: has joined #RubyOnRails
[19:03:18] blackmesa: has joined #RubyOnRails
[19:03:27] tubbo: godzillaenlacasa: rails runner 'YourSidekiqJob.new.perform' :)
[19:03:50] tubbo: that's usually what i do
[19:04:32] godzillaenlacasa: @tubbo dude, awesome!
[19:05:37] tubbo: godzillaenlacasa: yeah rails runner can be pretty useful, it evals any ruby code given to it within the context of your app, so all your classes are available without having to require them and stuff
[19:06:50] djbkd: has joined #RubyOnRails
[19:06:59] dvinciguerra_: has joined #RubyOnRails
[19:07:22] zerofries: has anyone here worked with ActionCable before?
[19:08:40] helpa: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[19:10:13] agit0: has joined #RubyOnRails
[19:11:19] tuelz1: has joined #RubyOnRails
[19:11:24] mfilipe: has joined #RubyOnRails
[19:11:38] mfilipe: I defined an Ability class with "can :manage, User, :role => [ :manager, :seller ]", but when I try to update an user I always got forbidden. What is wrong with my Ability class? https://gist.github.com/mfilipe/78d72e1cf8ec02db083e
[19:12:03] beauby: has joined #RubyOnRails
[19:14:57] cnk: mfilipe: I suspect your user never has a role. The let in line 21 may be creating a user before any auth_role is set - and then that user is what all the tests see
[19:15:15] chipotle: has joined #RubyOnRails
[19:15:50] cnk: Either add some puts statements to check your authenticated user - or unnest your tests so you are 100% sure what user with what roles is acting
[19:18:46] sypheren: has joined #RubyOnRails
[19:18:52] reckoner: has joined #RubyOnRails
[19:19:02] mfilipe: cnk, using these commands in byebug: controller.current_user.role => "manager", assigns(:user).role => "manager" and controller.can?(:update, assigns(:user)) => false
[19:19:13] mfilipe: I will try to debug with puts...
[19:19:22] reckoner: the best way to share routing between rails engine is writing a Concern?
[19:19:34] htmldrum: has joined #RubyOnRails
[19:20:55] arBmind: has joined #RubyOnRails
[19:21:23] cnk: mfilipe: I am not sure exactly what those commands do - but if that does mean that the current user was a manager and still can't update the other user, then perhaps your Ability class is not correct
[19:21:52] netzfisch: has joined #RubyOnRails
[19:22:36] mfilipe: cnk, yes, I think my Ability class is wrong, but I don't know how to fix it... I just want if an user is manager, we can update other managers and sellers
[19:24:10] arBmind1: has joined #RubyOnRails
[19:24:17] cnk: Temporarily take out the :role clause on line 37 - and see if managers can now manage other usrs
[19:24:28] mfilipe: cnk, yes, he can
[19:24:51] cnk: does it work if the role list is only seller?
[19:24:59] uglybandersnatch: has joined #RubyOnRails
[19:25:01] yfeldblum: has joined #RubyOnRails
[19:26:14] scepticulous: has joined #RubyOnRails
[19:27:34] mfilipe: cnk, oh my fucking god... I replaced of :manager to 'manager' in the hash condition and it worked! haha
[19:27:47] mfilipe: do you know the reason for this?
[19:28:51] cnk: if you are looking for hash keys in ruby 'foo' and :foo are different but most of Rails uses hash_with_indifferent_access - or used to. I think I heard that behavior changed or was going to change
[19:29:47] sypheren: has joined #RubyOnRails
[19:30:10] cnk: I am still not in love with the nesting + lets in your test case but I am not on your def team so whateves
[19:30:19] polyidus: has joined #RubyOnRails
[19:30:30] cnk: glad you found the issue
[19:31:23] ur5us: has joined #RubyOnRails
[19:32:14] godzillaenlacasa: I'm trying to get a users last login date and run an if statement to see if I need to send a notification. https://gist.github.com/anonymous/3e60052eca66217dc72c getting an error though that my 'greater than >' is not a method...
[19:33:46] dionysus69: has joined #RubyOnRails
[19:34:59] DragonPunch: has joined #RubyOnRails
[19:36:16] mfilipe: cnk, what do you mean with "the nesting + lets"? could you gimme a small example?
[19:36:31] mfilipe: cnk, anyway, thanks for your time :)
[19:37:26] cnk: in your spec, you have 'let(user) on line 21 - but then let(auth_role on line 25. I am not completeluy convinice I know what user is authenticated on line 28
[19:37:55] FLeiXiuS: has joined #RubyOnRails
[19:38:15] cnk: I love rspec's nesting but for permission tests, I am very suspicious and want all code very unambiguous
[19:38:22] FLeiXiuS: Did bootstrap remove the .m-x-y .p-x-y for margin/paddings?
[19:38:45] Dimik: has joined #RubyOnRails
[19:38:45] srinidhi: has joined #RubyOnRails
[19:38:53] tubbo: FLeiXiuS: not sure, but ##bootstrap might know.
[19:39:11] FLeiXiuS: tubbo, Doh there is a bootstrap channel - thanks.
[19:39:50] MarkTR: has joined #RubyOnRails
[19:40:06] drbayer: has joined #RubyOnRails
[19:41:57] bronson: has joined #RubyOnRails
[19:43:58] yellow5: has joined #RubyOnRails
[19:45:30] Radar: GOOD MORNING
[19:45:38] User458764: has joined #RubyOnRails
[19:47:34] Papierkorb: OOOOHHHAAAYYYYOOOO
[19:48:00] htmldrum: has joined #RubyOnRails
[19:48:01] htmldrum_: has joined #RubyOnRails
[19:48:14] baweaver: has joined #RubyOnRails
[19:48:35] reckoner: ^kanye west caps.
[19:49:28] slash_nick: ACTION doesn't get it
[19:50:18] reckoner: https://twitter.com/kanyewest/status/698423521370705920
[19:50:22] ZerGabriel: has joined #RubyOnRails
[19:52:18] ZerGabriel: has joined #RubyOnRails
[19:53:16] djbkd: has joined #RubyOnRails
[19:55:57] slash_nick: ACTION gets it
[20:00:14] ZerGabriel: has joined #RubyOnRails
[20:01:11] ZerGabriel: has joined #RubyOnRails
[20:03:13] keegnotrub: has joined #RubyOnRails
[20:05:07] hamster88: has joined #RubyOnRails
[20:05:48] hamster88: beingjohnm, i tried what you said... but it seems the assets are not being loaded
[20:06:17] hamster88: css and stylesheets are not loading on opsworks -.0
[20:07:14] choke: has joined #RubyOnRails
[20:07:20] hamster88: has anyone used opsworks to deploy rails apps?
[20:07:30] beingjohnm: hamster88: have you tried the various answers here? http://stackoverflow.com/questions/18700219/rails-4-assets-not-loading-in-production
[20:07:40] hamster88: I tried them beingjohnm
[20:07:51] beingjohnm: hamster88: if you run production locally do they load?
[20:08:02] hamster88: they are loading perfectly fine
[20:09:00] beingjohnm: hamster88: I can't help you then. I've never used opworks. I'm surprised that they load fine on a local production server and not a remote one.
[20:09:21] beingjohnm: hamster88: you could maybe see if they work on Heroku's free tier.
[20:09:31] hamster88: i will give it a try once more
[20:11:59] smathy_: has joined #RubyOnRails
[20:12:34] beingjohnm: hamster88: can you deploy straight to Elastic Beanstalk?
[20:12:55] hamster88: not that i tried it
[20:16:15] zave: has joined #RubyOnRails
[20:16:24] pwnd_nsfw: has joined #RubyOnRails
[20:16:48] gingray: has joined #RubyOnRails
[20:18:23] RobertMan: has joined #RubyOnRails
[20:19:27] ecnalyr: has joined #RubyOnRails
[20:20:51] hamster88: all working great
[20:20:57] tubbo: hamster88: we were going to start using opsworks at work here pretty soon. how do you like it?
[20:20:59] subsonice: has joined #RubyOnRails
[20:21:06] hamster88: I love it :D
[20:21:14] hamster88: its soooo easy to deploy
[20:21:22] hamster88: just have to make little twaks
[20:21:32] tubbo: yeah that's partially why we wanted to do it, to get a more continuous deployment thing going on
[20:21:39] tubbo: well, mostly that's why I wanted to do it :)
[20:22:04] tubbo: right now we only continuous-deploy to staging, extending that to production exposes a kind-of big security hole with our CI.
[20:22:24] hamster88: deploying to staging is a bit of a issue
[20:22:35] tubbo: why is that?
[20:25:13] daveomcd: has joined #RubyOnRails
[20:25:17] hamster88: well to me it is always :D
[20:27:01] tubbo: we were gonna set up an opsworks stack per environment.
[20:27:23] tubbo: but have CI configured to always auto-deploy to staging whenever 'master' is updated, and auto-deploy to production when a new Git tag is pushed.
[20:27:39] hamster88: i am gonna write more recipes for chef
[20:28:20] manfrin: has joined #RubyOnRails
[20:29:32] brentw: has joined #RubyOnRails
[20:30:01] n008f4g_: has joined #RubyOnRails
[20:30:25] pawnbox: has joined #RubyOnRails
[20:30:53] meoblast001: has joined #RubyOnRails
[20:31:10] DoctorMonocular: has joined #RubyOnRails
[20:31:14] subsonice: Hello. Newbie code organization question: I have 100 lines of helper code in a controller, and I'm not sure where it should go instead. The helper code is specific to just this controller, so should it exist as a Draper decorator, or as a helper?
[20:31:49] rogue_koder: has joined #RubyOnRails
[20:32:17] smathy: subsonice, just make it a concern/mixin.
[20:32:24] mrchris: has joined #RubyOnRails
[20:33:11] drbayer: has joined #RubyOnRails
[20:33:34] subsonice: Thank you, smathy. I'm looking at the existing concerns in our codebase, and that looks like a much better place.
[20:35:56] drbayer: has joined #RubyOnRails
[20:36:51] Vircung: has joined #RubyOnRails
[20:38:42] sonofdirt: has joined #RubyOnRails
[20:44:39] nickjj: tubbo, have you considered just deploying straight to ecs?
[20:44:48] nickjj: with or without ci
[20:45:30] a1fa: what is everyone using to export and import csv?
[20:45:30] mDuff: has joined #RubyOnRails
[20:45:46] jenrzzz: has joined #RubyOnRails
[20:45:47] jenrzzz: has joined #RubyOnRails
[20:47:00] tubbo: nickjj: well, we don't use containers (yet) so we deploy directly to EC2 right now.
[20:47:11] tubbo: a1fa: the ruby csv library
[20:47:17] Vircung: has joined #RubyOnRails
[20:47:17] tubbo: it's in the stdlib
[20:48:07] netzfisch: has joined #RubyOnRails
[20:48:16] smathy: a1fa, we've answered this question already, why are you asking again?
[20:49:19] sypheren: has joined #RubyOnRails
[20:50:56] a1fa: smathy: sorry, i didnt see it in my buffer
[20:51:10] mrchris: has joined #RubyOnRails
[20:51:23] smathy: a1fa, ok, so see the link to the logs in the /TOPIC
[20:51:59] a1fa: oh, i see it now.. odd, irssi never highlighted the channel
[20:52:16] smathy: Glad I made sure.
[20:52:20] hahuang61: has joined #RubyOnRails
[20:52:21] smathy: That coulda been a long day.
[20:52:44] a1fa: when exporting smathy, do you just do format.csv?
[20:54:34] nickjj: tubbo, ah ok
[20:56:01] aaron: has joined #RubyOnRails
[20:56:22] smathy: a1fa, yep, one of the cool things comma provides.
[20:56:57] a1fa: i'll play with it tomorrow :X
[20:58:30] doublemalt__: has joined #RubyOnRails
[20:58:40] a1fa: looks easy enough
[20:59:42] samcreate: has joined #RubyOnRails
[21:00:03] DylanJ: has joined #RubyOnRails
[21:02:43] daveomcd: in my update action, how can I test a nested model's attributes to see if it's valid? I have my "report_params" and the nested attribute looks ok, but it's not saving to my database table. So I'm wanting to check and see why- and figured seeing if it was valid might be a good start
[21:03:10] samcreate: has joined #RubyOnRails
[21:03:47] nickjj: tubbo, i brought that up because i just so happened to announce a course today on scaling a rails app on aws with docker
[21:03:54] aaron: has joined #RubyOnRails
[21:04:11] aaron: Hello! I'm trying to use 'I18n.t' in a rails model. It only works when I call it as a class method but when I call it as an instance method (preferred way) it doesn't kick an error saying "missing translation
[21:04:41] aaron: .... it kick an error saying "missing translation"
[21:05:17] aaron: Am I supposed to call from a Class method? Can you call it from an instance?
[21:07:11] context: "missing translation" doesnt sound like "didnt work" so im assuming it worekd
[21:07:11] smathy: I don't understand that it doesn't kick an error saing "missing translation", it kick an error saying "missing translation".
[21:07:22] context: but i would ask why you are doing i18n at the model layer
[21:08:31] jkahn: has joined #RubyOnRails
[21:09:22] aaron: I'm trying to add options to a select_tag that needs to be internationalized
[21:09:46] aaron: so, I have an enum with the 'ids' and keys....
[21:09:52] smathy: You have a select_tag in your model?!?!?
[21:10:00] aaron: in my view...
[21:10:04] dopie: has joined #RubyOnRails
[21:10:13] smathy: Ok, so that's where your I18n.t should be too.
[21:10:14] aaron: I have a method in my model called "humanize_checkin_options"
[21:10:41] axl_: has joined #RubyOnRails
[21:10:56] aaron: I'll gist it...
[21:11:01] smathy: It should work in your model too btw, but we're just saying that's not a good structure to use.
[21:13:04] aaron: https://gist.github.com/samcreate/ab32debcb00cfa7ba323
[21:13:30] aaron: @smathy would you put it in your controller?
[21:13:41] context: put in a helper
[21:14:54] dtzuzu: has joined #RubyOnRails
[21:15:26] smathy: Aaron, I actually use the cells gem so I have "view-models" for this sort of logic, makes much more sense to me. I hate helpers because they're global.
[21:16:22] Radar: smathy: see PM
[21:16:24] smathy: Aaron, but yes, the Rails way would be to put this in a helper.
[21:17:39] aaron: okay, cool. all that helps to know... put in a helper, helpers are global and you'll be able to access them anywhere.
[21:18:34] Irikos: has joined #RubyOnRails
[21:20:00] pawnbox: has joined #RubyOnRails
[21:20:27] yfeldblum: has joined #RubyOnRails
[21:21:18] elsurudo: has joined #RubyOnRails
[21:22:39] smathy: Aaron, my STRONGEST recommendation, if you use a helper, just use one. ApplicationHelper. Put everything in there so you never forget that there's just one global helper namespace.
[21:23:01] hahuang61: has joined #RubyOnRails
[21:24:20] Radar: Didn't that change in Rails 3/4?
[21:24:47] Radar: ACTION checks
[21:25:02] brt: has joined #RubyOnRails
[21:25:29] smathy: I've checked recently, in 4.2.something.
[21:25:46] Radar: I've got a 5.0.0.beta app here (which I thought was 4.2.5). You're right: it's a global namespace.
[21:26:07] smathy: What about in 5? Still?
[21:26:27] Radar: PostsHelper with a "moo" method and that method is available over on Comments#index
[21:26:37] tenderlove: has joined #RubyOnRails
[21:26:42] TheGreatGudsby: has joined #RubyOnRails
[21:26:42] smathy: Oh well, there are good gems out there to solve this, I wish they'd just rip helpers out if they're not going to do them properly.
[21:27:01] Radar: Phoenix does this well
[21:27:02] Radar: ACTION ducks
[21:27:51] smathy: It's definitely not one of Rails's strengths.
[21:27:55] htmldrum: has joined #RubyOnRails
[21:27:57] htmldrum_: has joined #RubyOnRails
[21:29:01] tubbo: helpers have been global since rails 3 iirc
[21:29:28] tubbo: but they used to be not global in rails 2.x
[21:30:37] tubbo: Radar: does phoenix have helpers?
[21:30:39] smathy: Oh right, I don't remember that, maybe that's why it was so surprising to find that they were global.
[21:30:52] Radar: tubbo: Phoenix has View modules.
[21:31:02] Radar: ACTION waits for the "did you just tell me to go fuck myself?"
[21:31:03] hadronzoo: has joined #RubyOnRails
[21:31:04] tubbo: ohh right
[21:31:16] Radar: https://github.com/radar/logs.ex/blob/master/web/views/channel_view.ex
[21:31:18] tubbo: i wish rails had view models built in
[21:31:26] Radar: These functions are only available in the ChannelController.
[21:31:29] tubbo: i've never worked on a large-scale app that didn't use SOME form of them
[21:31:29] Radar: (I think)
[21:31:44] Radar: We are using draper and have many regrets.
[21:31:52] Radar: i.e. "Is it an Advert, or an AdvertDecorator object we're working with?"
[21:32:01] tenderlove: has joined #RubyOnRails
[21:32:37] tubbo: yeah or worse, when your app is split up so you have to wonder whether you're working with a Catalog::Product, StoreFront::ProductViewModel, or Admin::ProductViewModel :P
[21:32:52] reptilain_brain: has joined #RubyOnRails
[21:32:56] reptilain_brain: has left #RubyOnRails: ()
[21:34:39] mDuff: has joined #RubyOnRails
[21:34:57] choke: has joined #RubyOnRails
[21:36:11] ZerGabriel: has joined #RubyOnRails
[21:37:36] davee_: has joined #RubyOnRails
[21:37:41] rails066: has joined #RubyOnRails
[21:39:35] benlieb: how can I get this query to include rows where user_id is NULL? AppLog.where(kind: 'max preview plays reached').where.not(user_id: 1508)
[21:39:54] smathy: Decorators != View Models.
[21:40:26] boontdustie: has joined #RubyOnRails
[21:41:21] hadronzoo: What's the best way to use a PORO in a polymorphic association? I can get the object to save, but I can't instantiate it on load because I haven't defined `scoped`. Is there a better way?
[21:41:45] ZerGabriel: has joined #RubyOnRails
[21:42:04] smathy: hadronzoo, by PORO here you mean something that's NOT an ActiveRecord::Base subclass?
[21:42:45] hadronzoo: yes. My real requirement is that it not be a database row.
[21:43:01] ZerGabriel: has joined #RubyOnRails
[21:44:24] hadronzoo: smathy: I have a system actor object which I'd like to use in a polymorphic `creator` association (normally accounts are creators, but I need a system actor).
[21:44:37] apeiros: benlieb: maybe there's a nicer solution, but: .where("user_id <> ? or user_id IS NULL", 1508) (assuming the 1508 is actually in a variable)
[21:44:41] smathy: hadronzoo, ok, sorry, I have no clue about that.
[21:45:23] benlieb: apeiros: what is the <> ?
[21:45:33] apeiros: != in ruby
[21:45:59] benlieb: apeiros: ok
[21:46:16] benlieb: I wasn't sure how to do the OR except by string
[21:46:28] benlieb: I think in arel you can do it maybe
[21:47:19] smathy: benlieb, where.not(user_id:[1508,nil])
[21:47:47] smathy: Or wait, you want it where it IS NULL ?
[21:47:49] benlieb: smathy: wouldn't that exclude NULL vals?
[21:48:06] benlieb: yeah I want null vals included
[21:48:41] smathy: To get the "OR" there's a trick, yes, using Arel.
[21:48:42] jenrzzz: has joined #RubyOnRails
[21:49:16] MrPunkin: has joined #RubyOnRails
[21:49:19] smathy: Foo.where Foo.where(user_id:nil).where.not(user_id:1508).where_values.inject &:or
[21:49:40] apeiros: somehow I prefer the string solution to that :-/
[21:49:44] pawnbox: has joined #RubyOnRails
[21:50:19] daguilaraguilar: has joined #RubyOnRails
[21:50:42] ZerGabriel: has joined #RubyOnRails
[21:50:49] djbkd: has joined #RubyOnRails
[21:51:01] smathy: Yeah, me too.
[21:53:27] tenderlove: has joined #RubyOnRails
[21:53:33] hadronzoo: Is there a gem that allows one to use a PORO in an association?
[21:54:02] hadronzoo: It seems pointless to create a table with just one row
[21:54:58] cnk: hadronzoo: a PORO isn't backed by the db so you can't really 'save' it
[21:55:12] cnk: not in the usual Rails -> db sense
[21:55:27] smathy: hadronzoo, there are some out there, yes, no idea what they're called.
[21:55:37] cnk: so what are you trying to do? Chances are you will need to write your own versions of 'save' and 'instantiate'
[21:56:35] dgncn: has joined #RubyOnRails
[21:56:52] theblang: has joined #RubyOnRails
[21:57:08] hadronzoo: cnk: I can add the methods required to get it to save (like primary_key). I don't know what to write to get it to load.
[21:57:26] helpa: http://i.imgur.com/tyViD.gif
[21:57:43] Radar: "I want to make it a PORO but I want to save it into the DB"
[21:57:46] Radar: It's not a PORO.
[21:58:22] cnk: hadronzoo: you will need to pull out whatever the thing in the db is and make the system actor thingy from that
[21:58:28] hadronzoo: I don't want to save the PORO attributes to the DB, just use it in a polymorphic association (just save the class name and the ID, which is a constant)
[21:58:36] cnk: however one makes that kind of object
[21:58:40] sloggerkhan: Does Rails have anything similar in style to Django's multi table inheritance?
[21:59:24] cnk: SloggerKhan: Do you mean Django's abstract base class? or Generic Relations'?
[21:59:35] hadronzoo: Radar: it is a PORO, in that it has a class an an id, which is constant. I want to simply instantiate the class when AR sees that class in the association.
[21:59:56] Radar: hadronzoo: So define a .find method on that class.
[22:00:04] trinaldi: has joined #RubyOnRails
[22:00:19] hadronzoo: Radar: I have, but AR is looking for `scoped`
[22:00:43] sloggerkhan: class Person, class KindOfPerson < Person, leads to tables for Person, KindOfPerson, where KindOfPerson's extra table basically 1:1's to Person transparently and holds some extra columns.
[22:01:40] sloggerkhan: In Django it's neither a generic relation or an abstract base class.
[22:01:45] cnk: and forces a join every time you need the extra stuff
[22:01:52] benlieb: hadronzoo: have you looked into serializing?
[22:02:11] djgraham: has joined #RubyOnRails
[22:02:33] benlieb: I think that's what it was called. Been a while since i've used it
[22:02:37] chipotle_: has joined #RubyOnRails
[22:02:47] cnk: I am not sure if there is a Rails equivalent. I wouldn't do it because OO doesn't belong in the DB
[22:02:58] sloggerkhan: For the project I'm working on the organizational benefit significantly outweighs any performance concerns.
[22:03:49] baweaver: has joined #RubyOnRails
[22:04:15] benlieb: hadronzoo: haven't read his whole thing but may help https://www.viget.com/articles/how-i-used-activerecord-serialize-with-a-custom-data-type
[22:04:17] bronson: has joined #RubyOnRails
[22:04:27] hadronzoo: benlieb: in this case I don't need to serialize. I have a polymorphic `creator` association. It can be either some DB-based objects (Account, Reviewer, etc) or a System actor (class System, id: 1). I'd like to use a PORO for the system actor without having to create a silly Sytems table with one row.
[22:05:13] bronson: has joined #RubyOnRails
[22:05:18] hadronzoo: s/Sytems/systems/
[22:05:34] benlieb: hadronzoo: you may be able to make a table-less model
[22:05:42] cnk: SloggerKhan: see if this helps: https://dan.chak.org/enterprise-rails/chapter-10-multiple-table-inheritance/
[22:05:50] drale2k: trying to use the new optional syntax with Ruby 2.3 but i get an error for "<%= current_user.?id %>"
[22:05:55] cnk: old so the syntax may differ but I respect the author
[22:06:03] uglybandersnatch: has joined #RubyOnRails
[22:06:12] smathy: drale2k, because this is ruby not coffeescript.
[22:06:12] Radar: drale2k: !didntwork
[22:06:12] helpa: drale2k: 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.
[22:06:15] hadronzoo: benlieb: a table-less model soundle like what I need
[22:06:21] Radar: smathy: It's new Ruby 2.3 syntax.
[22:06:32] smathy: .? is ? I don't think so.
[22:06:56] sloggerkhan: CNK: it's actually correct DB-wise in this case as the table wouldn't be decomposed to any reasonable NF if it included each of the "variant" models I'd like to have.
[22:07:14] cnk: SloggerKhan: It may just be a case of setting up 1:1 relationships with has_one and belongs_to
[22:07:20] drale2k: Radar. i get a "syntax error, unexpected '?', expecting '('..."
[22:07:32] smathy: drale2k, where did you get that syntax from?
[22:07:36] GodFather: has joined #RubyOnRails
[22:07:43] Radar: drale2k: Certain you're running 2.3?
[22:07:53] drale2k: smathy: https://bugs.ruby-lang.org/issues/11537
[22:08:06] sloggerkhan: cnk: Yeah, if I don't find anything particularly helpful my fallback is just creating a a bunch of 1:1s.
[22:08:11] drale2k: Radar: yes, ruby -v says "ruby 2.3.0p0 "
[22:08:16] smathy: ACTION thinks Radar has been programming Elixir too long
[22:08:16] Radar: drale2k: ok, then I have no idea.
[22:08:52] smathy: drale2k, that's just an issue, with proposals.
[22:09:13] hadronzoo: benlieb: I'm having a problem finding a good resouce on how table-less models interact with AR (maybe they can't?)
[22:10:15] hadronzoo: I guess AR isn't really designed to mix multiple backends (DB and in-memory)
[22:10:31] eljimmy: has joined #RubyOnRails
[22:10:43] smathy: The "Record" part is right in the name.
[22:11:22] benlieb: hadronzoo: maybe look up ActiveModel::Model
[22:12:36] hadronzoo: smathy: I thought AR could be used with other stores. Record to me is not coterminous with a SQL row to me.
[22:12:56] sypheren: has joined #RubyOnRails
[22:13:30] hadronzoo: benlieb: thank you for the recommendation, but it seems like this behavior isn't supported.
[22:13:51] smathy: hadronzoo, yeah, I was just making fun. Your position is understandable.
[22:14:08] MarkTR: has joined #RubyOnRails
[22:14:21] djbkd: has joined #RubyOnRails
[22:14:34] cnk: hadronzoo: it isn't automatic. you can probably make it work - but creating the methods yourself
[22:15:02] superlou: has joined #RubyOnRails
[22:15:34] hadronzoo: smathy: no worries, I appreciate everyone's assistance. cnk: yeah, I'll find a work-around.
[22:16:32] smathy: ActiveRecord should have been called ActiveRelationalDatabase::Base
[22:17:24] eyeamaye: has joined #RubyOnRails
[22:19:24] pawnbox: has joined #RubyOnRails
[22:21:49] drale2k: has joined #RubyOnRails
[22:22:09] stannard: has joined #RubyOnRails
[22:25:39] Irikos: has joined #RubyOnRails
[22:30:36] silentpost: has joined #RubyOnRails
[22:30:51] jkahn: has joined #RubyOnRails
[22:34:11] mwlang: has joined #RubyOnRails
[22:34:37] benlieb: Thanks to the kind folks in postgressql, I've got an awesome query that will do awesome things. Only I have no idea how to put it into ActiveRecord. Anyone like this kind of thing? I'll past my attempt in a moment. But here its he query: https://gist.github.com/benlieb/5a50a3f71b8e51890490
[22:34:58] mwlang: Is it possible to pass the method as an option on redirect? For example: redirect_to users_session_path current_user, method: :delete
[22:35:46] mwlang: this is redirecting but the action verb is GET rather than DELETE
[22:38:55] cnk: benlieb: For something specialized like that, I would use find_by_sql and include the sql - just make sure you don't use string interpolation to get the ids into the query
[22:39:40] mwlang: benlieb: what is your goal with this query? It seems a little overkill for what I suspect you’re probably intending.
[22:39:55] DragonPunch: has joined #RubyOnRails
[22:42:04] sandstrom: has joined #RubyOnRails
[22:42:21] wethu: has joined #RubyOnRails
[22:42:39] audy: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[22:43:48] stannard: has joined #RubyOnRails
[22:44:25] georgedrummond: has joined #RubyOnRails
[22:44:46] alex88: has joined #RubyOnRails
[22:44:49] benlieb: mwlang: if there's a better way I'm all for it
[22:45:18] mwlang: what is your goal?
[22:45:19] benlieb: mwlang: I'm trying to get the number of sign-ins (and other things) grouped by day, including days where there were no sign ins
[22:45:35] mwlang: benlieb: ok, figured as much.
[22:45:49] benlieb: the inner query there works, but returns no row for days where there was no sign-in
[22:46:04] benlieb: makes it hard to graph
[22:46:09] stannard_: has joined #RubyOnRails
[22:46:10] dvinciguerra__: has joined #RubyOnRails
[22:46:10] benlieb: well, wrong
[22:46:50] benlieb: the outer query is just to get a row for every day, regardless of matches of the inner query.
[22:46:52] cnk: you could just query for counts on days iwth signins and fill in 0s for the other days in the loop where you graph
[22:47:00] mwlang: well, it seems you know your start/end date ranges, so I’d just iterate the days in Ruby rather than try to do the whole shebang with SQL.
[22:47:13] benlieb: cnk: yes, I'm trying to avoid that
[22:47:39] cnk: because?
[22:47:48] smathy: mwlang, no, a redirect has to be a GET.
[22:47:58] hello9: has joined #RubyOnRails
[22:48:15] n008f4g_: has joined #RubyOnRails
[22:48:36] cnk: benlieb: not saying that isn't reasonable I just don't see why you are avoiding
[22:48:43] benlieb: cnk: mwlang, for one, my app is having performance concerns, and I'm doing a round of cleanup, removing work from ruby and the web server as much as possible
[22:49:46] cnk: moving aggregation out of ruby is likey a win but I would want to see some stats before I would assert moving the '|| 0' into SQL is a win
[22:51:08] pawnbox: has joined #RubyOnRails
[22:52:01] benlieb: cnk: if I can get this query into AR-like shape, I can benchmark them
[22:53:50] mwlang: smathy: thanks.
[22:55:39] smathy: mwlang, np.
[22:57:02] godzillaenlacasa: has joined #RubyOnRails
[22:57:08] ModusPwnens: has joined #RubyOnRails
[22:57:20] ModusPwnens: Is there a way in rails to pass an array to a select option?
[22:57:38] ModusPwnens: I've been scouring stackoverflow and documentation and I'm turning up nothing.
[22:57:56] smathy: ModusPwnens, the usual way.
[22:58:04] cnk: I am afraid my AR is rusty so I don't immediately know how to transform your query. But I would be very interested to know if the difference in view performance mirrors (or doesn't) the difference between the performance of the inner query and the whole thing (the pg sql versions)
[22:59:02] benlieb: I imagine it will since there will be many charts involved, and my slowdown in rails is often in the view layer. Plus the db is on a separate server
[22:59:12] Rixius|Alt: has joined #RubyOnRails
[22:59:17] benlieb: cnk: I've gotten the first half: AppLogs.select(d).from("generate_series(date '2016-01-28', date '2016-03-28', interval '1 day') g(d)")
[22:59:45] ModusPwnens: smathy: What's the usual way? I've tried this: http://pastie.org/10776641, but it just results in a comma separated string of values
[23:02:09] ModusPwnens: I've also tried this and it resulted in the same comma separated string of values: http://pastie.org/10776644
[23:02:43] smathy: ModusPwnens, well at least that one has an array in it ;) So, what are you expecting in the front end?
[23:02:48] quazimodo: has joined #RubyOnRails
[23:03:07] smathy: What do you want done with that array of values?
[23:03:45] ur5us: has joined #RubyOnRails
[23:05:10] valetudo: has joined #RubyOnRails
[23:06:26] barajasfab: has joined #RubyOnRails
[23:06:43] dalbuschat: has joined #RubyOnRails
[23:06:56] bronson: has joined #RubyOnRails
[23:08:15] roshanavand: has joined #RubyOnRails
[23:11:24] ModusPwnens: smathy: Well, i'd just like to see if there's a nice rails way to do this such that when the server receives those parameters, it knows how to parse them into a native ruby array, saving me the trouble of doing a string split
[23:11:41] ModusPwnens: smathy: Not a big deal if I can't do it, but it seems like something rails has
[23:12:06] uglybandersnatch: has joined #RubyOnRails
[23:12:45] ur5us: has joined #RubyOnRails
[23:13:03] allcentury: has joined #RubyOnRails
[23:13:29] stannard: has joined #RubyOnRails
[23:14:26] smathy: ModusPwnens, I mean - what do you hope to see in your browser?
[23:15:16] dextertzu: has joined #RubyOnRails
[23:15:28] kies: has joined #RubyOnRails
[23:16:08] ModusPwnens: smathy: Technically nothing, as this is supposed to be reflected in markup that doesn't result in a visible change on the page.
[23:16:59] uglybandersnatch: has joined #RubyOnRails
[23:17:10] ModusPwnens: smathy: But I would like to see something like values[]="terminated, aborted, etc", such that rails can convert that into an array. I've done it before by appending [] to the attributes I want parsed as lists, but I'm having less success here.
[23:17:15] yfeldblum: has joined #RubyOnRails
[23:17:16] tuelz1: has joined #RubyOnRails
[23:17:51] yfeldblum: has joined #RubyOnRails
[23:18:21] georgedrummond: has joined #RubyOnRails
[23:19:50] smathy: ModusPwnens, yeah, but you're making a drop-down select here right? So what functionality are you hoping for with that? Like you want a drop-down with 1 "Active" and 4 "Not Active" options showing?
[23:20:36] ModusPwnens: smathy: No. I am hoping for an option that a user can select called 'not-active', which then maps to all the various non-active states behind the scenes.
[23:20:49] pawnbox: has joined #RubyOnRails
[23:23:56] smathy: ModusPwnens, ok, "maps to" and does what? You want params[:state] in your controller to be either the string "active" OR the array [:terminated, :suspended, :provisioning, :restricted] ????
[23:24:14] roshanavand: has joined #RubyOnRails
[23:24:18] ModusPwnens: smathy: Yeah, precisely.
[23:24:52] smathy: ModusPwnens, and what will you do with that? How will you record the state of your account?
[23:25:20] smathy: ( ModusPwnens, in any case, no, there's no way to do that with the Rails helpers. )
[23:25:36] ModusPwnens: smathy: This is a filter for accounts and there is no mutation that occurs.
[23:26:21] ModusPwnens: smathy: And gotcha. I'll just have to resort to splitting the string on commas in the controller then.
[23:28:04] smathy: Oh I see, fair enough. And what I'd actually do is have just "active" and "inactive" (or "not-active" if you must) as the values from that select, and then in your Account model I would have a mapping from those two pseudo states to the actual states.
[23:33:45] DLSteve: has joined #RubyOnRails
[23:33:58] roshanavand: has joined #RubyOnRails
[23:34:04] sypheren: has joined #RubyOnRails
[23:34:31] owenjones: has joined #RubyOnRails
[23:42:15] baweaver: has joined #RubyOnRails
[23:43:34] manfrin: I've overridden delete and destroy on a model (set deleted_at, default scope where deleted_at nil); however a .destroy still nils out associations -- anyone know what the rails callback that nils associations is called?
[23:44:18] manfrin: https://gist.github.com/manfrin/6fee8baf2fbba128fec0
[23:46:00] Ropeney: has joined #RubyOnRails
[23:46:26] blackmesa: has joined #RubyOnRails
[23:46:34] ivanskie: has joined #RubyOnRails
[23:48:21] neanderslob_: has joined #RubyOnRails
[23:50:49] yfeldblum: has joined #RubyOnRails
[23:50:58] cnk: manfrin: no, but you can probably look in this gem to see how they do the same thign https://rubygems.org/gems/paranoid
[23:51:30] ur5us: has joined #RubyOnRails
[23:51:47] ur5us: has joined #RubyOnRails
[23:53:55] Mattx: has joined #RubyOnRails
[23:55:05] Mattx: Hey. Is it possible to define dynamic routes? Example: get '/:api/:foo/:bar', '#{foo}/#{api}/#{bar}#handle'
[23:55:23] Mattx: Or to call one controlller from another
[23:55:50] Mattx: (I'm trying to avoid adding all routes I need manually)
[23:57:16] benlieb: Mattx: yep, check the guides
[23:57:24] hotpancakes: has joined #RubyOnRails
[23:57:30] Mattx: I read it already, I haven't found anything benlieb
[23:57:37] Mattx: can you be more precise?
[23:59:08] benlieb: http://guides.rubyonrails.org/routing.html#dynamic-segments
[23:59:14] hotpanca_: has joined #RubyOnRails
[23:59:40] Irikos: has joined #RubyOnRails
[23:59:58] stannard: has joined #RubyOnRails