ridgepole 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c0c8c1752319c718ff7d81bd312595be2d82f13
4
- data.tar.gz: d47279b479c711c61612ff141ac256ffc6372918
3
+ metadata.gz: e76552f3870c883c466187a33c21c8d1b22c4bad
4
+ data.tar.gz: fee7cdd8d0dd112d033500907d9f468718fd139c
5
5
  SHA512:
6
- metadata.gz: 46869c5d0e8647b8abf3402d555cf84e60c3a024a9b48e46fbe0075ee1b7fd3cec44b51261df1f23446544ff3123394245649fe87812a56b3e5dccc174582463
7
- data.tar.gz: 185b564db9d8af17abe59fc9bc1cea970f1cc906a8a8e6231bfe42d68e86f66d67c78521eef77f694236a24b50afb89434d218314ad96c41dfc2959912192a70
6
+ metadata.gz: 0fddcb88ff0e7c8357536f746c732ebea7ef276321462992830031e078ce18933f5a76c4f4ecd0832a71f0d24a96e9c2b88a5aba4678483192467ecb80b6e8eb
7
+ data.tar.gz: d3c94e687f7b28d0b7cd13c75fd6ab473743c5c834b757289c05b244340e836d0a52c7b4e55ec22f3a8396473fc70624d5735b267476d9ddab80303c9d5bab27
@@ -94,10 +94,12 @@ class Ridgepole::Diff
94
94
  definition_delta[:add] ||= {}
95
95
  to_attrs[:options] ||= {}
96
96
 
97
- if priv_column_name
98
- to_attrs[:options][:after] = priv_column_name
99
- else
100
- to_attrs[:options][:first] = true
97
+ unless @options[:merge]
98
+ if priv_column_name
99
+ to_attrs[:options][:after] = priv_column_name
100
+ else
101
+ to_attrs[:options][:first] = true
102
+ end
101
103
  end
102
104
 
103
105
  definition_delta[:add][column_name] = to_attrs
@@ -6,9 +6,9 @@ class Ridgepole::Dumper
6
6
  def dump
7
7
  stream = StringIO.new
8
8
  conn = ActiveRecord::Base.connection
9
- target_tables = @options.fetch(:tables, [])
9
+ target_tables = @options[:tables]
10
10
 
11
- unless target_tables.empty?
11
+ if target_tables
12
12
  conn.tables.each do |tbl|
13
13
  next if target_tables.include?(tbl)
14
14
  ActiveRecord::SchemaDumper.ignore_tables << tbl
@@ -17,6 +17,8 @@ class Ridgepole::Dumper
17
17
 
18
18
  ActiveRecord::SchemaDumper.dump(conn, stream)
19
19
 
20
+ ActiveRecord::SchemaDumper.ignore_tables.clear if target_tables
21
+
20
22
  dsl = stream.string.lines.select {|line|
21
23
  line !~ /\A#/ &&
22
24
  line !~ /\AActiveRecord::Schema\.define/ &&
@@ -1,3 +1,3 @@
1
1
  module Ridgepole
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -2,6 +2,8 @@ $: << File.expand_path('..', __FILE__)
2
2
  require 'ridgepole'
3
3
  require 'string_ext'
4
4
 
5
+ ActiveRecord::Migration.verbose = false
6
+
5
7
  RSpec.configure do |config|
6
8
  config.before(:each) do
7
9
  restore_database
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ridgepole
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-23 00:00:00.000000000 Z
11
+ date: 2014-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord