Unique columns get 'magic' methods

Issue #12 resolved
Ben Ben created an issue

From the docs example for finding a user:

# load a third User from the database            
sqlmyuser3 = User.mapper.select(User.c.user_name=='fred')[0](0)

If user_name is a unique column (or perhaps if it isn't, ActiveRecord's just returns the first, not sure if thats such a good idea), you'd be able to shorten the above with:

# load a third User from the database            
sqlmyuser3 = User.mapper.select_by_user_name('fred')

Comments (3)

  1. Log in to comment