Commit Graph

650 Commits

Author SHA1 Message Date
José Valim
4f37b97033 Changed ActiveRecord to use new callbacks and speed up observers by only notifying events that are actually being consumed.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-09-08 10:26:39 -05:00
Joshua Peek
6dc9ad80e6 Fix warnings in AMo 2009-09-05 19:10:21 -05:00
Joshua Peek
c6e0923245 Fix failing AMo isolated tests 2009-09-05 18:54:19 -05:00
Kane
cf9f361699 added proc and symbol support to validates_numericality_of [#3049 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-31 13:35:14 -05:00
Yehuda Katz
dbf20c2dbb Initial AMo Lint implementation 2009-08-29 01:49:18 -05:00
Pratik Naik
25e5b0c4a8 Remove support for SQLite 2.
If you're still using it, please install the plugin from git://github.com/rails/sqlite2_adapter.git
2009-08-17 14:54:34 +01:00
Elliot Winkler
cccb0e6b93 Add validates_format_of :without => /regexp/ option [Elliot Winkler, Peer Allan]
[#430 state:resolved]

  Example :

    validates_format_of :subdomain, :without => /www|admin|mail/

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-10 15:22:31 +01:00
Jeff Dean
22f3398253 Introduce validates_with to encapsulate attribute validations in a class.
[#2630 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 22:47:56 -07:00
Adam Keys
5632b36701 Fix exclusive range patch to use begin/end instead of min/max. [#2981 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-08 23:42:18 +01:00
Pratik Naik
c6fe49b009 Simplyfy validates_length_of and remove puts 2009-08-08 19:08:39 +01:00
jzw
5ab94b2595 validates_length_of with maximum should allow nil [#2309 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2009-08-08 19:08:13 +01:00
James Hill
cfd421daa2 Allow validations to use values from custom readers [#2936 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-05 11:45:01 -05:00
Joshua Peek
272c504f91 Dasherize XML root by default to avoid invalid tags "<admin/posts>...</admin/posts>" [#2875 state:resolved] 2009-07-22 21:06:34 -05:00
John Maxwell
c39151a847 Patch to ActiveModel's (and ActiveRecord, by association) XML serialization: If two parameters are present in Procs supplied to to_xml's :procs option, the model being serialized will be passed as the second argument [#2373 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-07-22 20:47:15 -05:00
Joshua Peek
6944b391cd Kill AMo Base 2009-07-21 00:13:26 -05:00
Joshua Peek
2685d93b07 Kill AMo ivar attributes helper 2009-07-20 23:28:58 -05:00
Joshua Peek
d2b78b3594 Initial extraction of AMo xml serializer 2009-07-03 21:38:14 -05:00
Joshua Peek
e3d6d10e1f Ensure JSON serializer includes model naming 2009-07-03 21:38:13 -05:00
Yehuda Katz + Carl Lerche
7583a24ee0 Move mocha down below initial T::U require and bump version to 0.9.7 [#2858 state:resolved] 2009-07-01 11:53:17 -07:00
Joshua Peek
fbdf706fff Add basic JSON serializer to AMo 2009-06-17 21:27:54 -05:00
Joshua Peek
af5301089f Add simple attribute implementation backed by ivars 2009-06-17 21:27:54 -05:00
Joshua Peek
d5d59230f4 Simplify AMo validation attribute reader 2009-06-17 21:27:54 -05:00
Joshua Peek
1c4d28ba31 Move model naming into ActiveModel 2009-06-17 10:37:39 -05:00
Joshua Peek
4d70359200 Integrate ActiveModel::Observing into ActiveRecord 2009-06-10 23:36:44 -05:00
Joshua Peek
69742ca8fa Merge branch 'master' into active_model
Conflicts:
	activemodel/lib/active_model/core.rb
	activemodel/test/cases/state_machine/event_test.rb
	activemodel/test/cases/state_machine/state_transition_test.rb
	activerecord/lib/active_record/validations.rb
	activerecord/test/cases/validations/i18n_validation_test.rb
	activeresource/lib/active_resource.rb
	activeresource/test/abstract_unit.rb
2009-05-29 16:06:21 -05:00
Jeremy Kemper
e8550ee032 Cherry-pick core extensions 2009-05-13 12:00:15 -07:00
Pratik Naik
d758d996d1 Deprecate Model#validate/validate_on_create/validate_on_update. Use Model.validate :method and likewise 2009-03-21 19:07:15 +00:00
Pratik Naik
320933205e Deprecate Errors#on_base/add_to_base/invalid?/each_full 2009-03-21 18:34:05 +00:00
Pratik Naik
6173e5bfae Add ActiveModel::Validations tests for regular ruby classes 2009-03-20 22:21:27 +00:00
Pratik Naik
08a99d0eac Add I18n translations to ActiveModel and move more AR specific parts to ActiveRecord::Validations 2009-03-20 21:45:13 +00:00
Pratik Naik
7d187c193c Validation tests arent using any fixtures 2009-03-20 18:07:35 +00:00
Pratik Naik
4a582aa7ca Use mattr_accessor in TestsDatabase instead of setup method 2009-03-20 17:56:46 +00:00
Pratik Naik
37283a6aae Deprecate Error#on(attribute) in favour of Errors#[attribute] 2009-03-20 17:36:22 +00:00
Pratik Naik
4367f39dea TestDatabase -> TestsDatabase 2009-03-20 16:02:12 +00:00
Pratik Naik
d01e639daf Remove unused columns from the ActiveModel test schema 2009-03-20 15:33:40 +00:00
Pratik Naik
60756ad4ec Move relevant validation tests from Active Record to Active Model 2009-03-20 15:07:49 +00:00
Pratik Naik
e945bcfe4a Add test sqlite3 db to .gitignore 2009-03-20 11:22:27 +00:00
Pratik Naik
5b1a1bf5bf Make Active Model test suite similar to Active Record 2009-03-20 10:32:24 +00:00
Jeremy Kemper
1c36172c13 Ruby 1.9 compat: rename deprecated assert_raises to assert_raise.
[#1617 state:resolved]
2009-03-08 13:11:58 -07:00
Jeremy Kemper
d9c95c82e5 Explicitly require Active Support for tests 2008-11-24 22:45:44 -08:00
Jeremy Kemper
e931012287 Require Mocha >= 0.9.3 which includes a MiniTest adapter 2008-11-23 15:05:59 -08:00
Jeremy Kemper
0492759db3 MiniTest compat: don't shadow @name 2008-11-22 19:19:13 -08:00
Jeremy Kemper
5b7d07f423 Require mocha for tests. Get rid of uses_mocha helper. 2008-11-19 11:08:34 -08:00
Jeremy Kemper
a1ce4008c8 Require mocha before the testcase overrides, otherwise its run method is clobbered 2008-11-19 11:08:19 -08:00
Jeremy Kemper
d7bad6e2eb Use the Ruby load path for test_helper requires. Fix AM::TestCase. 2008-11-15 20:25:14 -08:00
rick
c9e366e997 all aasm tests without activerecord moved over and passing 2008-06-28 11:33:50 -07:00
rick
a9d9ca16c7 converted tests for more complex state transitions 2008-06-28 11:01:40 -07:00
rick
74cb056986 add basic events and transitions. still more tests to convert 2008-06-28 09:19:44 -07:00
rick
b9528ad3c5 initial statemachine machine and state classes 2008-06-28 00:55:02 -07:00
rick
7fc628e3fc convert specs to tests 2008-06-27 23:29:03 -07:00