Class: Remarkable::ActiveRecord::Base

Inherits:
Base
  • Object
show all
Defined in:
lib/remarkable_activerecord/base.rb

Instance Method Summary collapse

Instance Method Details

#with_options(opts = {}) ⇒ Object

Provides a way to send options to all ActiveRecord matchers.

validates_presence_of(:name).with_options(:allow_nil => false)

Is equivalent to:

validates_presence_of(:name, :allow_nil => false)


13
14
15
16
# File 'lib/remarkable_activerecord/base.rb', line 13

def with_options(opts={})
  @options.merge!(opts)
  self
end