mcfly 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MGZiZTcxYTIwYzcwNTJhODM2ZDFlZjc3ZmY3Y2ZjM2UwMGM0MDBiNQ==
5
+ data.tar.gz: !binary |-
6
+ MTljMDY5ZGM0MzgxYWM0ODkxNGU2MWI0N2NiNDc5YzA5YTA5ODMxNQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ NzZmZTAxOWMyMTNkNDg2ZDU2YzlkNjVhNTk2NWEzY2FjNWMzMjk0NjFlZTMw
10
+ ODRjNzU1MjExMDYwZDMwNDAzNzc4NDFmM2ZlNDBiNDc2MmNkNWZmYWI3ZTY3
11
+ ZDM5ZWM3ZDJjOGEwMzA0NzM4MjlkMjM5MTY1ODI4ZDQ1ZDc1YWY=
12
+ data.tar.gz: !binary |-
13
+ NzliY2I2NmQ5NTAwNDExNjdjNmViM2NjY2FjYTAzNTg0MDQ5ZDA5MWUxYjY2
14
+ ODE4NTc1Y2QyN2Y2NmI4YzM4NmVhNjJhODllOTJlOGExMmU3MjU4MWE0NGY5
15
+ OTM4YTg1ZDdkNzRiMGEwZWViYzVlNzEyNjdjZTFmMDE3MzY1M2E=
@@ -107,11 +107,11 @@ module Mcfly
107
107
  # checks against registered associations
108
108
  if self.class.class_variable_defined?(:@@associations)
109
109
  self.class.class_variable_get(:@@associations).each do |klass, fk|
110
- self.errors.add :base,
111
- "#{self.class.name.demodulize} cannot be deleted " +
112
- "because #{klass.name.demodulize} records exist" if
113
- klass.where("obsoleted_dt = 'infinity' and
114
- #{fk} = ?", self.id).count > 0
110
+ self.errors.add :base,
111
+ "#{self.class.name.demodulize} can't be deleted " +
112
+ "because #{klass.name.demodulize} records exist" if
113
+ klass.where("obsoleted_dt = ? AND #{fk} = ?",
114
+ 'infinity', self.id).count > 0
115
115
  end
116
116
  end
117
117
 
@@ -21,6 +21,12 @@ class McflyMigration < ActiveRecord::Migration
21
21
  }
22
22
  end
23
23
 
24
+ # TODO: Remove this in 4.0 since we can check direction
25
+ def migrate(direction)
26
+ @dir = direction
27
+ super
28
+ end
29
+
24
30
  def create_table(table_name, options = {}, &block)
25
31
  super { |t|
26
32
  t.integer :group_id, null: false
@@ -33,7 +39,7 @@ class McflyMigration < ActiveRecord::Migration
33
39
  block.call(t)
34
40
  }
35
41
 
36
- add_sql(table_name, true)
42
+ add_sql(table_name, true) if @dir == :up
37
43
  end
38
44
  end
39
45
 
data/lib/mcfly/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mcfly
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mcfly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
5
- prerelease:
4
+ version: 0.0.12
6
5
  platform: ruby
7
6
  authors:
8
7
  - Arman Bostani
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-10-29 00:00:00.000000000 Z
11
+ date: 2014-01-08 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rails
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: pg
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: delorean_lang
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rspec
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ! '>='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ! '>='
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rspec-rails
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ! '>='
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ! '>='
92
81
  - !ruby/object:Gem::Version
@@ -159,27 +148,26 @@ files:
159
148
  - spec/spec_helper.rb
160
149
  homepage: https://github.com/arman000/mcfly
161
150
  licenses: []
151
+ metadata: {}
162
152
  post_install_message:
163
153
  rdoc_options: []
164
154
  require_paths:
165
155
  - lib
166
156
  required_ruby_version: !ruby/object:Gem::Requirement
167
- none: false
168
157
  requirements:
169
158
  - - ! '>='
170
159
  - !ruby/object:Gem::Version
171
160
  version: '0'
172
161
  required_rubygems_version: !ruby/object:Gem::Requirement
173
- none: false
174
162
  requirements:
175
163
  - - ! '>='
176
164
  - !ruby/object:Gem::Version
177
165
  version: '0'
178
166
  requirements: []
179
167
  rubyforge_project:
180
- rubygems_version: 1.8.25
168
+ rubygems_version: 2.1.11
181
169
  signing_key:
182
- specification_version: 3
170
+ specification_version: 4
183
171
  summary: A database table versioning system.
184
172
  test_files: []
185
173
  has_rdoc: