neo4j 8.2.3 → 8.2.4

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: ed3de6664c585f0e48662a419cdb5287f361d2ec
4
- data.tar.gz: d0be71975e969b60b575e22ba333613c4eada69f
3
+ metadata.gz: 460b4490ba973c04eb800f32a095b7132587a21b
4
+ data.tar.gz: b016ef259799a5653e96b0c22e20e229082698a0
5
5
  SHA512:
6
- metadata.gz: e8494b0eb6c7fc75733b806656d4cdc46eb2877056f6ae9161bc0a96aa300452ed881bd32e3025d3da84f0d235655bf976c70114a57c8a809be70dbf6f81c26d
7
- data.tar.gz: 1687fdb57c2d83a94aaebdb6682bf0b22ba5100b31d03fa58b1f233cf78223b89f4888a35f69e782fc2cafdca40e95cc0e1c93c92a969788aaa5e174510c6bf2
6
+ metadata.gz: 6b117cd2ef0bae8dcd308bfb9f44c0620ced63749c6a7a0cd9c866e224ac64e88130fb21c5df2118ee8e980781f3fd4921089793318083894e217687b24cf9b3
7
+ data.tar.gz: e7602f3a2b185f1d0d65f4adf2e83d5faeaf68c1c989ab8c0ff14bdaa2cdf4437ccb24aa0ec75bc54a93b44e8047733131d4e9473acefadb45ad00d962200b33
data/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.
3
3
  This file should follow the standards specified on [http://keepachangelog.com/]
4
4
  This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
+ ## [8.2.4] 2017-09-20
7
+
8
+ ### Fixes
9
+
10
+ - Fixes ability to run `rails destroy model` and `rails destroy migration` (thanks @thefliik / see #1420)
11
+
6
12
  ## [8.2.3] 2017-09-19
7
13
 
8
14
  ### Fixes
data/lib/neo4j/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Neo4j
2
- VERSION = '8.2.3'
2
+ VERSION = '8.2.4'
3
3
  end
@@ -9,15 +9,47 @@ end
9
9
  module Neo4j::Generators::MigrationHelper
10
10
  extend ActiveSupport::Concern
11
11
 
12
+ def base_migration_file_name(file_name, prefix = '')
13
+ "#{prefix}#{file_name.parameterize}"
14
+ end
15
+
12
16
  def migration_file_name(file_name, prefix = '')
13
- "#{Time.now.utc.strftime('%Y%m%d%H%M%S')}_#{prefix}#{file_name.parameterize}.rb"
17
+ "#{Time.now.utc.strftime('%Y%m%d%H%M%S')}_#{base_migration_file_name(file_name, prefix)}.rb"
18
+ end
19
+
20
+ def migration_lookup_at(dirname)
21
+ Dir.glob("#{dirname}/[0-9]*_*.rb")
14
22
  end
15
23
 
24
+ # Stolen from https://github.com/rails/rails/blob/30767f980faa2d7a0531774ddf040471db74a23b/railties/lib/rails/generators/migration.rb#L20
25
+ def existing_migration(dirname, file_name)
26
+ migration_lookup_at(dirname).grep(/\d+_#{file_name}.rb$/).first
27
+ end
28
+
29
+ # :revoke happens when task is invoked with `rails destroy model ModelName`
16
30
  def migration_template(template_name, prefix = '')
17
- real_file_name = migration_file_name(file_name, prefix)
31
+ real_file_name = case @behavior
32
+ when :revoke
33
+ existing_migration(
34
+ 'db/neo4j/migrate',
35
+ base_migration_file_name(file_name, prefix)
36
+ )
37
+ else
38
+ migration_file_name(file_name, prefix)
39
+ end
40
+
41
+ # If running with :revoke and migration doesn't exist, real_file_name = nil
42
+ return if !real_file_name
43
+
18
44
  @migration_class_name = file_name.camelize
19
45
 
46
+ # template() method is still run on revoke but it doesn't generate anything
47
+ # other than a consol message indicating the filepath.
48
+ # (this appears to be behavior provided by rails)
20
49
  template template_name, File.join('db/neo4j/migrate', real_file_name)
50
+
51
+ # On revoke, we need to manually remove the file
52
+ FileUtils.rm(real_file_name) if @behavior == :revoke
21
53
  end
22
54
  end
23
55
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4j
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.2.3
4
+ version: 8.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Ronge, Brian Underwood, Chris Grigg