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
Sean Beckett

Standup 07/15/2008

Sean Beckett
Tuesday, July 15, 2008

Interesting Things

  • If using Desert and Rails 2.1, if the first view loaded is from a plugin things blow up.

Ask for Help

“How can I make follow_redirect go to a URL?”

When using a follow_redirect to a URL instead of a hash, the test fails with a string conversion exception. No solutions were forthcoming.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Sean Beckett

Standup 07/14/2008

Sean Beckett
Monday, July 14, 2008

Interesting Things

  • Congratulations to Engine Yard on closing $15M Series B financing!
  • After a catastrophic HDD failure, one Pivot found 1password on his iPhone to be invaluable in restoring all his login credentials.
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Joe Moore

<strike>Standup</strike> Free Slurpee! 07/11/2008

Joe Moore
Friday, July 11, 2008

Standup fun-stuff edition!

Interesting Things

  • Free Slurpee Day! Head to 711 Market Street (oh yeah) for a brain freeze.

Free Slurpee Day at 7-Eleven!

  • Where are all of the Pivots? Hmmm…

iPhone 3G Launch, AT&T Store  iPhone 3G Launch, SF Apple Store

  • Pie and brownies for breakfast!
  • Pivot Jonathan‘s wife is having an art opening. Check it out the Glass Cafe at Public Glass, Saturday, July 12, 6-9pm.

  • Pivot David band Gosta Berling is playing at Mr. Smith’s at 7th. and Market St. on 07/17.

Ask for Help

“Sometimes find(:first, :order => 'id DESC') returns the records in the wrong order!”

Rails 2.0.2. Roughly 1 out of every 15 times, the first id is not the first one returned. Very very strange.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Joe Moore

Standup 07/10/2008

Joe Moore
Thursday, July 10, 2008

Update 07/11/2008: A fix has been committed for the :named_scope_-column-collision issue.

Interesting Things

  • In Rails 2.0.2, we have seen a strange behavior when you have a belongs_to association declared on an ActiveRecord class, but the table does not have a foreign key for that relationship. Within a session, everything appears normal. The child object will still be saved, the parent object can even be reloaded. But by the next session, the child object is in the database, but cannot be retrieved.
  • When using named_scope, adding a :joins option will “mix-in” all of the attributes from that join table into your retrieved object, potentially overwriting any colliding attributes (including id … ouch!). There was consensus that this was a valuable feature, when used “properly”. Adding :select option can avoid this, or use :include.
  • We ran into an issue when using the JS Routes plugin in combination with Rails’ asset packaging. When asset packaging is invoked using <%= javascript_include_tag 'named_routes', 'xxx', :cache => true %> the named_routes.js file usually has not been generated, and application crashes at startup. Solution: we created a rake task to generate the named_routes.js file and run that as part of our deploy process.

Ask for Help

“Why did my JS respond_to block suddenly start rendering the HTML template instead of the RJS template?”

Rails 2.0.2; controller, action, respond_to block all work as expected. Just wrong file gets rendered. They fixed the problem by adding an explicit call to render but this should not be necessary. Suggestion is to move from the template.rhtml naming scheme to template.mime-type.render-engine scheme and see if it is fixed.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Joe Moore

Standup 07/09/2008

Joe Moore
Wednesday, July 9, 2008

Interesting Things

  • This weeks brown-bag discussion is on Haml.
  • Several of our projects will update Rails 2.1 Time Zone support. Reports coming soon.

Ask for Help

“When monit kills our Mongrels, our in-progress transactions are committed, not rolled-back!”

This is with Rails 1.99. Has anyone heard of this?

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Joe Moore

Standup 07/08/2008

Joe Moore
Tuesday, July 8, 2008

Interesting Things

  • Are you a OS X guru? Pivotal Labs is looking for a OS X Desktop Support tech. If you are interested, contact us!

Ask for Help

“Does anyone have suggestions for debugging Safari-specific JavaScript problems?”

Suggestion: download the nightly build of Safari/WebKit, which has a real JavaScript debugging tool.

“After switching from Selenium RC Fu to Polonium, our Selenium tests run extremely slow.”

The affect is similar to Selenium’s slow-mode.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Standup 05/30/2008

Pivotal Labs
Friday, May 30, 2008

Interesting Things

  • ActiveRecord’s #method_missing takes precedence over private methods, which means you cannot simply mark “private” database-derived attributes.
    code:

    # File: app/models/rock_star.rb
    #
    # == Schema Information
    # Schema version: 1
    #
    # Table name: rock_stars
    #
    #  id            :integer         not null, primary key
    #  real_name     :string(255)
    #  band_name     :string(255)
    #  personal_life :string(255)
    #
    
    
    class RockStar < ActiveRecord::Base
      def method_missing(method, *arguments, &block)
        puts "I see you've sent my #{method} back and my ActiveRecords and they're all scratched"
        super
      end
    
    
      private
    
    
      def personal_life=(arg)
        puts "Vanish in the air you'll never find me"
        attributes[:personal_life] = arg
      end
    end
    

    script/console:

    Loading development environment (Rails 2.0.2)
    >> sting = RockStar.new(:real_name => 'Gordon Sumner', :band_name => 'The Police')
    I see you've sent my real_name= back and my ActiveRecords and they're all scratched
    => #<RockStar id: nil, real_name: "Gordon Sumner", band_name: "The Police", personal_life: nil>
    >> sting.personal_life = "I'll be watching you"
    I see you've sent my personal_life= back and my ActiveRecords and they're all scratched
    => "I'll be watching you"
    

    Potential solutions:

    • Convention… name “private” database attributes with leading underscores
    • Exception:

      class RockStar < ActiveRecord::Base
        def personal_life=(arg)
          raise "Protest is futile, nothing seems to get through"
        end
      end
      
    • Have another? Post a comment.

  • ||= (”or equal”) blows up you have a public “writer”, but a private “reader”; makes sense, but still worth a mention.
    code:

    class Model < ActiveRecord::Base
      def field_name=(arg)
        @field_name = arg
      end
    
    
      private
    
    
      def field_name
        @field_name
      end
    end
    

    script/console:

    Loading development environment (Rails 2.0.2)
    >> instance = Model.new
    => #<Model id: nil, field_name: nil>
    >> instance.field_name = 'lala'
    => "lala"
    >> instance.field_name ||= 'dodo'
    NoMethodError: private method `field_name' called for #<Model:0x17df6d0>
      from /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:205:in `method_missing'
      from (irb):4
    
  • ActiveRecord writers always return the passed in argument, even if you define some other return value. This also makes sense — necessary for chaining, etc., but what the heck…
    code:

    class Model < ActiveRecord::Base
      def field_name=(arg)
        @field_name = arg
        return "custom return value"
      end
    end
    

    script/console:

    Loading development environment (Rails 2.0.2)
    >> instance = Model.new
    => #<Model id: nil, field_name: nil>
    >> instance.field_name = 'lala'
    => "lala"
    
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Dan Podsedly

Tracker public beta

Dan Podsedly
Friday, May 30, 2008

We’ve decided to share Tracker with the agile community. Details of the launch have yet to be worked out, including an exact date, but please register here if you’re interested in participating in the beta.

Stay tuned for more details!

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Standup 5/9/2008

Pivotal Labs
Friday, May 9, 2008

Interesting

  • attr_readonly marks an attribute as, ah, read only — use it to tell ActiveRecord that an attribute should not be a part of update operations. Rails uses attr_readonly internally with counter caches (search for “counter_cache” under ActiveRecord::Associations::ClassMethods) since counter caches are incremented/decremented directly in the database with sql. Without attr_readonly, subsequent updates of the counter_cache’d model would revert the counter to the value of the counter at the time the model was loaded.

Note: attr_readonly was either buggy or not exposed prior to 1.2.3. If you are using a version of rails prior to 1.2.3 you can do this instead:

def attributes_with_quotes(include_primary_key = true)
  attributes.inject({}) do |quoted, (name, value)|
    if column = column_for_attribute(name)
      # original:
      # quoted[name] = quote_value(value, column) unless !include_primary_key && column.primary
      quoted[name] = quote_value(value, column) unless !include_primary_key &&
          (column.primary || ["your_attributes", "listed_here"].include?(column.name))
    end
    quoted
  end
end

Ask for Help

  • help: Looking for recommendations on converting an existing schema to a new schema. We are considering dumping the existing schema to yaml (using ar_fixtures) and making the transformations there.
    • answer #1: One recent project had a “liberate” script that extracted information from the legacy database via sql statements and constructed AR model objects as necessary. The liberate script grew to some 1500 lines of code and was refactored many times.
    • answer #2: Another project did the data migration by first importing the legacy database and then using rails migrations as needed to transform the data to the new schema. Most of the migrations used sql for the transformations. These migrations did not have associated unit tests.
    • Please offer your suggestions in the comments.
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Standup 5/8/2008

Pivotal Labs
Thursday, May 8, 2008

Interesting

  • Firebug 1.2 Alpha works with Firefox 3 Beta nightly builds
  • Firefox 2 and Firefox 3 can peacefully coexist on the same system with different profiles

Ask for Help

  • help: “JsUnit doesn’t work with Firefox 3″
    • answer #1: Apparently not with the file based url, but does work with the http url
    • answer #2: “There appears to be what some consider a bug in Firefox 3 in which JS access across frames has changed from Firefox 2…” (Follow that link for an interim fix starting at “Here’s the good news:”)
  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Topics

  • agile (778)
  • rails (113)
  • testing (87)
  • ruby (83)
  • ruby on rails (70)
  • jobs (62)
  • javascript (54)
  • techtalk (44)
  • rspec (38)
  • activerecord (29)
  • productivity (29)
  • gogaruco (29)
  • ironblogger (29)
  • git (28)
  • nyc (27)
  • rubymine (25)
  • mobile (22)
  • bloggerdome (21)
  • cucumber (20)
  • process (19)
  • pivotal tracker (19)
  • jasmine (19)
  • design (18)
  • ios (18)
  • webos (17)
  • objective-c (17)
  • android (16)
  • palm (16)
  • "soft" ware (16)
  • fun (15)
  • tracker ecosystem (15)
  • ci (15)
  • cedar (15)
  • rails3 (14)
  • performance (14)
  • bdd (14)
  • gem (13)
  • tdd (13)
  • selenium (12)
  • css (12)
  • goruco (12)
  • bundler (12)
  • meetup (11)
  • railsconf (11)
  • nyc-standup (11)
  • capybara (10)
  • mac (10)
  • mojo (10)
  • chef (10)
  • api (10)
Subscribe to agile Feed
  1. ←
  2. 1
  3. ...
  4. 62
  5. 63
  6. 64
  7. 65
  8. 66
  9. 67
  10. 68
  11. ...
  12. 78
  13. →
  • 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 >