Tyler Schultz's blog
Help
Some pivots are having trouble with a flash embed tag's scale attribute. The desired behavior is that the movie scale to fit the size of the element. According to documentation, this should just work. The flash content will not scale, instead the content is getting cropped.
Anyone have experience using Amazon RDS with Heroku?
Several projects at Pivotal have used this combination with great success.
Interesting
- A project had some intermittently slow queries. The problem was traced back to some large strings in one of the columns. The team solved this problem by overriding the default scope, and only selecting the expensive column when needed.
Help:
- Does anyone know of a way to aggregate multiple projects into one hudson build? A pivot currently has 4 hudson projects that he'd like to show as one status. If any one project fails to build, then the build should go red, but hudson should still build the other three.
Interesting:
- Time gotcha:
In 1.8.7 you'll see this:
> Time.now => Wed Dec 08 22:26:37 -0800 2010 > 1.day.ago => Wed, 08 Dec 2010 06:26:44 UTC +00:00 > 1.day.ago.to_date => Wed, 08 Dec 2010 > (Time.now - 1.day).to_date => Tue, 07 Dec 2010
In 1.9.2 you'll see this:
ruby-1.9.2-p0 > Time.now => 2010-12-08 23:28:26 -0800 ruby-1.9.2-p0 > 1.day.ago => Tue, 07 Dec 2010 23:28:26 PST -08:00 ruby-1.9.2-p0 > 1.day.ago.to_date => Tue, 07 Dec 2010 ruby-1.9.2-p0 > (Time.now-1.day).to_date => Tue, 07 Dec 2010
Interesting:
- salesforce acquires heroku: http://blog.heroku.com/archives/2010/12/8/the_next_level
Interesting:
- Tests won't run if
rspecis included in thetestgroup.rspecmust be included in the development group, or both. When a test run is started theRAILS_ENVisdevelopment. After some initialization theRAILS_ENVis changed totest- a point at which theGemfilehas already been evaluated.
Interesting Thing
- Dynamic use of Object#extend at runtime invalidates the global method cache, causing performance degradations. Consider a design that makes use of extend at class parse time. Here's a slide deck that explains in detail: What Makes Ruby Go
Help
*"Proxying Apache to Thin and getting 502 errors."
Interesting
Beware: Health check ping every 3 seconds * 15 mongrels * 1 week = millions of session rows. Create skip_filter entry for your health ping action.
Snow Leopard 10.6.2 is out. An unlucky upgrader attempted to go 10.6.1 -> 10.6.2 and it hosed the machine. This required the upgrader to reinstall Snow Leopard from disk, then upgrading to 10.6.2. Backup your data before upgrading!
Redefining an aliased method may not do what you expect: When the aliased method is invoked the original implementation executes.
def do_something puts "hello" end alias :do_something_else :do_something def do_something puts "goodbye" end do_something_else # prints "hello"
Ask for Help
"We're getting id's from facebook that are overflowing INT columns in mysql tables. Should I use BIGINT to accommodate these ids? Is this wasteful?"
Use string columns instead. VARCHAR columns will only use as much space as the id needs.
"Are VARCHAR columns slower to join than INT columns?"
Not in mysql. Strings do not have join performance penalty compared to integers.
Interesting Things
Edward was a guest lecturer for a Carnegie Mellon University course where students are learning to do Agile development. Course work involves pair programming, TDD, and using Ruby on Rails. The talk was well received and Edward is invited to come back next year!
There is an apparent rails bug (2.3.2) when building associated objects and then saving them.
class User < ActiveRecord::Base
attr_accessor :bool
before_validation_on_create :set_bool
def set_bool
self.bool = true
end
end
class Child < User
belongs_to :adult
before_validation_on_create :create_adult
def create_adult
if adult.nil?
self.build_adult()
end
end
end
class Adult < User
end
specify "should work" do
child = Child.create!()
child.bool.should be_true
child.parent.bool.should be_true #fails
end
