jcnetdev-auto_migrations 1.3 → 1.4
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.
- data/auto_migrations.gemspec +2 -2
- data/lib/auto_migrations.rb +1 -6
- metadata +2 -2
data/auto_migrations.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'auto_migrations'
|
3
|
-
s.version = '1.
|
4
|
-
s.date = '2008-09-
|
3
|
+
s.version = '1.4'
|
4
|
+
s.date = '2008-09-09'
|
5
5
|
|
6
6
|
s.summary = "Allows migrations to be run automatically based on updating the schema.rb"
|
7
7
|
s.description = "Forget migrations, auto-migrate!"
|
data/lib/auto_migrations.rb
CHANGED
@@ -5,7 +5,7 @@ module AutoMigrations
|
|
5
5
|
class << ActiveRecord::Schema
|
6
6
|
alias :old_define :define
|
7
7
|
attr_accessor :version
|
8
|
-
def define(info={}, &block) @version
|
8
|
+
def define(info={}, &block) @version=info[:version]; instance_eval(&block) end
|
9
9
|
end
|
10
10
|
|
11
11
|
load(File.join(RAILS_ROOT, 'db', 'schema.rb'))
|
@@ -135,11 +135,6 @@ module AutoMigrations
|
|
135
135
|
|
136
136
|
def update_schema_version(version)
|
137
137
|
ActiveRecord::Base.connection.update("INSERT INTO schema_migrations VALUES ('#{version}')")
|
138
|
-
|
139
|
-
schema_file = File.join(RAILS_ROOT, "db", "schema.rb")
|
140
|
-
schema = File.read(schema_file)
|
141
|
-
schema.sub!(/:version => \d+/, ":version => #{version}")
|
142
|
-
File.open(schema_file, "w") { |f| f << schema }
|
143
138
|
end
|
144
139
|
|
145
140
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jcnetdev-auto_migrations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: "1.
|
4
|
+
version: "1.4"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PJ Hyett
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-09-
|
12
|
+
date: 2008-09-09 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|