[Nitro] [PATCH] bundle for Og, sql and validation

George Moschovitis george.moschovitis at gmail.com
Tue Mar 20 07:48:03 EDT 2007


thanks ;-)

On 3/20/07, Jonathan Buch <john at oxyliquit.de> wrote:
> 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/
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
>
>


-- 
http://blog.gmosx.com
http://cull.gr
http://www.joy.gr
http://nitroproject.org


More information about the Nitro-general mailing list