Commit Graph

246 Commits

Author SHA1 Message Date
Josh Kalderimis
a0000d0ea0 updated AR#create! to accept an options hash so the mass-assignment security role can be passed in, also updated the Changelog to mention the change to some of the AR method signatures. 2011-05-12 09:24:42 +02:00
Sebastian Martinez
c60e207674 Better formatting here 2011-04-24 19:44:12 -03:00
Xavier Noria
b481574a33 copy-edits 8d96b89 2011-02-21 11:37:08 +01:00
Nicholas Rowe
89b3bc4807 Typo: fixing the the 2011-02-19 23:46:30 -05:00
Peer Allan
8d96b89110 Clarification of ActiveRecord ActiveModel validation documentation 2011-02-18 20:51:56 -06:00
Jaime Iniesta
4b7dad2df3 ActiveRecord#save(false) is now deprecated, now it is save(:validate => false) 2011-01-18 00:35:07 +01:00
José Valim
e444439fe2 Partialy revert f1c13b0dd7 2010-11-28 16:55:53 +01:00
David Chelimsky
1f06652a57 use persisted? instead of new_record? wherever possible
- persisted? is the API defined in ActiveModel
- makes it easier for extension libraries to conform to ActiveModel APIs
  without concern for whether the extended object is specifically
  ActiveRecord

[#5927 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-11-09 13:54:04 -02:00
Carlos Antonio da Silva
ed2650646e Refactor AR validations a bit
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-06 13:40:06 +02:00
Carlos Antonio da Silva
9b610049bb Cleanup deprecation warnings in active record
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-06 13:39:55 +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
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
6445441253 Adds title to the rest of the files in activerecord/lib 2010-06-16 22:25:15 +04:30
Pratik Naik
88b4a8fcaf Remove undocumented save_without_validation! 2010-05-11 15:39:29 +01:00
Pratik Naik
1f675ea8c7 Succint save definition 2010-05-11 13:50:09 +01:00
José Valim
5c245b91d2 Make sure valid? preceives the context as in ActiveModel API (ht: Carlos Antonio) 2010-05-10 12:28:38 +03:00
wycats
d916c62cfc eliminate alias_method_chain from ActiveRecord 2010-05-09 02:37:52 +03:00
Josh Kalderimis
e17ff6d617 updated AR to work with the AMo model validation changes 2010-05-08 23:51:36 +03:00
José Valim
d6e2f5013c Drop AR I18n deprecation and simple use errors.messages as fallback. 2010-01-30 13:12:12 +01:00
José Valim
c0d31ca41b save(false) is gone, use save(:validate => false) instead. 2010-01-17 14:22:34 +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
José Valim
97a64b6b22 Get rid of DeprecatedCallbacks in ActiveRecord::Associations and finally remove it. 2009-12-30 11:43:34 +01:00
Xavier Noria
329e7f4441 Integer#even? and Integer#odd? are not needed for Ruby >= 1.8.7 2009-11-09 22:16:51 +01: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
Joshua Peek
21e7b84621 Callbacks, DeprecatedCallbacks = NewCallbacks, Callbacks 2009-10-12 22:15:43 -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
Sven Fuchs
d672a14ee7 allow ActiveRecord#RecordInvalid exception message to be localized
[#2754 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-26 11:29:16 -07:00
Pratik Naik
e033b5d037 Merge docrails 2009-07-25 16:03:58 +01:00
Joshua Peek
d5d59230f4 Simplify AMo validation attribute reader 2009-06-17 21:27:54 -05:00
Jeremy Kemper
d9f16fafec Update for Active Model yielding per error not per attribute 2009-06-08 19:37:50 -07:00
Joshua Peek
669fd84910 AS::Concern redefines "include" to lazy include modules as dependencies 2009-05-29 17:03:23 -05:00
Joshua Peek
c7c35be8fe AS::Concern includes InstanceMethods module if it exists 2009-05-29 16:28:54 -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
Joshua Peek
4e50a35fa2 Break up DependencyModule's dual function of providing a "depend_on" DSL and "included" block DSL into separate modules. But, unify both approaches under AS::Concern. 2009-05-28 11:35:36 -05:00
Jeremy Kemper
a69b28a8b1 Missing 1.8.7 backport extensions 2009-05-18 13:20:04 -07:00
Jeremy Kemper
e8550ee032 Cherry-pick core extensions 2009-05-13 12:00:15 -07:00
Bryan Helmkamp
a2875bec9a Use DependencyModule for included hooks in ActiveRecord 2009-05-11 22:23:47 -04:00
Jeremy Kemper
9b852af497 Explicitly require builder for to_xml 2009-04-30 20:34:11 -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
22ad30ed60 Move validate_on_create and validate_on_update from ActiveModel to ActiveRecord 2009-03-21 01:11:38 +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
cc5e019f6b Include ActiveModel::Validations from ActiveRecord::Validations 2009-03-20 19:12:18 +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
Chris Kampmeier
3c64c9a575 Fix spelling of an internal method [#1734 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-12 15:41:31 +00:00
Jeffrey Hardy
96eaeee446 Add ActiveRecord::Base#invalid? as the opposite of #valid? [#2159 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-08 15:20:23 +00:00
Arthur Klepchukov
ccb0a92fa2 Ensure validates_uniqueness_of considers limit on the field. [#1042 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-03-07 13:52:17 +00:00
Will Bryant
9991868d85 support end-exclusive ... Ranges in SQL hash condition sanitization properly
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1865 state:committed]
2009-02-06 13:43:02 +13:00
miloops
2b8be761e4 validate_length_of should use custom message if given when using in or within.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1057 state:committed]
2009-02-01 14:58:17 +13:00