Santiago Pastorino
47d568ed3f
Refactor calculation test to remove unneeded SQLite special case.
...
[#4633 ]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-05-24 20:54:38 -07:00
José Valim
ad4be3d75d
Fix failing test.
2010-05-21 16:20:56 +02:00
Neeraj Singh
1bc6b43f53
Replace assert with assert_equal in some test cases
...
[#4654 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-21 16:00:49 +02:00
Santiago Pastorino
aacf2581cd
refactor evals and adds some __FILE__ and __LINE__
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-20 15:18:57 +02:00
Xavier Noria
7f07cc364a
Merge remote branch 'rails/master'
2010-05-19 23:29:39 +02:00
Neeraj Singh
39a246f545
Final iteration of use better testing methods
...
[#4652 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-19 21:31:51 +02:00
Santiago Pastorino
715f7c0b7c
Fixes a test on transaction_callbacks_test.rb
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-19 12:59:47 +02:00
Neeraj Singh
b462952886
Use better assertion methods for testing
...
[#4645 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-19 10:18:36 +02:00
Jeremy Kemper
223d6415d0
Revert "Don't carry default value when changing column for a binary type on MySQL"
...
Broke mysql tests.
This reverts commit edec1afe25 .
Conflicts:
activerecord/test/cases/migration_test.rb
[#3234 state:open]
2010-05-18 11:02:39 -07:00
Étienne Barrié
3809c80cd5
make add_index and remove_index more resilient; new rename_index method; track database limits
...
[#3452 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-05-18 10:55:41 -07:00
Santiago Pastorino
03c3d1eb84
Fixes transaction callbacks tests
...
[#4640 state:committed]
Signed-off-by: wycats <wycats@gmail.com >
2010-05-18 19:32:37 +04:00
Ian White
b439d85a19
Nested records (re: autosave) are now updated even when the intermediate parent record is unchanged [ #4242 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-18 16:13:00 +02:00
Neeraj Singh
ce20b93606
assert_equal should be used instead of assert
...
[#4629 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-18 16:13:00 +02:00
Neeraj Singh
0ef13afef5
expected value should come first in assert_equal
...
[#4630 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-18 16:13:00 +02:00
Pratik Naik
5ddc904941
Remove Model.clear_default_scope
2010-05-18 12:22:23 +01:00
José Valim
c536835957
Cut the fat and make session stores rely on request.cookie_jar and change set_session semantics to return the cookie value instead of a boolean.
2010-05-18 03:18:23 +02:00
Paco Guzman
c2fb8afaa0
Use assert_equal correctly in transaction callback tests (exposing some of them as broken)
...
[#4612 ]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-05-17 07:16:53 -07:00
pleax
4db10bce7b
AR::Base#clone fixed to set dirty bits for cloned object
...
[#2919 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-05-16 17:45:12 -07:00
Comron Sattari
e1a340a91d
cache connection when quoting
...
[#3642 state:committed]
Signed-off-by: Marius Nuennerich <marius@nuenneri.ch >
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-05-16 17:40:40 -07:00
Rizwan Reza
d148a6f6ba
Merge branch 'master' of git://github.com/rails/rails
2010-05-17 02:40:15 +04:30
Federico Brubacher
6b4e0cc526
a cloned object no longer mimics changed flags from creator , plus a test case [ #4614 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-16 23:04:40 +02:00
Santiago Pastorino
821e15e5f2
Change on Array extension from rand => random_element [ #4555 state:committed]
...
Signed-off-by: Xavier Noria <fxn@hashref.com >
2010-05-16 22:23:44 +02:00
Nobuhiro IMAI
5d0afe75eb
prevent to run fixture accessor (e.g. test_foos for TestFoo model) as a test case [ #2992 state:resolved]
...
Signed-off-by: Wijnand Wiersma <wijnand@videre.net >
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-16 20:14:36 +02:00
Santiago Pastorino
fdfebb7782
Make use of assert_equal to test equallity between object assert expects and object and a message of error
...
[#4611 state:committed]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-16 16:06:28 +02:00
Wijnand Wiersma
d7a3e65c50
Postgresql doesn't allow to change a string type column to a binary type. Skip this test for postgresql for now. [ #4616 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-16 15:15:43 +02:00
Elomar França
edec1afe25
Don't carry default value when changing column for a binary type on MySQL [ #3234 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-16 10:45:26 +02:00
Neeraj Singh
5de2e0d416
better documentation for dependent option [ #4564 state:resolved]
2010-05-16 06:47:16 +04:30
José Valim
d6cbb27e7b
Revert "Make ActiveModel::Errors#add_on_blank and #add_on_empty accept an options hash and make various Validators pass their (filtered) options."
...
Having a huge array to whitelist options is not the proper way to handle this case. This means that the ActiveModel::Errors object should know about the options given in *all* validators and break the extensibility added by the validators itself. If the intent is to whitelist options before sending them to I18n, each validator should clean its respective options instead of throwing the responsibility to the Errors object.
This reverts commit bc1c8d58ec .
2010-05-15 21:55:16 +02:00
Jeroen van Dijk
bc1c8d58ec
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).
Original patch by Sven Fuchs, some minor changes and has been changed to be applicable to master again
[#4057 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-05-15 11:17:58 -07:00
Santiago Pastorino
47c9a35506
Reset quoted_table_name after set_table_name [ #4568 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2010-05-15 18:53:47 +01:00
Diego Algorta
3436fdfc12
Fix for get_ids when including a belongs_to association on a has_many association [ #2896 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2010-05-15 16:53:59 +01:00
wycats
9cfeefb637
Reorganized initializers a bit to enable better hooks for common cases without the need for Railtie. Specifically, the following hooks were added:
...
* before_configuration: this hook is run immediately after the Application class
comes into existence, but before the user has added any configuration. This is
the appropriate place to set configuration for your plugin
* before_initialize: This is run after all of the user's configuration has completed,
but before any initializers have begun (in other words, it runs right after
config/environments/{development,production,test}.rb)
* after_initialize: This is run after all of the initializers have run. It is an
appropriate place for forking in a preforking setup
Each of these hooks may be used via ActiveSupport.on_load(name) { }. In all these cases, the context inside the block will be the Application object. This means that for simple cases, you can use these hooks without needing to create a Railtie.
2010-05-15 06:09:07 -07:00
Neeraj Singh
58adc67371
STI should not ignore type condition while applying scopes from parent class scopes
...
[#4507 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-15 09:48:49 +02:00
David Chelimsky + Brian Tatnall
35a114a894
Modified default_scope to merge with any pre-existing default_scope
...
and added AR::Base::clear_default_scope
- clear_default_scope provides users who rely on the old behaviour
of each call to default_scope overwriting any previous default
scopes an opportunity to maintain that behaviour.
[#4583 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-15 08:38:28 +02:00
Neeraj Singh
a0621c1086
Better code formatting and proper line numbers for stack traces
...
[#4596 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-05-14 12:24:01 -07:00
Santiago Pastorino
0c37bf8f91
To allow proper fisting of stack trace
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-05-14 10:36:59 -07:00
Xavier Noria
7321a3a7d3
revises the rdoc of #average according to 5f3bd55, and realigns when clauses
2010-05-12 08:47:55 +02:00
Santiago Pastorino
5f3bd55726
type_cast_calculated_value refactor: value is never a Fixnum here. Fix test since SQLite returns Float.
...
[#4514 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-05-11 22:29:26 -07:00
Blake Smith
a4207c1084
Make sure timestamp is properly referenced
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-11 20:06:26 +02:00
Pratik Naik
88b4a8fcaf
Remove undocumented save_without_validation!
2010-05-11 15:39:29 +01:00
Pratik Naik
475d1d1713
Use arel instead of sql strings
2010-05-11 15:32:41 +01:00
Pratik Naik
1f675ea8c7
Succint save definition
2010-05-11 13:50:09 +01:00
José Valim
5c245b91d2
Make sure valid? preceives the context as in ActiveModel API (ht: Carlos Antonio)
2010-05-10 12:28:38 +03:00
Pratik Naik
ce5827ea47
Make sure schema dumper doesnt throw up when there are no index lengths
2010-05-09 12:43:06 +01:00
Pratik Naik
8d2f6c16e3
Revert "Revert "Add index length support for MySQL [ #1852 state:open]""
...
This reverts commit 6626833db1 .
2010-05-09 12:42:48 +01:00
Pratik Naik
f75a6fec29
Improve code from 231d7676f7
2010-05-09 12:33:25 +01:00
Josh Kalderimis
231d7676f7
corrected AR find_each and find_in_batches to raise when the user uses select but does not specify the primary key
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-09 13:14:47 +03:00
wycats
d916c62cfc
eliminate alias_method_chain from ActiveRecord
2010-05-09 02:37:52 +03:00
Josh Kalderimis
e17ff6d617
updated AR to work with the AMo model validation changes
2010-05-08 23:51:36 +03:00
Santiago Pastorino
0b4211c88b
Here the intention was to assign to different objects
2010-05-08 23:29:51 +03:00