Module: E9Rails::ActiveRecord::InheritableOptions

Extended by:
ActiveSupport::Concern
Defined in:
lib/e9_rails/active_record/inheritable_options.rb

Defined Under Namespace

Modules: ClassMethods Classes: IndifferentOptions, Options

Instance Method Summary collapse

Instance Method Details

#optionsObject



34
35
36
37
38
39
40
# File 'lib/e9_rails/active_record/inheritable_options.rb', line 34

def options
  ensuring_method_attributes do
    opts = read_options
    opts.reverse_merge! Hash[options_parameters.map(&:to_s).zip([nil])]
    options_class.new(opts, self)
  end
end

#options=(hash) ⇒ Object



28
29
30
31
32
# File 'lib/e9_rails/active_record/inheritable_options.rb', line 28

def options=(hash)
  ensuring_method_attributes do
    write_options(hash || {})
  end
end