fixturease 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/Rakefile +1 -1
  2. data/bin/fixturease.rb +4 -2
  3. metadata +1 -1
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'rake/gempackagetask'
2
2
  require 'rubygems'
3
3
 
4
- PKG_VERSION="0.2.1"
4
+ PKG_VERSION="0.2.2"
5
5
  PKG_FILES=["bin/fixturease.rb","Rakefile"]
6
6
 
7
7
  spec = Gem::Specification.new do |s|
data/bin/fixturease.rb CHANGED
@@ -30,10 +30,12 @@ else
30
30
  unless ActiveRecord::Base.fixturease_fixtures.keys.empty?
31
31
  puts
32
32
  puts "Saving fixtures:"
33
- ActiveRecord::Base.fixturease_fixtures.each_pair do |k,v|
33
+ ActiveRecord::Base.fixturease_fixtures.each_pair do |k,val|
34
34
  filename = "#{ENV['RAILS_ROOT']}/#{ENV['FIXTURES_ROOT']}/#{k.table_name}.yml"
35
35
  print "#{k} [#{filename}]: "
36
- puts v.keys.collect{|rec_id| vars[k.find(rec_id)] ? vars[k.find(rec_id)] : rec_id }.to_sentence
36
+ v = {}
37
+ val.each_pair {|rec_id,obj| v[rec_id] = obj if k.exists?(rec_id) }
38
+ puts v.keys.collect{|rec_id| o = k.find(rec_id) ; vars[o] ? vars[o] : rec_id}.to_sentence
37
39
  f = File.new("#{filename}","a")
38
40
  f.write "\n\n# Fixturease (#{Time.now}):\n\n"
39
41
  f.write v.values.inject({}) { |hsh, record| hsh.merge(vars[record] || "#{k.table_name}_#{record.id}" => record.attributes) }.to_yaml(:SortKeys => true).gsub(/^---.*\n/,"")
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: fixturease
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.1
6
+ version: 0.2.2
7
7
  date: 2007-01-19 00:00:00 +02:00
8
8
  summary: Easy fixture creation tool
9
9
  require_paths: