Commit Graph

42 Commits

Author SHA1 Message Date
Manoj 204aabc24c quote fix ` to ' in the ArgumentError message
message quote fix
2012-01-24 22:10:06 +05:30
Rafael Mendonça França 2a663dcf09 Remove Array.wrap call in ActiveModel 2012-01-06 01:04:33 -03:00
Anand 4cef581fcf replaced remove and define method calls to :redefine 2011-11-07 16:22:30 +05:30
Myron Marston d3c15a1d31 Allow ActiveRecord observers to be disabled.
We have to use Observer#update rather than Observer#send since the enabled state is checked in #update before forwarding the method call on.
2011-08-12 20:48:44 -07:00
Ganesh Kumar 3d789ea4b9 ActionMailer deliver method Documentation corrected Ticket #761 2011-05-21 13:55:52 +05:30
Guillermo Iguaran ec1993c33f Prefer each instead of for in 2011-05-19 01:25:31 -05:00
Myron Marston 99363dcf60 Add documentation for new observer enable/disable feature. 2011-05-06 10:00:14 -07:00
Sebastian Martinez b84b759ec6 Improved ActiveModel Observing docs. 2011-04-30 20:35:25 -03:00
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
Josh Kalderimis 0cf7b2f1b4 minor correction to the Active Model instantiate_observers doc 2011-04-22 15:24:11 +02:00
Paco Guzman 7e9d45cc7f remove unused assigned variable 2011-03-06 22:24:22 +01:00
Xavier Noria 9297027e08 copy-edits 6d7a826 2011-02-21 11:01:26 +01:00
Nicholas Rowe 6d7a8267b9 Documentation: Added small comments to Observering module 2011-02-20 21:05:41 -05:00
Jimmy Cuadra bd7d8665a0 add note about observer config for rails apps
ActiveModel::Observer and ActiveRecord::Observer have similar
documentation, but a Rails user looking at the ActiveModel version
might not realize that a change to config/application.rb is
required to activate the observer. This change adds a note to
that effect, pointing to the AR version from the AM version.
2011-02-16 14:15:48 -08:00
brainopia da82b0a746 Remove reference to ActiveRecord from ActiveModel comments 2011-01-15 03:10:10 +03:00
Subba Rao Pasupuleti 2d74ed49f4 reader method eliminates defined? checks
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-01 13:59:53 +02:00
Jaime Iniesta 5430f5bd06 lifecycle should be two words, life cycle 2010-08-26 14:23:58 +02:00
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
José Valim 87f64ef05e Improve a bit the code in latest commits. 2010-07-08 22:59:41 +02:00
Łukasz Strzałkowski 4a26a292a0 Removing method before redefining it. It was causing warnings. [#5072 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-08 22:29:08 +02:00
Santiago Pastorino 51be8dbded Move constantize from conversions to inflections.
This removes ActiveModel dependency on TZInfo.

[#4979 state:committed]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-26 20:49:30 +02:00
Rizwan Reza 2572af11ce Revised and added headings. 2010-06-14 13:49:01 +04:30
Santiago Pastorino b3d2080278 Observing module is using constantize 2010-06-06 22:42:28 -07: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
Gavin Stark 6e45bf53fb Fixing documentation on ActiveModel::Observer#observed_classes 2010-01-18 00:21:45 -05:00
Mikel Lindsaar e6063282f9 Fixing documentation for ActiveModel::Observer 2010-01-17 19:12:12 +11:00
Joshua Peek 723a47bfb3 Kill AMo observing wrap_with_notifications since ARes was only using it 2009-09-02 11:44:36 -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 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
Pratik Naik 2bc4189faf Get rid of active_model/core and active_model/callbacks 2009-03-21 01:32:59 +00:00
rick b7c6ceff9a tweak activemodel load order a bit 2008-06-27 23:29:47 -07:00
Rick Olson 5dc3f91832 initial experimental commit of active_model
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8118 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-09 14:59:15 +00:00