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
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
Pratik Naik
dd2779e1b8
Merge commit 'mainstream/master'
2009-09-30 22:27:02 +01: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
Pratik Naik
340be9bddd
Merge commit 'mainstream/master'
2009-09-21 21:14:04 +01: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
Jay Pignata
38e6eb74ab
Fixing typo in ActiveRecord::Errors documentation
2009-09-17 23:03:36 -04:00
Brian Donovan
f183288050
Fix typo.
...
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-09-17 18:30:28 -07:00
Mike Gunderloy
0fb16d018a
Clean up documentation on validates_length_of and change overly juvenile example.
2009-09-15 07:11:20 -05: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
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
Pratik Naik
bae00bb1cc
Merge commit 'mainstream/master'
2009-08-31 22:11:50 +01: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
Pratik Naik
2e50110eac
Merge commit 'mainstream/master'
2009-08-09 18:39:44 +01: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
Joshua Peek
aad5a30bf2
Add simple support for ActiveModel's StateMachine for ActiveRecord
2009-08-04 11:03:57 -05:00
Rodrigo Rosenfeld Rosas
f320c994db
Fix typo in generate_message documentation.
2009-07-30 13:32:47 -03:00
Yehuda Katz
c4d1075bd3
Add support for error_messages_for(@obj)
2009-07-28 19:06:14 -07: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
108545a9d6
Clean up validation example
2009-07-21 00:56:27 -05:00
Joshua Peek
574323df62
So you can require 'activemodel'
2009-07-21 00:52:50 -05:00
Joshua Peek
92c00d7586
AMo conversion helper
2009-07-21 00:51:57 -05:00
Joshua Peek
6944b391cd
Kill AMo Base
2009-07-21 00:13:26 -05:00
Joshua Peek
48bc39e03a
Improve AMo observing docs
2009-07-21 00:11:26 -05:00
Joshua Peek
7c84bbf160
Add wrap_with_notifications helper to AMo observing
2009-07-20 23:57:01 -05:00
Joshua Peek
2685d93b07
Kill AMo ivar attributes helper
2009-07-20 23:28:58 -05:00
Yehuda Katz
5ffaaa71d1
Define ActiveModel API Compliance
...
- Define to_model on AR
- Define to_model on ActiveModel::APICompliant
- Update test fixtures to be API Compliant
- Start using to_model in AP
2009-07-20 00:27:04 +09:00
Yehuda Katz
45d41d8012
Add some simple examples for unconventional AMo and AP use
2009-07-19 23:24:19 +09:00
Yehuda Katz
1a2946a6d9
Add some missing dependencies
2009-07-15 14:16:30 -07:00
Joshua Peek
e83a05af07
Integrate AMo XML serializer into AR
2009-07-11 16:20:58 -05:00
Joshua Peek
783db25e0c
Integrate AMo JSON serializer into AR
2009-07-03 23:12:42 -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
8f7c657f4b
Move observing notify helper into AMo
2009-06-11 13:41:48 -05:00
Joshua Peek
c4e440b1d2
Fix observing AS dependencies
2009-06-11 13:21:56 -05:00
Joshua Peek
4d70359200
Integrate ActiveModel::Observing into ActiveRecord
2009-06-10 23:36:44 -05:00
Jeremy Kemper
14de1a9597
each yields per message not per attribute
2009-06-08 19:37:51 -07:00
Joshua Peek
28f36279cd
Properly require ActiveModel validation dependencies
2009-06-08 20:32:08 -05:00
Joshua Peek
01515f8ecd
Fix activesupport path
2009-06-08 19:59:56 -05:00
Jeremy Kemper
5481e54175
AM::StateMachine autoloads
2009-05-30 11:59:16 -07:00
Joshua Peek
e7d6f48ea9
Use AS::Concern in ActiveModel
2009-05-30 09:35:24 -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
Jeremy Kemper
2f42433f0a
Cherry-pick the inflector only
2009-05-05 21:40:53 -07:00
Jeremy Kemper
b2d6fdae35
Fix tests on 1.9
2009-04-22 17:07:04 -07:00
Jeremy Kemper
ab321268f8
No more free lunch
2009-04-22 16:10:49 -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
2bc4189faf
Get rid of active_model/core and active_model/callbacks
2009-03-21 01:32:59 +00:00
Pratik Naik
e4b89b4680
Validation options dont need explicit :on => :save
2009-03-21 01:16:30 +00:00
Pratik Naik
379e468034
Remove DEFAULT_VALIDATION_OPTIONS from validations
2009-03-21 01:14:58 +00:00
Pratik Naik
22ad30ed60
Move validate_on_create and validate_on_update from ActiveModel to ActiveRecord
2009-03-21 01:11:38 +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
bc1dd0b82e
Improve the deprecation message for Errors#on
2009-03-20 18:12:21 +00:00
Pratik Naik
7d187c193c
Validation tests arent using any fixtures
2009-03-20 18:07:35 +00:00
Pratik Naik
78c9791729
ActiveModel.load_all! isn't really needed at this point
2009-03-20 18:02:50 +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
cda984d314
Future deprecation message
2009-03-20 15:27:55 +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
Pratik Naik
93e2d378df
Autload ActiveModel::Observing
2009-03-20 01:13:24 +00:00
Pratik Naik
77acfefedf
Make Active Resource use ActiveModel::Errors
2009-03-19 23:45:08 +00:00
Pratik Naik
638333b7a1
Move uniqueness and association validations to Active Record
2009-03-19 23:44:30 +00:00
Pratik Naik
8828b2ca67
Move all the Active Record validations to Active Model
2009-03-19 23:28:59 +00:00
Pratik Naik
18eb80ccc7
Merge docrails
2009-03-16 11:28:36 +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
Pratik Naik
dbbae5e00e
Merge with docrails
2008-12-07 03:27:53 +01: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
0e2d18e415
Extract state query method definition and quiet method redefinition warning.
2008-11-22 19:19:13 -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
bedea33043
Eliminate method redefinition warning
2008-11-19 11:07:19 -08:00
Jeremy Kemper
29a31912fc
Lazy-require state machine internals when the module is included
2008-11-15 21:05:03 -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
Pratik Naik
6ef35461dc
Merge docrails
2008-09-03 17:58:47 +01:00
Clemens Kofler
a377c9853c
Some performance goodness for AM Validations.
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-09-03 00:55:23 +02:00
Clemens Kofler
b42f53ca1f
Some performance goodness for AM StateMatchine.
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-09-03 00:55:23 +02:00
Clemens Kofler
1646e8c364
More symbols for send and respond_to?.
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-09-03 00:55:22 +02:00
Jeremy Kemper
a1eb4e11c2
Get rid of 'Object#send!'. It was originally added because it's in Ruby 1.9, but it has since been removed from 1.9.
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Conflicts:
actionpack/test/controller/layout_test.rb
2008-08-31 13:20:15 -07:00
Tarmo Tänav
656f0e7c6c
Fix file permissions
...
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-07-31 16:36:23 -05:00
rick
01db5ded54
Merge branch 'state_machine'
...
Some big changes:
* Added some redundant requires so active_support/inflecto can be loaded
without the rest of ActiveSupport.
* Disabled callbacks and validations until they are added and tested.
* Converted specs back to tests, using ActiveSupport::TestCase and the new
#test helper.
* As an experiment, I imported Scott Barron's awesome AASM gem into
ActiveModel. I added multiple state machine support and vastly improved
the API (no more aasm_* prefixes). All the old tests pass. If this bothers
people, I have no problems removing this and contributing the changes back to
AASM. I just feel like AMo is a better spot for all these 'modelish' features.
2008-06-29 12:13:58 -07: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
b7c6ceff9a
tweak activemodel load order a bit
2008-06-27 23:29:47 -07:00
rick
7fc628e3fc
convert specs to tests
2008-06-27 23:29:03 -07:00
Jeremy Kemper
a02d672cd7
Horo rdoc template
2008-06-22 10:38:25 -07:00
Jake Howerton
3baf810482
Add rdoc task to activemodel. [ #156 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-05-16 10:35:09 +01:00
Pratik Naik
dc4eec1129
Merge docrails:
...
commit e6afd8b273
Author: Xavier Noria <fxn@hashref.com>
Date: Thu May 8 23:49:36 2008 +0200
Overall documentation improvement and markup corrections. Zillion changes.
commit 2fead68b31
Author: Austin Putman <austin@emmanuel.local>
Date: Wed May 7 19:35:46 2008 -0700
Documented class methods on ActionController::Routing. These are dangerous, and mostly used for testing.
commit f5b84182db
Author: Teflon Ted <github@rudiment.net>
Date: Wed May 7 16:08:49 2008 -0400
Added explanation about errant inflections not being patched in the future in order to avoid breaking legacy applications.
commit 370f4f5172
Author: Sunny Ripert <negatif@gmail.com>
Date: Wed May 7 14:00:59 2008 +0200
Applied list conventions in AR::Base
commit 5bd18429f0
Author: Sunny Ripert <negatif@gmail.com>
Date: Wed May 7 13:53:35 2008 +0200
Renamed Options list to Attributes list whenever they weren't option hashes in AR::Base
commit d912bd5672
Author: Yaroslav Markin <yaroslav@markin.net>
Date: Wed May 7 13:50:28 2008 +0400
Add a filter_parameter_logging usage hint to generated ApplicationController.
This may help to remind the developer to filter sensitive information from application logs.
Closes #11578
commit b243de0db3
Author: Jack Danger Canty <git@6brand.com>
Date: Tue May 6 23:39:47 2008 -0700
doc: disambiguating an example ActiveRecord class
commit f81d771f06
Author: Jack Danger Canty <git@6brand.com>
Date: Tue May 6 23:35:05 2008 -0700
doc: ActiveRecord::Reflection::AssociationReflection#through_reflection
Added documentation demonstrating the use of #through_reflection for
finding intervening reflection objects for HasManyThrough
and HasOneThrough.
commit ae6b46f00b
Author: Cheah Chu Yeow <chuyeow@gmail.com>
Date: Wed May 7 13:47:41 2008 +0800
Document AttributeAssignmentError and MultiparameterAssignmentErrors.
commit 8f463550b5
Author: John Barnette <jbarnette@gmail.com>
Date: Tue May 6 22:46:44 2008 -0700
Killing/fixing a bunch of outdated language in the AR README.
commit aca44bcd92
Author: Cheah Chu Yeow <chuyeow@gmail.com>
Date: Wed May 7 13:34:52 2008 +0800
Make a note about ActiveResource::Timeouterror being raised when ARes calls timeout.
commit 284a930a93
Author: Jonathan Dance <jd@wuputah.com>
Date: Tue May 6 14:58:26 2008 -0400
improvements to the page caching docs
commit 9482da6213
Author: Sunny Ripert <negatif@gmail.com>
Date: Mon May 5 18:13:40 2008 +0200
validates_numericality_of() "integer" option really is "only_integer"
commit e9afd6790a
Author: Sunny Ripert <negatif@gmail.com>
Date: Mon May 5 12:11:59 2008 +0200
Harmonized hash notation in AR::Base
commit 67ebf14a91
Author: Sunny Ripert <negatif@gmail.com>
Date: Mon May 5 12:06:19 2008 +0200
Turned options into rdoc-lists in AR::Base
commit 0ec7c0a41d
Author: Marshall Huss <mwhuss@Macbook.local>
Date: Sun May 4 23:21:33 2008 -0400
Added information of how to set element_name in the case the user has a name confliction with an existing model
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-05-09 10:40:50 +01:00
Xavier Noria
64092de257
Improve documentation coverage and markup
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-05-02 14:45:23 +01:00
Joshua Peek
46ab7422d9
Use define_callbacks helper for ActiveRecord validations.
2008-04-20 11:45:44 -05:00
Joshua Peek
cf04e62127
Tidy up ActiveSupport::Callbacks::CallbackChain instance API.
2008-04-17 23:30:01 -05:00
Pratik Naik
097c0d6166
Fix more typos and changelog
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9227 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-04-05 11:18:05 +00:00
David Heinemeier Hansson
d950addbfd
Move it around a bit
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9174 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-04-01 00:13:39 +00:00
David Heinemeier Hansson
87535bd373
Splitting them up first
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9173 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-04-01 00:05:48 +00:00
David Heinemeier Hansson
a5445fd9c5
Deprecate some more legacy
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9172 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-31 23:45:48 +00:00
David Heinemeier Hansson
9ddc6143e0
Something more to work with
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9171 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-03-31 23:40:34 +00:00
Rick Olson
5dc3f91832
initial experimental commit of active_model
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8118 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-09 14:59:15 +00:00