lib/cassandra_object/migrations.rb in gotime-cassandra_object-2.7.3 vs lib/cassandra_object/migrations.rb in gotime-cassandra_object-2.7.4

- old
+ new

@@ -2,12 +2,14 @@ module Migrations extend ActiveSupport::Concern extend ActiveSupport::Autoload included do - class_inheritable_array :migrations - class_inheritable_accessor :current_schema_version + class_attribute :migrations + self.migrations = [] + + class_attribute :current_schema_version self.current_schema_version = 0 end autoload :Migration @@ -23,10 +25,10 @@ end end module ClassMethods def migrate(version, &blk) - write_inheritable_array(:migrations, [Migration.new(version, blk)]) + migrations << Migration.new(version, blk) if version > self.current_schema_version self.current_schema_version = version end end