Sha256: e261baef5991465039cccef63cc5899116bf73ffc67957febbdd0983b3e0d680
Contents?: true
Size: 598 Bytes
Versions: 1
Compression:
Stored size: 598 Bytes
Contents
require 'dm-core' module DataMapper::Model # Creates a single record of seed data for use # with the db:seed rake task. # # === Parameters # constraints :: Immutable reference attributes. Defaults to :id def seed(*constraints, &block) MerbSeed::Seeder.plant(self, *constraints, &block) end def seed_many(*constraints) seeds = constraints.pop seeds.each do |seed_data| seed(*constraints) do |s| seed_data.each_pair do |k,v| s.send "#{k}=", v end end end end def column_names properties.map{|i| i.field } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
merb_seed-0.1.1 | lib/merb_seed/orm/dm_ext.rb |