Aaron Patterson
42be67e8d4
unfactoring clear_stale_cached_connections!
2010-07-16 14:48:50 -07:00
Aaron Patterson
04ef434b21
only test for existence of +pool+ once
2010-07-16 11:44:29 -07:00
Aaron Patterson
b952470cc2
use an attr_reader for performance
2010-07-16 11:44:29 -07:00
David Genord II
1fcf4e8ecb
JoinDependency#graft does not properly set parent join [ #5124 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2010-07-16 08:28:49 +01:00
Pratik Naik
0c2c893434
Revert "Style fixes"
...
This reverts commit 3c300b3121 .
2010-07-15 13:17:35 +01:00
Aaron Patterson
62dd1d8d23
clean up ||= with an initialized variable and attr_reader
2010-07-14 17:53:20 -07:00
wycats
3c300b3121
Style fixes
2010-07-14 17:33:07 -07:00
Aaron Patterson
955b26ac6e
primary_key_name already checks for the model_class
2010-07-14 17:11:52 -07:00
Aaron Patterson
d41a28bcca
use array intersection for dry / faster code
2010-07-14 17:09:14 -07:00
Aaron Patterson
6a534455f6
remove useless ternary in PostgreSQL adapter
2010-07-14 15:44:15 -07:00
Aaron Patterson
8ba14c238e
PostgreSQLAdapter#query string interpolation calls to_s for us
2010-07-14 15:18:48 -07:00
Aaron Patterson
51c9b666e6
PostgreSQLAdapter#query bail early if there is no column and dry up our conditionals
2010-07-14 15:10:45 -07:00
Aaron Patterson
36150c902b
Let's initialize instance variables in the postgres adapter.
2010-07-14 15:04:14 -07:00
Pratik Naik
d5921cdb7a
Remove unintentional API changes. [ #1108 ]
2010-07-14 18:32:28 +01:00
Pratik Naik
4a06489525
Style fixes
2010-07-14 16:50:26 +01:00
Xavier Noria
b7944e1b21
revises the rdoc of update_attributes and update_attributes! to document they are wrapped in a transaction, and adds code comments explaining why
2010-07-14 17:42:57 +02:00
Jacob Lewallen
d10ecfefb8
Set destroyed=true in opt locking's destroy [ #5058 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-07-14 08:02:17 +02:00
Neeraj Singh
edb5401039
count method should not take options if it is operated on has_many association which has finder_sql or counter_sql
...
[#2395 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-07-13 22:03:35 +02:00
Neeraj Singh
f4fbc2c1f9
update_attributes and update_attributes! are now wrapped in a transaction
...
[#922 state:resovled]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-07-13 22:02:00 +02:00
Aaron Patterson
e35e6171bb
reducing range comparisons when converting types to sql
2010-07-13 11:56:00 -07:00
Aaron Patterson
35e304193b
only loop through all rows and columns once in the postgres adapter
2010-07-13 10:57:22 -07:00
Aaron Patterson
bc35631dc7
use constants instead of magic numbers. meow
2010-07-13 10:57:22 -07:00
Xavier Noria
6d2e4ee96c
Merge remote branch 'docrails/master'
2010-07-13 18:41:09 +02:00
Benjamin Quorning
7e075e6247
Fixed many references to the old config/environment.rb and Rails::Initializer
2010-07-13 13:00:21 +02:00
Vitalii Khustochka
b75fca9e57
Added reorder delegation for ActiveRecord::Base(to be able to overwrite the default_scope ordering in the named scope [ #5093 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-07-13 08:31:55 +02:00
Will St. Clair + Neeraj Singh
b520d602ff
string IDs are now quoted correctly [ #5064 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-07-13 08:14:52 +02:00
Mislav Marohnić
571cb1ddc6
enable AS::JSON.encode to encode AR::Relation by providing as_json method
...
[#5073 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-07-13 08:09:28 +02:00
José Valim
3401311562
Tidying up a bit, so update_attribute is not called twice on touch.
2010-07-13 08:05:09 +02:00
Neeraj Singh
1d45ea0814
with this fix touch method - does not call validations - doest not call callbacks - updates updated_at/on along with attribute if attribute is provided - marks udpated_at/on and attribute as NOT changed
...
[#2520 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-07-13 07:03:42 +02:00
Aaron Patterson
2aed63eb52
our method is modifying the original array, so refactor to use destructive methods
2010-07-12 17:58:48 -07:00
Aaron Patterson
2c3aab32dd
PostgreSQLAdapter#select_raw removing dead code
2010-07-12 17:52:53 -07:00
Aaron Patterson
79e9f4a318
PostgreSQLAdapter#select_raw use each_with_index to avoid multiple array lookups
2010-07-12 17:49:12 -07:00
Aaron Patterson
8521cdf03d
PostgreSQLAdapter#select_raw fields and results are empty even if ntuples is 0
2010-07-12 17:44:15 -07:00
Aaron Patterson
c9710a43ff
refactor PostgreSQLAdapter#result_as_array to create fewer Range objects
2010-07-12 17:00:29 -07:00
Aaron Patterson
7c4e0401d2
cleaning up PostgreSQLAdapter#select
2010-07-12 16:54:00 -07:00
Aaron Patterson
cee2ff2768
these strings do not need to be frozen
2010-07-12 16:43:20 -07:00
Aaron Patterson
8fb838ed16
use Hash#each to avoid a second hash lookup
2010-07-12 16:32:45 -07:00
José Valim
6b29dc876f
Just add connection management middleware if running in a concurrent environment.
2010-07-12 20:18:54 +02:00
José Valim
da84c9d0d2
Remove old rubygems require.
2010-07-12 20:18:04 +02:00
Aaron Patterson
f33ee69d59
reducing funcalls, cleaning up primary key methods for sqlite adapter
2010-07-10 13:30:49 -07:00
Xavier Noria
86d5c728fb
revises recent commit related to :uniq => true
2010-07-10 00:50:59 +02:00
Neeraj Singh
44b752bea1
expanding on :uniq option in has_many
2010-07-09 16:39:34 -04:00
Xavier Noria
2f04c87855
Merge remote branch 'docrails/master'
2010-07-09 22:08:24 +02:00
José Valim
d9ebc76d70
Refactor previous commits a bit.
2010-07-08 23:45:10 +02:00
David Trasbo
786342e17f
Return from ActiveRecord::Base#attributes= unless value is a hash [ #4070 state:committed]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-07-08 23:24:20 +02:00
Neeraj Singh
1e53404fe9
reset_counter should work with non-traditional belongs_to and polymorphic belongs_to
...
[#4984 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-07-08 23:24:12 +02:00
José Valim
87f64ef05e
Improve a bit the code in latest commits.
2010-07-08 22:59:41 +02:00
Neeraj Singh
01629d1804
This patch changes update_attribute implementatino so:
...
- it will only save the attribute it has been asked to save and not all dirty attributes
- it does not invoke callbacks
- it does change updated_at/on
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-07-08 22:43:18 +02:00
Neeraj Singh
690352dce4
consolidating updated_at and updated_on
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-07-08 22:41:58 +02:00
Grant Ammons
17650e394f
Eager loading :through associations will join the :source model if there are :conditions. [ #2362 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-07-08 22:36:26 +02:00