BadrIT / translation_center

Translation Center is a multi-lingual, GUI rich, community based, translation center for Rails apps
http://www.badrit.com/gems/translation_center/
MIT License
152 stars 71 forks source link

Drop using microseconds for migration versions #52

Open ahmadsherif opened 11 years ago

ahmadsherif commented 11 years ago

Consider a case where you specify a migration that's was created later as a target (rake db:migrate VERSION=xxxx), for AR to decide whether to migrate up or down, it would get the maximum value found in the schema_migrations table, which would one of the gem's three migration files due to the presence of the extra 6 digits, AR would consider it a down migration, reverting (or dropping!) translation_center tables.

Inhering from ActiveRecord::Generators::Base is preferable because it handles versions conflicts correctly. This leaves us with acts_as_votable migration version conflicts with ours, so we use a little meta-programming (read, hack :smile: ). I removed the sleep(1) call because it's not needed anymore (audited plays nice with the rest), besides, time is of the essence.

sonarcloud[bot] commented 11 months ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information