Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Standup 10/31/08

Rajan Agaskar
Friday, October 31, 2008

Interesting Things

  • Aliasing ActiveRecord reader methods

    ActiveRecord reader methods are not eagerly loaded, and as such cannot be aliased using alias_method. There are a number of workarounds to this, those talked about included: calling self.define_read_methods, after which all your read methods will be loaded and available for aliasing, or you can simply define the alias instead of using alias_method.

  • belongs_to and foreign keys.

    If you specify an alternate foreign key when using belongs to, you will have access to that id via the name of the foreign key, and not the name of the belongs_to association. It may be worthwhile allowing access to the id via the belongs_to association in order to keep consistency.

  • boo

    BOOOO!!!!! BOOOOOOOOO!

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

One comment

  1. Strass says:

    You could also use alias_attribute : http://noobkit.com/show/ruby/rails/rails-stable/activesupport/module/alias_attribute.html

    October 31, 2008 at 6:36 pm

Add New Comment Cancel reply

Your email address will not be published.

Rajan Agaskar

Rajan Agaskar
San Francisco

Recent Posts

  • Restart post-migration
  • Capybara 2.0 is out.
  • Try using Mongo
Subscribe to Rajan's Feed

Author Topics

  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >