Commit Graph

38 Commits

Author SHA1 Message Date
ShunsukeAida 33cc907305 Name#model_name doesn't return a String object 2014-05-30 00:09:41 +09:00
Peter Markou f6ab778297 Fix errors for four of the code samples
The four code samples that fail to run are:

- Add attribute magic to objects. Fixed by introducing a Person
  instance variable.

- Tracking value changes. Fixed by replacing `attr_accessor` with
  `define_attribute_methods`, providing getter and setter methods
  for `name` and providing the missing `Person#save` method. A
  call to `Person#save` has to precede the `person.name = 'robert'`
  assignment, if we want `previous_changes` to include 'bob'.

- Adding `errors` interface to objects. Fixed by introducing a
  Person instance variable, assigning `nil` to its name and calling
  `Person#validate!`.

- Custom validators. Fixed by defining `HasNameValidator` before
  it is used by `ValidatorPerson`.

All the code samples can now be run smoothly.

Call Dirty#changes_applied in Person#save, instead of modifying instance vars.
2014-03-08 21:19:42 +02:00
T.J. Schuck 72bb3fc297 Change all "can not"s to the correct "cannot". 2014-01-03 17:02:31 -05:00
Yves Senn 068289f239 align the result of expressions vertically [ci skip]. 2013-04-12 17:22:39 +02:00
Waynn Lue 008fd54e74 clarify verbiage 2013-03-12 18:44:10 -07:00
Trung Lê 86c4fe8191 ActiveRecord <-> Active Record [ci skip] 2013-01-15 10:52:02 +00:00
Akira Matsuda 7f495993bb Observers was extracted from Active Model as `rails-observers` gem 2013-01-02 06:23:12 +09:00
Hrvoje Šimić aee07fe135 include serializers in ActiveModel::Serialization example 2012-10-19 17:24:34 +02:00
Hrvoje Šimić 2d2c82354f better examples in ActiveModel readme 2012-10-19 16:58:30 +02:00
Robin Dupret f839e619d4 Use a 1.9 Hash syntax in README files (fixes thanks to @vijaydev) 2012-10-10 15:14:03 +02:00
Francesco Rodriguez 00c94d7d94 updating define_attribute_methods documentation 2012-05-14 11:38:23 -05:00
Vijay Dev 700dd0014b Revert "fixing active model links in readme"
This reverts commit c962680e19.

Reason: The links must be relative to work in both edge and stable api
sites.
2012-05-07 20:43:04 +05:30
Francesco Rodriguez ae0a4ca2e1 removing the surrounding +s in active model readme 2012-05-07 09:49:54 -05:00
Francesco Rodriguez 204a79fe61 fixing marked actived model classes in readme 2012-05-07 00:48:19 -05:00
Francesco Rodriguez 79f1daf2ce marking some active model classes 2012-05-07 00:45:54 -05:00
Francesco Rodriguez c962680e19 fixing active model links in readme 2012-05-07 00:40:00 -05:00
Francesco Rodriguez 9f3637fad5 adding observer example 2012-05-07 00:33:26 -05:00
Alexey Vakhov 616de66c55 Fix ActiveModel README example 2012-05-04 12:32:35 +04:00
Bernard Kroes be4a44f1f9 Fixed expected value in comment. Removed duplicate lines in example. 2012-04-21 22:16:38 +02:00
Vijay Dev 02a5847d32 fix bad format [ci skip] 2012-04-11 22:37:17 +05:30
Jonathan Mazin 729890469d Fix small markup error; fix incorrect link 2012-04-09 15:41:50 -03:00
Vijay Dev c0a7999115 minor corrections in AMo::Model docs [ci skip] 2012-03-05 22:46:44 +05:30
Carlos Antonio da Silva cb9d03f0d4 Add docs with usage examples for ActiveModel::Model
Also add test to ensure basic model does not explode when
initialized with nil.
2012-03-03 04:45:30 -03:00
Vijay Dev e6c98b83cb Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	activerecord/lib/active_record/relation/query_methods.rb
2012-02-09 23:44:17 +05:30
Carlos Antonio da Silva 9296996029 Fixes in AMo README 2012-02-07 20:29:14 -02:00
José Valim 91bb008c0b Update README to mention lint. 2012-02-07 23:17:24 +01:00
Kristian Freeman 2315e96a17 Finished implementation of MIT license linking. 2011-12-23 13:03:21 -08:00
Waynn Lue 2579d88405 capitalize RubyGems properl 2011-08-13 16:22:31 -07:00
Rashmi Yadav 111347f0cc The trailing '/' isn't being picked up by Github anyway, and the link works as is. 2011-08-13 16:22:15 -07:00
Vishnu Atrai 5801f42975 fixed type 2011-07-21 10:12:29 -07:00
Bratish Goswami 840ca47a46 Download and installation, License and Support sections added for activemodel 2011-07-21 13:03:45 +05:30
R.T. Lechow 86c15d8b89 Active Model typos. 2011-03-05 11:56:34 +01:00
John Firebaugh 57bc25c5f8 Use run_callbacks; the generated _run_<name>_callbacks method is not a public interface.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-01-31 19:45:53 -02:00
Vijay Dev 4038a6bc0f minor fixesin READMEs 2010-12-20 01:07:33 +05:30
Santiago Pastorino b451de0d6d Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) 2010-08-14 04:12:33 -03:00
Paco Guzman 8a2b69b727 applied guidelines to "# =>" 2010-08-12 17:09:58 +02:00
Mislav Marohnić 3e196db6ad improve Active Model README
- fix indentation problems
 - revised introductory text to state right away what the library is
 - improved examples: reduce heavy usage of ellipsis,
   don't mark paragraphs of text as code
2010-07-22 10:03:55 +02:00
José Valim 508fba9e07 Add .rdoc extension to README files. 2010-07-21 12:51:14 +02:00