Skip to content

Commit

Permalink
Added the db:init thor task.
Browse files Browse the repository at this point in the history
  • Loading branch information
gma committed Nov 11, 2008
1 parent 482f989 commit cf11029
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
8 changes: 8 additions & 0 deletions Thorfile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ class Db < Thor
ActiveRecord::Migrator.migrate( ActiveRecord::Migrator.migrate(
"db/migrate/", ENV["VERSION"] ? ENV["VERSION"].to_i : nil) "db/migrate/", ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
end end

desc "init", "create first successful test run"
def init
run = TestRun.new
run.application_versions << ApplicationVersion.check_current_versions(:live)
run.passed = true
run.save!
end
end end


class App < Thor class App < Thor
Expand Down
12 changes: 0 additions & 12 deletions lib/integral/console.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,15 +1,3 @@
# Loaded by script/console. # Loaded by script/console.


Integral::Database.connect Integral::Database.connect

# You should only use this function when you first install integral, to give
# yourself a successful test run for your existing applications. You should
# use the app:add thor task to add all relevant applications before you
# run it.
#
def create_test_run_from_live_versions(success)
run = TestRun.new
run.application_versions << ApplicationVersion.check_current_versions(:live)
run.passed = success
run.save!
end

0 comments on commit cf11029

Please sign in to comment.