David Heinemeier Hansson
32d4330b81
Get ready for beta 4
2010-06-08 14:47:02 -04:00
José Valim
a04060fb6f
Really make include_root_in_json default to true [ #3770 state:resolved]
2010-06-08 01:02:45 +02:00
Santiago Pastorino
b3d2080278
Observing module is using constantize
2010-06-06 22:42:28 -07:00
Xavier Noria
a0bb1dda11
revises rdoc of AMo::Error#add [ #4738 state:resolved]
2010-06-01 15:44:14 +02:00
rohit
8e3c3b06dc
Fixed numericality validator in ActiveModel to reject hex numbers for floats completely [ #4622 state:commited]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-18 03:10:56 +02:00
Jeremy Kemper
5371242384
Valid hex strings aren't valid float column values, to match the integer restriction. [ #4622 state:resolved]
2010-05-17 07:58:26 -07:00
Federico Brubacher
6b4e0cc526
a cloned object no longer mimics changed flags from creator , plus a test case [ #4614 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-16 23:04:40 +02:00
José Valim
d6cbb27e7b
Revert "Make ActiveModel::Errors#add_on_blank and #add_on_empty accept an options hash and make various Validators pass their (filtered) options."
...
Having a huge array to whitelist options is not the proper way to handle this case. This means that the ActiveModel::Errors object should know about the options given in *all* validators and break the extensibility added by the validators itself. If the intent is to whitelist options before sending them to I18n, each validator should clean its respective options instead of throwing the responsibility to the Errors object.
This reverts commit bc1c8d58ec .
2010-05-15 21:55:16 +02:00
Jeroen van Dijk
bc1c8d58ec
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).
Original patch by Sven Fuchs, some minor changes and has been changed to be applicable to master again
[#4057 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-05-15 11:17:58 -07:00
Josh Kalderimis
92160219a8
minor changes to instance level validations implementation based on feedback from José Valim
2010-05-13 13:57:37 -07:00
Josh Kalderimis
9131a88bb8
validation macros can now be used within an instance
2010-05-13 13:57:37 -07:00
Santiago Pastorino
6334006b81
Revert "Refactor of active_model/naming.rb and allow collection and element to be writable"
...
This reverts commit f7862b2c34 .
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-12 21:02:16 +02:00
Santiago Pastorino
bea3c26833
Make ActiveResource serialize XML correctly when element_name is set.
...
[#4529 ]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-05-12 09:31:36 -07:00
Santiago Pastorino
f7862b2c34
Refactor of active_model/naming.rb and allow collection and element to be writable
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-05-12 09:31:30 -07:00
Xavier Noria
e1a0d86fe0
Merge remote branch 'rails/master'
2010-05-09 11:46:45 +02:00
Josh Kalderimis
82485068f8
updated AMo validations to use a context for valid? and invalid?, removing the dependency on AR
2010-05-08 23:51:28 +03:00
Santiago Pastorino
b38639ab71
typo 'Provivdes' -> 'Provides'
2010-05-05 00:55:44 -03:00
Jatinder Singh
bce2c0ce37
Active Model JSON serializer now supports custom root option
...
[#4515 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-05-04 13:17:26 -07:00
Lawrence Pit
9bd91b00b8
Favor %{} in all code instead of (deprecated) {{}} as interpolation syntax for I18n
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-05-03 13:37:32 +02:00
José Valim
13867a3f5f
Use %{} syntax in I18n (faster) instead of {{}}.
2010-05-01 12:54:52 +02:00
José Valim
2e9af3638d
Move several configuration values from Hash to ActiveSupport::XmlMini, which both Hash and Array depends on.
...
Also, refactored ActiveModel serializers to just use ActiveSupport::XmlMini.to_tag. As consequence, if a serialized attribute is an array or a hash, it's not encoded as yaml, but as a hash or array.
2010-04-29 12:42:42 +02:00
Santiago Pastorino
ce48b3103a
Makes validates_acceptance_of to not override database fields [ #4460 state:committed]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-04-28 23:12:03 +02:00
reu
77c099c231
Fix validates_numericaly_of only integer error message [ #4406 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-04-25 10:14:15 +02:00
José Valim
9476daa829
Speed up xml serializer by computing values just once and remove unecessary code duplication.
2010-04-22 12:29:08 +02:00
Jeremy Kemper
1924cff934
Fix Active Model observer tests
2010-04-16 13:14:52 -07:00
Mislav Marohnić
c2ca73c9ee
ActiveModel::Observing: stop using Observable Ruby module, re-implement notify_observers
...
`Observable#notify_observers` from Ruby always returns false (which halts ActiveRecord
callback chains) and has extra features (like `changed`) that were never used.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-04-16 13:09:07 -07:00
Ryan Bigg
d748cc3cd0
Re-define empty? for errors to check if the values inside the OrderedHash are empty rather than the OrderedHash itself. [ #4356 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-04-10 13:21:20 +02:00
José Valim
ee309d506c
Update versions (otherwise you install a gem from source as beta3 but internally it's beta2) and update CHANGELOG.
2010-04-10 12:17:34 +02:00
Santiago Pastorino
13e00ce606
fix stack trace lines on class_eval
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-04-09 21:28:49 +02:00
Aaron Patterson
30f3a3df77
errors.rb needs to be declared as UTF-8 [ #3941 state:resolved]
...
Signed-off-by: wycats <wycats@gmail.com >
2010-04-02 09:14:55 -07:00
Sam Pohlenz
3adaef8ae7
Restore changed_attributes method in ActiveModel::Dirty and loosen expectation on including class' initialize method.
...
[#4308 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2010-04-01 17:52:45 -07:00
David Heinemeier Hansson
d868cb4f8a
Prep for beta2, depend on latest Bundler
2010-04-01 13:36:45 -07:00
Jeremy Kemper
7e3b4c1f2f
Merge branch 'master' of github.com:rails/rails
2010-03-28 11:34:16 -07:00
Jeremy Kemper
d1f3437cac
Cosmetics: mismatch indentation
2010-03-28 11:34:09 -07:00
Xavier Noria
76f024ac8d
adds missing requires for Object#blank? and Object#present?
2010-03-28 14:15:02 +02:00
Xavier Noria
3b1c69d2dd
adds a few requires in active_model/dirty.rb
...
[#4284 state:committed]
2010-03-28 12:43:20 +02:00
Jeremy Kemper
a98db7c6ef
Use Array.wrap uniformly
2010-03-27 11:50:11 -07:00
Jeremy Kemper
c3cea9b594
Fix unstated dep on HWIA
2010-03-27 11:03:36 -07:00
José Valim
f1da7174cc
Fix tests added in previous commit.
2010-03-27 11:04:21 +01:00
Jacob Atzen
a5d637d86c
ActiveModel::Dirty#changes should return a HashWithIndifferentAccess [ #4157 state:resolved]
...
Keep the Rails style of inject
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-03-27 10:48:32 +01:00
wycats
197904341f
Merge branch 'master' into docrails
2010-03-26 15:10:24 -07:00
José Valim
4c7c406155
Remove reference to unexistent methods and fix typo.
2010-03-26 01:12:24 +01:00
Aaron Patterson
b652aa8121
cleaning up a bunch of method already defined warnings [ #4209 state:resolved]
...
Signed-off-by: wycats <wycats@gmail.com >
2010-03-17 13:56:33 -07:00
Aaron Patterson
df735cf5b7
fisting uninitialized ivar warnings. [ #4198 state:resolved]
...
Signed-off-by: wycats <wycats@gmail.com >
2010-03-16 15:11:00 -07:00
Aaron Patterson
8c3e46c093
clean up more warnings, remove unnecessary methods, fix eval line numbers. [ #4193 state:resolved]
...
Signed-off-by: wycats <wycats@gmail.com >
2010-03-16 11:48:34 -07:00
Pratik Naik
e68bfaf1fe
Merge remote branch 'mainstream/master'
...
Conflicts:
activerecord/lib/active_record/base.rb
railties/lib/rails/configuration.rb
railties/lib/rails/log_subscriber.rb
2010-03-12 16:00:01 +00:00
Bryan Helmkamp
a4111bbca0
Update versions of all components to normalize them to new format
2010-03-02 00:32:48 -05:00
José Valim
ae8070e21b
Add missing information about attributes method.
2010-02-28 11:43:13 +01:00
José Valim
32afcdcb88
ActiveModel::Lint should not require our models to respond to id.
2010-02-28 11:39:39 +01:00
Jeremy Kemper
2ba6049506
Accept array of attributes as arg also, like 2.3
2010-02-25 13:07:48 -08:00