Archive for July, 2009

Got an strange error:
 invalid value for Integer "09"
What did I do? (…)Integer(somestring)(…) where somestring was something between 01-99.
Turns out that an leading zero tells ruby that this is octal. Hell, I don’t have any octal stuff in my web app.
Solution: Do it the ruby way, use .to_i – even cleaner, and no octal nonsense [...]

In the java world, you have setter and getter in your model which are called ALWAYS. Change some behaviour in the setter/getter and you are done. Things are somewhat more complicated if we look at rails and activerecord.
Imagine you have a model that should parse both minutes and a formatted hour/minute string as data:
testcase.estimated_time = [...]

Elektrischer Reporter

27, Jul 2009

hab grad ganz was tolles entdeckt
es geht um netzneutralität, das urheberrecht, intellectual property uvm… ansehen!

Superbrain!

27, Jul 2009

Jeder weiß doch, dass die Wiener die schlimmsten blutsaugenden Insekten der Welt sind ;o)

If you want to show _when_ the app has been deployed with capistrano, this snipped might come in handy:
#############################################################
#   Custom Tasks
#############################################################

set :version_file, "#{tcdb_path}/app/views/layouts/_version.html.erb"

namespace :my_tasks do
desc "Sets the timestamp in version_file"
task :set_version_info do
run "rm #{version_file}"
run "echo ‘#{Time.now}’ >> #{version_file}"
end
end

after ‘deploy:symlink’, ‘my_tasks:set_version_info’
One more thing… add this file to your layout (the footer is a good place [...]


top

Switch to our mobile site