Page 1 of 6 | Next »
[10:41:17] Mosselman: I am playing with websockets and faye. I have an issue though. As you can see here: https://github.com/faye/faye-websocket-ruby#websocket-api
[10:42:03] Mosselman: I can create a client `ws = Faye::Client.new...` and then call `ws.send('message')` to send a message... But I get the error: undefined method `message' for #<Faye::Client:0x0000010f3d3578>
[10:51:17] Mosselman: Ok I figured it out. I turns out I was using one of the many other gems. Which makes sense as websocket gems, etc. are aplenty
[13:55:36] Mosselman: I have a quick question: I have a model 'record' with more than one association. I want to destroy the record unless any one of the associations prevents it to be destroyed. How can I check this? I was thinking along the lines of record.destroyable?
[14:02:47] Mosselman: balr0g: but what if I don't want to destroy? I just want to know whether I can.
[14:05:30] Mosselman: balr0g: Well I now ended up manually checking if there are for example comments: record.comments.any?, but that is very specific. I think there is no 'easier' solution though.
[10:03:05] Mosselman: I have a question. Does anyone have any experience in auto-scaling Heroku web and worker dynos? I have looked at an add-on, namely 'Adept Scale' and a gem to go into my app called 'hirefire'.
[10:09:15] Mosselman: elaptics: I want to automatically increase the workers on Heroku when I have more than X jobs scheduled and scale back down to 1 when there are less than X
[10:12:28] Mosselman: universa1: I know, what I am asking is if anyone has good/bad experiences with some of them and what they'd recommend
[11:08:08] Mosselman: workmad3: I am aware that there are some gems. I mentioned this in my question. I was just wondering if anyone has had any good experience with any of them.
[18:18:46] Mosselman: Hi guys. I have a question. I am setting up postgres and suddenly remembered something. Isn't it so that I can give the user running my rails server permission on the db and have rails connect through that user?
[18:23:22] Mosselman: ckboii89: For mac: http://apple.stackexchange.com/questions/146849/how-do-i-recompile-bash-to-avoid-shellshock-the-remote-exploit-cve-2014-6271-an
[18:23:57] Mosselman: codesoda: what would be the benefit of these sub factories over normal traits?
[18:26:05] Mosselman: codesoda: You can create a new factory and name it lets say "my_special_factory" like so: factory :special_user, class: User
[18:29:28] Mosselman: codesoda: so in your example that could be factory :closed_high_priority_bug_report, class: BugReport
[18:47:12] Mosselman: rhizome: the problem was that he'd have to type all the traits he wants every time. He'd like to define all the traits in one place and then have shortcuts to implement those. So create :close_prio_bug_report
[19:07:40] Mosselman: rhizome: the underscore were of my poor design. I can imagine that sometimes it would be useful. But instead of a 'sub' factory I'd try to call traits from others. factory.create :user, :manager which would in turn call the traits :registered, :vault_key, :anual_bonus
[20:15:39] Mosselman: Ok so I have a fairly specific question for you all. I am using the gem 'phony' for parsing phone numbers. Now I thought it should be fairly trivial to have it return an array of all of its country codes, but I can't really seem to find out how.
[20:16:41] Mosselman: Is there a general place where I could find such a thing? Or do all gems by definition have one?
[20:19:29] Mosselman: mikecmpbll: I was throwing things at it through pry console, should've jumped to the code straight away.
[20:22:31] Mosselman: mikecmpbll: I should know better than trying to do things this late after not sleeping a lot
[20:29:02] Mosselman: mikecmpbll: I think I figured it out. It splits countries up in that hash according to the length of the country identifiers. e.g. 1 => us, 2 => greece, netherlands, etc
[10:27:01] Mosselman: Radar: when was 4.1.6 released? Website still says that 4.1.5 is the latest version
[12:36:59] Mosselman: dANO: then I'd set that as a data attribute on something so that you can load it on first load
[12:41:54] Mosselman: dANO: You do something along the lines of: `<div id='product' email@example.com_json>`
[12:43:17] Mosselman: Then with jquery you could do: `$('#product').data('meta-data')` to get the data back
[12:45:09] Mosselman: dANO: I recommend you use jbuilder, it gives you great control over what your json will look like and contain
[12:48:43] Mosselman: I think you can even render your jbuilder template inside your data attributes dANO
[12:55:33] Mosselman: I have no idea how it is setup now, but maybe the time-zone calculations, etc are not cached yet for a single action. So that some calculations are repeated or something
[13:30:56] Mosselman: rvanlieshout: yep that is a lot nicer, but I agree, update_all is a lot faster
[13:41:09] Mosselman: rvanlieshout: but having touch: true on the relation would trigger the touches one-by-one right? So if you don't need the touch callback on the user you'd be better off creating a after_update callback on the role that does role.users.update_all... ?
[13:43:17] Mosselman: axilla: cool good to know, I should look at experimenting with caching some more
[13:49:56] Mosselman: so I have a question of my own. I am writing a migration and removing a t.references and I want it to be reversible. This means that I have to indicate a type. But when I write `:integer` as a type it does not create an index when rolling back
[13:56:00] Mosselman: rvanlieshout: I didn't really mean automated test, just a test to find out so we can answer this question for ourselves.
[14:03:30] Mosselman: An unrelated question: Would it make sense to create an index for a boolean column in a migration?
[14:13:53] Mosselman: mikecmpbll: No I'd expect the time to be stored as basic as possible and then to translate through models/etc for the user. Right?
[14:17:39] Mosselman: rsl: If I plan a meeting in my home city at 14:00 then get on a plane and fly to somewhere where it is 5 hours later and then check my phone the meeting still has to be at 14:00
[14:18:31] Mosselman: I get called by my lawyer 'hey when was that meeting?' me: 'let me check... aah at 14:00'
[14:19:10] Mosselman: rsl that is what I meant. It may change, but it has to be clearly indicated that it did.
[14:20:00] Mosselman: I am saying my phone should not automatically change display times without telling me.
[14:21:09] Mosselman: What I am saying is that if I look at my phone I don't want it to 'move' with me without telling me.
[14:21:49] Mosselman: rsl: I am not saying the hours should change. I am saying your view of the time shouldn't
[14:22:10] Mosselman: So when I travel, if my phone decides to change time along with me, it should clearly say it changed.
[14:24:42] Mosselman: Ok. lets say I build a calendar, it should change, but the time should be displayed like so: 14:00 (05:00 local time) or something of the sort. Since I planned the event before I got here
[14:26:34] Mosselman: pontiki: yes or at least noticing when users change so that they aren't suddenly expected to recalculate their time zone difference
[14:50:54] Mosselman: "My MacBook has gone to sleep." that is why you should run your IRC client inside a screen on a raspberrypi... maybe
[18:16:32] Mosselman: Hi guys, I have installed minitest and succesfully run model tests and integration tests, but when I include a 'describe' block in my controller tests it says: NameError: Unable to resolve controller for ...
[18:24:59] Mosselman: The latter having the advantage of using an external (Google's) phone number specification, but I have no idea whether it actually delivers on its promises