aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/callbacks.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 19:55:02 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 20:16:27 +0200
commit80e66cc4d90bf8c15d1a5f6e3152e90147f00772 (patch)
treee7e75464af04f3cf1935b29238dbd7cb2337b0dd /activemodel/lib/active_model/callbacks.rb
parent411ccbdab2608c62aabdb320d52cb02d446bb39c (diff)
downloadrails-80e66cc4d90bf8c15d1a5f6e3152e90147f00772.tar.gz
rails-80e66cc4d90bf8c15d1a5f6e3152e90147f00772.tar.bz2
rails-80e66cc4d90bf8c15d1a5f6e3152e90147f00772.zip
normalizes indentation and whitespace across the project
Diffstat (limited to 'activemodel/lib/active_model/callbacks.rb')
-rw-r--r--activemodel/lib/active_model/callbacks.rb36
1 files changed, 18 insertions, 18 deletions
diff --git a/activemodel/lib/active_model/callbacks.rb b/activemodel/lib/active_model/callbacks.rb
index 8a87025536..283090e380 100644
--- a/activemodel/lib/active_model/callbacks.rb
+++ b/activemodel/lib/active_model/callbacks.rb
@@ -122,28 +122,28 @@ module ActiveModel
private
- def _define_before_model_callback(klass, callback) #:nodoc:
- klass.define_singleton_method("before_#{callback}") do |*args, &block|
- set_callback(:"#{callback}", :before, *args, &block)
+ def _define_before_model_callback(klass, callback) #:nodoc:
+ klass.define_singleton_method("before_#{callback}") do |*args, &block|
+ set_callback(:"#{callback}", :before, *args, &block)
+ end
end
- end
- def _define_around_model_callback(klass, callback) #:nodoc:
- klass.define_singleton_method("around_#{callback}") do |*args, &block|
- set_callback(:"#{callback}", :around, *args, &block)
+ def _define_around_model_callback(klass, callback) #:nodoc:
+ klass.define_singleton_method("around_#{callback}") do |*args, &block|
+ set_callback(:"#{callback}", :around, *args, &block)
+ end
end
- end
- def _define_after_model_callback(klass, callback) #:nodoc:
- klass.define_singleton_method("after_#{callback}") do |*args, &block|
- options = args.extract_options!
- options[:prepend] = true
- conditional = ActiveSupport::Callbacks::Conditionals::Value.new { |v|
- v != false
- }
- options[:if] = Array(options[:if]) << conditional
- set_callback(:"#{callback}", :after, *(args << options), &block)
+ def _define_after_model_callback(klass, callback) #:nodoc:
+ klass.define_singleton_method("after_#{callback}") do |*args, &block|
+ options = args.extract_options!
+ options[:prepend] = true
+ conditional = ActiveSupport::Callbacks::Conditionals::Value.new { |v|
+ v != false
+ }
+ options[:if] = Array(options[:if]) << conditional
+ set_callback(:"#{callback}", :after, *(args << options), &block)
+ end
end
- end
end
end