Ernie Miller

No, I don't work in NYC, DC, or the valley, and I'm cool with that.

RSS Feed

Tag Archives: rails

MetaWhere 0.5.2 – Debug your SQL

0 Comments

I just pushed version 0.5.2 of MetaWhere after some discussion on the Rails core mailing list, adding the debug_sql method. What’s the difference between debug_sql and to_sql, you ask?
Read the rest of this post

Filed under Blog
Jul 9, 2010

Uploadify and Rails 3

20 Comments

If you’re using Uploadify, the nifty jQuery file upload plugin — which we’ll forgive for providing all its examples in PHP (*shudder*) — there’s a good chance you followed the general pattern outlined by John Nunemaker over at RailsTips. His article describes in detail how to get Flash to play nicely with Rails sessions using Rack middleware. Unfortunately, Rails 3 requires a few minor changes to this setup.
Read the rest of this post

Filed under Blog
Jul 9, 2010

Scoping Searches with MetaSearch

0 Comments

Earlier this month, I released new gems of MetaSearch and MetaWhere. These gems were important personal milestones for me, because with the release of Rails 3 beta 4 and Arel 0.4.0, I was finally able to make a gem release of the work I’d been putting in on GitHub the past few months. I gave a few summary release notes, and then all fell silent on this blog. Part of this is because I’ve been busy at the office, working on a new iPhone app for a client of ours. Starting tonight, and in preparation for Rails 3 final, I’m going to cover some of the features in more detail. First up: scoping searches.
Read the rest of this post

Filed under Blog
Jun 30, 2010

MetaSearch and MetaWhere 0.5.0 released!

1 Comment

With the release of Rails 3.0.0.beta4 and Arel 0.4.0, all of the pieces have come together in gem form to allow a new gem release of both MetaSearch and MetaWhere.

I’m really excited about these releases, as they’ve been a long time coming. The last MetaSearch gem release was way back in March, while the last MetaWhere gem was released in April — this felt like an eternity in the fast-moving edge Rails world. :) I hope you enjoy the new release, and thanks in advance for submitting any bugs you find!

Now, on to what’s new since the last gem releases…
Read the rest of this post

Filed under Blog
Jun 8, 2010

ActiveRecord::Relation vs Arel

4 Comments

Since the release of ActiveRecord Query Interface 3.0, I think the line has been pretty blurry for the Rails community about where ActiveRecord ends and Arel begins. I’ve seen folks attribute ActiveRecord::PredicateBuilder to Arel, and I’ve seen folks assume that an ActiveRecord::Relation is an Arel object. Neither is the case. Since MetaSearch and MetaWhere both use combinations of ActiveRecord::Relation and Arel under the hood, and I’ve spent some time putting together patches for both Rails core and Arel, the blurry line between them has become more distinct for me. In this post, I hope to clear up some misunderstandings before Rails 3 is released, and the AR 3.0 query interface becomes the norm.
Read the rest of this post

Filed under Blog
May 11, 2010

Why (fork) Arel?

2 Comments

In a few recent posts, you may have noticed me mention my Arel fork on GitHub. I’ve never really devoted a post to discussing that fork, what’s different about it, and why it exists, so here’s some background.

Read the rest of this post

Filed under Blog
May 3, 2010

MetaUpdates

0 Comments

MetaSearch and MetaWhere updates, I mean. I spent some time over the weekend (and technically tonight, as well) wrapping up some nifty new features on MetaSearch and MetaWhere. Read on for the highlights.
Read the rest of this post

Filed under Blog
Apr 26, 2010

Introducing MetaWhere

8 Comments

Recently, I spent some time working on a patch to Rails core to allow ActiveRecord::PredicateBuilder to allow more powerful queries — that is, support for additional Arel predicates beyond Equality and In. If you’re not familiar with PredicateBuilder, that’s where the magic happens when converting the arguments you supply to ActiveRecord::Relation#where or ActiveRecord::Base#find‘s :conditions hash into Arel predicates for a query. Anyway, after a brief discussion with Pratik on #rails-contrib, where he shared a bit of insight into his thoughts on tackling the same problem and encouraged me to create a plugin, I came up with a bit of a hybrid — something that I think scratches this particular itch pretty well for me: MetaWhere. Read on for how it works. [Update: If you're arriving via Ruby5 or the Rails weblog, you might also be interested in the latest MetaWhere updates, why I forked Arel, or the main MetaWhere page. Thanks for visiting!]
Read the rest of this post

Filed under Blog
Apr 15, 2010

Ruby 1.9, BasicObject, and ! (not)

2 Comments

In a recent discussion on the Rails-core mailing list, Joe Smith raised an issue that bothered me while I was working on my fork of Arel: predicate negation (not) has odd left-to-right readability. While only a minor annoyance, it did get me to spend some time tonight investigating a possible solution. This was when I got acquainted with Ruby 1.9′s BasicObject class, and more specifically, BasicObject#!.
Read the rest of this post

Filed under Blog
Apr 10, 2010

MetaSearch: Testers wanted

3 Comments

MetaSearch has had a bunch of nifty additions since the last released gem version. I’d really love to have some testers try out the new version, but it requires some handy additions to Arel which currently only exist on my fork. Those intrepid enough to try it out will gain a host of bug fixes, custom validators, and any- and all-suffixed methods for easier multi-condition searches.
Read the rest of this post

Filed under Blog
Apr 3, 2010

About

I'm Ernie Miller. But then, you probably knew that by looking at the page title, or the URL. I'm a Ruby programmer in Louisville, Kentucky. This blog used to be called "metautonomo.us", which I thought was kind of clever, but nobody, including me, could type it. Lesson learned.