Activity Graph

Page 1 of 1


[03:12:47] maxmanders: *.net *.split
[03:18:06] maxmanders: has joined #ruby
[03:18:07] maxmanders: has joined #ruby
[03:18:07] maxmanders: Changing host


[09:55:16] maxmanders: Ping timeout: 264 seconds


[16:50:05] maxmanders: *.net *.split


[21:06:26] maxmanders: Ping timeout: 240 seconds


[13:31:22] maxmanders: Ping timeout: 272 seconds


[14:52:54] maxmanders: has joined #ruby
[14:52:54] maxmanders: has joined #RubyOnRails


[14:59:42] maxmanders: Quit: ZNC -


[02:28:54] maxmanders: has joined #ruby


[22:53:20] maxmanders: has joined #RubyOnRails


[06:15:19] maxmanders: has joined #ruby


[20:13:58] maxmanders: Ping timeout: 240 seconds
[20:16:44] maxmanders: has joined #ruby


[18:21:04] maxmanders: has joined #RubyOnRails


[13:50:42] maxmanders: Ping timeout: 260 seconds
[13:53:36] maxmanders: has joined #ruby


[03:53:35] maxmanders: Ping timeout: 248 seconds
[03:56:23] maxmanders: has joined #ruby
[08:42:35] maxmanders: has joined #RubyOnRails


[03:37:16] maxmanders: has joined #ruby
[14:41:13] maxmanders: has joined #ruby
[14:53:26] maxmanders: has joined #RubyOnRails
[15:01:21] maxmanders: Ping timeout: 248 seconds
[15:04:19] maxmanders: has joined #ruby
[15:05:12] maxmanders: has joined #RubyOnRails


[09:42:22] maxmanders: Ping timeout: 260 seconds
[09:42:52] maxmanders: has joined #ruby


[00:17:09] maxmanders: *.net *.split
[00:22:38] maxmanders: has joined #RubyOnRails
[00:23:02] maxmanders: has joined #ruby


[23:26:16] maxmanders: *.net *.split
[23:31:03] maxmanders: has joined #RubyOnRails
[23:31:03] maxmanders: has joined #ruby


[14:52:53] maxmanders: has joined #RubyOnRails


[15:10:52] maxmanders: *.net *.split


[18:54:26] maxmanders: *.net *.split
[19:13:48] maxmanders: has joined #ruby
[19:13:48] maxmanders: has joined #RubyOnRails


[14:16:06] maxmanders: has joined #ruby
[14:16:06] maxmanders: has joined #RubyOnRails


[05:04:50] maxmanders: *.net *.split


[19:47:44] maxmanders: has joined #ruby
[19:47:44] maxmanders: has joined #RubyOnRails


[23:12:57] maxmanders: *.net *.split


[11:36:30] maxmanders: Ping timeout: 264 seconds
[11:42:01] maxmanders: has joined #ruby
[11:42:01] maxmanders: has joined #RubyOnRails


[04:59:18] maxmanders: has joined #ruby
[04:59:18] maxmanders: has joined #RubyOnRails


[03:26:27] maxmanders: Ping timeout: 260 seconds


[22:24:04] maxmanders: Ping timeout: 252 seconds
[22:49:28] maxmanders: has joined #ruby
[22:49:28] maxmanders: has joined #RubyOnRails
[23:04:57] maxmanders: Max SendQ exceeded
[23:06:10] maxmanders: has joined #ruby
[23:06:10] maxmanders: has joined #RubyOnRails


[17:20:46] maxmanders: *.net *.split
[17:21:32] maxmanders: has joined #ruby
[17:21:32] maxmanders: has joined #RubyOnRails


[12:25:04] maxmanders: *.net *.split
[12:28:16] maxmanders: has joined #ruby
[12:28:17] maxmanders: has joined #RubyOnRails


[18:04:37] maxmanders: Ping timeout: 255 seconds
[18:06:04] maxmanders: has joined #ruby
[18:06:04] maxmanders: has joined #RubyOnRails


[13:32:24] maxmanders: Ping timeout: 256 seconds
[13:35:35] maxmanders: has joined #ruby
[13:35:35] maxmanders: has joined #RubyOnRails


[21:07:19] maxmanders: Ping timeout: 260 seconds
[21:10:02] maxmanders: has joined #ruby
[21:10:02] maxmanders: has joined #RubyOnRails


[13:43:05] maxmanders: Ping timeout: 240 seconds
[13:45:50] maxmanders: has joined #ruby
[13:45:50] maxmanders: has joined #RubyOnRails


[15:38:19] maxmanders: *.net *.split
[15:41:27] maxmanders: has joined #ruby
[15:41:44] maxmanders: has joined #RubyOnRails
[15:52:08] maxmanders: *.net *.split
[16:47:43] maxmanders: has joined #ruby
[16:48:03] maxmanders: has joined #RubyOnRails


[06:28:55] maxmanders: has joined #RubyOnRails
[06:28:56] maxmanders: has joined #ruby
[08:36:41] maxmanders: Excess Flood
[10:34:47] maxmanders: *.net *.split


[19:01:50] maxmanders: *.net *.split


[09:24:06] maxmanders: Quit: ZNC -
[09:47:26] maxmanders: has joined #ruby
[09:47:27] maxmanders: has joined #RubyOnRails


[00:08:50] maxmanders: has joined #RubyOnRails
[00:09:00] maxmanders: has joined #ruby


[21:43:07] maxmanders: *.net *.split


[15:36:59] maxmanders: *.net *.split
[15:37:55] maxmanders: has joined #ruby
[15:37:55] maxmanders: has joined #RubyOnRails


[21:01:58] maxmanders: Ping timeout: 244 seconds
[21:02:52] maxmanders: has joined #RubyOnRails
[21:02:53] maxmanders: has joined #ruby
[21:20:20] maxmanders: Ping timeout: 264 seconds


[14:39:37] maxmanders: Quit: ZNC -
[14:42:35] maxmanders: has joined #ruby
[14:42:35] maxmanders: has joined #RubyOnRails


[13:37:25] maxmanders: Anybody using the latest aws-sdk Gem with SQS?
[13:37:39] maxmanders: I've installed the latest 'aws-sdk' Ruby gem, and reviewing the docs there should be an Aws::SQS::QueuePoller object - but that doesn't appear to exist, and Pry only lists Client, Resource but not QueuePoller as a class of Aws::SQS (
[13:40:49] maxmanders: Hmm havenwood thanks - don't suppose you can confirm what version of the Gem you have installed?
[13:41:24] maxmanders: I'm using an optimistic 'aws-sdk', '~>2'
[13:42:04] maxmanders: I'm on 2.0.22 - I'll add the specific version to my gemspec and see how I get on - thanks!
[13:43:09] maxmanders: _shrug_ all good now - thanks havenwood


[19:18:26] maxmanders: A question of Gem style/structure: I'm developing some company specific tools for working with AWS. Let's say I have a module structure, e.g. foobar::{ec2,rds...}::backup. I'd like to use Thor to provide a CLI for working with difference services.
[19:18:58] maxmanders: Let's say I'd execute e.g. foobar ec2 backup scheduler --run or foobar ec2 backup worker --run
[19:19:38] maxmanders: I'd have a CLI object in the Foobar::Ec2::Backup module; should that extend a base Thor CLI object in Foobar? Hope that makes sense!
[19:20:44] maxmanders: I guess without context - how would I go about structuring a CLI tool that could have different functionality in different modules; given the way Thor works, I'd guess the main bin/ script would exist in the top level module? But how do I go about implementing specific features in a submodule?
[19:26:07] maxmanders: ebonics: I think I'm doing a terrible job of explaining myself!
[19:26:45] maxmanders: So, with Thor, you can do e.g. `command subcommand action`, e.g. 'aws ec2 describe-instances'. Each of those options are parsed, and not mapped to a particular module/class.
[19:27:33] maxmanders: But let's say I wanted to implement all of my 'ec2' functionality in its own gem - would I write all the code in that gem, require that gem in e.g. a 'aws' gem; and then use Thor with the required gem code?
[19:28:31] maxmanders: thatslifeson: thanks for the sanity check ;-)
[19:29:08] maxmanders: I've written some trivial CLI gems before, but not something as ambitious as I'm planning, with related but disparate functionality in separate gems, all tied together in another gem!
[19:31:08] maxmanders: atmosx: thatslifeson: ah, but you're pros I'm sure ;-) I think the key to getting it right is small, testable bits of code that I can use another script as a 'runner' for
[19:31:36] maxmanders: Can't beat a bit of positive encouragement - thanks!


[15:29:24] maxmanders: I think I'm over-thinking / over-complicating... I'm using Devise, and it's all working great. Let's say I want separate actions for editing a password; editing a set of additional User fields; maybe editing some API keys etc. Is there any reason to keep Devise in the mix, rather than just creating a new controller for the users resource, with any actions I need?
[15:29:51] maxmanders: I.e. retain Devise for the session handling, account creation etc - and then manage the actual objects separately?
[15:44:58] maxmanders: @nickjj: thanks - trying to do things the idiomatic Ruby / Rails way to avoid shooting myself in the foot later :-)


[11:48:11] maxmanders: I'll share a Gist this doesn't strike someone as an obvious thing I'm missing. I'm using Devise with some custom routes. When I try to edit my account via the RegistrationsController, I initially had a 406 response with errors about invalid params. I've since added these via a before_action to devise_parameter_sanitier.for(:account_update). The specific error goes away, but I still receive a 406 response. Any ideas?


[15:43:25] maxmanders: Hi! I'd love it if someone could help me with this Gist, I feel like I'm missing something obvious:
[15:43:55] maxmanders: For some reason, as you can see in the rspec output, the `rake routes` look as I'd expect, but rspec seems to be munging the :action param in a weird way
[15:45:29] maxmanders: Well, the rspec fails because it seems to map POST user_session_path to :controller => dashboard and :action => <full path to session controller and action>, rather than :controller => sessions :action =>new
[15:45:59] maxmanders: I don't understand why a `post user_session_path` would expand to include the name of the current controller rather than what I'd expect of /devise/sesions/
[15:50:51] maxmanders: Hmm okay... I guess that makes sense - I'll RTFM a bit more


[16:05:50] maxmanders: Caveat - I may be going about this the wrong way... I'm writing some unit tests for controllers, and using a setup method to authenticate a FactoryGirl user via the Devise helpers. But how do I avoid running setup() to make sure that redirects work correctly when accessing a route if a user is not authenticated?
[16:07:07] maxmanders: universa1: that'd work! Just figured I should have a single SomethingControllerTest that tests that controller in a single class, rather than two different classes for authenticated, and not authenticated.
[16:08:06] maxmanders: universa1: cool - makes sense - thank you!


[19:13:47] maxmanders: Hoping someone can take a look at and tell me where I'm going wrong.
[19:14:15] maxmanders: Contrived action using nested routes - a curl works, but trying to do the same in my test file says route not found - but the routing looks sensible to me
[19:16:38] maxmanders: Ahhhh *doh* - lemme fix that and see if my brain will forgive me
[19:17:48] maxmanders: So assert_routing takes two params, the first is the route, and the second is a hash of assertions about the route resolution - failing to RTFM so I guess I can do :format => :json as a second param?
[19:18:41] maxmanders: Ok thanks folks!
[20:50:55] maxmanders: I was asking for some help testing nested routes earlier, if anyone's interested I've updated the Gist ( with the correct passing tests
[20:51:50] maxmanders: So I've learnt that when testing nested routes, the :controller parameter in assert_routing needs to be a slash/separated/controller/name
[20:52:19] maxmanders: And I need to explicitly pass in the content-type header as :format if I've constrained the route to only respond to certain content-types
[20:52:45] maxmanders: Also, subdomain needs to be matched, so the assertion needs to be against an FQDN!
[20:54:05] maxmanders: rushed: sorry - not following you... I kept getting diff output from the tests telling me what I'd failed to test - which lead me to adding all the parameters
[20:56:05] maxmanders: rushed: yeah - and having now replaces "/v1/echo/wibble" with "" and added parameters to check the subdomain and format that I specified in routes.rb, the tests pass
[20:56:27] maxmanders: So less of question - more of a huzzah \o/ , it makes sense now - I'll quieten down now :-)


[20:06:45] maxmanders: Noob quesetion - I've created some nested namespaces and prefixes to permit style routes, with controllers in app/controllers/api/v1 named API::V1::SomeController. Does this file structure and naming convention need to be reflected in the generated controller tests?
[20:07:04] maxmanders: I.e. should I locate my controller tests in a similar folder structure, and name them similarly with appropriate module prefixes?


[11:29:58] maxmanders: I've done some reading, but still not sure why I might choose Grape over plain Rails for an API - anybody have any experience of opinion?


[20:48:43] maxmanders: Probably subjective/opinionated - but is there a preferred way of deploying a Rails app from e.g. Jenkins to an AWS EC2 autoscaling group? Is a hand-rolled script with Capistrano and some AWS code the best bet?
[21:48:20] maxmanders: @tubbo - no worries there, more of an infrastructure guy than a Ruby guy - got my Chef and EC2 skills sorted out.
[21:48:31] maxmanders: @tubbo: just figured there was a more 'ruby' way ;-)
[22:01:02] maxmanders: tubbo: yeah... good point :-P
[22:01:35] maxmanders: tubbo: Yup, agreed! No point reinventing the wheel investigating what you think others _might_ do - just do what works for you I guess ;-)
[22:02:41] maxmanders: I've already got a CloudFormation JSON for the AWS infrastructure, and roles and environments for the app server - may as well keep going with the deployment!


[17:27:51] maxmanders: Getting started with some basic CI with Jenkins... I've noticed that config/secrets.yml shouldn't be in version control - but that I also seem to need to keep `rake secret` and sticking that in the file for each environment.
[17:28:10] maxmanders: I get the security implications but this seems a bit of a pain - is there a preferred way to do this step as part of a build?


[18:08:37] maxmanders: Can anyone recommend a good plugin for Atlassian Bamboo for building Rails projects, running automated tests etc. Or alternatively tell me if Jenkins + <something> is a better approach?


[05:08:27] maxmanders: I have a controller action that is POSTed to and creates anew Wibble; I have another action that is POSTed to and sends an SMS. These actions also talk JSON. If I want to send an SMS in response to creating a Wibble, how should I do it? Should the Wibble create action internally call the SMS code; should I make a POST request back to my own app via HTTP (if so, and the API requires authentication, what do I do); do I do something else?
[05:09:01] maxmanders: Trying to be idiomatic and dry (and necessarily theoretical)
[05:09:49] maxmanders: Trying to 'dogfood' my own API, but not sure the RoR to call back to your own API as part of request handling


[21:17:24] maxmanders: Potentially dumb question here. I have a partial in a layout that renders a list of some Model instances in a sidebar. If I reload that async with JS, the var from the controller is stale...
[21:18:39] maxmanders: Senjai: indeed... I'm a PHP veteran, so web dev isn't new :-P
[21:19:14] maxmanders: Senjai: but rather than a partial, I'll need a controller action that I call rather than a partial I guess, to ensure a new request is made behind the scenes...
[21:21:41] maxmanders: Senjai: not to hand, not on my machine - just popped into my head... I'll post back later when I'm back at my terminal! Cheers any way!


[10:10:19] maxmanders: I have a Parent has_many Children relationship, and I'm using nested resources. In Rails 4.0, I could set @parent = is params(:parent_id) didn't exist, and this worked fine with the link_to helper. Since upgrading, to 4.1, I'm seeing exceptions because doesn't actually exist. How _should_ I be handling cases where I want to create a new Child and assign it to an arbitrary Parent?


[20:18:53] maxmanders: Re - I'm getting an error "undefined method ` validates' for Class..."
[20:19:13] maxmanders: Very very basic class, so not sure what's going on - unless I've stumbled blindly into naming my model after a reserved word 'Group' somehow?
[20:20:55] maxmanders: smathy: that was my thinking too - Rails 4.X...
[20:22:56] maxmanders: smathy: Ah yeah, right - sorry I thought you had some cunning `rails console` snippet I could run to find out if it was a reserved classname ;-)
[20:27:37] maxmanders: smathy: looks like `validates :field, uniqueness: true` has become `validates_uniqueness_of: field` in Rails 4 - and similar methods for other validations.
[20:29:03] maxmanders: smathy: I'd have thought so to, but swapping plain old validates for the alternative did the trick - *shrug*
[20:31:41] maxmanders: smathy: Ruby 2.0.0 and Rails 4.0.0
[20:33:59] maxmanders: smathy: Cool - in that case, I'm going for 'Group' is odd in certain circumstances - I think I'll rename it to avoid surprised later on.
[20:35:12] maxmanders: smathy: Oh joy :-\
[20:36:47] maxmanders: smathy: Restarted rails server just in case.
[20:37:29] maxmanders: smathy: When I load any controller fronting that particular model - I can the stacktrace to a Gist if you think it'll help?
[20:38:24] maxmanders: smathy: I'll update then; never sure how quickly to follow the current version; is it best with Rails to always be on the latest minor version - is there a notion of 'stable'?
[20:41:35] maxmanders: smathy: Great advise - thanks a lot!
[20:41:42] maxmanders: s/advise/advice
[20:43:53] maxmanders: smathy: followed!


[21:27:21] maxmanders: Can anyone point me at a common pattern/process for a parent/child form where you can either select an existing parent association from a drop down; or create a new one in the same form and save both? Is this quite a common use case?
[21:28:53] maxmanders: cpruitt: fair point ;-)
[21:29:53] maxmanders: A Group has many Devices; a Device belongs to a Group. When adding a new Device, I'd like to select a from a select box; or have an option to create a new Group inline and apply that Group to the new Device.
[21:30:44] maxmanders: I'm thinking an AJAX/JS loaded form partial if drop down option is e.g. "Create New"; and in the method; make sure that if a new Group is set to call it's save first?
[21:31:06] maxmanders: Does that sound sensible/reasonable?
[21:32:21] maxmanders: True - I'd at least need some JS to include the new Group form based on the drop down value...
[21:32:29] maxmanders: cpruitt: exactly.
[21:33:07] maxmanders: cpruitt: I'd still need to do some checking in the device_controller to create a new group before saving the device...
[21:33:19] maxmanders: cpruitt: thanks for the sanity check / rubber-duck test :-P
[21:33:52] maxmanders: cpruitt: Cool, we're on the same page - thanks!


[21:39:46] maxmanders: If I have a Gemfilem I can specify a name, version, github source etc. and do bundle install / update. How do I achieve the same effect without a Gemfile, i.e. install directly into RVM from a Github source?


[09:28:15] maxmanders: I have a before_filter in a controller to load records for a partial in my layout. That partial is loaded via content_for in the view... Can I add that content_for to all views? I could define a partial and include that partial, but I'd rather have a hook that injected the content_for block into all the controller views without needing to add that block to each view erb.
[09:39:31] maxmanders: elaptics: Ok, I'll take a look - thanks!
[09:40:27] maxmanders: elaptics: So, effectively build the HTML structure in the controller defined as a variable, and use a before_filter to apply it?
[09:47:38] maxmanders: elaptics: Thanks for your help :-)


[16:39:36] maxmanders: if @foo has a 'bar' column, I can output in a view; if @foo has_one @baz, I can't echo e.g., instead I have to define @baz.to_s... should I be able to access a related objects fields in Rails 4, and if so, how?
[19:55:42] maxmanders: If foo has_many bar and bar belongs_to foo, I'd expect to be able to do foo.bars.each... but apparently not - what am I missing?
[19:56:37] maxmanders: soahccc: cool, so my assumption is correct but I've borked something along the way - thanks :-)
[20:49:05] maxmanders: I have Group has_many Device and Device belongs_to Group. If I create a new Group (g1) and a new Device (d1) in the console, and set = g1, why doesn't g1.devices list d1?


[21:14:06] maxmanders: Just getting my feet wet with Rails 4 and could use some help. Re Gist ( My controller and mode and routes for 'group' are all singular; yet when using `form_for @group...` I get an error about groups_path - where did this plural 'groups' come from?
[21:15:45] maxmanders: s/mode/model
[21:18:47] maxmanders: uberjar: which convention have I overlooked?
[21:20:10] maxmanders: uberjar: Yeah, got that - but what specific convention have I misunderstood? SIngular 'model' maps to plural 'models' in a form?
[21:21:22] maxmanders: uberjar: Ah okay :-\
[21:22:50] maxmanders: uberjar: I think I'll try being as explicit as possible with `form_for`, add all the bits e,g, action, URL and see if that works.
[21:26:04] maxmanders: Ah - well, no - I did 'resources :group'; which generates the route table in the list - i.e. /group/new etc... the other routes like /route/ work
[21:27:05] maxmanders: iamgiri: Updated Gist
[21:27:37] maxmanders: iamgiri: okay - but then wouldn't that map to a plural controller using Rails magic?
[21:28:09] maxmanders: Would I also need groups_controller.rb with class GroupsController... and if so, should I be using `rails g controller something_plural <action>`?
[21:30:02] maxmanders: Hmm okay then!
[21:30:23] maxmanders: Damn. Should be able to just rename the files, views and classes manually right? There's no Rails registry under the hood?
[21:33:33] maxmanders: iamgiri: Aye, I don't object to it at all, just misunderstood the particular conventions... I'll give it a shot and report back if things go bad
[21:40:31] maxmanders: iamgiri: A bit of Vim magic, and it's working... So to confirm: plural routes, plural controllers, singular models and use the right plural/singular in paths depending on context, and what 'rake routes' says?


[17:07:12] maxmanders: hubbub it is indeed - who's this?
[17:07:47] maxmanders: Hey man! How goes it?!
[17:08:19] maxmanders: Didn't know you were a Ruby man - I've made the shift, now doing Ruby and devops stuff with Cloudreach. Also got our second Whisky Web conference in April!
[17:08:36] maxmanders: Good luck with that!


[10:23:55] maxmanders: I'm ramping up with Ruby and Rails (formerly PHP dev). See ( I've installed stable ruby with RVM, created Gemset for my app, rails console and server work, but rake is throwing errors - not sure how to debug. Can anyone help?
[10:28:06] maxmanders: jbermudes: initially rake routes; but rake on its own throws errors.
[10:29:02] maxmanders: jbermudes: all rake targets are throwing the same error. My 'gut' (I know...) feeling is that my version of rake is perhaps not appropriate given the other gems in the gemset? (apologies, still getting used to the concepts)
[10:30:51] maxmanders: workmad3: they were already there. I'm working through a rails book, and checked out the baseline version for the next chapter so I was working from a common known state.
[10:32:44] maxmanders: workmad3: Yeah, I figured as much, just wasn't sure what _should_ be there. Maybe I should start a new rails project, then copy the other code in to place.
[10:33:35] maxmanders: workmad3: I'll give that a shot... watch this space ;-)
[10:34:18] maxmanders: workmad3: Now I'm getting 'undefined method `load_tasks' for Rails::Application:Class'
[10:35:03] maxmanders: workmad3:
[10:35:41] maxmanders: I modified the Rakefile to use the later version of Rails... the book may be a little out of date. Perhaps I should create a new rvm environment with their version of Rails, and then use that and bundle install from there...
[10:35:53] maxmanders: workmad3: Sorry - modified Gemfile not Rakefile
[10:36:09] maxmanders: ACTION scratches head
[10:36:24] maxmanders: workmad3: I'm going to put that down to late night coding last night and start again :-P
[10:36:39] maxmanders: workmad3: *facepalm*
[10:38:02] maxmanders: workmad3: I have no idea... I think I ran so many gem installs and uninstalls and bundle updates I tied myself in knots. I'll start a fresh this morning and see how I get on :-)
[10:38:21] maxmanders: I have to say, the Ruby and RoR online communities really are very helpful and accommodating. Keep up the good work!
[10:40:21] maxmanders: workmad3: Thanks for the pointer ;-)


[20:56:42] maxmanders: Hey, new to ruby and using Chef... in iterm2 or gnu screen all fine, but in tmux I get errors about not finding gems...
[20:57:10] maxmanders: ... not familiar enough with how ruby searches for gems to kmow where to start digging... ideas?
[20:57:30] maxmanders: s/ruby searches/ ruby search path etc/
[22:29:51] maxmanders: if $GEM_PATH and $GEM_HOME aren't set in my environment, how to I determine where gems will get loaded from?
[22:31:23] maxmanders: TTilus: apologies - just getting started, I presume I should use --help, man and Google before I ask in here?
[22:39:49] maxmanders: TTilus: many thanks, I'll come back when I'm a more experienced Rubyist with less beginner questions to ask :-)
[22:53:34] maxmanders: Fixed the problem I was having - RVM wasn't being called so unexpected version of ruby being used - fixed that and gem install chef; everything working