Methods
B
C
N
Attributes
[R] callbacks
Class Public methods
new(options = {})
# File activemodel/test/cases/callbacks_test.rb, line 33
def initialize(options = {})
  @callbacks = []
  @valid = options[:valid]
  @before_create_returns = options.fetch(:before_create_returns, true)
  @before_create_throws = options[:before_create_throws]
end
Instance Public methods
before_create()
# File activemodel/test/cases/callbacks_test.rb, line 40
def before_create
  @callbacks << :before_create
  throw(@before_create_throws) if @before_create_throws
  @before_create_returns
end
create()
# File activemodel/test/cases/callbacks_test.rb, line 46
def create
  run_callbacks :create do
    @callbacks << :create
    @valid
  end
end