Skip to content

Commit 694fb6b

Browse files
committed
don't require columns when there are migrations pending
1 parent 471c9c7 commit 694fb6b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/rails/concerns/helpers.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module Rails
22
module Concerns
33
module Helpers
44
def require_column base, column_name
5+
return if ActiveRecord::Migrator.needs_migration?
6+
57
if base.table_exists? and base.columns.map(&:name).exclude?(column_name)
68
raise NotImplementedError, "#{base} must have '#{column_name}' column"
79
end

0 commit comments

Comments
 (0)