A Brundage Web-log

Things Adrienne & Dean Do, Think and Write

Browsing Posts tagged ruby

acts_as_commentable is a nice little ruby on rails plugin. It extends your ActiveRecord classes giving them comments. We are going to use comments on all kinds of things, starting with recipes, of course. However, AAC lacks a critical feature: the ability for users to approve comments before they are displayed. In this post I am [...]

I was extending acts_as_commentable and needed a good RSpec test to check the returned objects from its finder methods belonged to the correct user. For example, Comment.find_comments_by_user( :some_user ) should all belong_to :some_user. I’ll be darned if that doesn’t look like a RSpec description. Since there is no all_belong_to matcher, I wrote one. module ActiveRecordValidations [...]

Login, Signup We are presented with these quick forms all the time. While it is easy to create standard login and signup pages, Amazon.com has a good one: What makes it good? First of all, the prompts are written in plain English. Amazon sells to a wide slice of the population, meaning that about 15% [...]

Ruby on Rails allows for plugins to extend its functionality. My first attempt at one is nothing special but I am going to blog about it anyway I needed a way to check if a number is within a range before saving a record to the database. Rails has a number of good validations built [...]

Before the death of my drives I had a flexible Measurement class written up. As most of you know brewing involves all kinds of measurement – hop weights, boil volume, bitterness, etc. The class served as a base that more specific classes would inherit and provided the framework for converting between different measurement systems. For [...]