Posted in Ruby on Rails by: sean
No Comments
21 Jan
ХудожникБогородицаUpdate – if you sign up through this link, New Relic will send you an RC helicopter for trying out New Relic. Like many Rails people, I use New Relic to monitor my Rails app. At Wave Accounting we even pay for it. It’s well worth the money, as you get a lot of extra [...]
Posted in Ruby on Rails, Telephony by: sean
5 Comments
25 Oct
икони цени I’ve wanted to play with the Twilio client for a while. They have this great quick start but it’s written in PHP. Now I don’t mind PHP, but I prefer Ruby. If I’m going to write anything using the client, it’s going to be in Ruby, so I don’t see the point in [...]
Posted in Ruby on Rails by: sean
No Comments
25 Jul
КартиниSmallPayroll.ca was my first big Rails project, and looking back at some of the code, it shows. One of the first things I did was the timesheet. The form has 21 input fields per employee, then it has to go through the database and figure out if days have changed or deleted. So it’s doing [...]
Posted in Ruby on Rails by: sean
1 Comment
16 Jun
I have been playing with the Freshbooks API and the Twilio API as part of a contest that Twilio is running. It’s a great excuse to try something I’ve been meaning to do for a while. I ran into a few problems. The freshbooks gem doesn’t work under 1.9.2, which I found out after trying [...]
Posted in Ruby on Rails by: sean
No Comments
10 Jun
I have an administration panel for my Rails application that shows various information. I’ve found it helpful to show the last few commits along with a link to the repository. Here’s the code: Controller: @commits = Array.new git = `git log -15 –abbrev-commit –pretty=format:”%H – %cr – %s – %d”` git.split(/\n/).each do |commit| elements = [...]
Posted in Linux/Unix/OpenSource, Ruby on Rails by: sean
No Comments
16 Jan
I recently changed SmallPayroll to use Beanstalkd instead of delayed_job for background processing. delayed_job is an awesome tool and makes asynchronous processing so simple. However I wanted to have multiple queues so that I could have different workers processing different queues, and have some upcoming needs to process the jobs quicker than the 5 second [...]
Posted in Linux/Unix/OpenSource, Ruby on Rails by: sean
No Comments
09 Dec
I was just fighting with this, and being new to the Rails 3 way of things, the docs didn’t quite make sense. Step 1 – Install the plugin rails plugin install https://github.com/rails/exception_notification.git Step 2 – Edit config/application.rb: module MyApp class Application < Rails::Application # ….. # somewhere in this block put the following: config.middleware.use “::ExceptionNotifier”, [...]
Posted in Linux/Unix/OpenSource, Ruby on Rails by: sean
No Comments
27 Sep
трапезни масиI’ve started using Git instead of svn. Like many other people, I tried it out to get easier branching, but found it’s just a pleasure to use in general. One great feature is that git can work with an SVN repository. You use git to check out some SVN code into a local git [...]
Posted in Ruby on Rails by: sean
6 Comments
29 Jun
I have been slowly learning how to use JMeter to load test the Small Payroll application. One of the problems has been getting around the CSRF protection that Rails puts in with the authenticity_token parameter. Each form has a hidden form element: <div style=”margin:0;padding:0;display:inline”> <input name=”authenticity_token” type=”hidden” value=”16iUP1J2tdSKyvHKgYR/I/og6K7NgPPmTHCZ+idQP4k=” /> </div> The token is also encrypted [...]
Posted in Ruby on Rails by: sean
No Comments
03 Sep
I love some of shoulda’s macros, partially because it forces me to think about my tests and put them in setup blocks, which ends up making things cleaner. So I ran into a case where I do an action and use should_change to make sure that a certain number of rows were added to a [...]