Commit Graph

99 Commits

Author SHA1 Message Date
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
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