paulelliott/fabrication

View on GitHub
lib/fabrication/generator/data_mapper.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Fabrication::Generator::DataMapper < Fabrication::Generator::Base

  def self.supports?(klass)
    defined?(DataMapper) && klass.ancestors.include?(DataMapper::Hook)
  end

  def build_instance
    self._instance = _klass.new(_attributes)
  end

  protected

  def persist
    _instance.save
  end

end