In my previous post on this subject I described an approach
to versioning the API of a REST/HTTP web service. This approach has
significant advantages over the approach that is currently most common
(i.e. embedding a version token in the URL). However, it does have
some downsides. This post is an attempt to outline those and […]
Ara Howard has discovered that the ActiveRecord validation mechanism
does not ensure data
integrity.1 Validations feel
a bit like database constraints but it turns out they are really only
useful for producing human friendly error messages.
This is because the assertions they define are tested by reading from the
database before the changes are written to the database. As you […]
My team ran into this problem yesterday where the a particular, very
important, request was failing in one of our Rails apps. The failure
did did not make much sense and even more confusingly, the same code
worked perfectly in the console. As part of debugging the problem we
restarted the mongrel cluster, and suddenly everything worked […]
Defining new behavior for core Rails classes in mixins is a common
pattern in Rails plugins. This allows for a separation of concerns
that improves maintainability and digestability. However, it raises a
bit of question about where the mixin inclusion step should take
place. Should it happen in the plugin’s init.rb or in the same file
as […]
Consider a situation where you have a type of resource which always
belongs to a resource of another type. How do you model the URI
space using Rails? For example, say you have an address
resource type. An address is always associated with exactly one user,
but a user may have several addresses (work, home, etc).
The simple […]
Rake is a really excellent build tool. It is basically
Make on steroids (and minus a few of the annoying inconveniences
of make). If you build software of any sort you owe it to yourself to
check out Rake.
The source of my Rake related euphoria today is that I just used a
feature of Rake that is […]
This has got to be my favorite RoR error message:
1) Error:
test_truth(Admin::EscalationMgt::EscalationViewsControllerTest):
ArgumentError: Admin::EscalationMgt is not missing constant EscalationViewsController!
Only in Rails would the fact that you are trying to use a constant that does exist be an error.
¶
Posted 07 March 2007
† Peter Williams
§
Uncategorized
‡
°
Also tagged:
I have been at my new job for just over a month now so I suppose it is
time to post something about it. I joined Absolute Performance at
the end of November. We do “operations management solutions” which is
marketing speak for helping you — both reactively and proactively –
keep your applications, and systems, available […]
I happened upon DrySQL the other day and I was immediately
interested. DrySQL is an add-on to the standard ActiveRecord
support in Rails that uses a lot more of the meta-data in the database
to generated the model classes. The standard ActiveRecord classes
basically just use the column names to create accessor and modifier
methods for the models. […]
¶
Posted 03 January 2007
† Peter Williams
§
Uncategorized
‡
°
Also tagged:
Mr. Davidson saying that “FastCGI is weak sauce” and HTTP is were it’s at. Damn right. I am glad to see the Rails community is coming realizing the power of HTTP.