Sha256: a6fe71e01857a8a0526e91e7a8596055ae7e03a5f1fd3444e65a8171a1512df5
Contents?: true
Size: 388 Bytes
Versions: 17
Compression:
Stored size: 388 Bytes
Contents
module Pickle class Migrant < Adapter def self.factories model_classes.select { |model| model.respond_to?(:mock) }.collect { |model| new(model) } end def initialize(klass) @klass, @name = klass, klass.name.underscore.gsub('/', '_') end def create(attrs={}) @klass.mock!(Hash[attrs.collect { |k,v| [k.to_sym, v] }]) end end end
Version data entries
17 entries across 17 versions & 1 rubygems