Commit Graph

286 Commits

Author SHA1 Message Date
Mikel Lindsaar
5fe3dc4bf5 Adding ruby version spec to all gemspec files to at least 1.8.7
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-02-08 09:42:12 +01:00
Prem Sichanugrist
1d9d9d2d89 Fix tiny version number from '3.0.0beta' to '3.0.0.beta1', so 'rake install' will be run correctly [#3879 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-02-06 15:51:44 +01:00
Jeremy Kemper
c548e21365 Bump git versions to 3.0.0.beta1 since we've released 2010-02-05 09:24:12 -08:00
Jeremy Kemper
459ecaf95d Submarine the rake-gemcutter dep in Rakefiles 2010-02-05 00:03:03 -08:00
Jeremy Kemper
7b81f5981f Fix task defines 2010-02-04 18:44:32 -08:00
Jeremy Kemper
c1785f3282 Release using gemcutter gem:push tasks 2010-02-04 18:28:45 -08:00
Pratik Naik
8260f0b40f Merge remote branch 'mainstream/master'
Conflicts:
	railties/guides/source/3_0_release_notes.textile
2010-02-04 13:14:44 +00:00
David Heinemeier Hansson
79817aa9e7 Move to 3.0.0.beta 2010-02-03 17:29:51 -08:00
Mikel Lindsaar
12681c2a71 Merge branch 'master' of git://github.com/rails/rails
Conflicts:
	activemodel/README
	activemodel/lib/active_model/errors.rb
	activemodel/lib/active_model/serialization.rb
	railties/guides/source/3_0_release_notes.textile
2010-02-02 14:04:23 +11:00
Mikel Lindsaar
d1eed079e1 Merge branch 'master' of git://github.com/rails/rails 2010-02-02 10:51:19 +11:00
Pratik Naik
fdcf4d6c51 Merge remote branch 'mainstream/master' 2010-02-01 23:42:38 +00:00
Carl Lerche
9f01dff9c2 Get rails tests running on bundler 0.9 2010-01-31 19:13:43 -08:00
Mikel Lindsaar
65ad16568c Updating copyright dates on all licenses 2010-02-01 10:10:53 +11:00
Mikel Lindsaar
a07d0f8786 Full update on ActiveModel documentation 2010-02-01 10:08:20 +11:00
Pratik Naik
ed60021f39 Merge remote branch 'mainstream/master'
Conflicts:
	activemodel/lib/active_model/state_machine.rb
2010-01-31 14:32:26 +00:00
Joshua Peek
db49c706b6 Axe AM state machine
We're going do it eventually, get it done before 3.0 is final.
2010-01-30 18:38:01 -06:00
José Valim
d6e2f5013c Drop AR I18n deprecation and simple use errors.messages as fallback. 2010-01-30 13:12:12 +01:00
Pratik Naik
efd0bd3b73 Merge remote branch 'mainstream/master' 2010-01-24 01:33:18 +05:30
Yehuda Katz
1a50d2e66a Stop overriding LoadError.new to return a MissingSourceError (and sometimes nil!) 2010-01-19 22:35:26 -08:00
Pratik Naik
c71120e29c Merge remote branch 'mainstream/master' 2010-01-19 13:40:26 +05:30
Mikel Lindsaar
3cb0283fb6 Documentation cleanup and linkage for validator 2010-01-19 11:29:01 +11:00
Mikel Lindsaar
9aee365924 Adding ActiveModel::Validations documentation 2010-01-18 18:29:33 +11:00
Mikel Lindsaar
91c38403be Adding documentation for ActiveModel::Translation 2010-01-18 18:13:49 +11:00
Mikel Lindsaar
71328a9856 Fixing up state machine docs 2010-01-18 17:20:25 +11:00
Gavin Stark
6e45bf53fb Fixing documentation on ActiveModel::Observer#observed_classes 2010-01-18 00:21:45 -05:00
Nestor Ovroy
aa8cbb79dc Partial Documentation for ActiveModel::StateMachine 2010-01-18 14:54:02 +10:00
Samuel Elliott
31ea83eb89 Adding Proc support to validation messages so that they can become a little more dynamic, allowing for customisations during the request [#3514 status:resolved].
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-01-17 14:40:10 +01:00
Mikel Lindsaar
a6831b95d6 Updating ActiveModel::Errors documentation to plug Translations and Validations modules 2010-01-17 20:22:14 +11:00
Mikel Lindsaar
19814df40d Adding documentation for ActiveModel::Serialization 2010-01-17 20:14:14 +11:00
José Valim
afd0c06dfa Validates needs hash slice. 2010-01-17 09:57:16 +01:00
Mikel Lindsaar
e6063282f9 Fixing documentation for ActiveModel::Observer 2010-01-17 19:12:12 +11:00
Mikel Lindsaar
fbc7c2beca Adding ActiveModel::Naming documentation 2010-01-17 15:52:33 +11:00
Mikel Lindsaar
87bd8c803b Update errors docs 2010-01-17 15:41:41 +11:00
Mikel Lindsaar
cf55e4e382 Added documentation for ActiveModel::Lint 2010-01-17 15:35:18 +11:00
Mikel Lindsaar
4d4bdb0766 Added ActiveModel::Errors documentation 2010-01-17 15:17:54 +11:00
Mikel Lindsaar
6f663addaa Merge branch 'master' of github.com:lifo/docrails 2010-01-17 12:46:51 +11:00
Mikel Lindsaar
8834b2612b Adding ActiveModel::AttributeMethods documentation 2010-01-17 12:42:53 +11:00
Pratik Naik
dba196cb7f Merge docrails 2010-01-17 03:26:20 +05:30
Pratik Naik
b04230e3bb Merge remote branch 'mainstream/master'
Conflicts:
	actionpack/lib/action_controller/metal/flash.rb
2010-01-17 03:20:30 +05:30
Mikel Lindsaar
e1c15d9fa1 fixed column alignment 2010-01-16 23:09:32 +11:00
Mikel Lindsaar
4a2d2ef91a Adding RDoc for active_model dirty 2010-01-16 23:03:20 +11:00
Mikel Lindsaar
db274a02ed Fixed readme for ActiveModel::Dirty 2010-01-16 22:21:07 +11:00
Mikel Lindsaar
d1bedd182b Updated README 2010-01-15 10:01:40 +11:00
Mikel Lindsaar
23e434f08f ActiveModel::Conversion documentation 2010-01-15 08:29:08 +11:00
Mikel Lindsaar
582228e435 ActiveModel::Callbacks documentation 2010-01-15 08:19:53 +11:00
José Valim
b078f7fd39 Fix typos and add tests to ensure they will be caught the next time. 2010-01-11 23:38:35 +01:00
José Valim
017f5d5308 Fix typo by renaming :genre to :gender. 2010-01-09 00:18:07 +01:00
José Valim
7045c4c279 Allow validates to map some types to specific options. So now you can do:
validates :email, :presence => true, :format => /@/
  validates :genre, :inclusion => %w(m f)
  validates :password, :length => 6..20
2010-01-08 21:36:04 +01:00
José Valim
fa14d6d51e Compile length validator options still at the class level, so whenever the validator is called, it just needs to check for :maximum, :minimum and :is values. 2010-01-08 21:36:04 +01:00
José Valim
47a5fd4c4b Allow :if, :unless, :on, :allow_nil and :allow_blank as shared options in validates. 2010-01-07 19:23:59 +01:00
jamie
0a79eb7889 Add validates method as shortcut to setup validators for a given set of attributes:
class Person < ActiveRecord::Base
  include MyValidators

  validates :name, :presence => true, :uniqueness => true, :length => { :maximum => 100 }
  validates :email, :presence => true, :email => true
end

[#3058 status:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-01-07 19:23:59 +01:00
José Valim
a25ef06956 Allow to specify default attributes names translation in I18n yml files.
For example, you could easily specify :created_at and :updated_at translations as:

  en:
    attributes:
      created_at: "Created at"
      updated_at: "Updated at"

This configuration is built on ActiveModel, so it means those translations are
shared between different ORMs as well (but always as a fallback).
2010-01-07 15:31:50 +01:00
José Valim
b0572ab2b6 Be sure to dup load paths before clearing the array. 2010-01-07 15:31:50 +01:00
José Valim
190ce3ab37 Errors messages are now moved from :activerecord.errors to simply :errors on I18n yml files. 2010-01-07 15:31:49 +01:00
Joshua Peek
e5ed62deea Autoload AR test case 2010-01-04 16:50:01 -06:00
Joshua Peek
640d9e7e32 Autoload AMo test case 2010-01-04 16:29:07 -06:00
Joshua Peek
2601a16ede Autoload AS test case 2010-01-04 16:22:46 -06:00
David Heinemeier Hansson
5e94d3e3ea Merge 2010-01-03 22:27:28 -08:00
David Heinemeier Hansson
532b11690f Change the ActiveModel::Base.include_root_in_json default to true for Rails 3 [DHH] 2010-01-03 22:02:10 -05:00
Pratik Naik
cda36a0731 Merge remote branch 'mainstream/master' 2010-01-04 03:24:39 +05:30
José Valim
4796be33a4 Add missing tests to Validators. 2010-01-03 17:14:50 +01:00
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
Pratik Naik
5446d5cb05 Merge remote branch 'mainstream/master'
Conflicts:
	activesupport/lib/active_support/core_ext/hash/conversions.rb
2009-11-17 22:47:23 +00: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
Pratik Naik
66ee2654ff Merge commit 'mainstream/master' 2009-10-10 17:15:11 +01: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