1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #11220 from aditya-kapoor/add-concern

Change Rails Migration generator module to use AS::Concern
This commit is contained in:
Carlos Antonio da Silva 2013-07-01 12:47:00 -07:00
commit 259161881f

View file

@ -1,15 +1,14 @@
require 'active_support/concern'
module Rails
module Generators
# Holds common methods for migrations. It assumes that migrations has the
# [0-9]*_name format and can be used by another frameworks (like Sequel)
# just by implementing the next migration version method.
module Migration
extend ActiveSupport::Concern
attr_reader :migration_number, :migration_file_name, :migration_class_name
def self.included(base) #:nodoc:
base.extend ClassMethods
end
module ClassMethods
def migration_lookup_at(dirname) #:nodoc:
Dir.glob("#{dirname}/[0-9]*_*.rb")