José Valim
08986ce290
Remove deprecated ActiveModel tests (%d and %s is no longer supported in error messages a couple months already)
2010-01-02 22:27:03 +01:00
José Valim
653fa4c10c
Add naming to AMo::Lint
2010-01-02 22:27:02 +01:00
José Valim
7cc0a4cfa1
Use activerecord.errors.format as in Rails 2.3.5.
2010-01-02 22:27:02 +01:00
José Valim
5fdd0e80a4
Be sure to convert namespaced names to we have 'Parrots name' instead of 'Parrots.name' in error messages.
2010-01-02 22:27:02 +01:00
Jeremy Kemper
4f590b67b7
Ruby 1.9.2: explicit coercion check no longer needed; bug fixed upstream
2010-01-01 11:02:09 -08:00
Carl Lerche
ae7ada1fde
Some railties cleanup:
...
* Rename <framework>/rails.rb -> <framework>/railtie.rb
* Rails::Plugin -> Rails::Railtie
* Rails::Plugin::Vendored -> Rails::Plugin
2009-12-31 13:12:52 -08:00
Carl Lerche
e749424dfa
Rename rails.rb -> rails/all.rb and rails/core.rb -> rails.rb
2009-12-31 13:12:52 -08:00
Carl Lerche
a23f4b6aee
Add a /rails.rb for each framework for consistency
2009-12-31 11:57:59 -08:00
José Valim
6d390671f6
Move ActiveRecord callbacks implementation to ActiveModel and make use of it.
...
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local >
2009-12-28 16:19:23 -08:00
Jeremy Kemper
632df063a3
Merge commit 'josevalim/validations'
2009-12-28 11:13:35 -08:00
Jeremy Kemper
292363c75f
Use i18n
2009-12-27 15:17:44 -08:00
José Valim
74098e4cb6
No need to use ValidationsRepairHelper hack on ActiveModel anymore, Model.reset_callbacks(:validate) is enough. However, tests in ActiveRecord are still coupled, so moved ValidationsRepairHelper back there.
2009-12-23 13:30:58 +01:00
José Valim
e31077c9aa
Small clean up in Naming and TTranslation tests.
2009-12-23 12:28:02 +01:00
José Valim
44cd9e0e71
ActiveRecord::Validations are now built on top of Validator as well.
2009-12-23 12:14:00 +01:00
José Valim
279067639f
validates_each uses a BlockValidator.
2009-12-23 01:38:15 +01:00
José Valim
977a5c43b1
Added check_validity! to EachValidator and refactor existing ones.
2009-12-23 01:08:27 +01:00
Joshua Peek
f737c2d69b
All AMo modules are safe to defer
2009-12-22 17:39:41 -06:00
José Valim
f1085f4128
Move validations in ActiveModel to validators, however all validatity checks are still in the class method.
2009-12-23 00:36:51 +01:00
Joshua Peek
ace20bd25e
Flip deferrable autoload convention
2009-12-22 17:27:37 -06:00
José Valim
2476c5312d
Validator is simply sent to validate method. However, the API needs to change, so validate accepts a record.
2009-12-22 23:12:21 +01:00
Joshua Peek
7ee5843c3c
Fully expand relative rails framework paths and make sure we aren't
...
adding any to the load path more than once.
2009-12-16 11:56:51 -06:00
Joshua Peek
1ab35020c1
Hush AMo test suite
2009-12-16 11:05:48 -06:00
Jeremy Kemper
63e435955e
Ruby 1.9.2: explicitly raise NoMethodError for explicit coercion attempts
2009-12-06 18:22:09 -08:00
Carlhuda
c1304098cc
Reorganize autoloads:
...
* A new module (ActiveSupport::Autoload) is provide that extends
autoloading with new behavior.
* All autoloads in modules that have extended ActiveSupport::Autoload
will be eagerly required in threadsafe environments
* Autoloads can optionally leave off the path if the path is the same
as full_constant_name.underscore
* It is possible to specify that a group of autoloads live under an
additional path. For instance, all of ActionDispatch's middlewares
are ActionDispatch::MiddlewareName, but they live under
"action_dispatch/middlewares/middleware_name"
* It is possible to specify that a group of autoloads are all found
at the same path. For instance, a number of exceptions might all
be declared there.
* One consequence of this is that testing-related constants are not
autoloaded. To get the testing helpers for a given component,
require "component_name/test_case". For instance, "action_controller/test_case".
* test_help.rb, which is automatically required by a Rails application's
test helper, requires the test_case.rb for all active components, so
this change will not be disruptive in existing or new applications.
2009-12-02 20:01:08 -08:00
Jeremy Kemper
3fd2624be4
Uses Hash#reverse_merge
2009-11-13 10:31:05 -08:00
Jeremy Kemper
bbb3e5a858
Unify test:isolated across components and run by default at toplevel
2009-11-10 16:50:15 -08:00
Joshua Peek
11e798ae0f
Avoid adding component lib/ to load path multiple times
2009-11-09 23:28:36 -06:00
Jeremy Kemper
a038b3d1bc
Make Rakefile usable outside of base dir
2009-11-09 03:31:59 -08:00
José Valim
9fbb2c571b
Fix error_messages_for when instance variable names are given.
...
Signed-off-by: Joshua Peek <josh@joshpeek.com >
2009-10-21 11:18:36 -05:00
José Valim
e714b499cc
Move validator, human_name and human_attribute_name to ActiveModel, remove deprecated error messages and add i18n_scope and lookup_ancestors.
...
Signed-off-by: Carl Lerche <carllerche@mac.com >
2009-10-20 17:52:32 -07:00
Yehuda Katz + Carl Lerche
4f6d6f7031
Have all the tests running off a single Gemfile
2009-10-20 16:34:44 -07:00
Joshua Peek
35576a237e
Add arel to AMo gemfile
2009-10-20 10:16:19 -05:00
Joshua Peek
6094e65169
We won't be publishing tars and zips anymore
2009-10-16 13:56:59 -05:00
Yehuda Katz
02b76862e1
Bundle AMo
2009-10-15 14:04:18 -07:00
Joshua Peek
21e7b84621
Callbacks, DeprecatedCallbacks = NewCallbacks, Callbacks
2009-10-12 22:15:43 -05:00
Joshua Peek
ff56f3d5e1
Rewrite ActiveModel::Lint as a simple TU mixin
2009-10-07 09:24:51 -05:00
Sam Pohlenz
4df96338ed
Fixed behavior of attribute_methods_generated? [ #3220 state:resolved]
...
Signed-off-by: Joshua Peek <josh@joshpeek.com >
2009-10-07 09:07:39 -05:00
Sam Pohlenz
f8e91bda9c
Don't share attribute matchers between classes [ #3216 state:resolved]
...
Allows separate models that include ActiveModel::AttributeMethods to
use different sets of attribute matchers.
Signed-off-by: Joshua Peek <josh@joshpeek.com >
2009-10-07 09:07:39 -05:00
Jeremy Kemper
38e056ee2a
Use ActiveModel::TestCase base class
2009-09-24 22:56:30 -07:00
Joshua Peek
f430d6b63e
Make gemspecs the authoritative source instead of generating them from the Rakefile
2009-09-25 00:46:13 -05:00
lakshan
e2d0b0ee61
fixed ActiveModel::Lint typos [ #3236 state:resolved]
...
Signed-off-by: Joshua Peek <josh@joshpeek.com >
2009-09-21 09:49:43 -05:00
Brian Donovan
f183288050
Fix typo.
...
Signed-off-by: Yehuda Katz <wycats@gmail.com >
2009-09-17 18:30:28 -07:00
Jeremy Kemper
697dda5f29
Fix deprecated gem-name requires
2009-09-14 13:04:43 -07:00
Jeremy Kemper
8682d76cc9
Revert "Allow frameworks to be required by their gem name"
...
This has just been confusing. Better to educate than band-aid.
This reverts commit 18a24274ec .
Originally from http://dev.rubyonrails.org/ticket/8845 [drnic]
2009-09-12 02:41:01 -07:00
Akira Matsuda
0990a13500
Ensure validation errors to be ordered in declared order
...
[#2301 state:committed milestone:2.3.5]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2009-09-11 18:52:22 -07:00
José Valim
2ea1d684d9
Refactor new callbacks and AR implementation.
...
Signed-off-by: Joshua Peek <josh@joshpeek.com >
2009-09-08 10:26:39 -05:00
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
Joshua Peek
723a47bfb3
Kill AMo observing wrap_with_notifications since ARes was only using it
2009-09-02 11:44:36 -05:00