List Info

Thread: bundle for Og, sql and validation




bundle for Og, sql and validation
country flaguser name
Germany
2007-03-20 05:51:53
Hi,

Tue Mar 20 12:44:10 EET 2007  Jonathan Buch <johelloit.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-generalrubyforge.org
h
ttp://rubyforge.org/mailman/listinfo/nitro-general
  
Re: bundle for Og, sql and validation
user name
2007-03-20 06:48:03
thanks 

On 3/20/07, Jonathan Buch <johnoxyliquit.de> wrote:
> Hi,
>
> Tue Mar 20 12:44:10 EET 2007  Jonathan Buch <johelloit.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-generalrubyforge.org
> h
ttp://rubyforge.org/mailman/listinfo/nitro-general
>
>


-- 
http://blog.gmosx.com
http://cull.gr
http://www.joy.gr
http://nitroproject.org
_______________________________________________
Nitro-general mailing list
Nitro-generalrubyforge.org
h
ttp://rubyforge.org/mailman/listinfo/nitro-general

Re: bundle for Og, sql and validation
user name
2007-03-20 12:25:25
On 3/20/07, Jonathan Buch <johnoxyliquit.de> wrote:
>    * fix validate_format

What was wrong with validate_format?  Is there a spec for
the bug?

Judson

-- 
Q: How does a hacker escape handcuffs?
A: Backslashes.
_______________________________________________
Nitro-general mailing list
Nitro-generalrubyforge.org
h
ttp://rubyforge.org/mailman/listinfo/nitro-general

Re: bundle for Og, sql and validation
country flaguser name
Germany
2007-03-23 12:56:39
Hi,

> On 3/20/07, Jonathan Buch <johnoxyliquit.de> wrote:
>>    * fix validate_format
>
> What was wrong with validate_format?  Is there a spec
for the bug?

It validated on "a" instead of "val".  
(look up the change respective
code lines).

no spec for that bug, sorry. ^^;  This is just what I did at
work.

Jo

-- 
Feel the love
http://pinkjuice.c
om/pics/ruby.png
_______________________________________________
Nitro-general mailing list
Nitro-generalrubyforge.org
h
ttp://rubyforge.org/mailman/listinfo/nitro-general

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )