diff options
| author | Alban Peignier | 2018-02-22 19:18:26 +0100 |
|---|---|---|
| committer | Alban Peignier | 2018-02-22 19:18:26 +0100 |
| commit | 02cd9a9e5d05ab9858e6de27e38cd6b56b919d69 (patch) | |
| tree | 2537cfa43a2d1d99008f86bbd7756bb37a772e5e /app/models/referential.rb | |
| parent | 81ad0ea87ad2986cbad2a4ba98f2c2be194e0cee (diff) | |
| download | chouette-core-02cd9a9e5d05ab9858e6de27e38cd6b56b919d69.tar.bz2 | |
Add a spec to verify to Referential migration count after creation. Refs #6010
Diffstat (limited to 'app/models/referential.rb')
| -rw-r--r-- | app/models/referential.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/models/referential.rb b/app/models/referential.rb index 3b770603a..91a88d02d 100644 --- a/app/models/referential.rb +++ b/app/models/referential.rb @@ -408,6 +408,7 @@ class Referential < ActiveRecord::Base end check_migration_count(report) + # raise "Wrong migration count: #{migration_count}" if migration_count < 300 end end @@ -417,9 +418,12 @@ class Referential < ActiveRecord::Base end def migration_count - if self.class.connection.table_exists?("#{slug}.schema_migrations") - self.class.connection.select_value("select count(*) from #{slug}.schema_migrations;") - end + raw_value = + if self.class.connection.table_exists?("#{slug}.schema_migrations") + self.class.connection.select_value("select count(*) from #{slug}.schema_migrations;") + end + + raw_value.to_i end def assign_slug(time_reference = Time) |
