Commit Graph

4717 Commits

Author SHA1 Message Date
Aaron Patterson
974ff0dd43 singleton method added is no longer needed 2010-11-17 14:26:35 -08:00
Aaron Patterson
0bea9fd6be schema migrations work as instances 2010-11-17 14:26:34 -08:00
Aaron Patterson
8b2f801ed8 converted migrations to support instance methods 2010-11-17 14:26:34 -08:00
Aaron Patterson
77440ec51a fixing assertions so error messages will be more helpful 2010-11-17 13:02:03 -08:00
Carl Lerche
ccd2f3ede5 Update the version.rb files to include a PRE part 2010-11-16 17:19:46 -08:00
Aaron Patterson
2738ec891b removing many unused variables 2010-11-16 17:06:50 -08:00
Aaron Patterson
08c64bbd39 super automatically passes on the implicit block 2010-11-16 14:28:19 -08:00
Aaron Patterson
05320e3788 use unless instead of if ! 2010-11-16 14:28:19 -08:00
Aaron Patterson
5f608fc7c4 removing space errors 2010-11-16 14:28:19 -08:00
Aaron Patterson
c801f233df reloading an association will properly set attributes of instantiated objects. Thanks Brian Palmer [#5802 state:resolved] 2010-11-16 14:28:19 -08:00
Aaron Patterson
59ba800698 refactoring uniq method 2010-11-16 13:34:18 -08:00
Aaron Patterson
7ebd36d1c4 refactor to reduce method calls 2010-11-16 11:43:11 -08:00
Alexandru Catighera
a5cdf0b9eb Fix ActiveRecord calculations when grouped by multiple fields 2010-11-16 10:38:47 -08:00
Piotr Sarnacki
437ceab139 Create directory before copying migrations if it does not exist 2010-11-16 17:00:01 +01:00
Xavier Noria
a820d0afdd revises RDoc of AR::Base#== 2010-11-16 15:58:37 +01:00
Santiago Pastorino
4718d097ff Models should be equals even after destroyed
[#5978 state:committed]
2010-11-16 12:40:40 -02:00
Aaron Patterson
ace84a003c support finding by a ruby class [#5979 state:resolved] 2010-11-15 20:25:43 -08:00
Aaron Patterson
7bf9cbb766 adding more test coverage around finding with active record objects 2010-11-15 15:30:58 -08:00
Aaron Patterson
dcdfc84f55 use quoted id of single AR::Base objects in predicates 2010-11-15 14:35:38 -08:00
Neeraj Singh
7c5c1a07c0 if association is already loaded and if a find operation is performed on the already loaded association list with an empty hash then do not perform another sql
[#5972 state:resolved]
2010-11-15 10:12:23 -08:00
Aaron Patterson
022519a032 fisting a bunch of unused variable warnings 2010-11-15 10:12:09 -08:00
Santiago Pastorino
bc556a21e2 Remove unused var 2010-11-14 15:34:07 -02:00
Jason Cheow
93c9f4a942 Fix bug where size of through association is not correct after adding a has_many association (occurs only before main object has been reloaded).
[#5968 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-11-14 15:32:52 -02:00
Franck Verrot
983976ec54 Finder gives a little bit more info on the lookup column (primary key) 2010-11-13 06:32:08 +08:00
Santiago Pastorino
b734e192a7 present? is better here 2010-11-11 19:00:33 -02:00
José Valim
f912a359aa Merge remote branch 'drogus/plugin_new'
Conflicts:
	railties/test/generators/app_generator_test.rb
2010-11-11 19:39:21 +01:00
Franck Verrot
de2933e1a0 STI type is now updated when calling AR::Base.becomes on subclasses [#5953 state:resolved] 2010-11-12 02:17:34 +08:00
Santiago Pastorino
296e5c38f1 Use ! instead of not 2010-11-11 15:24:49 -02:00
Santiago Pastorino
894fd28859 Fixed bug in active_record/nested_attributes where an empty string id caused an ActiveRecord::RecordNotFound error. Found by [Ben Tillman]
[#5638 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-11-11 15:23:40 -02:00
Santiago Pastorino
ceef719924 Bump Arel up to 2.0.2 2010-11-11 15:05:12 -02:00
José Valim
9c9f416d39 Allow AR Session Store to be renewed 2010-11-11 14:17:14 +01:00
Xavier Noria
41366cdec6 syncs CHANGELOGs for 3.0.2 in 3-0-stable with the ones in master 2010-11-09 20:56:41 +01:00
Santiago Pastorino
88a559d414 Double negation of an already boolean value produces the same result 2010-11-09 16:53:03 -02:00
Santiago Pastorino
75dfd95618 Don't check if persisted is defined just initialize it properly 2010-11-09 16:00:02 -02:00
Santiago Pastorino
994a1c2a47 Execute less operations 2010-11-09 14:03:09 -02:00
David Chelimsky
1f06652a57 use persisted? instead of new_record? wherever possible
- persisted? is the API defined in ActiveModel
- makes it easier for extension libraries to conform to ActiveModel APIs
  without concern for whether the extended object is specifically
  ActiveRecord

[#5927 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-11-09 13:54:04 -02:00
Michael Koziarski
3d6eea0221 Update the validates_uniqueness_of documentation to tell you to use a unique index.
The other options mentioned were not good ideas and disclaimed as such in the documentation.
2010-11-08 10:16:40 +13:00
Raimonds Simanovskis
6709078eb1 use column names as order by complex function parameters, fix for postgresql adapter to correctly remove ASC/DESC
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-11-07 09:55:17 -02:00
Aaron Patterson
1acc086278 reduce duplication in assiciations #construct() 2010-11-06 18:20:08 -07:00
Aaron Patterson
c11102d4f8 make sure we keep parent records in order 2010-11-06 14:32:41 -07:00
Aaron Patterson
39a8056791 only call to_s on the association variable once 2010-11-05 17:08:56 -07:00
Aaron Patterson
c43d909ee2 simplify instantiate in the join parts object 2010-11-05 16:56:50 -07:00
Aaron Patterson
d89d702361 index is not used, so removing it 2010-11-05 16:56:50 -07:00
Aaron Patterson
a79e1de90a reduce method calls to the join base object 2010-11-05 16:56:50 -07:00
Aaron Patterson
06d518a323 stop recursively calling exists? 2010-11-05 15:36:36 -07:00
Santiago Pastorino
00261a187e Avoid warning: shadowing outer local variable 2010-11-05 16:34:23 -02:00
Santiago Pastorino
3146aa68fd Fixes queries using limits and punctuation in order, removes order("col1, col2") usage in favor of order(["col1", "col2"})
[#4597 state:committed]
2010-11-05 11:27:34 -07:00
Aaron Patterson
d5e45931a0 renaming exec in the mysql adapter 2010-11-05 10:21:14 -07:00
Aaron Patterson
0f45f23669 renaming exec in the PG adapter 2010-11-05 10:15:33 -07:00
Aaron Patterson
9a08517c8d converted exec to exec_query for sqlite 2010-11-05 10:08:38 -07:00