Re: [Rails-core] Still trying to get pagination fixed.. STILLhavethis ActiveRecord connection helper thingy pending

2006-02-10 Thread Tom Ward
On 2/9/06, Michael Koziarski <[EMAIL PROTECTED]> wrote:

> * notests - For patches submitted without unittests
>
> These should also be marked XPATCH, because barring exceptional
> circumstances (or trivial fixes) we don't apply patches which don't
> include tests.

Going through and marking untested (or otherwise deficient) patches
XPATCH is an excellent idea - reducing the patch queue, and inviting
help in areas that need it.

I'm less keen on the 'notests' keyword, as I can't see what value it
adds to the XPATCH flag.  A simple comment ('This patch looks
complete, but has no tests') would be enough for me.  Some broader
designation that a patch is 'nearly there' might be more useful,
splitting patches that need loads of work from those that don't.

In the end though, it's not worth the time obsessing about.  Let's try
out these ideas and see which ones stick.

Tom
--
email : tom at popdog.net
___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] Multithreaded script/runner

2006-02-10 Thread Tom Ward
I've been using the pooled adapter on some installations without any
obvious problems, but not running against rails 1.0. I know that some
changes were made in #428 that may affect the pool.

I'll take a look at the code I wrote over the weekend, and see how it
looks against 1.0 and trunk.  I'll comment against #2162 with anything
I find.

Tom

On 2/9/06, Greg Lappen <[EMAIL PROTECTED]> wrote:
> Your guess is as good as mine.  Tom Ward did some work based on my
> original patch to implement a pooled adaptor which I thought was on
> track to be integrated into the core, but i still don't see it in
> subversion.  We would like to be able to use Rails with webrick in
> multithreaded mode for small admin apps and the like.
>
> Can anyone comment on the status of integration the connection
> pooling patch?
>
> Greg
>
> On Jan 31, 2006, at 6:53 PM, Kyle Maxwell wrote:
>
> > I'm trying to use a multi-threaded script/runner, which dies with too
> > many (mysql) database connections.  I reading up, and it appears that
> > this is because each thread uses a new database connection.  Moreover,
> > the thread doesn't close out the connection when it's done.  It
> > appears that patch #2162, which would enable connection pooling, was
> > stalled.  Is this planned for 1.1?  Is there another way around the
> > issue?
> >
> > --
> > Kyle Maxwell
> > Chief Technologist
> > E Factor Media // FN Interactive
> > [EMAIL PROTECTED]
> > 1-866-263-3261
> > ___
> > Rails-core mailing list
> > Rails-core@lists.rubyonrails.org
> > http://lists.rubyonrails.org/mailman/listinfo/rails-core
>
> ___
> Rails-core mailing list
> Rails-core@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-core
>
___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


[Rails-core] [3795] render_component doesn't work with modules?

2006-02-10 Thread Nathaniel S. H. Brown
I just submitted a bug report for the render_component not being able to
properly find the modules.

I did a pretty detailed search, and wasn't able to find anything in the
tracker. Is this something you guys are already aware of ?

http://dev.rubyonrails.org/ticket/3795

-Nb

~
 Nathaniel S. H. Brown   http://nshb.net 
~

___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] Be a hero: Convert Active Record fixtures to schema.rb

2006-02-10 Thread Wilson Bilkovich
On 2/10/06, David Heinemeier Hansson <[EMAIL PROTECTED]> wrote:
> I've started for a few new tests to use schema.rb instead of creating
> a gazillion changes to all the db-specific .sql files. Great stuff.
> But it would be even greater if ALL of the db-specific fixtures were
> replaced by entries in schema.rb. Should not be a too hard task.
> Anyone up for it?
> --

Is this possible for systems (like Oracle) that don't have schema dump
support yet?
..or did I miss some breaking news somewhere?

Either way, I'm happy to help.  Adding a new table as a fixture for
every adapter once was enough for me. I can only imagine what it's
like for the core team.
___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


RE: [Rails-core] [3795] render_component doesn't work with modules?

2006-02-10 Thread Nathaniel S. H. Brown
Just nailed it down to having a "/" in the controller.

If you even trying:

render_component :controller => "/blog", :action => "list"

It will produce an error saying it cant find ::Blog

-Nb

~
 Nathaniel S. H. Brown   http://nshb.net 
~
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf 
> Of Nathaniel S. H. Brown
> Sent: February 10, 2006 6:09 AM
> To: rails-core@lists.rubyonrails.org
> Subject: [Rails-core] [3795] render_component doesn't work 
> with modules?
> 
> I just submitted a bug report for the render_component not 
> being able to properly find the modules.
> 
> I did a pretty detailed search, and wasn't able to find 
> anything in the tracker. Is this something you guys are 
> already aware of ?
> 
> http://dev.rubyonrails.org/ticket/3795
> 
> -Nb
> 
> ~
>  Nathaniel S. H. Brown   http://nshb.net 
> ~
> 
> ___
> Rails-core mailing list
> Rails-core@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-core
> 

___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] AR Unit Tests

2006-02-10 Thread Wilson Bilkovich
On 2/10/06, Bob Silva <[EMAIL PROTECTED]> wrote:
>
> test_lock_column_name_existing(LockingTest):
>
> ActiveRecord::StatementInvalid: Mysql::Error: #42S02Table
> 'activerecord_unittest.legacy_things' doesn't exist: DELETE
> FROM legacy_things

This is a test I wrote.  I don't use MySQL, unfortunately, so I can
only hope that I got the definition syntax right.  This is what is in
the mysql.sql file.. is this correct?

CREATE TABLE `legacy_things` (
  `id` int(11) NOT NULL auto_increment,
  `tps_report_number` int(11) default NULL,
  `version` int(11) NOT NULL default 0,
  PRIMARY KEY  (`id`)
) TYPE=InnoDB;
___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] AR Unit Tests

2006-02-10 Thread Jakob Skjerning

Wilson Bilkovich wrote:

This is a test I wrote.  I don't use MySQL, unfortunately, so I can
only hope that I got the definition syntax right.  This is what is in
the mysql.sql file.. is this correct?


Sure is:

mysql> CREATE TABLE `legacy_things` (
->   `id` int(11) NOT NULL auto_increment,
->   `tps_report_number` int(11) default NULL,
->   `version` int(11) NOT NULL default 0,
->   PRIMARY KEY  (`id`)
-> ) TYPE=InnoDB;
Query OK, 0 rows affected, 1 warning (0.07 sec)


--
Jakob Skjerning - http://mentalized.net
___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] AR Unit Tests

2006-02-10 Thread Lars Pind
I'm seeing the same on OS X. I just upgraded from MySQL 4.1 to 5.0  
(mysql-standard-5.0.18-osx10.4-powerpc), and ruby from 1.8.2 to 1.8.4  
(ruby 1.8.4 (2005-12-24) [powerpc-darwin8.4.0]) just to make sure  
that wasn't the cause. It wasn't.


This is the status:

701 tests, 2210 assertions, 3 failures, 27 errors

The ones I'm seeing are:

ActiveRecord::StatementInvalid: Mysql::Error: Table  
'activerecord_unittest.taggings' doesn't exist: DELETE FROM taggings

16 times


ActiveRecord::StatementInvalid: Mysql::Error: Table  
'activerecord_unittest.legacy_things' doesn't exist: DELETE FROM  
legacy_things

3 times

3 transaction tests failing:

20) Failure:
test_callback_rollback_in_save(TransactionTest) [./test/ 
transactions_test.rb:119]:

 is not true.

21) Failure:
test_failing_on_exception(TransactionTest) [./test/ 
transactions_test.rb:87]:

First shouldn't have been approved.
 is not true.

22) Failure:
test_successful_with_return(TransactionTest) [./test/ 
transactions_test.rb:49]:

 is not true.


and finally

ActiveRecord::RecordNotFound: Couldn't find Mixin with ID=1001
8 times.


I tried a little svn digging, and I had to go all the way back to  
December 1st 2005 to find a checkout that tested cleanly for me. Weird.


/Lars


On Feb 10, 2006, at 8:15 AM, Michael Koziarski wrote:

Yep, I have the dbs set up right, MySQL 5.1.0 with InnoDB enabled  
on a fresh
SuSE 10 box. Most of the tests pass, I'll tinker with it and see  
what's

happening.

Curious if anyone on the core team tests outside of OSX? (Meaning,  
are the
tests known to pass in a non-osx environment?) The reason I ask,  
is in

activesupport, there is an incompatibility with Linux when calling
STDERR.tell resulting in a failed test.


Jeremy and Nicholas have been seen running tests on linux, but I
personally only use mac os x and freebsd.If you can't track it
down, let me know,  I can probably dig up my old fedora core
installation.


--
Cheers

Koz
___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


RE: [Rails-core] AR Unit Tests

2006-02-10 Thread Bob Silva
Hi Lars,

Glad to see those errors, it's EXACTLY the same output I receive. If you run
tests again, all the taggings errors disappear though.

Bob Silva
http://www.railtie.net/

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:rails-core-
> [EMAIL PROTECTED] On Behalf Of Lars Pind
> Sent: Friday, February 10, 2006 7:14 AM
> To: rails-core@lists.rubyonrails.org
> Subject: Re: [Rails-core] AR Unit Tests
> 
> I'm seeing the same on OS X. I just upgraded from MySQL 4.1 to 5.0
> (mysql-standard-5.0.18-osx10.4-powerpc), and ruby from 1.8.2 to 1.8.4
> (ruby 1.8.4 (2005-12-24) [powerpc-darwin8.4.0]) just to make sure
> that wasn't the cause. It wasn't.
> 
> This is the status:
> 
> 701 tests, 2210 assertions, 3 failures, 27 errors
> 
> The ones I'm seeing are:
> 
> ActiveRecord::StatementInvalid: Mysql::Error: Table
> 'activerecord_unittest.taggings' doesn't exist: DELETE FROM taggings
> 16 times
> 
> 
> ActiveRecord::StatementInvalid: Mysql::Error: Table
> 'activerecord_unittest.legacy_things' doesn't exist: DELETE FROM
> legacy_things
> 3 times
> 
> 3 transaction tests failing:
> 
> 20) Failure:
> test_callback_rollback_in_save(TransactionTest) [./test/
> transactions_test.rb:119]:
>  is not true.
> 
> 21) Failure:
> test_failing_on_exception(TransactionTest) [./test/
> transactions_test.rb:87]:
> First shouldn't have been approved.
>  is not true.
> 
> 22) Failure:
> test_successful_with_return(TransactionTest) [./test/
> transactions_test.rb:49]:
>  is not true.
> 
> 
> and finally
> 
> ActiveRecord::RecordNotFound: Couldn't find Mixin with ID=1001
> 8 times.
> 
> 
> I tried a little svn digging, and I had to go all the way back to
> December 1st 2005 to find a checkout that tested cleanly for me. Weird.
> 
> /Lars
> 
> 
> On Feb 10, 2006, at 8:15 AM, Michael Koziarski wrote:
> 
> >> Yep, I have the dbs set up right, MySQL 5.1.0 with InnoDB enabled
> >> on a fresh
> >> SuSE 10 box. Most of the tests pass, I'll tinker with it and see
> >> what's
> >> happening.
> >>
> >> Curious if anyone on the core team tests outside of OSX? (Meaning,
> >> are the
> >> tests known to pass in a non-osx environment?) The reason I ask,
> >> is in
> >> activesupport, there is an incompatibility with Linux when calling
> >> STDERR.tell resulting in a failed test.
> >
> > Jeremy and Nicholas have been seen running tests on linux, but I
> > personally only use mac os x and freebsd.If you can't track it
> > down, let me know,  I can probably dig up my old fedora core
> > installation.
> >
> >
> > --
> > Cheers
> >
> > Koz
> > ___
> > Rails-core mailing list
> > Rails-core@lists.rubyonrails.org
> > http://lists.rubyonrails.org/mailman/listinfo/rails-core
> 
> ___
> Rails-core mailing list
> Rails-core@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-core

___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] [3795] render_component doesn't work with modules?

2006-02-10 Thread Trevor Squires

Hi Nathaniel,

I'm using a version of edge (not the most recent, but after module  
namespace support was improved) and I use render_component into a  
module namespace quite extensively with no problems.


I know you said you "nailed it down to having a '/' in the  
controller" but are you sure it's not simply the *leading* slash  
character that's giving you problems?


Regards,
Trevor

On 10-Feb-06, at 6:35 AM, Nathaniel S. H. Brown wrote:


Just nailed it down to having a "/" in the controller.

If you even trying:

render_component :controller => "/blog", :action => "list"

It will produce an error saying it cant find ::Blog

-Nb

~
 Nathaniel S. H. Brown   http://nshb.net
~



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Nathaniel S. H. Brown
Sent: February 10, 2006 6:09 AM
To: rails-core@lists.rubyonrails.org
Subject: [Rails-core] [3795] render_component doesn't work
with modules?

I just submitted a bug report for the render_component not
being able to properly find the modules.

I did a pretty detailed search, and wasn't able to find
anything in the tracker. Is this something you guys are
already aware of ?

http://dev.rubyonrails.org/ticket/3795

-Nb

~
 Nathaniel S. H. Brown   http://nshb.net
~

___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core



___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core




--
Trevor Squires
http://somethinglearned.com



___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] [3795] render_component doesn't work with modules?

2006-02-10 Thread Rick Olson
On 2/10/06, Trevor Squires <[EMAIL PROTECTED]> wrote:
> Hi Nathaniel,
>
> I'm using a version of edge (not the most recent, but after module
> namespace support was improved) and I use render_component into a
> module namespace quite extensively with no problems.
>
> I know you said you "nailed it down to having a '/' in the
> controller" but are you sure it's not simply the *leading* slash
> character that's giving you problems?
>
> Regards,
> Trevor

This might be related to changeset [3563]
(http://dev.rubyonrails.org/changeset/3563).  When I get some time
I'll dig into the issue if no one else has by then.

--
Rick Olson
http://techno-weenie.net
___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] [3795] render_component doesn't work with modules?

2006-02-10 Thread Trevor Squires

Rick,

I'm not sure that changeset is the issue.  As I said before, a  
*leading* slash will give you problems.


If you look at the stack trace (assuming I'm recreating Nathaniel's  
problem correctly) it says the error is thrown in Inflector#constantize.


That bit of code expressly *forbids* leading :: characters in the  
constant name being resolved and you can see it in action in the  
console simply by typing:


"/foo/bar".camelize.constantize

I'm not sure, but I don't recall a leading '/' in a render_component  
call *ever* working for me...


Regards,
Trevor

On 10-Feb-06, at 7:27 AM, Rick Olson wrote:


On 2/10/06, Trevor Squires <[EMAIL PROTECTED]> wrote:

Hi Nathaniel,

I'm using a version of edge (not the most recent, but after module
namespace support was improved) and I use render_component into a
module namespace quite extensively with no problems.

I know you said you "nailed it down to having a '/' in the
controller" but are you sure it's not simply the *leading* slash
character that's giving you problems?

Regards,
Trevor


This might be related to changeset [3563]
(http://dev.rubyonrails.org/changeset/3563).  When I get some time
I'll dig into the issue if no one else has by then.

--
Rick Olson
http://techno-weenie.net
___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


RE: [Rails-core] AR Unit Tests

2006-02-10 Thread Bob Silva
The problem with the taggings table is that aaa_create_tables isn't the
first test that is run (on linux at least).

On that note, is it the best design to have a test dependent on another
test? associations_join_model_test is dependent on aaa_create_tables running
before it.

Still working on resolving the rest of the errors.


Bob Silva
http://www.railtie.net/

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:rails-core-
> [EMAIL PROTECTED] On Behalf Of Bob Silva
> Sent: Friday, February 10, 2006 7:22 AM
> To: rails-core@lists.rubyonrails.org
> Subject: RE: [Rails-core] AR Unit Tests
> 
> Hi Lars,
> 
> Glad to see those errors, it's EXACTLY the same output I receive. If you
> run
> tests again, all the taggings errors disappear though.
> 
> Bob Silva
> http://www.railtie.net/
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:rails-core-
> > [EMAIL PROTECTED] On Behalf Of Lars Pind
> > Sent: Friday, February 10, 2006 7:14 AM
> > To: rails-core@lists.rubyonrails.org
> > Subject: Re: [Rails-core] AR Unit Tests
> >
> > I'm seeing the same on OS X. I just upgraded from MySQL 4.1 to 5.0
> > (mysql-standard-5.0.18-osx10.4-powerpc), and ruby from 1.8.2 to 1.8.4
> > (ruby 1.8.4 (2005-12-24) [powerpc-darwin8.4.0]) just to make sure
> > that wasn't the cause. It wasn't.
> >
> > This is the status:
> >
> > 701 tests, 2210 assertions, 3 failures, 27 errors
> >
> > The ones I'm seeing are:
> >
> > ActiveRecord::StatementInvalid: Mysql::Error: Table
> > 'activerecord_unittest.taggings' doesn't exist: DELETE FROM taggings
> > 16 times
> >
> >
> > ActiveRecord::StatementInvalid: Mysql::Error: Table
> > 'activerecord_unittest.legacy_things' doesn't exist: DELETE FROM
> > legacy_things
> > 3 times
> >
> > 3 transaction tests failing:
> >
> > 20) Failure:
> > test_callback_rollback_in_save(TransactionTest) [./test/
> > transactions_test.rb:119]:
> >  is not true.
> >
> > 21) Failure:
> > test_failing_on_exception(TransactionTest) [./test/
> > transactions_test.rb:87]:
> > First shouldn't have been approved.
> >  is not true.
> >
> > 22) Failure:
> > test_successful_with_return(TransactionTest) [./test/
> > transactions_test.rb:49]:
> >  is not true.
> >
> >
> > and finally
> >
> > ActiveRecord::RecordNotFound: Couldn't find Mixin with ID=1001
> > 8 times.
> >
> >
> > I tried a little svn digging, and I had to go all the way back to
> > December 1st 2005 to find a checkout that tested cleanly for me. Weird.
> >
> > /Lars
> >
> >
> > On Feb 10, 2006, at 8:15 AM, Michael Koziarski wrote:
> >
> > >> Yep, I have the dbs set up right, MySQL 5.1.0 with InnoDB enabled
> > >> on a fresh
> > >> SuSE 10 box. Most of the tests pass, I'll tinker with it and see
> > >> what's
> > >> happening.
> > >>
> > >> Curious if anyone on the core team tests outside of OSX? (Meaning,
> > >> are the
> > >> tests known to pass in a non-osx environment?) The reason I ask,
> > >> is in
> > >> activesupport, there is an incompatibility with Linux when calling
> > >> STDERR.tell resulting in a failed test.
> > >
> > > Jeremy and Nicholas have been seen running tests on linux, but I
> > > personally only use mac os x and freebsd.If you can't track it
> > > down, let me know,  I can probably dig up my old fedora core
> > > installation.
> > >
> > >
> > > --
> > > Cheers
> > >
> > > Koz
> > > ___
> > > Rails-core mailing list
> > > Rails-core@lists.rubyonrails.org
> > > http://lists.rubyonrails.org/mailman/listinfo/rails-core
> >
> > ___
> > Rails-core mailing list
> > Rails-core@lists.rubyonrails.org
> > http://lists.rubyonrails.org/mailman/listinfo/rails-core
> 
> ___
> Rails-core mailing list
> Rails-core@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-core

___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


RE: [Rails-core] AR Unit Tests

2006-02-10 Thread Bob Silva
Whew! Gotta find those debugging switches a little faster next time.

Wasn't able to track down why, but aaa_create_tables.rb tests weren't being
run first. In my case, instead of the file name determining the order of
things, the class name would determine the order. So I renamed the class to
AAACreateTablesTest and everything runs fine.

The other problem was that the mysql.sql had an invalid (my)SQL comment in
it. --Alter lock... In mysql, a '--' comment has to have at least one
whitespace character following it.

The patch is ticket #3798.

Now all tests run successfully.

Bob Silva
http://www.railtie.net/



> -Original Message-
> From: [EMAIL PROTECTED] [mailto:rails-core-
> [EMAIL PROTECTED] On Behalf Of Bob Silva
> Sent: Friday, February 10, 2006 9:01 AM
> To: rails-core@lists.rubyonrails.org
> Subject: RE: [Rails-core] AR Unit Tests
> 
> The problem with the taggings table is that aaa_create_tables isn't the
> first test that is run (on linux at least).
> 
> On that note, is it the best design to have a test dependent on another
> test? associations_join_model_test is dependent on aaa_create_tables
> running
> before it.
> 
> Still working on resolving the rest of the errors.
> 
> 
> Bob Silva
> http://www.railtie.net/
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:rails-core-
> > [EMAIL PROTECTED] On Behalf Of Bob Silva
> > Sent: Friday, February 10, 2006 7:22 AM
> > To: rails-core@lists.rubyonrails.org
> > Subject: RE: [Rails-core] AR Unit Tests
> >
> > Hi Lars,
> >
> > Glad to see those errors, it's EXACTLY the same output I receive. If you
> > run
> > tests again, all the taggings errors disappear though.
> >
> > Bob Silva
> > http://www.railtie.net/
> >
> > > -Original Message-
> > > From: [EMAIL PROTECTED] [mailto:rails-core-
> > > [EMAIL PROTECTED] On Behalf Of Lars Pind
> > > Sent: Friday, February 10, 2006 7:14 AM
> > > To: rails-core@lists.rubyonrails.org
> > > Subject: Re: [Rails-core] AR Unit Tests
> > >
> > > I'm seeing the same on OS X. I just upgraded from MySQL 4.1 to 5.0
> > > (mysql-standard-5.0.18-osx10.4-powerpc), and ruby from 1.8.2 to 1.8.4
> > > (ruby 1.8.4 (2005-12-24) [powerpc-darwin8.4.0]) just to make sure
> > > that wasn't the cause. It wasn't.
> > >
> > > This is the status:
> > >
> > > 701 tests, 2210 assertions, 3 failures, 27 errors
> > >
> > > The ones I'm seeing are:
> > >
> > > ActiveRecord::StatementInvalid: Mysql::Error: Table
> > > 'activerecord_unittest.taggings' doesn't exist: DELETE FROM taggings
> > > 16 times
> > >
> > >
> > > ActiveRecord::StatementInvalid: Mysql::Error: Table
> > > 'activerecord_unittest.legacy_things' doesn't exist: DELETE FROM
> > > legacy_things
> > > 3 times
> > >
> > > 3 transaction tests failing:
> > >
> > > 20) Failure:
> > > test_callback_rollback_in_save(TransactionTest) [./test/
> > > transactions_test.rb:119]:
> > >  is not true.
> > >
> > > 21) Failure:
> > > test_failing_on_exception(TransactionTest) [./test/
> > > transactions_test.rb:87]:
> > > First shouldn't have been approved.
> > >  is not true.
> > >
> > > 22) Failure:
> > > test_successful_with_return(TransactionTest) [./test/
> > > transactions_test.rb:49]:
> > >  is not true.
> > >
> > >
> > > and finally
> > >
> > > ActiveRecord::RecordNotFound: Couldn't find Mixin with ID=1001
> > > 8 times.
> > >
> > >
> > > I tried a little svn digging, and I had to go all the way back to
> > > December 1st 2005 to find a checkout that tested cleanly for me.
> Weird.
> > >
> > > /Lars
> > >
> > >
> > > On Feb 10, 2006, at 8:15 AM, Michael Koziarski wrote:
> > >
> > > >> Yep, I have the dbs set up right, MySQL 5.1.0 with InnoDB enabled
> > > >> on a fresh
> > > >> SuSE 10 box. Most of the tests pass, I'll tinker with it and see
> > > >> what's
> > > >> happening.
> > > >>
> > > >> Curious if anyone on the core team tests outside of OSX? (Meaning,
> > > >> are the
> > > >> tests known to pass in a non-osx environment?) The reason I ask,
> > > >> is in
> > > >> activesupport, there is an incompatibility with Linux when calling
> > > >> STDERR.tell resulting in a failed test.
> > > >
> > > > Jeremy and Nicholas have been seen running tests on linux, but I
> > > > personally only use mac os x and freebsd.If you can't track it
> > > > down, let me know,  I can probably dig up my old fedora core
> > > > installation.
> > > >
> > > >
> > > > --
> > > > Cheers
> > > >
> > > > Koz
> > > > ___
> > > > Rails-core mailing list
> > > > Rails-core@lists.rubyonrails.org
> > > > http://lists.rubyonrails.org/mailman/listinfo/rails-core
> > >
> > > ___
> > > Rails-core mailing list
> > > Rails-core@lists.rubyonrails.org
> > > http://lists.rubyonrails.org/mailman/listinfo/rails-core
> >
> > ___
> > Rails-core mailing list
> > Rails-core@lists.rubyonrails.org
> > http://lists.rubyonrails.org/mailman/listinfo/rails-core
> 
> _

[Rails-core] Sybase adapter association dates

2006-02-10 Thread John Sheets
I'm trying to clean up my Sybase adapter patch
(http://dev.rubyonrails.org/ticket/3765) and I keep tripping over a
puzzling hurdle.  I can get all the unit tests to pass in stable and (with
a few minor tweaks) in trunk, but in both cases I have to special-case the
date assert in associations_test.rb for the following methods:

  test_additional_columns_from_join_table
  test_habtm_adding_before_save_with_join_attributes
  test_rich_association

In each case, the joined_on field comes back as a String, not a Date.  Can
anyone give me a hint what might be causing this?  I'd really like to
remove the special-casing if I can.

Thanks,
John


___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] XSS prevention with Rails

2006-02-10 Thread Dave Teare
Has there been any progress on this?  I have an OWASP compliance review
@ my day job and would like something like this to point to.

Thanks!

On Monday, January 09, 2006, at 8:56 PM, Florian Weber wrote:
>> Have a look at TextHelper#sanitize and go from there.
>> http://ha.ckers.org/xss.html has a good list of things to guard for.
>> It would be cool to turn that site into a test case and work until we
>> pass 'em all.
>
>Yep, that's exactly what I had in mind too =)
>___
>Rails-core mailing list
>Rails-core@lists.rubyonrails.org
>http://lists.rubyonrails.org/mailman/listinfo/rails-core


Cheers!
--Dave.


-- 
Posted with http://DevLists.com.  Sign up and save your time!
___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] Be a hero: Convert Active Record fixtures to schema.rb

2006-02-10 Thread Michael Schoen

Is this possible for systems (like Oracle) that don't have schema dump
support yet?
..or did I miss some breaking news somewhere?


I believe Oracle supports all the migrations methods now. If I've missed 
something please let me know.


___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] anyone in a committing mood?

2006-02-10 Thread Michael Schoen

I punted on the oracle patches.  But 3611 is in now.  Sorry for the
delay in getting back to you.


Thanks for that. Can somebody handle the Oracle patches? They're all 
fairly trivial. #3210 will likely get another pass, as the current patch 
works for some folks, doesn't help for others.


If it would help I can bundle them all up into a single patch, just let 
me know.


___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] anyone in a committing mood?

2006-02-10 Thread David Heinemeier Hansson
> If it would help I can bundle them all up into a single patch, just let
> me know.

It would. Please do roll them all up into 1 patch and get a few
Oracle'ers to try that out. If you could get them to comment on this
new ticket with "+1 works for me", then that'd be great. Thanks!
--
David Heinemeier Hansson
http://www.loudthinking.com -- Broadcasting Brain
http://www.basecamphq.com   -- Online project management
http://www.backpackit.com   -- Personal information manager
http://www.rubyonrails.com  -- Web-application framework
___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] anyone in a committing mood?

2006-02-10 Thread Derrick Spell
On Feb 10, 2006, at 2:49 PM, David Heinemeier Hansson wrote:If it would help I can bundle them all up into a single patch, just letme know. It would. Please do roll them all up into 1 patch and get a fewOracle'ers to try that out. If you could get them to comment on thisnew ticket with "+1 works for me", then that'd be great. Thanks!--Would a similar approach be helpful for the new OpenBase adapter (ticket #3538)?  I'm guessing it hasn't even been looked at because of the overhead in getting your system ready to test it...install new bindings...install openbase...I haven't yet looked into making this a plugin so that it can be tested with ease.  Is such a plugin possible?  If so, can someone point me to some docs to get me started on making one? Derrick Spell Webmaster / Programmer Suran Systems, Inc.  ___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] Be a hero: Convert Active Record fixtures to schema.rb

2006-02-10 Thread Wilson Bilkovich
On 2/10/06, Michael Schoen <[EMAIL PROTECTED]> wrote:
> > Is this possible for systems (like Oracle) that don't have schema dump
> > support yet?
> > ..or did I miss some breaking news somewhere?
>
> I believe Oracle supports all the migrations methods now. If I've missed
> something please let me know.
>

Perhaps I'm just misunderstanding how this works.
I have this in environment.rb:
config.active_record.schema_format = :ruby

..and "rake db_schema_dump" produces a schema.rb file that contains only this:
ActiveRecord::Schema.define(:version => 10) do

end

The migrations themselves work fine, though.. this project was built
without any manual table creation.

Oh wait, I just figured it out.  It's because the application logs in
as a user that gets to the tables via synonyms.  I changed it to log
in as the DBA, and now it can (mostly) dump the schema.
I do get this error, though, right at the end:
# Could not dump table "spending_plans" because of following StandardError
# Unknown type 'LONG' for column 'comment_text'

Has that been changed since I did this setup?  I remember looking at
the schema definition code for Oracle in trunk, and wondering what
LONG was all about.

Is there a way to make the schema dumper aware of synonyms?

Thanks,
--Wilson.
___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] anyone in a committing mood?

2006-02-10 Thread David Heinemeier Hansson
> Would a similar approach be helpful for the new OpenBase adapter (ticket
> #3538)?  I'm guessing it hasn't even been looked at because of the overhead
> in getting your system ready to test it...install new bindings...install
> openbase...

That'd be a great idea. It definitely helps us with confidence about
whether to apply a ticket or not if we have a number of people who've
been trying it out and getting it all working.

> I haven't yet looked into making this a plugin so that it can be tested with
> ease.  Is such a plugin possible?  If so, can someone point me to some docs
> to get me started on making one?

Have a look at the source in
http://dev.rubyonrails.org/browser/plugins, a bunch of examples there.
--
David Heinemeier Hansson
http://www.loudthinking.com -- Broadcasting Brain
http://www.basecamphq.com   -- Online project management
http://www.backpackit.com   -- Personal information manager
http://www.rubyonrails.com  -- Web-application framework
___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] AR Unit Tests

2006-02-10 Thread Michael Koziarski
On 2/11/06, Bob Silva <[EMAIL PROTECTED]> wrote:
> Whew! Gotta find those debugging switches a little faster next time.
>
> Wasn't able to track down why, but aaa_create_tables.rb tests weren't being
> run first. In my case, instead of the file name determining the order of
> things, the class name would determine the order. So I renamed the class to
> AAACreateTablesTest and everything runs fine.

Thanks for that, it's been ... somewhat annoying lately, I'm glad you
tracked it down.

> The other problem was that the mysql.sql had an invalid (my)SQL comment in
> it. --Alter lock... In mysql, a '--' comment has to have at least one
> whitespace character following it.
>
> The patch is ticket #3798.

Looks good, the two patches both add the drop table readers for mysql,
but that's no big deal.

> Now all tests run successfully.

I'll verify, and apply today

> Bob Silva
> http://www.railtie.net/
>
>
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:rails-core-
> > [EMAIL PROTECTED] On Behalf Of Bob Silva
> > Sent: Friday, February 10, 2006 9:01 AM
> > To: rails-core@lists.rubyonrails.org
> > Subject: RE: [Rails-core] AR Unit Tests
> >
> > The problem with the taggings table is that aaa_create_tables isn't the
> > first test that is run (on linux at least).
> >
> > On that note, is it the best design to have a test dependent on another
> > test? associations_join_model_test is dependent on aaa_create_tables
> > running
> > before it.
> >
> > Still working on resolving the rest of the errors.
> >
> >
> > Bob Silva
> > http://www.railtie.net/
> >
> > > -Original Message-
> > > From: [EMAIL PROTECTED] [mailto:rails-core-
> > > [EMAIL PROTECTED] On Behalf Of Bob Silva
> > > Sent: Friday, February 10, 2006 7:22 AM
> > > To: rails-core@lists.rubyonrails.org
> > > Subject: RE: [Rails-core] AR Unit Tests
> > >
> > > Hi Lars,
> > >
> > > Glad to see those errors, it's EXACTLY the same output I receive. If you
> > > run
> > > tests again, all the taggings errors disappear though.
> > >
> > > Bob Silva
> > > http://www.railtie.net/
> > >
> > > > -Original Message-
> > > > From: [EMAIL PROTECTED] [mailto:rails-core-
> > > > [EMAIL PROTECTED] On Behalf Of Lars Pind
> > > > Sent: Friday, February 10, 2006 7:14 AM
> > > > To: rails-core@lists.rubyonrails.org
> > > > Subject: Re: [Rails-core] AR Unit Tests
> > > >
> > > > I'm seeing the same on OS X. I just upgraded from MySQL 4.1 to 5.0
> > > > (mysql-standard-5.0.18-osx10.4-powerpc), and ruby from 1.8.2 to 1.8.4
> > > > (ruby 1.8.4 (2005-12-24) [powerpc-darwin8.4.0]) just to make sure
> > > > that wasn't the cause. It wasn't.
> > > >
> > > > This is the status:
> > > >
> > > > 701 tests, 2210 assertions, 3 failures, 27 errors
> > > >
> > > > The ones I'm seeing are:
> > > >
> > > > ActiveRecord::StatementInvalid: Mysql::Error: Table
> > > > 'activerecord_unittest.taggings' doesn't exist: DELETE FROM taggings
> > > > 16 times
> > > >
> > > >
> > > > ActiveRecord::StatementInvalid: Mysql::Error: Table
> > > > 'activerecord_unittest.legacy_things' doesn't exist: DELETE FROM
> > > > legacy_things
> > > > 3 times
> > > >
> > > > 3 transaction tests failing:
> > > >
> > > > 20) Failure:
> > > > test_callback_rollback_in_save(TransactionTest) [./test/
> > > > transactions_test.rb:119]:
> > > >  is not true.
> > > >
> > > > 21) Failure:
> > > > test_failing_on_exception(TransactionTest) [./test/
> > > > transactions_test.rb:87]:
> > > > First shouldn't have been approved.
> > > >  is not true.
> > > >
> > > > 22) Failure:
> > > > test_successful_with_return(TransactionTest) [./test/
> > > > transactions_test.rb:49]:
> > > >  is not true.
> > > >
> > > >
> > > > and finally
> > > >
> > > > ActiveRecord::RecordNotFound: Couldn't find Mixin with ID=1001
> > > > 8 times.
> > > >
> > > >
> > > > I tried a little svn digging, and I had to go all the way back to
> > > > December 1st 2005 to find a checkout that tested cleanly for me.
> > Weird.
> > > >
> > > > /Lars
> > > >
> > > >
> > > > On Feb 10, 2006, at 8:15 AM, Michael Koziarski wrote:
> > > >
> > > > >> Yep, I have the dbs set up right, MySQL 5.1.0 with InnoDB enabled
> > > > >> on a fresh
> > > > >> SuSE 10 box. Most of the tests pass, I'll tinker with it and see
> > > > >> what's
> > > > >> happening.
> > > > >>
> > > > >> Curious if anyone on the core team tests outside of OSX? (Meaning,
> > > > >> are the
> > > > >> tests known to pass in a non-osx environment?) The reason I ask,
> > > > >> is in
> > > > >> activesupport, there is an incompatibility with Linux when calling
> > > > >> STDERR.tell resulting in a failed test.
> > > > >
> > > > > Jeremy and Nicholas have been seen running tests on linux, but I
> > > > > personally only use mac os x and freebsd.If you can't track it
> > > > > down, let me know,  I can probably dig up my old fedora core
> > > > > installation.
> > > > >
> > > > >
> > > > > --
> > > > > Cheers
> > > > >
> > > > > Koz
> > > > > __

[Rails-core] Quoting table and column names inside AR

2006-02-10 Thread Bob Silva








There are quite a few tickets asking for quoted table names
and field names to enable reserved words as table or column names.

What is the general consensus regarding this issue? 

 

 

Bob Silva

http://www.railtie.net/

 






___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] Quoting table and column names inside AR

2006-02-10 Thread Wilson Bilkovich
On 2/10/06, Bob Silva <[EMAIL PROTECTED]> wrote:
>
> There are quite a few tickets asking for quoted table names and field names
> to enable reserved words as table or column names.
>
> What is the general consensus regarding this issue?
>

Is there a downside, other than the effort of making the changes?
I've had the lack of quoting cause me to change column names in the
past, so I wouldn't mind assisting.
___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


RE: [Rails-core] Quoting table and column names inside AR

2006-02-10 Thread Bob Silva
I've learned to just not use reserved names in my models, but since the
databases allow quoting of names to get around this limitation, I don't see
why Rails shouldn't allow for it as well. The question is in implementation.
I would think an AR configuration variable would be best since there is a
small performance penalty involved with it. Those that need to support
legacy databases or choose to use reserved names can take the hit and leave
the others unaffected. Before I invest any time into it, I would like to
know what the core members thoughts on it are.

While you're giving thought to that, what are your thoughts on renaming the
quote method inside of AR:B? Quite a few tickets come through for that as
well.


Bob Silva
http://www.railtie.net/

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:rails-core-
> [EMAIL PROTECTED] On Behalf Of Wilson Bilkovich
> Sent: Friday, February 10, 2006 2:11 PM
> To: rails-core@lists.rubyonrails.org
> Subject: Re: [Rails-core] Quoting table and column names inside AR
> 
> On 2/10/06, Bob Silva <[EMAIL PROTECTED]> wrote:
> >
> > There are quite a few tickets asking for quoted table names and field
> names
> > to enable reserved words as table or column names.
> >
> > What is the general consensus regarding this issue?
> >
> 
> Is there a downside, other than the effort of making the changes?
> I've had the lack of quoting cause me to change column names in the
> past, so I wouldn't mind assisting.
> ___
> Rails-core mailing list
> Rails-core@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-core

___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] Be a hero: Convert Active Record fixtures to schema.rb

2006-02-10 Thread Michael Schoen

Is there a way to make the schema dumper aware of synonyms?


Should be, I'll take a look at that.
___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


[Rails-core] Date Helper Mega Patch

2006-02-10 Thread Bob Silva
Hi guys,

I'm going to start work on a mega-patch to close the following tickets:

1260
1050
847
1427
2089
2655
2998
2833
1382
363
1782
and a new one that's only 6 hours old: 3800


They all have to do with the Date Helper.

* Support index and/or @auto_index
* Enable discard year
* time_select (alias to datetime_select with previous patch applied)
* Unique id's as per w3c spec
* :order for datetime_select to mimic date_select :order option
* add :include_seconds to datetime_select, select_datetime and time_select


Opinions, ideas or objections so I don't have anything in the patch which is
likely to get it shot down.

Thanks

Bob Silva
http://www.railtie.net/


___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] Date Helper Mega Patch

2006-02-10 Thread Michael Koziarski
> They all have to do with the Date Helper.
>
> * Support index and/or @auto_index
> * Enable discard year
> * time_select (alias to datetime_select with previous patch applied)
> * Unique id's as per w3c spec
> * :order for datetime_select to mimic date_select :order option
> * add :include_seconds to datetime_select, select_datetime and time_select
>
>
> Opinions, ideas or objections so I don't have anything in the patch which is
> likely to get it shot down.

I like the idea and have no objections.   However,  what will
time_select 'select'?   Ruby 'times' have a date component:

irb(main):002:0> Time.now
=> Sat Feb 11 15:29:17 NZDT 2006


> Thanks
>
> Bob Silva
> http://www.railtie.net/
>
>
> ___
> Rails-core mailing list
> Rails-core@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-core
>


--
Cheers

Koz
___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


Re: [Rails-core] Quoting table and column names inside AR

2006-02-10 Thread Michael Koziarski
> While you're giving thought to that, what are your thoughts on renaming the
> quote method inside of AR:B? Quite a few tickets come through for that as
> well.

Unfortunately we have a lot of people calling the quote method from
plugins, custom code etc.  We can't rename it without breaking
backwards compatibility, which means we can't do it until 2.0.

One option would be to mark it as deprecated in the docs and create a
method with the new name.


--
Cheers

Koz
___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


RE: [Rails-core] [3795] render_component doesn't work with modules?

2006-02-10 Thread Nathaniel S. H. Brown
I originally tried the render_component 'admin/blog', when viewing a page
within the 'admin/someothercontroller', and had the same issue. When I did
further tests, I found that both 'admin/blog' and '/admin/blog' replicated
the same error abut the inflector.

I haven't tried with edge, but was planning on later on this weekend as I
want to get RJS rolling.

Also, David, I just read on your archives, that you like to stick to the
"Release often" mantra. Any idea when 1.1 is coming? :) Would be great to
get the RJS templates by default.

-Nb

~
 Nathaniel S. H. Brown   http://nshb.net 
~
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf 
> Of Trevor Squires
> Sent: February 10, 2006 8:32 AM
> To: rails-core@lists.rubyonrails.org
> Subject: Re: [Rails-core] [3795] render_component doesn't 
> work with modules?
> 
> Rick,
> 
> I'm not sure that changeset is the issue.  As I said before, a
> *leading* slash will give you problems.
> 
> If you look at the stack trace (assuming I'm recreating 
> Nathaniel's problem correctly) it says the error is thrown in 
> Inflector#constantize.
> 
> That bit of code expressly *forbids* leading :: characters in 
> the constant name being resolved and you can see it in action 
> in the console simply by typing:
> 
> "/foo/bar".camelize.constantize
> 
> I'm not sure, but I don't recall a leading '/' in a 
> render_component call *ever* working for me...
> 
> Regards,
> Trevor
> 
> On 10-Feb-06, at 7:27 AM, Rick Olson wrote:
> 
> > On 2/10/06, Trevor Squires <[EMAIL PROTECTED]> wrote:
> >> Hi Nathaniel,
> >>
> >> I'm using a version of edge (not the most recent, but after module 
> >> namespace support was improved) and I use render_component into a 
> >> module namespace quite extensively with no problems.
> >>
> >> I know you said you "nailed it down to having a '/' in the 
> >> controller" but are you sure it's not simply the *leading* slash 
> >> character that's giving you problems?
> >>
> >> Regards,
> >> Trevor
> >
> > This might be related to changeset [3563] 
> > (http://dev.rubyonrails.org/changeset/3563).  When I get some time 
> > I'll dig into the issue if no one else has by then.
> >
> > --
> > Rick Olson
> > http://techno-weenie.net
> > ___
> > Rails-core mailing list
> > Rails-core@lists.rubyonrails.org
> > http://lists.rubyonrails.org/mailman/listinfo/rails-core
> 
> ___
> Rails-core mailing list
> Rails-core@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-core
> 

___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core


[Rails-core] Re: Auto-generated find queries adding bogus WHERE clauses

2006-02-10 Thread Matthew Palmer
[Please respect MFT to rails-core; I think most of the discussion of this,
if any, will be more topical there]

On Fri, Feb 10, 2006 at 01:33:32PM +1100, Matthew Palmer wrote:
> class Collection << ActiveRecord::Base
>   def findpkg
> self.repositories.each do |r|
>   p = r.packages.find(:all, :conditions => "name like '%pkg%'")
> end
>   end
> end

The bug is that HasManyAssociation#find modifies it's arguments, so the
above (slightly fictionalised) variant is misleading; the real code is:

def findpkg(*args)
  self.repositories.each do |r|
p = r.packages.find(*args)
# Do things with p
  end
end

Adding "puts args.inspect" before and after the call to find() shows that
args is in fact being modified, by the fact that the options object is the
same as args[1] on the entry to HasManyAssociation#find.  This simple patch
makes the whole problem go away:

--8<--
--- has_many_association.rb 2006-02-10 16:37:32.0 +1100
+++ has_many_association.rb.orig2006-02-10 16:37:21.0 +1100
@@ -51,7 +51,7 @@
   end
 
   def find(*args)
-options = Base.send(:extract_options_from_args!, args).dup
+options = Base.send(:extract_options_from_args!, args)
 
 # If using a custom finder_sql, scan the entire collection.
 if @options[:finder_sql]
-->8--

I'm planning on reporting this in Trac, but I'm curious about people's
opinions -- is it reasonable to assume that arguments which appear, on the
surface, to be read-only may be modified by called methods?

- Matt
___
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core