Commit Graph

146 Commits

Author SHA1 Message Date
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 18a24274ec823ded4ffa29bf33fd3d76816aab7e.
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
Carl Lerche
bd53ebde72 Add required dependencies on activemodel 2009-09-01 12:26:00 -07:00
Yehuda Katz
67f5d611f5 Add rake gemspec and gemspecs to the repo 2009-08-31 17:20:44 -07:00
Joshua Peek
66d713fc8f License, version, and gemspec for ActiveModel. Ship it! 2009-08-31 19:09:16 -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
Josh Sharpe
80989437dc I added this feature so that a Map of changed fields could be retrieved
after a model had been saved. This is useful in the after_save callback
when you need to know what fields changed. At present there is no way
to do this other than have code in the before_save callback that takes
a copy of the changes Map, which I thought was a bit messy.

Example.

  person = Person.find_by_name('bob')
  person.name = 'robert'
  person.changes # => {'name' => ['bob, 'robert']}
  person.save
  person.changes # => {}
  person.previous_changes # => {'name' => ['bob, 'robert']}
  person.reload
  person.previous_changes # => {}

Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-31 12:50:27 -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
Joshua Peek
c6bc8e6626 Break up concerns for choosing what attributes should be serialized and the actual serializer 2009-08-13 22:27:36 -05:00
Joshua Peek
f97dae5ebe Extract common dirty tracking methods in AMo 2009-08-10 13:51:48 -05:00
Joshua Peek
391f978acd AMo overrides alias_attribute and manages aliasing all known attribute method matchers 2009-08-10 11:58:44 -05:00
Joshua Peek
d574cb31f0 Centralize attr method name concatenation in AttributeMethodMatch 2009-08-10 11:53:10 -05:00
Pratik Naik
e202c6c814 Move :with/:without check outside the method generated by validates_format_of 2009-08-10 15:24:48 +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
Pratik Naik
5ce3831faf Use send instead of instance_eval 2009-08-06 00:11:28 +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
f8d3c72c39 Extract generic attribute method generation to AMo 2009-08-04 23:36:05 -05:00