Commit Graph

3920 Commits

Author SHA1 Message Date
Aaron Patterson
5e2b473b47 reorganizing adapter specific tests. [#4974 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-25 14:47:14 -07:00
Santiago Pastorino
efbd0eb9f7 Order is not guaranteed here, ordering by id of people table makes it work 2010-06-25 12:44:57 -07:00
Neeraj Singh and Santiago Pastorino
0ebb5bf659 Support for multiple selects added
[#4841 state:committed]
2010-06-25 15:57:04 -03:00
Santiago Pastorino
3d8ccb9240 Makes a build_select for the select part of build_arel 2010-06-25 15:06:32 -03:00
Santiago Pastorino
82dc16b7d2 Metaprogramming not needed here 2010-06-25 15:06:32 -03:00
Santiago Pastorino
3344c011da Avoid a blank line before the add/remove columns 2010-06-25 15:06:32 -03:00
Łukasz Strzałkowski
518b16d9ae Line break in migration template and nicer code indentation
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-25 10:57:05 +02:00
José Valim
73682d016c Merge remote branch 'miloops/fixes' 2010-06-24 20:19:19 +02:00
Santiago Pastorino
7a7c608a26 Your original TIME ZONE value on PostgreSQL is correctly restored now, after going through options :utc and then going back to :local
[#4950 state:committed]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-24 20:12:22 +02:00
Santiago Pastorino
497a0c3b00 quotes are not necessary here
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-24 20:12:22 +02:00
Emilio Tagua
4b5f417e63 Only yield block if given. 2010-06-24 13:17:24 -03:00
Emilio Tagua
2c203a9413 Remove block definitions in finder methods. 2010-06-24 13:07:39 -03:00
Emilio Tagua
4086ecea24 Remove block definition from method, is not needed since yield is used inside. 2010-06-24 12:02:00 -03:00
Emilio Tagua
d9f199e123 Don't define block, just yield if block is given. 2010-06-24 11:40:23 -03:00
Emilio Tagua
fdb7f84eb1 Remove deprecated block usage in composed_of. 2010-06-24 11:17:05 -03:00
José Valim
6788db824a Move Rails::LogSubscriber to ActiveSupport::LogSubscriber, allowing frameworks like ActiveRecord and ActiveResource to log outsude Rails::Application [#4816 state:resolved] 2010-06-24 13:23:43 +02:00
Emilio Tagua
5441e082f9 Add tests for relation count. Fix other tests that were conceptually wrong.
[#4882 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-24 11:41:55 +02:00
Paul Gillard
4a0a640d33 Remove incorrect comment regarding #initialize_copy
Comment added in #3164 is incorrect after reading http://dev.rubyonrails.org/ticket/7191.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-23 22:42:17 +02:00
Michael Lovitt
49f52c3d91 Sessions should not be created until written to and session data should be destroyed on reset.
[#4938]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-23 11:56:35 -07:00
Neeraj Singh
0bf3baa6b3 adding fix for to_xml for ActiveRecord relation object
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-23 18:00:32 +02:00
Neeraj Singh
eb04408a20 ActiveRecord's relation object should respond to to_json and to_yaml
[#4547 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-23 18:00:25 +02:00
Neeraj Singh
a3ce6fcc56 adding column named 'group' to ensure that nothing breaks given that 'group' is sql reserved word
[#4945 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-23 17:46:37 +02:00
Mohammed Siddick.E
7008911222 Patch for Namespace problem in Scaffold. [#4763 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-23 09:30:55 +02:00
Paul Gillard
d132dd3352 Don't clone associations [#4894 state:resolved]
Cloning an active record object should be shallow in that it should copy attributes but not associations. This was no longer true as a result of #3164.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-23 09:27:15 +02:00
Jeff Dean
e639536ea8 remove_column should raise an ArgumentError when no columns are passed [#4803 state:resolved]
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2010-06-23 16:21:29 +12:00
Edgars Beigarts
62c4e4d385 Fix connection reloading in development mode. [#4929 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-22 21:48:43 +02:00
Santiago Pastorino
f61ac89947 Avoid method redefined warning
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-22 21:16:59 +02:00
James Harton
d0df7f1196 Fix small bug where ActiveRecord::PredicateBuilder#build_from_hash didn't test for Arel::Relation as right hand value. [#4917 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-22 18:05:27 +02:00
Neeraj Singh
7033be5f72 test for #4917
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-22 18:04:38 +02:00
Emilio Tagua
12a9e84799 Clean CHANGELOG whitespace.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-22 16:44:10 +02:00
Emilio Tagua
7df105b1e6 Fix order method to accept relation attributes.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-22 16:44:10 +02:00
Emilio Tagua
df595b577e Use the new query API in AR performance script.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-22 16:44:10 +02:00
Jeroen van Dijk
26392c4ac5 Make ActiveModel::Errors#add_on_blank and #add_on_empty accept an options hash and make various Validators pass their (filtered) options.
This makes it possible to pass additional options through Validators to message generation. E.g. plugin authors want to add validates_presence_of :foo, :format => "some format".

Also, cleanup the :default vs :message options confusion in ActiveModel validation message generation.

Also, deprecate ActiveModel::Errors#add_on_blank(attributes, custom_message) in favor of ActiveModel::Errors#add_on_blank(attributes, options).

Also, refactoring of ActiveModel and ActiveRecord Validation tests. Test are a lot more DRY now. Better test coverage as well now.

The first four points were reapplied from an older patch of Sven Fuchs which didn't apply cleanly anymore and was not complete yet.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-21 11:55:21 +02:00
Emilio Tagua
7b7cedcb8d Don't waste time building relations if there are no values presents. [#4860 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-21 01:10:33 +02:00
Xavier Noria
207fa59675 Merge remote branch 'rails/master'
Conflicts:
	actionpack/lib/abstract_controller/base.rb
2010-06-20 23:13:19 +02:00
Rizwan Reza
3ef1d63a78 All scopes are now cross-referenced. 2010-06-21 00:45:34 +04:30
Steve Abatangle
4515947845 Fix problem with migrations template that can cause bogus code to be created
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-20 12:32:51 +02:00
rohit
95a8f252c0 remove executable permission from files that don't need it. [#4802 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-20 00:50:48 +02:00
Emilio Tagua
e061212e86 Refactor build_arel: move joins out and simplify havings. [#4860 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-20 00:37:55 +02:00
James Le Cuirot
f664c57fe8 Don't overwrite unsaved updates when loading an association but preserve the order of the loaded records. Reapplied from before but now allows already-saved records to be refreshed.
[#4830 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-20 00:32:06 +02:00
José Valim
72725d7b7f Merge branch 'master' of github.com:rails/rails 2010-06-20 00:12:54 +02:00
José Valim
0247995d05 ActiveModel::Validations::Callbacks should not be required by default. 2010-06-19 18:20:02 +02:00
Neeraj Singh
51739d3228 moving before_validation and after_validation functionality from ActiveRecord to ActiveModel
[#4653 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-19 17:59:52 +02:00
José Valim
312f433241 Clear DescendantsTracker on each request. 2010-06-19 17:51:44 +02:00
José Valim
033e0a041f ActiveRecord and ActionPack now use the new descendants implementation. 2010-06-19 17:15:21 +02:00
Master Lambaster
a7cae64104 Fix test which prevents connection reset on failing and remove hardcoded connection
[#4689 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-18 15:28:14 -07:00
Brian Durand
237165feb3 Fix bug with rolling back frozen attributes.
[#2991]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-18 15:11:17 -07:00
Aaron Patterson
bf6661c5d7 setting the timezone in postgres to whatever ruby thinks the timezone is [#4895 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-17 16:49:21 -07:00
Xavier Noria
12eef93e89 documents how to run an individual test in AR 2010-06-17 17:41:39 +02:00
Malcolm Locke
1910c92395 Missing quote and indentation wrong 2010-06-17 14:26:13 +12:00