Your browser is no longer supported! Please upgrade your web browser now.
Code posts:

Easy Rails Asset Handling with HTML5 & S3

While working on the new Harvest Help Center, our team had a chance to look at some common web-app issues with fresh eyes. Asset upload is almost certainly a requirement of any modern document-based web site, usually for images or general downloadable assets. There are a few pre-built Rails plugins that address asset upload (most notably paperclip), but they require database tables and are often designed with server-side storage in mind. Having a robust server-side solution for assets provides many benefits, but we found they were unnecessary for the simple workflow we had in mind.

We worked at finding something simpler and came up smiling.

Continue reading…

A New Rails 3 Positioning Library: RankedModel

When we started work on the new Harvest Help Center, it was with the fresh perspective of our recent Rails 3 upgrades. We looked for a simple row sorting solution, but the traditional plugin ActsAsList is showing it’s age with old ActiveRecord conventions and naive logic. Rising to the challenge, we rolled up our sleeves and built our own ordering solution, that we have dubbed RankedModel.

ActsAsList

ActsAsList has been around for a long time. I can’t recall what release of Rails it came out with, but it was well before Rails 1.0. The fact that it has remained the default solution for row ordering so long speaks to how simple the problem of row sorting is. There isn’t anything too crazy going on in this code:

  • Keep the order of items in an integer column.
  • When fetching a set of items, default the order statement to sort by that column.
  • When we move an item to a new position, assign all the other items to their new positions.

But there were a few downsides to using ActsAsList:

  • The code does not use ARel. This means we can’t chain sorted item collections into complex ARel queries.
  • If one item is moved, many of the other items are adjusted to compensate for the movement. Many rows in MySQL can be updated by one row’s reassignment.

What’s a modern Rails developer to do?

Continue reading…

Delta Force: The Secret to Legendary Customer Support

The pride of Harvest is our customer support. We believe the success of Harvest begins and ends with you, our customers. We’re very excited about our new Harvest Support site, and we have an outstanding frontline support team that talks to 100’s of customers every week. Many questions are quick to answer, but some require more technical knowledge.

Since last summer, we’ve been experimenting with a tiered rotation of team members into bugfix roles: the Fireteam and Delta Force. This system is great for small teams with stretched technical resources, and allows for fast support response without having a bloated support staff.

Continue reading…

Harvest Upgrades to Rails 3

Harvest is on Rails 3! This is exciting news from the Harvest technical team. I’ll detail how the upgrade process went, but first a little history. The initial commit to Harvest was made on November 23rd, 2005 – five years ago. Back then, we ran Rails 0.14.1 and were still discussing how time should be entered into Harvest. That’s five years of Rails releases since we started, and each upgrade was a painful but worthwhile experience.

I cannot stress that last conviction enough. Besides the obvious technical improvements an upgrade brings, there is also a morale boost from using the very best tools. This comes at a cost: Upgrading a key dependency is challenging for an app of Harvest’s size.

Name Lines
Controllers 12K
Models 25K
Views 28K
Helpers 7K
Libraries 3K
Functional tests 18K
Unit tests 20K
Selenium tests 2K
Our Javascript 10K

Harvest also has 32 plugins, 82 gem dependencies, our widgets, mobile apps, and Co-op integration. These are all potential breaking points during an upgrade. Continue reading…

Harvest Integrations Galore: GitHub in Co-op, Fluid Growl Reminders, and Java for Harvest

A smattering of developers (who are also Harvest customers!) have released some cool integrations in the past few months, and we thought we’d share the highlights with you.

Post GitHub Commits to Co-op

Robert May of Core Web Design has put together an integration between GitHub and Co-op, Harvest’s team communication application. This GitHub service posts GitHub commits from any project of your choosing directly to Co-op. It’s a fantastic way to keep your team up-to-date on the latest development activity.

To set up the integration, visit the source GitHub repository and go to Admin > Service Hooks. Choose Co-op and fill in the necessary information.

Continue reading…

How To Generate Excel Files with Ruby

While Harvest provides powerful reports sometimes nothing beats having all of your data in a spreadsheet.  Unfortunately, the defacto spreadsheet tool (Excel) has some tricky file formats, making programatic export more difficult than it should be. We recently made improvements to how we handle Excel exports in Harvest, and I’d like to share a few options for exporting spreadsheets with Ruby.

Continue reading…

Harvested, a New Ruby API wrapper

For you developers out there, Harvest user Zach Moazeni has released a Harvested, which is a new Ruby API wrapper.

We’re delighted to see the creative and imaginative ways our customers are making Harvest work for them, please let us know if you have created a Harvest integration you’d like to share!

Harvest Supports Ruby Summer of Code

Harvest was built from the ground up with Ruby on Rails, a powerful framework for building web apps. Rails has been part of daily activity here since back when we worked on client projects right alongside of Harvest. As an OSS project, Rails needs contributions of all sorts to continue evolving. The latest program to help push Rails forward is Ruby Summer of Code.

The Ruby Summer of Code program is designed to help fund student development of Ruby and/or Rails projects in the summer of 2010. Accepted students will be matched up with accepted mentors and will have two months to complete their summer projects.  Harvest is proud to support this inspired endeavor, and the future of Ruby development.

The student application window is from April 5th to April 23rd, so that means the deadline is just a week away.  If you are (or know of a) student with an idea for a great Ruby project, get your application in now!

Co-op, Twitter, and Motivation with Cobot

We are pretty active on Twitter. It’s a great way to get quick messages out as we release new features. We love to hear what you have to say about Harvest, good or bad.

It would not be particularly efficient for everyone on the team to watch the flow of tweets about Harvest. So, for those of us who have the task of watching Twitter, we like to favorite interesting tweets about Harvest, and we also like to share them with the rest of the team. This is a perfect task for automation by Cobot, your friendly Co-op robot.

We created a Ruby script that runs every 30 minutes looking for the latest favorited tweets on our Harvest Twitter account. It also looks at the Harvest stream to pull in anything we’ve said on Twitter. These tweets get inserted into our Co-op stream and provide a nice bit of motivation from our wonderful customers.

If you are curious to see the script, it can be found on GitHub. And here it is in action:

Co-op with Twitter inline

Enjoy using Cobot to enhance your Co-op workstreams, we’re excited to know if you find this feature useful!

Introducing Cobot: System Messaging for Co-op

The Harvest Team communicates with Co-op all day, every day. It is the visual heartbeat of our team, as we share failures, successes and silliness from our work days and our lives. While this heartbeat is strong, it also has an obvious arrhythmia: no system status messages.

For the past couple weeks we have been refining an API technique to programmatically add system status, and anything else, to a Co-op workstream. We are pleased with the results, and would like to introduce you to Cobot:

Cobot - The Harvest Co-op Robot

Cobot posts may be created via the Co-op API.

Along for the ride are a couple of new formatting features now enabled for Co-op statuses. First, statuses now accept <br /> tags to force new lines, which is essential for posting things like deployment of multiple code commits.

Co-op also now supports code pastes. If you paste anything in your Co-op message box with two or more new lines, the code paste view will take effect:

Philip J. Fry WTFjs

Feel free to share what kinds of system messages you will be looking to bring into your Co-op workstreams, we’re excited to know if you find this feature useful!