anaconda 0.9.0 → 0.9.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 +4 -4
- data/README.markdown +1 -1
- data/lib/anaconda/version.rb +1 -1
- data/lib/generators/anaconda/migration_generator.rb +5 -5
- 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: d5c39c58bac90e84af18f2b81d0bfd36a81b937c
|
4
|
+
data.tar.gz: e0b98f5d1e1aa018b9cdf11266ce9bb5a1850198
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe908d46e6bac0af90be5d7e1165b8708059493aea556a9366e2c101af190d237605c8432b6b538dad31eac4ef4d5556ab33b812c062a604f9550a32a137e2c9
|
7
|
+
data.tar.gz: e72559222bee2e36a59835b231786e7e90572df22a2d180ef007bca3eb389768afbd745910daa52fbd1e27bb5288bda20decd5a9f7f760ba7f733cab825a7117
|
data/README.markdown
CHANGED
@@ -91,7 +91,7 @@ We highly recommend the `figaro` gem [https://github.com/laserlemon/figaro](http
|
|
91
91
|
|
92
92
|
We provide a migration generator. Assuming `anaconda_for :asset` inside of PostMedia model:
|
93
93
|
|
94
|
-
$ rails g
|
94
|
+
$ rails g anaconda:migration PostMedia asset
|
95
95
|
|
96
96
|
* Model setup
|
97
97
|
|
data/lib/anaconda/version.rb
CHANGED
@@ -8,15 +8,15 @@ module Anaconda
|
|
8
8
|
argument :field_name, :type => :string, :default => "asset"
|
9
9
|
|
10
10
|
def create_migration_file
|
11
|
-
destination = "db/migrate/#{Time.now.strftime('%Y%m%d%H%M%S')}_anaconda_migration_for_#{file_name}_#{field_name}.rb"
|
12
|
-
migration_name = "AnacondaMigrationFor#{file_name.titlecase}#{field_name.titlecase}"
|
11
|
+
destination = "db/migrate/#{Time.now.strftime('%Y%m%d%H%M%S')}_anaconda_migration_for_#{file_name}_#{field_name}.rb".gsub(" ", "")
|
12
|
+
migration_name = "AnacondaMigrationFor#{file_name.titlecase}#{field_name.titlecase}".gsub(" ", "")
|
13
13
|
count = nil
|
14
14
|
i = 1
|
15
|
-
while !Dir.glob("db/migrate/*_anaconda_migration_for_#{file_name}_#{field_name}#{count}.rb").empty?
|
15
|
+
while !Dir.glob("db/migrate/*_anaconda_migration_for_#{file_name}_#{field_name}#{count}.rb".gsub(" ", "")).empty?
|
16
16
|
i += 1
|
17
17
|
count = "_#{i}"
|
18
|
-
destination = "db/migrate/#{Time.now.strftime('%Y%m%d%H%M%S')}_anaconda_migration_for_#{file_name}_#{field_name}#{count}.rb"
|
19
|
-
migration_name = "AnacondaMigrationFor#{file_name.titlecase}#{field_name.titlecase}#{i}"
|
18
|
+
destination = "db/migrate/#{Time.now.strftime('%Y%m%d%H%M%S')}_anaconda_migration_for_#{file_name}_#{field_name}#{count}.rb".gsub(" ", "")
|
19
|
+
migration_name = "AnacondaMigrationFor#{file_name.titlecase}#{field_name.titlecase}#{i}".gsub(" ", "")
|
20
20
|
end
|
21
21
|
create_file destination, <<-FILE
|
22
22
|
class #{migration_name} < ActiveRecord::Migration
|