Posts By: Ken Collins

Power Moves: SQL Server on Linux, Rails, and Docker

Microsoft is releasing new versions of SQL Server on Linux more and more frequently. Last month brought us SQL Server 2017 Community Technology Preview 2.0 and like the others before, it's a breeze to use with Docker.

Read More

Making Static Components Stateful With CSS/Sass

Searching for some red ladies hoodies to wear at your team's event this Fall? How about a purple heathered t-shirt for your group's outing? Last month we launched an exciting change to our product catalog – the ability to filter styles whose color(s) match a simplified name or filter. Finding your customizable apparel in the right color is now easier than ever. And thanks to our usage of SUIT-based CSS components, along with the ability to leverage existing Rails' fragment...

Read More

Rolling Builds on TravisCI

Work on the Ruby SQL Server stack often requires long build times. Dependencies need to be downloaded, native extensions built, followed by long test runs to remote services. One feature I have come to rely on with Appveyor are their rolling builds - where commits to the same branch cancel previous running builds. Though Appveyor is great for Windows builds, my 💖 belongs to TravisCI. They are my goto for continuous integration due to their GitHub integration and open source...

Read More

Microsoft's First Open Source DataCamp

Rarely do the words "open source" come to mind when the Microsoft Corporation is mentioned. As the maintainer of the SQL Server stack for both Ruby & Rails, and a long time Apple/UNIX fan, I have been engineering solutions to make working with SQL Server as easy as possible. Often times the work has required outside in hacks to a closed & proprietary set of technologies. That changed last week.

Read More

Colorized SQL Log Backport for ActiveRecord

One of the new features of Rails 5 will be granular SQL logging so you can easily see SELECT, INSERT, UPDATE, DELETE, and TRANSACTION statements in your log. For example: But why let Rails 5 have all the fun? Today I created a gem that allows you to leverage this feature now. The gem is currently compatible and tested for Rails 3.2 to 4.2. Get it here and happy logging!

Read More

Rails Multi-Database Best Practices Roundup

Seamless second database integration for Rails. 2016-01-11: We just finished a new version of SecondBase, our own gem that provides support for Rails to manage dual databases by extending ActiveRecord tasks that create, migrate, and test your application. It supports Rails 4.x and up. Check it out on GitHub. Since landing my first job programming with Ruby, most Rails applications I have worked with have managed two or more database connections. Often times these connections are both readable and writable....

Read More

Customizing Rake Tasks In Rails 4.1 And Higher

I have been overriding, invoking, and executing custom Rake tasks since I was an early Ruby developer. Tweaking your project's automated tasks are likely the closest thing Rails developers come to building their own light saber. Most popular are adding or changing how the Rails test suite behaves. For example, adding Capybara to your project. Recently I have been upgrading projects from 3.2 to 4.2 and one thing that really stood out to me was how Rails testing tasks are...

Read More

ActiveRecord 4.2's Type Casting

Last month Rails 4.2 was released and if you have been keeping up with my posts, I even covered how you can upgrade from 3.2 to 4.2 in one step! This speaks volumes to how easy it is to adopt to outward facing API changes within our beloved framework. But often times, version changes bring implementation changes that we never see. For example, all of Aaron Patterson's work for AdequateRecord Pro™ are performance optimizations that affect no outward API interface...

Read More

Unit Testing Sass Frameworks

Building the living style guide for CustomInk's new mobile/responsive sites required that we stand on the shoulders of other great frameworks. All of them well authored and hence well tested. But as we built more tools on top of these giants, we felt the need to test our own framework's code and thus began the search for Sass/CSS testing methods. After surveying the current state of testing, I found myself let down. To be fair, there are some really clever...

Read More

From Rails 3.2 to 4.2

Last week I set out to upgrade HomeMarks, a personal bookmarking project of mine. This application sat on a very recent upgrade to Rails 3.2. It is written as an API to both an iOS and HTML JavaScript interface. It is by no means huge and should represent a nominal service oriented application. Here are some stats: 8 Models (450 LOC) 11 Controllers (550 LOC) 2 Mailers (50 LOC) 8 Libraries (500 LOC) Using Ruby 2.1.2. The application is heavily...

Read More

Dynamic SVGs Using <defs> Elements & JavaScript

The scalable vector graphics format has a really nifty way to define and reuse objects. It does this by allowing objects or paths to be defined in the <defs> element and then used one or many times with the <use> element. It is a great way to keep your SVG's file size low. Even better, it makes for a great programmatic interface to dynamically compose an image. While designing the third iteration of my personal MetaSkills.net blog, I decided to...

Read More

Instrumenting Your Code With ActiveSupport Notifications

Have you ever wondered how tools like New Relic are able to gain valuable metrics to your Rails application's internals? Or maybe you are interested in learning how to write your own libraries and gems so they can be instrumented using those same techniques? Once again the answer is to look deep into the Rails source code – and the answer is ActiveSupport::Notifications. A simple and powerful instrumentation API for Ruby available in Rails v3.0 and upward.

Read More

Bootstrap Your Next Project With The HolyGrailHarness

The HolyGrailHarness is a curated Rails application prototype that focuses on simple test patterns for Ruby & JavaScript! Unlike normal Rails Application Templates or more modern Rails application generators like Rails Composer, the HolyGrailHarness is a basic Rails application that can be considered a prototype and customized via a simple setup script. It is also somewhat opinionated in that it promotes simple and powerful testing choices and focuses on using Ruby 1.9 and up, MiniTest::Spec, Capybara, Poltergeist/PhantomJS, and Konacha. More...

Read More