Santiago Pastorino
9143032a10
Add missing require
2011-02-13 02:38:31 -02:00
Ernie Miller
fbd917f50a
Remove Relation#& alias for Relation#merge
2011-02-12 17:23:19 -08:00
Brian Lopez
7eb554bdb1
switch over to Mysql2::Client#ping for the mysql2 connection check
2011-02-12 16:59:13 -08:00
Ernie Miller
d72add9c20
Fix table name collision due to incorrect alias count on certain joins.
...
[#6423 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2011-02-12 19:52:12 -02:00
Aaron Patterson
5b0695a8cb
key habtm fixtures off table name
2011-02-11 17:53:55 -08:00
Aaron Patterson
2b353acac3
Fixture class no longer needs a reference to the database connection
2011-02-11 17:45:09 -08:00
Aaron Patterson
bc3c3453d4
convert fixtures to a list of hashes to insert
2011-02-11 17:20:53 -08:00
Aaron Patterson
55a4fb5e70
fixture should quack like a hash
2011-02-11 17:14:23 -08:00
Aaron Patterson
a5b61269f3
Fixtures class constantizes this value, so no need to do it twice
2011-02-11 17:02:53 -08:00
Aaron Patterson
24166c2603
database quoting should take care of this, no need to gsub
2011-02-11 16:52:23 -08:00
Aaron Patterson
0ebbf6be8a
calculate model class on construction
2011-02-11 16:35:15 -08:00
Aaron Patterson
61fc309479
clear cache for all connections when resetting
2011-02-11 16:26:48 -08:00
Aaron Patterson
e0802fa176
avoid side effects from method calls, localize ivar assignment
2011-02-11 16:22:38 -08:00
Aaron Patterson
af5b1db965
create fixtures always returns a list, so build a hash from the list
2011-02-11 16:18:37 -08:00
Aaron Patterson
6344246654
create_fixtures() should always return a list
2011-02-11 16:09:34 -08:00
Aaron Patterson
ca938c0fc9
fixing variable names
2011-02-11 15:37:05 -08:00
Aaron Patterson
77a6e25584
use hash defaults to dry up ||= calls
2011-02-11 15:01:51 -08:00
Aaron Patterson
fb09d02542
refactor fixtures to do less work in the constructor
2011-02-11 14:33:03 -08:00
Aaron Patterson
83dd6e1e62
favor composition over inheritence. use AS::OrderedHash rather than omap
2011-02-11 10:03:45 -08:00
Aaron Patterson
339ad0d002
fixing tests on 1.8, using a list of lists because order is important
2011-02-10 14:17:09 -08:00
Aaron Patterson
61b69338b2
simplify bind parameter logging
2011-02-10 13:54:29 -08:00
Aaron Patterson
2f49cd91b7
bind parameters are logged to debug log
2011-02-10 13:34:33 -08:00
Aaron Patterson
028016ede3
test cases for bind parameter logging
2011-02-10 09:56:50 -08:00
Aaron Patterson
c560c8b2ba
log method takes an option list of bind values
2011-02-09 15:15:37 -08:00
Aaron Patterson
5548e47adb
rawr, mysql, mysql2, why do you hate me. :'(
2011-02-09 13:35:56 -08:00
Josh Kalderimis
9d8fdfec38
removed some duplication from LH issue 5505 regarding AR touch and optimistic locking [ #5505 state:resolved]
...
Signed-off-by: Santiago Pastorino and José Ignacio Costa <santiago+jose@wyeworks.com >
2011-02-09 18:28:15 -02:00
Franck Verrot
8bc464c809
The optimistic lock column should be increased when calling touch
...
Signed-off-by: Santiago Pastorino and José Ignacio Costa <santiago+jose@wyeworks.com >
2011-02-09 18:27:40 -02:00
Aaron Patterson
d3b2596884
use parenthesis so limit works on all dbs
2011-02-09 11:51:09 -08:00
Raimonds Simanovskis
c567ccbb17
bugfix for serialized_attributes to be class specific
...
previously serialized_attributes were kept as class attribute of ActiveRecord::Base - if some attribute was defined as serialized in one subclass then it was serialized in all other subclasses as well (if it had the same name)
2011-02-09 09:19:56 -08:00
Ken Collins
56fb3b1594
Allow limit values to accept an ARel SQL literal.
2011-02-09 08:33:40 -08:00
Aaron Patterson
5046120b97
comma limits do not make sense on oracle or pg
2011-02-08 16:54:07 -08:00
Aaron Patterson
1c6f4562d7
primary keys should not be cleared on cache clear, fixing oracle tests
2011-02-08 16:01:16 -08:00
Aaron Patterson
0b58a7ff42
limit() should sanitize limit values
...
This fixes CVE-2011-0448
2011-02-08 14:21:12 -08:00
Aaron Patterson
8ce57652b2
ignore max identifier length queries from pg
2011-02-08 13:38:05 -08:00
Aaron Patterson
cd440236ad
this test requires the job model, so we should require it
2011-02-08 11:31:46 -08:00
Jan
9643243204
make set_table_name take effect immediately
2011-02-08 10:31:09 -08:00
Aaron Patterson
ac86923fca
no more faker, rbench, or addressable
2011-02-07 19:53:22 -08:00
Aaron Patterson
08ef06dbf1
just return the record from insert_record, use truthiness for comparisons
2011-02-07 16:25:22 -08:00
Aaron Patterson
2b4de6621f
require tag since we need it for this test
2011-02-07 16:09:33 -08:00
Jon Leighton
4f7bdc8f74
Documentation for recent refinements to association deletion
2011-02-07 23:35:05 +00:00
Jon Leighton
e62b576472
Refactor the implementations of AssociatioCollection#delete and #destroy to be more consistent with each other, and to stop passing blocks around, thus making the execution easier to follow.
2011-02-07 23:35:05 +00:00
Jon Leighton
d9870d92f7
This string should continue
2011-02-07 23:35:05 +00:00
Jon Leighton
52f09eac5b
Correctly update counter caches on deletion for has_many :through [ #2824 state:resolved]. Also fixed a bunch of other counter cache bugs in the process, as once I fixed this one others started appearing like nobody's business.
2011-02-07 23:35:05 +00:00
Jon Leighton
05bcb8cecc
Support the :dependent option on has_many :through associations. For historical and practical reasons, :delete_all is the default deletion strategy employed by association.delete(*records), despite the fact that the default strategy is :nullify for regular has_many. Also, this only works at all if the source reflection is a belongs_to. For other situations, you should directly modify the through association.
2011-02-07 23:35:05 +00:00
Jon Leighton
d55406d2e9
Make record.association.destroy(*records) on habtm and hm:t only delete records in the join table. This is to make the destroy method more consistent across the different types of associations. For more details see the CHANGELOG entry.
2011-02-07 23:35:05 +00:00
Aaron Patterson
5f1ea2a26b
we do not use this method, so delete
2011-02-07 15:28:49 -08:00
Aaron Patterson
30bba95a04
update ignored SQL for oracle
2011-02-07 15:12:21 -08:00
Aaron Patterson
1193709cd6
removing some freedom patches. use notification system to count sql queries
2011-02-07 14:35:11 -08:00
Aaron Patterson
9f773d66b5
mysql2 should log these sql statements
2011-02-07 14:35:11 -08:00
Aaron Patterson
0de661d6c7
the connection pool caches table_exists? calls
2011-02-07 09:26:52 -08:00