José Valim
f224c66a91
to_key should return all exists keys (if any exists), regardless if the object is persisted or not. If you need it to reflect persistance, you should use to_param.
2010-08-15 11:30:06 -03:00
Santiago Pastorino
3270c58ebb
Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;)
2010-08-14 04:20:06 -03:00
Subba Rao Pasupuleti
fe2d65864e
no callbacks should be created for empty array [ #5289 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-08-12 13:13:41 -03:00
Subba Rao Pasupuleti
9df227983f
tidy up validations length code [ #5297 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-08-12 13:13:37 -03:00
Greg Campbell
d03a1249a0
Add missing ActiveModel::Validations require
...
[#5311 state: resolved]
ActiveModel::Validations uses Hash#except, but does not require it from
ActiveSupport. (This wasn't showing up in the tests, because it was
required in the helper, and was also required in
ActiveModel::Serialization).
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-08-12 13:13:33 -03:00
Xavier Noria
b2eaac24c3
fixes a typo reported by rymai
2010-08-10 15:35:23 +02:00
Adam Meehan
5c109e243f
typo in AM
2010-08-09 12:25:11 +02:00
Xavier Noria
902d732617
Merge remote branch 'docrails/master' into 3-0-stable
2010-08-05 01:15:08 +02:00
Neeraj Singh
589e6977d7
adding documentation to ActiveSupport::Concern ht:strictly typed for an awesome example
...
some minor documentation changes
2010-08-04 17:03:03 -04:00
rohit
8158afa47e
Give extracted options back to args in AMo callbacks. Fixes two failing tests in AR.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-08-04 00:33:23 -03:00
wycats
146a013c42
Fix a couple of mistaken deprecation solutions
2010-08-03 12:50:13 -07:00
wycats
4474470ffd
update this for a change in the core method
2010-08-03 11:49:44 -07:00
wycats
9ae7f04cd6
properly deprecate #{type}_validation_on_#{on}
2010-08-03 11:48:06 -07:00
wycats
1318bf6e33
Properly deprecate validate_on_#{on}
2010-08-03 11:48:06 -07:00
Subba Rao Pasupuleti
5987fd4c79
Tidy up error.rb code
...
[#5288 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-08-03 14:58:53 -03:00
José Valim
3b170b2e14
Freeze options so we raise an error when people modify it in place.
2010-08-03 15:37:35 +02:00
José Valim
79583ca9b1
validates_length_of should not change the options hash in place. [ #5283 state:resolved]
2010-08-03 15:37:26 +02:00
Tore Darell
2c8a4a53a8
Remove or fix non-working examples and add a few tests to Dirty [ #5185 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-08-03 10:47:30 +02:00
Neeraj Singh
74f7e172c7
fixing documentation
2010-08-03 04:14:14 -04:00
Alex Le
aeaab06c79
ActiveModel::Errors json serialization to work as Rails 3b4 [ #5254 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-08-02 16:26:32 +02:00
Xavier Noria
ccd45618ed
Merge remote branch 'rails/master'
2010-07-30 02:35:24 +02:00
Xavier Noria
755af49755
edit pass to apply API guideline wrt the use of "# =>" in example code
2010-07-30 02:30:04 +02:00
Neeraj Singh
1a6d76223b
expanding on the will_change! method in documentation
2010-07-29 09:18:29 -04:00
David Heinemeier Hansson
856fc4bbc3
Prep for RC
2010-07-26 12:53:25 -05:00
Neeraj Singh
aa2235be7b
replacing around with for in the comments for callbacks
2010-07-22 01:28:30 +02:00
Piotr Sarnacki
6807b08099
Moved a few methods from RecordIdentifier to ActiveModel::Naming
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-07-21 11:29:58 +02:00
Neeraj Singh
c9630d9d87
adding proper markup to comment
2010-07-16 09:58:01 -04:00
Santiago Pastorino
060ca6abce
Add missing require to use Set
2010-07-11 02:55:47 -03:00
José Valim
87f64ef05e
Improve a bit the code in latest commits.
2010-07-08 22:59:41 +02:00
Łukasz Strzałkowski
4a26a292a0
Removing method before redefining it. It was causing warnings. [ #5072 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-07-08 22:29:08 +02:00
José Valim
c285f07a92
Change documentation for ActiveModel::MassAssignmentSecurity a bit and make debug always be called since some people may overwrite warn! to add extra behavior even if logger is not available.
2010-07-08 19:02:34 +02:00
Josh Kalderimis
4b66aab00f
mass_assignment_security moved from AR to AMo, and minor test cleanup
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-07-08 18:28:45 +02:00
Santiago Pastorino
075f8b7241
Add a missing require to allow the usage of Array#to_xml
2010-07-03 09:59:51 -03:00
Santiago Pastorino
51be8dbded
Move constantize from conversions to inflections.
...
This removes ActiveModel dependency on TZInfo.
[#4979 state:committed]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-06-26 20:49:30 +02:00
José Valim
7bd85a8fc2
Work around the fact the JSON gem was overwriting to_json implementation for all Ruby core classes.
...
This is required because the JSON gem is incompatible with Rails behavior and was not allowing ActiveModel::Errors to be serialized.
So we need to ensure Rails implementation is the one triggered. [#4890 state:resolved]
2010-06-26 12:01:13 +02:00
Josh Kalderimis
e8c064bbe0
Regression with how base errors messages are added to a model. Works correctly for both string error messages and symbol translated messages.
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-06-23 14:45:55 +02:00
José Valim
0421fb7a91
Refactor previous commit a bit [ #4057 state:resolved]
2010-06-21 12:17:24 +02:00
Jeroen van Dijk
26392c4ac5
Make ActiveModel::Errors#add_on_blank and #add_on_empty accept an options hash and make various Validators pass their (filtered) options.
...
This makes it possible to pass additional options through Validators to message generation. E.g. plugin authors want to add validates_presence_of :foo, :format => "some format".
Also, cleanup the :default vs :message options confusion in ActiveModel validation message generation.
Also, deprecate ActiveModel::Errors#add_on_blank(attributes, custom_message) in favor of ActiveModel::Errors#add_on_blank(attributes, options).
Also, refactoring of ActiveModel and ActiveRecord Validation tests. Test are a lot more DRY now. Better test coverage as well now.
The first four points were reapplied from an older patch of Sven Fuchs which didn't apply cleanly anymore and was not complete yet.
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-06-21 11:55:21 +02:00
Xavier Noria
207fa59675
Merge remote branch 'rails/master'
...
Conflicts:
actionpack/lib/abstract_controller/base.rb
2010-06-20 23:13:19 +02:00
José Valim
0247995d05
ActiveModel::Validations::Callbacks should not be required by default.
2010-06-19 18:20:02 +02:00
Neeraj Singh
51739d3228
moving before_validation and after_validation functionality from ActiveRecord to ActiveModel
...
[#4653 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-06-19 17:59:52 +02:00
Rizwan Reza
de65c82bfa
Changes call backs to callbacks.
2010-06-15 22:48:10 +04:30
Rizwan Reza
596300ac8a
Merge branch 'master' of github.com:lifo/docrails
2010-06-15 22:21:39 +04:30
Rizwan Reza
3ae67fbebb
Add titles to the rest of the files in active_model/validations/*
2010-06-15 22:20:19 +04:30
Rizwan Reza
d896d8fa20
Minor doc changes to active_model/validations/confirmation.rb
2010-06-15 22:17:06 +04:30
Rizwan Reza
6907bfe1ab
Minor doc changes to active_model/validations/acceptance.rb
2010-06-15 22:13:30 +04:30
Bryan Woods
89b96c0313
Active Model lint - fix minor typos
2010-06-15 13:38:22 -04:00
Evgeniy Dolzhenko
ef404c771d
Fix a bunch of minor spelling mistakes
2010-06-15 12:04:22 +04:00
Xavier Noria
f17159b029
edit pass: the names of Rails components have a space, ie, "Active Record", not "ActiveRecord"
2010-06-14 23:22:04 +02:00
Rizwan Reza
e67c28dfe0
Added headings to serializers.
2010-06-14 13:59:55 +04:30