Commit Graph

4328 Commits

Author SHA1 Message Date
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
Aaron Patterson
89962d82f1 refactor a bunch of return / if to a case / when 2011-02-03 16:00:59 -08:00
Aaron Patterson
dde8933d60 add_limit_offset! is deprecated 2011-02-03 15:54:31 -08:00
Aaron Patterson
a88071e92a just use the superclass implementation 2011-02-03 15:48:34 -08:00
Aaron Patterson
7423a71fc0 allow AR caches to be cleared, clear them on class reloading 2011-02-03 15:35:44 -08:00
Aaron Patterson
23a3ba4260 Revert "ARel only requires the connection from the AR class. Simply return the AR class rather than jump through hoops and store ivars"
This reverts commit d65e3b481e.
2011-02-03 14:04:21 -08:00
Ken Collins
95d5d9b6c4 The type_cast_calculated_value method will trust DB types before casting to a BigDecimal.
[#6365 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-03 20:00:51 -02:00
Aaron Patterson
d65e3b481e ARel only requires the connection from the AR class. Simply return the AR class rather than jump through hoops and store ivars 2011-02-03 11:50:43 -08:00
Aaron Patterson
1a15fda021 reduce cache misses on STI subclasses 2011-02-03 11:12:07 -08:00
Aaron Patterson
a5d8f0be00 this method should be private 2011-02-03 09:09:27 -08:00
Guillermo Álvarez
351331fb34 Make serialized columns with explicit object_type return a new instance of the object instead of nil 2011-02-03 09:08:45 -08:00
Xavier Noria
a96a9a4948 Merge branch 'master' of git://github.com/lifo/docrails 2011-02-02 22:04:11 +01:00
Aaron Patterson
8bfa8e7cbe this method should never return nil 2011-02-02 10:25:53 -08:00
Aaron Patterson
3fc598095e just require mysql2 2011-02-02 10:25:53 -08:00
Santiago Pastorino
12b2f8b040 Delete blank lines in migration generator 2011-02-02 16:20:03 -02:00
Aaron Patterson
70b9db173e adding mysql2 adapter 2011-02-02 10:17:39 -08:00
Franck Verrot
8dcacd0cc7 Refactor clear_timestamp_attributes to use the newly created all_timestamp_attributes_in_model
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-02 12:45:25 -02:00
Franck Verrot
a5b03e9c7a Implement and test private method all_timestamp_attributes_in_model
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-02 12:45:14 -02:00
Franck Verrot
5178e64175 Added timestamp_attributes_for_create_in_model
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-02 12:44:53 -02:00
Michał Łomnicki
4e39072017 Configurable generation of add_index for references columns
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-01 22:50:51 -02:00
Aaron Patterson
5b42e96602 make sure de-serialization happens on object instantiation 2011-02-01 15:23:55 -08:00
Aaron Patterson
a0fac71922 store the serialized column values in the @attributes hash 2011-02-01 14:25:47 -08:00
Aaron Patterson
ebe485fd8e serialize can take an arbitrary code object 2011-02-01 14:25:47 -08:00
Aaron Patterson
ee34b4cf34 share column cache among subclasses, only look up columns per AR::Base subclass once 2011-02-01 14:25:46 -08:00
Aaron Patterson
a6cf6ec98b move the coders to the serialized_attributes hash 2011-02-01 14:25:46 -08:00
Aaron Patterson
69600a9f97 avoid column lookup on subclasses, keep column info cached as table_name => column_list 2011-02-01 14:25:46 -08:00
Aaron Patterson
3cc2b77dc1 adding a YAML Column coder for YAML serialization to db columns 2011-02-01 14:25:46 -08:00