Skip to content

Commit 748851e

Browse files
committed
Adds ::rollback method to Songkick::Oauth2::Schema
Also updates README to indicate the availability of the rollback method. (Also aliased as ::down)
1 parent 1671aba commit 748851e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

README.rdoc

+2
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ the gem's migrations that have not yet been applied to your database.
113113
-> 0.0009s
114114
...
115115

116+
To rollback migrations, use <tt>Songkick::OAuth2::Model::Schema.rollback</tt>.
117+
116118

117119
=== Model Mixins
118120

lib/songkick/oauth2/schema.rb

+8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ class << self
1010
alias :up :migrate
1111
end
1212

13+
def self.rollback
14+
ActiveRecord::Base.logger ||= Logger.new(StringIO.new)
15+
ActiveRecord::Migrator.down(migrations_path)
16+
end
17+
class << self
18+
alias :down :rollback
19+
end
20+
1321
def self.migrations_path
1422
File.expand_path('../schema', __FILE__)
1523
end

0 commit comments

Comments
 (0)