Skip to content
This repository has been archived by the owner on Nov 11, 2017. It is now read-only.

Commit

Permalink
lib refactoring
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.thoughtbot.com/plugins/when/trunk@326 7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
  • Loading branch information
jcarroll committed Feb 13, 2008
1 parent 461ec95 commit 36eb979
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
5 changes: 1 addition & 4 deletions lib/callbacks.rb
Expand Up @@ -9,11 +9,8 @@ class << klass


callbacks.each do |callback| callbacks.each do |callback|
src = <<-END src = <<-END
def #{callback}_with_conditions (*callbacks, &block) def #{callback}_with_conditions(*callbacks)
options = callbacks.extract_options! options = callbacks.extract_options!
if block_given?
callbacks << block
end
callbacks.each do |callback| callbacks.each do |callback|
#{callback}_without_conditions do |record| #{callback}_without_conditions do |record|
unless (! options[:if].nil? && ! evaluate_condition(options[:if], record)) || unless (! options[:if].nil? && ! evaluate_condition(options[:if], record)) ||
Expand Down
7 changes: 0 additions & 7 deletions lib/when.rb
Expand Up @@ -3,10 +3,3 @@


ActiveRecord::Base.send :include, ActiveRecordHook::Callbacks ActiveRecord::Base.send :include, ActiveRecordHook::Callbacks
ActionController::Base.send :include, ActionControllerHook::Filters ActionController::Base.send :include, ActionControllerHook::Filters

# module When

# def
# end

# end

0 comments on commit 36eb979

Please sign in to comment.