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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/neo4j/version.rb +1 -1
- data/lib/rails/generators/neo4j_generator.rb +34 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 460b4490ba973c04eb800f32a095b7132587a21b
|
4
|
+
data.tar.gz: b016ef259799a5653e96b0c22e20e229082698a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
@@ -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}
|
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 =
|
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
|
|