Halaman

Minggu, 14 November 2010

[shared] rails exception logger

https://github.com/defunkt/exception_logger

installation:
- ruby script/generate exception_migration
- rake db:migrate
- in application_controller.rb add
include ExceptionLoggable
rescue_from Exception, :with => :exception_handler

private

def exception_handler exception
log_exception exception
render "/500.html"
end


the default controller and view using prototype.js instead of jquery so i created my own controller view under admin namespace. the database pretty simple and similar to rails exception notification

for rails 3:
https://github.com/QuBiT/exception_logger

Rabu, 10 November 2010

kaspersky conflicting with tortoise svn

kaspersky, settings, exclusions, add:
- rules for the project folder
- trusted application for:
- - ..\system32\searchprotocolhost.exe
- - ..\system32\searchfilterhost.exe
- - ..\tortoisesvn\bin\tsvncache.exe
- - ..\tortoisesvn\bin\tortoiseproc.exe
- - ..\tortoisesvn\bin\tortoisemerge.exe

other possible cause:
win7 bug prior sp1: http://support.microsoft.com/kb/982927/en-us

Kamis, 04 November 2010

Mysql::Error: query: not connected

MySQL 5.1 client library doesn't play well with Rails

download:
http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll

source:
http://forums.aptana.com/viewtopic.php?f=20&t=7563&p=27407&hilit=libmysql.dll#p27407

Sabtu, 30 Oktober 2010

named scope conditions eager loaded warning

http://jitu-blog.blogspot.com/2009/07/looking-into-rails-namedscope.html

Senin, 25 Oktober 2010

[shared] range overlap check

overlap = !((end2 < start1) || (start2 > end1))

r = Range.find_all(:conditions => ["NOT ((end < ?) || (start > ?))", new_start, new_end])

overlap = r.present?
number_of_overlaps = r.length