Commit Graph

5554 Commits

Author SHA1 Message Date
Santiago Pastorino
dad7fdc573 Rails::Plugin has gone 2012-01-03 10:39:08 -02:00
Sergey Nartimov
0f2f8003d2 remove ActiveSupport::Base64 in favor of ::Base64 2012-01-02 22:48:15 +03:00
Vijay Dev
f3e079e8b5 Merge pull request #4248 from andrew/2012
Updated copyright notices for 2012
2011-12-31 12:48:19 -08:00
Andrew Nesbitt
1b413510fe Updated copyright notices for 2012 2011-12-31 20:30:08 +00:00
Aaron Patterson
641b43e865 updating the reaping frequency documentation 2011-12-30 16:14:25 -08:00
Aaron Patterson
59f2696d00 rename start to run and use Thread.pass rather than sleeping to schedule the watchdog 2011-12-30 16:10:53 -08:00
Aaron Patterson
405aeb5da4 connection pool starts the reaper 2011-12-30 15:39:39 -08:00
Aaron Patterson
ddde548816 connection specification will deep copy the config 2011-12-30 15:35:21 -08:00
Aaron Patterson
41c24eb3e3 each connection pool has a reaper 2011-12-30 15:27:41 -08:00
Aaron Patterson
cde7692d4e introduce a timer class for reaping connections 2011-12-30 15:19:07 -08:00
Aaron Patterson
cceabe03a8 raise a pull full error when the connection pool is full and no connection can be obtained 2011-12-30 14:56:26 -08:00
Aaron Patterson
b1ac881433 connections are only removed if they are inactve 2011-12-30 14:31:30 -08:00
Aaron Patterson
86729eb733 connections can be reaped via the reap method 2011-12-30 14:26:29 -08:00
Aaron Patterson
e060cf01a5 deal with removing connections associated with the current thread 2011-12-30 14:14:13 -08:00
Aaron Patterson
17ff88c4d4 connections can be removed from the pool 2011-12-30 14:09:39 -08:00
Aaron Patterson
bf9e6c7c9b queue and signal no longer needed 2011-12-30 13:49:31 -08:00
Aaron Patterson
5dc7257b7a refactor checking out the connection 2011-12-30 13:47:10 -08:00
Aaron Patterson
df9de6fc6c infinite loop is no longer necessary 2011-12-30 11:45:34 -08:00
Aaron Patterson
6769293988 connections must be checked in at the end of a thread 2011-12-30 11:37:21 -08:00
Alexey Muranov
b52d9d0ff5 Fixes for TestFixtures::setup_fixture_accessors
Renamed "fixture_name" to "accessor_name" and made fixture names in the form "admin/users" be used as the key for the hashes @fixture_cache and @loaded_fixtures.

Previously the variable "fixture_name" here was getting a value of the form "admin_user", and this value was then used as the hash key.
2011-12-30 10:34:02 +01:00
Alexey Muranov
7162ea2a0c Fixture's table name be defined in the model
Made the fixture's table name be taken from its model class whenever this class responds to table_name, instead of inferring it sometimes from the fixture's pass.

The previous behavior seemed buggy because it depended on whether the model class was passed as a constant or as a name string.

Improved Fixtures#initialize.
2011-12-30 10:34:02 +01:00
Alexey Muranov
e0ef093619 Use foo/bar instead of foo_bar keys for fixtures
This solves an issue with set_fixture_class class method caused by create_fixtures method's overwriting passed to it fixture model classes, when the fixtures are "namespased": foo/bar or admin/users.

The idea is to use "foo/bar" string as the name and identifier of a
fixture file bar in directory foo.  The model class of the fixture is either set with set_fixture_class method, or otherwise inferred from its name using camelize method.

Also a bug is fixed in lines 487-489 when the table names were guessed by substitution from the fixture file names, ambiguously called  table_names, instead of being taken from fixture attributes.  Now they are taken from attributes.

I plan to submit another fix so that the fixture's table name (for
example foo_bar) be defined by the fixture's model whenever possible,
instead of inferring it from the fixture's name ("foo/bar").
2011-12-30 10:34:01 +01:00
Vijay Dev
04d308a03b Merge branch 'master' of github.com:lifo/docrails 2011-12-29 23:35:45 +05:30
Jon Leighton
c99d507fcc Deprecate implicit eager loading. Closes #950. 2011-12-29 14:27:33 +00:00
Aaron Patterson
780a222dc2 Merge pull request #4216 from edgecase/master_fix_reorder_with_limited_ids
allow reorder to affect eager loading correctly
2011-12-28 17:03:37 -08:00
Xavier Noria
e99987bc30 app code in general wants Time.current, not Time.now 2011-12-28 23:47:10 +01:00
Aaron Patterson
0b61e3f86a Merge pull request #4222 from amatsuda/ar_predicate_builder_refactor
refactor AR::PredicateBuilder.build_from_hash
2011-12-28 11:42:29 -08:00
Jon Leighton
88d2af5be4 Delete some stray lines 2011-12-28 18:44:15 +00:00
Akira Matsuda
612d671e99 refactor AR::PredicateBuilder.build_from_hash 2011-12-29 03:35:24 +09:00
Jon Leighton
6e5b98e910 Avoid deprecation warning 2011-12-28 18:27:41 +00:00
Jon Leighton
dae7b65453 Support establishing connection on ActiveRecord::Model.
This is the 'top level' connection, inherited by any models that include
ActiveRecord::Model or inherit from ActiveRecord::Base.
2011-12-28 18:27:41 +00:00
Jon Leighton
93c1f11c0a Support configuration on ActiveRecord::Model.
The problem: We need to be able to specify configuration in a way that
can be inherited to models that include ActiveRecord::Model. So it is
no longer sufficient to put 'top level' config on ActiveRecord::Base,
but we do want configuration specified on ActiveRecord::Base and
descendants to continue to work.

So we need something like class_attribute that can be defined on a
module but that is inherited when ActiveRecord::Model is included.

The solution: added ActiveModel::Configuration module which provides a
config_attribute macro. It's a bit specific hence I am not putting this
in Active Support or making it a 'public API' at present.
2011-12-28 18:27:41 +00:00
Jon Leighton
16381289c6 Merge pull request #4213 from amatsuda/ar_where_array_of_nil_and_a_value
AR#where with an Array of 2 elements including a nil
2011-12-28 07:50:25 -08:00
Matt Jones + Scott Walker
18fb2d4c02 allow reorder to affect eager loading correctly 2011-12-28 09:53:13 -05:00
Jo Liss
b92a22e6eb typo 2011-12-28 15:29:36 +01:00
Jon Leighton
4af5252d36 Merge pull request #4153 from alexeymuranov/my_fix_for_prefix_suffix_fixtures_test
Fix a fixtures test case with table prefix/suffix
2011-12-28 03:35:12 -08:00
Alexey Muranov
64f106dfd1 Use the correct table name from fixture
Fixed a bug in fixtures.rb where the table name was incorrectly inferred from the fixture path which was ambiguously called "table_name" but was also used as the fixture name.
Now, the "correct" table name is taken from an instance variable.
2011-12-28 11:58:07 +01:00
Akira Matsuda
1877cf9b2a where(foo: [1, nil]) becomes "WHERE foo = 1 OR foo IS NULL"
was "WHERE foo IN (1) OR foo IS NULL" before
2011-12-28 15:32:56 +09:00
Akira Matsuda
c8711e4ecd no need to compact an already compacted Array 2011-12-28 15:00:27 +09:00
Jo Liss
dd72235225 Document that index names are made up of all columns, not just the first.
index_name has been using the following expression

    "index_#{table_name}_on_#{Array.wrap(options[:column]) * '_and_'}"

since at least 2006 (bc7f2315), and that's how they come out in my DB.

Please check that this is correct before merging into master, perhaps
I'm misunderstanding the section I changed.
2011-12-27 13:18:34 +01:00
Arun Agrawal
29b5e5f665 Revert "This conditions is required to work with database create task. 1.9.2 is having a bug with "Calling return within begin still executes else". "
No need to worry about 1.9.2 with master
This reverts commit fbf4bee6ed3682b361d6fbeca8e185e665e26b81.
2011-12-27 15:55:45 +05:30
Uģis Ozols
acab767c9d Remove unnecessary comma. 2011-12-26 21:44:50 +02:00
Vijay Dev
54e522a388 Merge branch 'master' of github.com:lifo/docrails 2011-12-25 19:33:33 +05:30
Uģis Ozols
2d1cbd02b4 Clarify what persisted? returns. 2011-12-25 15:41:50 +02:00
Uģis Ozols
e4a1868bec Remove extra 'be'. 2011-12-25 15:28:25 +02:00
Sergey Nartimov
1e9e88fcd3 remove checks for encodings availability 2011-12-25 14:34:58 +03:00
Jon Leighton
deb91690ae Intercept sends in Model::DeprecationProxy 2011-12-24 14:48:44 +00:00
Sergey Nartimov
5ca86ac8f9 deprecate String#encoding_aware? and remove its usage 2011-12-24 15:57:54 +03:00
Jon Leighton
a5fa310f40 Fix position of load hook so that Base has been defined and included Model before it runs 2011-12-24 12:30:17 +00:00
Jon Leighton
00318e9bdf Add some doc for ActiveRecord::Model 2011-12-24 11:28:03 +00:00