Sha256: f18ace558201d992f9d674cb8ff84029a034e77e8b9583c7fcb35a9920a7b7f2

Contents?: true

Size: 649 Bytes

Versions: 24

Compression:

Stored size: 649 Bytes

Contents

class TestModelWithAttributeDefaultValues

  # stub ActiveRecord::Base methods

  def self.after_initialize(method_or_proc)
    @@after_initialize_method_or_proc = method_or_proc
  end

  def initialize(*args)
    args.extract_options!.each do |key, value|
      self.send("#{key}=", value)
    end

    @@after_initialize_method_or_proc.respond_to?(:call) ?
      @@after_initialize_method_or_proc.call(self) :
      send(@@after_initialize_method_or_proc)
  end

  def read_attribute(attrib)
    self.send(attrib)
  end

  def write_attribute(attrib, value)
    self.send("#{attrib}=", value)
  end

  include Riveter::AttributeDefaultValues

end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
riveter-0.0.5 spec/support/test_model_with_attribute_default_values.rb
riveter-0.0.4 spec/support/test_model_with_attribute_default_values.rb
riveter-0.0.3 spec/support/test_model_with_attribute_default_values.rb
riveter-0.0.1 spec/support/test_model_with_attribute_default_values.rb