[Nitro] [PATCH] bundle for Og, sql and validation
Jonathan Buch
john at oxyliquit.de
Tue Mar 20 06:51:53 EDT 2007
Hi,
Tue Mar 20 12:44:10 EET 2007 Jonathan Buch <jo at helloit.fi>
* sql.rb changes
* remove duplicated write_attrs
* made write_attr_boolean return 'f' instead of NULL
* fix require in tc_timestamped
* add :extra_condition to .find (for use with set_find_options())
i.e. set_find_options(:extra_condition => 'time_deleted IS NULL')
* fix validate_format
* :where is now handled together with :condition in find()
use case for :extra_condition
module Preserved
attr_accessor :time_deleted, Time
set_find_options(:extra_condition => 'time_deleted IS NULL')
alias_method :force_delete, :delete
def delete
@time_deleted = Time.now
save
end
def undelete
@time_deleted = nil
save
end
end
class Foo
is Preserved
end
Foo.find() # => only finds non-deleted Foos
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqlrb.bndl.tar.bz2
Type: application/bzip2
Size: 8936 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070320/315c9e2b/attachment-0001.bin
More information about the Nitro-general
mailing list