aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/callbacks.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix description for AM::CallbacksVipul A M2015-01-311-1/+1
|
* Deprecate `false` as the way to halt AM callbacksclaudiob2015-01-021-2/+1
| | | | | | | | | | Before this commit, returning `false` in an ActiveModel `before_` callback such as `before_create` would halt the callback chain. After this commit, the behavior is deprecated: will still work until the next release of Rails but will also display a deprecation warning. The preferred way to halt a callback chain is to explicitly `throw(:abort)`.
* Throw :abort halts default CallbackChainsclaudiob2015-01-021-1/+1
| | | | | | | | | | | | | | This commit changes arguments and default value of CallbackChain's :terminator option. After this commit, Chains of callbacks defined **without** an explicit `:terminator` option will be halted as soon as a `before_` callback throws `:abort`. Chains of callbacks defined **with** a `:terminator` option will maintain their existing behavior of halting as soon as a `before_` callback matches the terminator's expectation. For instance, ActiveModel's callbacks will still halt the chain when a `before_` callback returns `false`.
* fix typo in in define_model_callbacks comment [ci skip]Ryan Selk2014-10-031-1/+1
|
* add notes for `define_model_callbacks` [ci skip]Kuldeep Aggarwal2014-10-031-0/+3
|
* Fix few typos in the documentation [ci skip]Robin Dupret2013-12-211-1/+1
|
* remove some evals from callback conditionalsAaron Patterson2013-06-111-1/+4
|
* deprecating string based terminatorsAaron Patterson2013-05-141-1/+1
|
* Using define method instead of class eval when defining model callbacks.wangjohn2013-05-081-18/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on my benchmark results, this change improves performance substantially when defining callbacks. This benchmark (https://gist.github.com/wangjohn/5542610) was run using the current master and also using my experimental branch which replaced class_eval with define_single_method. Using class_eval (current master): user system total real 10 trials 0.000000 0.000000 0.000000 ( 0.001568) 50 trials 0.020000 0.000000 0.020000 ( 0.021715) 500 trials 0.110000 0.000000 0.110000 ( 0.115357) 1000 trials 0.250000 0.000000 0.250000 ( 0.260025) 10000 trials 2.560000 0.000000 2.560000 ( 2.568408) 50000 trials 12.800000 0.010000 12.810000 ( 12.886871) Using define_single_method (experimental branch): user system total real 10 trials 0.000000 0.000000 0.000000 ( 0.000790) 50 trials 0.000000 0.000000 0.000000 ( 0.002960) 500 trials 0.050000 0.010000 0.060000 ( 0.055690) 1000 trials 0.100000 0.000000 0.100000 ( 0.094073) 10000 trials 0.890000 0.000000 0.890000 ( 0.900364) 50000 trials 4.650000 0.000000 4.650000 ( 4.686127)
* Convert ActiveModel to 1.9 hash syntax.Patrick Robertson2013-05-011-4/+4
| | | | | I also attempted to fix other styleguide violations such as { a: :b } over {a: :b} and foo(b: 'bar') over foo( b: 'bar' ).
* Missing require extract_optionsAkira Matsuda2013-01-311-0/+2
|
* cleanup, removed dispensable `require` statements from `ActiveModel`Yves Senn2012-11-251-2/+0
|
* minor edits in AM documentation [ci skip]Francesco Rodriguez2012-10-211-1/+1
|
* add around_create callback documentation for ActiveModel::Callbacksandrea longhi2012-08-081-0/+11
|
* Make internal callback model definitions private in AMoCarlos Antonio da Silva2012-06-251-5/+7
| | | | | | | These _define class methods don't need to be exposed to objects that extend ActiveModel::Callbacks. Also use merge! options to avoid the creation of an extra hash.
* add :nodoc: to internal implementations [ci skip]Francesco Rodriguez2012-06-221-1/+1
|
* update ActiveModel::Callbacks documentation [ci skip]Francesco Rodriguez2012-06-221-24/+26
|
* AS::Callbacks: :skip_after_callbacks_if_terminated optionBogdan Gusiev2012-02-031-1/+2
|
* Remove Array.wrap call in ActiveModelRafael Mendonça França2012-01-061-3/+2
|
* Log 'Filter chain halted as CALLBACKNAME rendered or redirected' every time ↵José Valim2011-11-301-1/+1
| | | | a before callback halts.
* Small docs fix in Active Model callbacks moduleAlexey Vakhov2011-11-191-1/+1
|
* Remove extra white spaces on ActiveModel docs.Sebastian Martinez2011-05-231-1/+1
|
* Use run_callbacks; the generated _run_<name>_callbacks method is not a ↵John Firebaugh2011-01-311-4/+1
| | | | | | public interface. Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* No need to symbolize these.José Valim2010-12-271-1/+1
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-29/+29
| | | | 's/[ \t]*$//' -i {} \;)
* no callbacks should be created for empty array [#5289 state:resolved]Subba Rao Pasupuleti2010-08-121-3/+6
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* replacing around with for in the comments for callbacksNeeraj Singh2010-07-221-1/+1
|
* Changes call backs to callbacks.Rizwan Reza2010-06-151-8/+8
|
* Minor changes to active_model/callbacks.rb and dirty.rbRizwan Reza2010-06-141-1/+1
|
* Minor changes to callbacks and conversion API docs.Rizwan Reza2010-06-141-6/+6
|
* fix stack trace lines on class_evalSantiago Pastorino2010-04-091-3/+3
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Use Array.wrap uniformlyJeremy Kemper2010-03-271-3/+4
|
* ActiveModel::Callbacks documentationMikel Lindsaar2010-01-151-31/+73
|
* Move ActiveRecord callbacks implementation to ActiveModel and make use of it.José Valim2009-12-281-0/+91
| | | | Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
* Get rid of active_model/core and active_model/callbacksPratik Naik2009-03-211-7/+0
|
* initial statemachine machine and state classesrick2008-06-281-1/+1
|
* tweak activemodel load order a bitrick2008-06-271-0/+2
|
* initial experimental commit of active_modelRick Olson2007-11-091-0/+5
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8118 5ecf4fe2-1ee6-0310-87b1-e25e094e27de