Commit Graph

497 Commits

Author SHA1 Message Date
thedarkone
09dd71cbdf Handle the empty array correctly. 2011-07-28 12:24:02 +02:00
Aaron Patterson
a5188333aa bumping to rc5 2011-07-25 16:03:01 -07:00
Ben Marini
d4832f1027 Fix example code for #validates_with instance method 2011-07-25 14:21:52 -07:00
Sebastian Gassner
f4558c660d Documentation fix: adding missing equal sign in code sample for ActiveModel::Dirty. 2011-07-23 12:29:32 +02:00
Alexander Uvarov
79956db91c Follow rails convention by using Array.wrap 2011-06-24 03:27:54 +06:00
Alexander Uvarov
52302f0856 Allow to specify mass-assignment roles as array 2011-06-24 03:20:28 +06:00
José Valim
83efad01e9 Get rid of the alternate namespace lookup. 2011-06-11 17:31:11 +02:00
Aaron Patterson
279781f896 bumping to 3.1.0.rc4 2011-06-09 15:53:49 -07:00
Aaron Patterson
aefd703443 bumping to 3.1.0.rc3 2011-06-08 14:34:20 -07:00
thoefer
3451bcb62e Brought back alternative convention for namespaced models in i18n. 2011-06-08 11:10:56 -04:00
Aaron Patterson
26648978b6 bumping to rails 3.1.0.rc2 2011-06-07 17:01:20 -07:00
Vijay Dev
0e8857b65e fix incorrect output 2011-06-06 22:45:04 +02:00
Vijay Dev
424d72586f use clearer variable name in examples 2011-06-06 22:44:43 +02:00
Vijay Dev
69b3c9cf9a remove stray ( 2011-06-06 22:44:02 +02:00
Ben Orenstein
f4a4d5fa1c Change hashrocket spacing to match conventions. 2011-06-06 22:43:16 +02:00
Daniel Schierbeck
93659a3166 Remove superfluous whitespace from ActiveModel::SecurePassword
Only one space is needed, yo!
2011-05-22 04:02:47 -07:00
David Heinemeier Hansson
82857adc56 Bump versions for rc1 2011-05-21 20:56:52 -05:00
Ganesh Kumar
3d789ea4b9 ActionMailer deliver method Documentation corrected Ticket #761 2011-05-21 13:55:52 +05:30
Yves Senn
e5429b789d Specify the name to be used for ActiveModel::Name fixes #1168
This patch allows to specify the name of your models independent of the class name.
2011-05-20 16:59:09 +02:00
Guillermo Iguaran
ec1993c33f Prefer each instead of for in 2011-05-19 01:25:31 -05:00
Jim Herzberg
fbf99653f1 Attributes with :string type should not be given the type passed in model serialization options. Closes #1058 2011-05-18 15:52:55 -04:00
Akira Matsuda
35c5ccb30c Remove unneeded merge with default false options 2011-05-16 15:37:44 +09:00
Akira Matsuda
cbe1d2488b Don't add DEFAULT_TOKENIZER to every instance of LengthValidator. Just use it only when needed. 2011-05-16 15:37:44 +09:00
Xavier Noria
d491130236 Merge branch 'master' of git://github.com/lifo/docrails
Conflicts:
	actionpack/lib/action_view/helpers/date_helper.rb
	railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt
2011-05-14 11:21:27 +02:00
Joshua Wehner
2cef2d411a Methods that return nil should not be considered YAML 2011-05-10 12:06:09 -04:00
Josh Kalderimis
b2451f4a7f renamed mass-assignment scopes to roles, updated code, tests, docs and security guide 2011-05-08 16:43:29 +02:00
Myron Marston
99363dcf60 Add documentation for new observer enable/disable feature. 2011-05-06 10:00:14 -07:00
Sebastian Martinez
6826936335 Improve doc styles for ActiveModel::Conversion 2011-05-04 22:49:11 -03:00
David Heinemeier Hansson
169ae75e09 Prepare for beta1 2011-05-04 20:21:05 -05:00
Sebastian Martinez
b84b759ec6 Improved ActiveModel Observing docs. 2011-04-30 20:35:25 -03:00
Dan Pickett
1efaed5af1 Merge branch 'master' of github.com:lifo/docrails 2011-04-29 19:18:10 -04:00
Aditya Sanghi
36ee2bafec fix typo 2011-04-29 09:53:02 +05:30
Aditya Sanghi
bf5cf5db86 :if should not fire on validations when not in context with :on 2011-04-29 02:54:37 +05:30
Myron Marston
fef22157b0 Fix bug with AM::Observer disablement.
Now that we propagate the enabling/disabling to descendants, we no longer have to check the disabled_observer Set on each superclass of the model class.  This was causing a bug when disabling all observers at a superclass level and then enabling an individual observer at a subclass level.

Plus the logic is simpler now :).
2011-04-28 08:27:15 -07:00
Myron Marston
9a385394ac Fix dev env memory leaks by using AS::DescendantsTracker rather than keeping track of subclasses manually.
There's also no need to keep track of all ObserverArray instances in a hash, as this is likely to leak memory, too.
2011-04-28 08:07:08 -07:00
Myron Marston
05d4653cef Revert "Revert "Handle enabling/disabling observers at different levels of the class hierarchy.""
This reverts commit 2a25c5818b.

I'm going to add another commit that keeps the same behavior of fixes
the problems of leaking memory in development.
2011-04-28 07:58:58 -07:00
José Valim
2a25c5818b Revert "Handle enabling/disabling observers at different levels of the class hierarchy."
This reverts commit ad62f19287 because the current
subclasses implementation leaks memory in development.

Instead of keeping an array of subclasses, the better solution is to
ask the parent if an observer is being disabled or not.
2011-04-28 09:32:57 +02:00
Myron Marston
ad62f19287 Handle enabling/disabling observers at different levels of the class hierarchy.
Last call wins.
2011-04-28 10:25:07 +08:00
Myron Marston
1f8cc446d9 Allow observers to be enabled and disabled.
This is useful in situations like model unit tests and the occasional rake task to backfill old data.
2011-04-28 10:23:49 +08:00
Myron Marston
5d20c0a64a Wrap line that is over 200 characters long. Now it's much easier to read. 2011-04-28 10:23:48 +08:00
Sebastian Martinez
c4b494bdc4 Rephrased Dirty#changed? docs 2011-04-26 23:37:11 -03:00
Sebastian Martinez
4554983ab1 Removed extra whitespace 2011-04-26 23:29:11 -03:00
Sebastian Martinez
a2bfa5fa30 Better formatting on ActiveModel::Translation 2011-04-26 23:26:10 -03:00
Josh Kalderimis
bf40c729c6 minor correction to the AMo mass-assignment security docs 2011-04-24 09:58:12 +02:00
Josh Kalderimis
1054ebd613 AM mass assignment security attr_accessible and attr_protected now allow for scopes using :as => scope eg.
attr_accessible :name
    attr_accessible :name, :admin, :as => :admin
2011-04-24 09:53:18 +02:00
Josh Kalderimis
0cf7b2f1b4 minor correction to the Active Model instantiate_observers doc 2011-04-22 15:24:11 +02:00
Xavier Noria
9b423ac0b7 let this regexp be stricter
The purpose of this regexp is to detect strings that
are valid identifiers to be used as method names.
The anchor $ allows a trailing newline, and both ^
and $ may be bypassed because Ruby regexps are
multiline always. The anchors \A and \z are the
proper ones to ensure string boundaries.
2011-04-19 18:16:38 +02:00
José Valim
dca31b9224 Let's not dup because value may not always be duplicable. 2011-04-19 18:06:01 +02:00
José Valim
30472d4244 Avoid define_method if possible. 2011-04-19 17:58:06 +02:00
Aaron Patterson
3e23752236 bcrypt will encrypt anything, so validate_presence_of would not catch nil / blank passwords. Thank you to Aleksander Kamil Modzelewski for reporting this 2011-04-14 14:54:25 -07:00