• Authlogic Perishable Token changes and breaks emails

    Overall, I think Authlogic is pretty great.  It’s saved me a bunch of time that I don’t have to worry about user creation and user session maintenance.  But this one little doozy was causing some issues when sending out one-time-use emails like invites or password resets.

    The perishable_token is the suggested way to send out secured one-time-use emails because it’s updated every time the User model is updated (like, when the user logs in) so the email can’t be re-used to reset the password again for instance.  I’m using it in some pretty strange ways to handle proxy users (users who haven’t actually registered yet on our site), but this issue also is present for the password-reset case.

    I noticed that some users were getting rejected after clicking the link in the email saying that the perishable token was no longer valid. “That can’t be right,” I thought to myself – because I know for a fact that some of those users hadn’t logged in.  But their token was still invalid. So after a little bit of troubleshooting, I realized the issue….

    The token is updated every time the User object is saved. Not just when they login.  And I have jobs running in the background to update the users with external data pulled from various APIs.  So my job was resetting the perishable_token for every user it touched.  Ok, so how did I fix the issue?  Simple really – I just took control of the maintenance of the perishable_token away from Authlogic and handled it myself.

    (more…)


  • Whirlfood – social suggestions for food & nightlife [beta]

    Well, this is the site that I’ve been working on in my learning Ruby on Rails series. It’s called Whirlfood (pending a better name) and it is going to be a social suggestion site that helps you pick places to eat and where to go out with friends.

    But while we’re working on the algorithm, it just does some neato analytics on your data. We’ll be adding more analytics once we get the friend import stuff working – we we can analyze how you interact with your friends and look for trends. Then we’ll really start to tackle the suggestion engine. We have what we think are some pretty cool ideas for that part.

    Stats Dashboard

    Fullscreen Map View

    This is just a quickie screenshot set of what the stats look like for me (and I’ve only been using Foursquare for 2 weeks while building this app). If you want to sign up and play with it, let me know and I’ll get you the link to the beta site!


  • Running Rails 3 using RVM

    Getting RVM installed and managing two ruby environments (ruby 1.8.7 + rails 2.3.8 / ruby 1.9.2 + rails 3.0.0) went better than expected. This gist pointed me in the right direction. Now hopefully the process of migrating a rails 2.3.8 app to 3.0.0 will be as quick and easy.


  • A User Friend Relationship Model in Rails

    In building my first Ruby on Rails app, I needed to create a facebook / social-networking style friend relationship between users. The simple requirements were that it the friendship should require approval (e.g. a friend request followed by an accept or ignore) and it should be lightweight (not using two records for a single relationship).

    This method and code is inspired by two blog posts, which got me started but neither of which really fulfilled my complete requirement. The first used two records per friendship and the second was a twitter-style friend/follower without the approval process.

    So, here I break down my Friendship model which hopefully you will find useful and/or insightful as a complete solution or a starting point for your own implementation.

    (more…)


  • Rails Deployment: Engine Yard or Heroku?

    As I’m thinking about beta launching my first Rails app, I need to decide how to do the deploy.  Heroku and Engine Yard stand out as the most popular hosts, from what I see. Heroku also has a free option, which appeals to me.  Is one much better than the other?

    Long-term, I will probably host the app myself at my colo, but to keep things simple at first I don’t want to learn the intricacies of Rails hosting right now…


  • Learning Rails – Day II

    Well, I spent the second half of today (and >4 hours at Farmer Boys) working on my Whirlfood project in Rails and made a surprising amount of progress.  Took some time to start to get used to the Rails methodology and the Ruby language syntax, but I think I’m in pretty good shape now.

    Got to admit, I’m starting to like Rails for rapid development. After 2 days, I feel like I can build a simple web app almost as quickly as I can using C#.  Which completely amazes me.  Of course, there are lots of complex things and specialized functions that I still don’t know how to do in Rails, but still, I’m pretty stunned. In a good way.

    (more…)


  • Learning Rails – Day I

    I’ve been reading up a bit on Ruby and think I have a passable handle on the syntax.  Also studied the structure of Rails apps.  So now it’s time to actually build something to actually learn it.  And because I have no patience for more Hello World examples, I’m going to build something actually useful.

    Only problem is that I don’t have any tiny project ideas right now.  So I’m going to re-work an existing idea and build a social restaurant recommendation site, based on my previous (poorly-named) Edahh project.  If it turns out well, it might just be the basis for a re-launch of that service.

    But let’s not get ahead of ourselves.  First things first:

    $ rails whirlfood -d mysql

    And the adventure begins.


FRESH / LATEST POSTS

FRESH / Twitter Updates