Commit Graph

186 Commits

Author SHA1 Message Date
Aaron Patterson
1d7c0336ef using bind parameters for updates 2011-04-30 17:27:46 -07:00
Aaron Patterson
f1df6b2dce postgresql supports prepare statement deletes 2011-04-29 11:09:37 -07:00
Ken Collins
35d0b6029f Use existing #empty_insert_statement_value for an insert with no columns. 2011-04-24 12:52:28 -04:00
Ken Collins
bc50c1cb02 The #substitute_at gets an ActiveRecord::ConnectionAdapters::Column in #insert to match replacement in #exec_query. 2011-04-23 00:15:33 +08:00
Aaron Patterson
9951af0289 sort insert columns for better cache hits 2011-04-14 14:26:57 -07:00
Aaron Patterson
12ae92216b refactoring inserts to use the same method on the connection 2011-04-14 13:37:40 -07:00
Aaron Patterson
8571facea3 insert statements are prepared, but values are not escaped properly 2011-04-14 13:37:39 -07:00
Jon Leighton
788bd30859 ActiveRecord::Base.scopes hash is not needed 2011-04-12 19:46:04 -07:00
Jon Leighton
8572ae6671 Evaluate default scopes at the last possible moment in order to avoid problems with default scopes getting included into other scopes and then being unable to remove the default part via unscoped. 2011-04-12 19:46:04 -07:00
Jon Leighton
5740d4ec0c Deprecated support for passing hashes and relations to default_scope, in favour of defining a 'default_scope' class method in the model. See the CHANGELOG for more details. 2011-04-12 19:46:04 -07:00
Emilio Tagua
b35617235d Use IM when trying to load records using ID.
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-04-04 10:48:12 +02:00
Andrew White
555d016389 Quote find_in_batches ORDER BY clause [#6620 state:resolved] 2011-03-29 17:24:55 +01:00
Aaron Patterson
15d3cc21f4 pushing id insertion and prefetch primary keys down to Relation#insert 2011-03-22 09:18:01 -07:00
Chris Oliver
015192560b Fixed a bug when empty? was called on a grouped Relation that wasn't loaded
[#5829 state:resolved]

Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
2011-03-12 22:31:21 +00:00
Jon Leighton
532f915037 Referencing a table via the ON condition in a join should force that table to be eager-loaded via a JOIN rather than via subsequent queries. 2011-03-07 08:51:17 -08:00
Jon Leighton
d90b4e2615 Rewrote AssociationPreload. 2011-02-28 22:12:34 +00:00
Aaron Patterson
8fc54a2e81 only take the limit if there is a limit to take 2011-02-25 14:24:05 -08:00
Aaron Patterson
4bd8d2607c Relation will delegate to AR::Base which already uses the Dynamic finders, so eliminate duplicate calls 2011-02-22 11:07:51 -08:00
Rodrigo Navarro
62fd334684 Adding new examples for update_all method 2011-02-20 22:22:52 -03:00
Rodrigo Navarro
4da0157aaf Adding examples 2011-02-20 22:03:29 -03:00
Emilio Tagua
8ee0b44148 Merge remote branch 'rails/master' into identity_map
Conflicts:
	activerecord/examples/performance.rb
	activerecord/lib/active_record/association_preload.rb
	activerecord/lib/active_record/associations.rb
	activerecord/lib/active_record/associations/association_proxy.rb
	activerecord/lib/active_record/autosave_association.rb
	activerecord/lib/active_record/base.rb
	activerecord/lib/active_record/nested_attributes.rb
	activerecord/test/cases/relations_test.rb
2011-02-15 12:01:04 -03:00
Aaron Patterson
1c6f4562d7 primary keys should not be cleared on cache clear, fixing oracle tests 2011-02-08 16:01:16 -08:00
Jon Leighton
2120da7f73 ActiveRecord::Relation#primary_key should return a string, just like ActiveRecord::Base.primary_key does. 2011-01-03 16:24:32 -08:00
Aaron Patterson
23b03baba6 use the sql literal factory method 2010-12-24 16:01:07 -07:00
Aaron Patterson
0fbf829b1e stop the recursive insanity 2010-12-24 15:59:02 -07:00
Aaron Patterson
34d79fad85 setting the primary key on the update manager 2010-12-24 15:59:02 -07:00
Raimonds Simanovskis
2b795050de fixed retrieval of primary key value in Ralation#insert method
previously primary key value was always assigned nil which caused Oracle enhanced adapter failing tests
2010-12-23 23:22:00 +08:00
Emilio Tagua
02fc6fbccd Merge remote branch 'rails/master' into identity_map
Conflicts:
	activerecord/lib/active_record/associations/association_proxy.rb
	activerecord/lib/active_record/autosave_association.rb
	activerecord/lib/active_record/base.rb
	activerecord/lib/active_record/persistence.rb
2010-12-20 11:23:07 -03:00
Aaron Patterson
63480d234d stop delegating inserts to ARel, use the INSERT SQL ourselves 2010-12-16 01:49:29 +05:30
Aaron Patterson
b0fc912f1b avoid deprecate api 2010-12-02 15:50:34 -08:00
Aaron Patterson
ead0c6eed3 removing more calls to deprecated methods 2010-12-02 15:07:00 -08:00
Aaron Patterson
39f5fc06cb just call join_sql against the manager object 2010-11-30 16:42:21 -08:00
Aaron Patterson
fe522f79c7 we already know it is already an array, so we do not need to make really really sure it is an array 2010-11-30 15:53:04 -08:00
Aaron Patterson
ae6033331f shorten up scope_for_create 2010-11-30 15:48:15 -08:00
Aaron Patterson
dccf624b64 Ruby 1.8, how does it work? 2010-11-30 15:20:27 -08:00
Aaron Patterson
c856e25b32 removing arel 1.0 compatibility 2010-11-30 14:56:53 -08:00
Aaron Patterson
6c32290bac testing Relation#table_name 2010-11-30 14:29:35 -08:00
Aaron Patterson
b6848b6491 cleaning up where_values_hash 2010-11-30 12:05:02 -08:00
Emilio Tagua
7892543a88 Don't change tests, fix code: if locking is enabled skip IM. 2010-11-19 19:08:57 -03:00
Emilio Tagua
b9e869a420 Query objects if readonly_value is false, skip them only if nil. 2010-11-19 19:08:57 -03:00
Emilio Tagua
a3210d90be implicit_readonly is not set until records are loaded, just check readonly_value and then set readonly status. 2010-11-19 19:08:10 -03:00
Emilio Tagua
c0ad5e48f6 Don't use identity map if loading readonly records, this will prevent changing readonly status on already loaded records. 2010-11-19 19:08:09 -03:00
Aaron Patterson
296467fcc4 only returning where values for the corresponding relation, also filtering where value hash based on table name [#5234 state:resolved] [#5184 state:resolved] 2010-10-30 13:25:49 -07:00
Aaron Patterson
cc468d3ec8 exec returns an AR::Result 2010-10-26 13:44:07 -07:00
Aaron Patterson
6ceffb8178 adding bind_values to relations 2010-10-26 13:44:07 -07:00
Xavier Noria
21ff8849bb in regexps, the dot in a character class is not a metacharacter 2010-10-15 16:31:00 +02:00
Aaron Patterson
c2cad2d97e where_values_hash always returns a hash 2010-09-28 15:56:08 -07:00
Marcelo Giorgi
cdfd013dd7 Set attributes properly for model built from association with conditions [#5562 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-09-28 15:22:50 -03:00
Aaron Patterson
133742d185 @klass also uses DynamicFinderMatch, so no need for it on the relation 2010-09-27 16:51:12 -07:00
Jakub Suder
2524cf404c fixed some issues with JSON encoding
- as_json in ActiveModel should return a hash
  and handle :only/:except/:methods options
- Array and Hash should call as_json on their elements
- json methods should not modify options argument

[#5374 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-09-07 11:33:10 -07:00