lib/paratrooper/pending_migration_check.rb in paratrooper-2.3.0 vs lib/paratrooper/pending_migration_check.rb in paratrooper-2.4.0
- old
+ new
@@ -9,15 +9,21 @@
self.match_tag_name = match_tag_name
self.system_caller = system_caller
end
def migrations_waiting?
- call = %Q[git diff --shortstat #{last_deployed_commit} #{match_tag_name} -- db/migrate]
- self.diff = system_caller.execute(call)
- !diff.strip.empty?
+ @migrations_waiting ||= check_for_pending_migrations
end
def last_deployed_commit
@last_deploy_commit ||= heroku.last_deploy_commit
+ end
+
+ private
+
+ def check_for_pending_migrations
+ call = %Q[git diff --shortstat #{last_deployed_commit} #{match_tag_name} -- db/migrate]
+ self.diff = system_caller.execute(call)
+ !diff.strip.empty?
end
end
end