AS::Callbacks::Callback refactor #3637

Merged
merged 1 commit into from Jan 5, 2012

Projects

None yet

2 participants

@bogdan
bogdan commented Nov 15, 2011

In order to make Callbacks code always operate on valid peaces of code

Concatenated Callback#start and Callback#end method into #apply
method.

The main concern is around filter. Current implementation of #start #end for around filter looks like this:

def start(....)
  "#{name}(halted) do"
end 
def end(....)
    "  value
  end"
end

This is insanely confusing. Now it looks like:

def apply(...)
  <<-RUBY_EVAL
#{name}(halted) do
  #{code}
  value
end
RUBY_EVAL
end
@bogdan bogdan AS::Callbacks::Callback refactor
In order to make Callbacks code always operate on valid peaces of code
Concatenated Callback#start and Callback#end method into #apply
method.
3dc80b7
@josevalim josevalim merged commit 0e8dda7 into rails:master Jan 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment