lib/migration_tools/tasks.rb in migration_tools-1.3.1 vs lib/migration_tools/tasks.rb in migration_tools-1.4.0
- old
+ new
@@ -8,11 +8,11 @@
define_migrate_group
define_convenience_tasks
end
def group
- return @group if @group
+ return @group if defined?(@group) && @group
@group = ENV['GROUP'].to_s
raise "Invalid group \"#{@group}\"" if !@group.empty? && !MIGRATION_GROUPS.member?(@group)
@group
end
@@ -34,10 +34,10 @@
ActiveRecord::Migrator.new(:up, migrations_paths, target_version)
end
end
def pending_migrations
- return @pending_migrations if @pending_migrations
+ return @pending_migrations if defined?(@pending_migrations) && @pending_migrations
@pending_migrations = migrator.pending_migrations
@pending_migrations = @pending_migrations.select { |proxy| group.empty? || proxy.migration_group == group }
@pending_migrations
end