Commit Graph

4354 Commits

Author SHA1 Message Date
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
c560c8b2ba log method takes an option list of bind values 2011-02-09 15:15:37 -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
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
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
Jan
9643243204 make set_table_name take effect immediately 2011-02-08 10:31:09 -08:00
Aaron Patterson
08ef06dbf1 just return the record from insert_record, use truthiness for comparisons 2011-02-07 16:25:22 -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
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
Akira Matsuda
40aefb9301 avoid nil.dup
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-07 09:51:51 -02:00
John Hawthorn
a3f5d7159d fix db:fixtures:load with FIXTURES specified [#6061 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-06 18:45:42 -02:00
Xavier Noria
8b5dc9caa5 Merge branch 'master' of git://github.com/lifo/docrails 2011-02-05 19:47:08 +01:00
Brian Morearty
c56e314866 Updates to ActiveRecord::Timestamp documentation.
Change ActiveRecord::Base.xyz to config.active_record.xyz in docs.

Remove <tt> from code samples.

Update skip_time_zone_conversion_for_attributes code sample: put the call in the model class.

Clarify that skip_time_zone_conversion_for_attributes skips converion when reading.
2011-02-05 09:07:00 -08:00
Aaron Patterson
59f7780a34 adjust query counts to be consistent across databases, make sure database log the same things 2011-02-04 18:14:59 -08:00
Aaron Patterson
acccb72cb1 column cache now lives on the connection pool 2011-02-04 18:14:59 -08:00
Aaron Patterson
c94651f8c8 almost fisted 2011-02-04 18:14:59 -08:00
Aaron Patterson
0cd42864e3 making sure primary key is set on the columns 2011-02-04 18:14:59 -08:00
Aaron Patterson
5f3cf4244d connection pool can cache column, table, and primary key information 2011-02-04 18:14:59 -08:00
Edward Faulkner
909588d964 Fixing ordering of HABTM association deletion [#6191 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-04 19:39:59 -02:00
Kevin Skoglund
94175c0e39 Improve regex in rake db:migrate status [#5940 state:resolved]
[#5940 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-04 12:59:06 -02:00
Gabriel Horner
ac15647bf0 keep options titles consistent to "Options" 2011-02-03 23:51:06 -05:00