lol_dba 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5f965e8e5463841860f579840400ff6a3464c62
4
- data.tar.gz: 455fc4389cd58ba70158cfd9f10b14e34500fef0
3
+ metadata.gz: 0f8f30bc53bf7278cad306997f434ba8de25169b
4
+ data.tar.gz: 6420eeecffc2fcb69aca524eca6978d2e294a89d
5
5
  SHA512:
6
- metadata.gz: 054bfcbe1203ed325c3b3cf07ada9a41410f830f2e18b46c59a5c10b0fe7167691e0143f10dd33f9a2c87f1fb6d2ad8bb15a6b6596073f5e4793958baceebebd
7
- data.tar.gz: 836ebb3454366193e65a80b6d40504efec1f06c63a9a011cb8700c100df6eac462429cbc79829f915a166810a77c6ceccd23fef51f23c609fb9fdd42556db356
6
+ metadata.gz: bb7439613b407c72b0cc2d192a57fd291da192aa5835a7e6fbb2787f84834949774b50711838e675e5f21afce8cf741da7acd6cfd7282322ab87a134deeae78c
7
+ data.tar.gz: ceb284d9f78a6c9821fca67586b6483c033b51e01473ae3f1a51ad9f07eb419db0336848a01c6af69923f175f87053b1b078b9b25adadd4b7a924a702a8425ae
@@ -98,7 +98,7 @@ EOM
98
98
  if reflection_options.options.has_key?(:polymorphic) && (reflection_options.options[:polymorphic] == true)
99
99
  poly_type = "#{reflection_options.name.to_s}_type"
100
100
  poly_id = "#{reflection_options.name.to_s}_id"
101
-
101
+
102
102
  @index_migrations[@table_name.to_s] += [[poly_type, poly_id].sort] unless @index_migrations[@table_name.to_s].include?([poly_type, poly_id].sort)
103
103
  else
104
104
  foreign_key = reflection_options.options[:foreign_key] ||= reflection_options.respond_to?(:primary_key_name) ? reflection_options.primary_key_name : reflection_options.foreign_key
@@ -4,7 +4,7 @@ module LolDba
4
4
 
5
5
  def initialize(migration_file)
6
6
  self.full_name = File.basename(migration_file, ".rb")
7
- require Rails.root + "db/migrate/#{full_name}.rb"
7
+ require Rails.root.join(migration_file)
8
8
  end
9
9
 
10
10
  def number
@@ -55,7 +55,12 @@ module LolDba
55
55
  end
56
56
 
57
57
  def migrations(which)
58
- migrator = ActiveRecord::Migrator.new(:up, ActiveRecord::Migrator.migrations_path)
58
+ migrator = nil
59
+ if ActiveRecord.version.version =~ /^4./
60
+ migrator = ActiveRecord::Migrator.new(:up, ActiveRecord::Migrator.migrations(ActiveRecord::Migrator.migrations_path))
61
+ else
62
+ migrator = ActiveRecord::Migrator.new(:up, ActiveRecord::Migrator.migrations_path)
63
+ end
59
64
  if which == "all"
60
65
  migrator.migrations.collect { |m| m.filename }
61
66
  elsif which == "pending"
@@ -1,3 +1,3 @@
1
1
  module LolDba
2
- VERSION = "1.6.0" unless defined? LolDba::VERSION
2
+ VERSION = "1.6.1" unless defined? LolDba::VERSION
3
3
  end
@@ -17,6 +17,7 @@ module LolDba
17
17
  end
18
18
 
19
19
  def write(string)
20
+ return if file_name.nil?
20
21
  File.open(path, 'a') { |file| file << string; file << ";\n" }
21
22
  end
22
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lol_dba
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Plentz
@@ -12,48 +12,48 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-07-27 00:00:00.000000000 Z
15
+ date: 2014-09-08 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activerecord
19
19
  requirement: !ruby/object:Gem::Requirement
20
20
  requirements:
21
- - - '>='
21
+ - - ">="
22
22
  - !ruby/object:Gem::Version
23
23
  version: '3.0'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - '>='
28
+ - - ">="
29
29
  - !ruby/object:Gem::Version
30
30
  version: '3.0'
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: actionpack
33
33
  requirement: !ruby/object:Gem::Requirement
34
34
  requirements:
35
- - - '>='
35
+ - - ">="
36
36
  - !ruby/object:Gem::Version
37
37
  version: '3.0'
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - '>='
42
+ - - ">="
43
43
  - !ruby/object:Gem::Version
44
44
  version: '3.0'
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: railties
47
47
  requirement: !ruby/object:Gem::Requirement
48
48
  requirements:
49
- - - '>='
49
+ - - ">="
50
50
  - !ruby/object:Gem::Version
51
51
  version: '3.0'
52
52
  type: :runtime
53
53
  prerelease: false
54
54
  version_requirements: !ruby/object:Gem::Requirement
55
55
  requirements:
56
- - - '>='
56
+ - - ">="
57
57
  - !ruby/object:Gem::Version
58
58
  version: '3.0'
59
59
  description: lol_dba is a small package of rake tasks that scan your application models
@@ -69,8 +69,8 @@ executables:
69
69
  extensions: []
70
70
  extra_rdoc_files: []
71
71
  files:
72
- - .gitignore
73
- - .travis.yml
72
+ - ".gitignore"
73
+ - ".travis.yml"
74
74
  - Gemfile
75
75
  - Gemfile.lock
76
76
  - README.md
@@ -113,17 +113,17 @@ require_paths:
113
113
  - lib/lol_dba
114
114
  required_ruby_version: !ruby/object:Gem::Requirement
115
115
  requirements:
116
- - - '>='
116
+ - - ">="
117
117
  - !ruby/object:Gem::Version
118
118
  version: '0'
119
119
  required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  requirements:
121
- - - '>='
121
+ - - ">="
122
122
  - !ruby/object:Gem::Version
123
123
  version: '0'
124
124
  requirements: []
125
125
  rubyforge_project:
126
- rubygems_version: 2.0.3
126
+ rubygems_version: 2.2.2
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: A small package of rake tasks to track down missing database indexes and