rake_migrations 1.0.7 → 1.0.8
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 +4 -4
- data/README.md +4 -2
- data/lib/rake_migrations/version.rb +1 -1
- 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: 2b2674843e0d04ad4ed802931586a2d7b673e0b5
|
|
4
|
+
data.tar.gz: 169f48cd05126580f22959d5e66933ec075b7e56
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e17a87999e4de49e343a12a6499700aab37d85fbd9ae5ac29f41d945a929350d3b51b011396db72cad7ca5f0b1563925bd5dfef32d720e149065ccfef7b2b51d
|
|
7
|
+
data.tar.gz: 4988a035ce299d1e0b02931fc3d640847457e6e0a71a07ddb847999e47dd77962c6cfc09163c3b7fa04e038420016b6ba4698b1934a9718e1690c257ac27c336
|
data/README.md
CHANGED
|
@@ -68,15 +68,17 @@ This will generate a file under 'lib/tasks/rake_migrations' with a timestamp and
|
|
|
68
68
|
namespace :users do
|
|
69
69
|
desc "update run_at field to get value as in start_time"
|
|
70
70
|
task update_some_field: [:environment] do
|
|
71
|
-
# EXAMPLE
|
|
71
|
+
# EXAMPLE
|
|
72
72
|
User.update_all({role_id: 1}, {role_id: 2})
|
|
73
|
-
|
|
73
|
+
|
|
74
74
|
# DO NOT REMOVE THIS PART
|
|
75
75
|
RakeMigration.find_or_create_by_version(__FILE__[/\d+/])
|
|
76
76
|
end
|
|
77
77
|
end
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
+
Update: If you are using Rails 4 or greater, the find_or_create_by_version has been changed to find_or_create_by(version: __FILE__[/\d+/]).
|
|
81
|
+
|
|
80
82
|
Simply insert your code above the "DO NOT REMOVE THIS PART" line. The checklist is there to help you and the person who is code-reviewing your code to think of problems that might occur from your rake task. Afterwards you can run the rake task normally:
|
|
81
83
|
|
|
82
84
|
```ruby
|